1. Create new Foler.
We will create and use new folder.
- cd
- mkdir camcv
- cd camcv
- cp -r /opt/vc/userland/host_applications/linux/apps/raspicam/* .
- mv RaspiStill.c camcv.c
and rename raspistill.c to camcv.c (This file is still-shot file)
Editing cmakelists.txt
- sudo nano CMakeLists.txt
Recommend Delete all text and copy below text.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
cmake_minimum_required(VERSION 2.8)
project(camcv)
SET(COMPILE_DEFINITIONS -Werror)
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/interface/vcos)
include_directories(/opt/vc/userland)
include_directories(/opt/vc/userland/interface/vcos/pthreads)
include_directories(/opt/vc/userland/interface/vmcs_host/linux)
include_directories(/opt/vc/userland/interface/khronos/include)
include_directories(/opt/vc/userland/interface/khronos/common)
include_directories(/home/pi/camcv/)
include_directories(/home/pi/camcv/gl_scenes/)
include_directories(/home/pi/camcv/libfacerec/include/)
add_executable(camcv RaspiCamControl.c RaspiCLI.c RaspiPreview.c camcv.c RaspiTex.c RaspiTexUtil.c gl_scenes/teapot.c gl_scenes/models.c gl_scenes/square.c gl_scenes/mirror.c gl_scenes/sobel.c gl_scenes/yuv.c tga.c )
target_link_libraries(camcv /opt/vc/lib/libmmal_core.so /opt/vc/lib/libmmal_util.so /opt/vc/lib/libmmal_vc_client.so /opt/vc/lib/libvcos.so /opt/vc/lib/libbcm_host.so /opt/vc/lib/libGLESv2.so /opt/vc/lib/libEGL.so libpthread.so libm.so)
| cs |
cmake
- cmake .
make
- sudo make
Run~!!
- ./camcv -t 1000
Maybe picam's led turn on about 1 sec.
2. Save to jpg file.
changing camcv.c
- sudo nano camcv.c
Searching 'default_status(&state);' and add below line ' state.filename=”foobar.jpg”; '
- state.filename=”foobar.jpg”;
cmake . and make
Run
- ./camcv -t 1000
picam turn on led.
Check file.
- ls
P.S If you see stray error
If you see above error, change to ANSI text mode.
No comments:
Post a Comment