한글 블로그로 보기
Download userland
1
2
3
4
5
|
cd
mkdir camcv
cd camcv
cp -r /opt/vc/userland/host_applications/linux/apps/raspicam/* .
mv RaspiStill.c camcv.c
| cs |
And rename raspistill.c to camcv.c for still shot.
Changing code cmakelists.txt use nano..
1
|
sudo nano CMakeLists.txt
| cs |
Copy & paste below code.
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
1
|
sudo cmake .
| cs |
make
1
|
sudo make
| cs |
run camcv
1
|
./camcv -t 1000
| cs |
Turn on picam's led.
Changing code for save to jpg file.
1
|
sudo nano camcv.c
| cs |
Searching 'default_status(&state);' and add this code.
state.filename=”foobar.jpg”;
1
|
state.filename=”foobar.jpg”;
| cs |
Cmake & make.
Run camcv
1
|
./camcv -t 1000
| cs |
Check jpg file.
1
|
ls
| cs |
P.S If stray error?
If using edit tool samba or putty watching stray error.
So edit file in raspberry pi.
No comments:
Post a Comment