raspi-config
enable cam
<img src=”/images/raspcam_track/2.jpg” alt=”替代文本” title=”2.jpg” width=auto />
here
create a build directory and compile (it takes a while)
string &operator+(const string& A,const string& B) //cpp TEST
sudo mkdir build
cd build
sudo cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make
sudo make install
069e
remove then content of CMakeLists.txt and replace with :
project( YOUR CODE NAME )
find_package( OpenCV REQUIRED )
include_directories(/opt/vc/userland/host_applications/linux/libs/bcm_host/include)
include_directories(/opt/vc/userland/host_applications/linux/apps/raspicam/gl_scenes)
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(./gl_scenes)
include_directories(.)
include_directories(/opt/vc/include)
include_directories(/opt/vc/include/interface/vcos)
include_directories(/opt/vc/include/interface/vcos/pthreads)
include_directories(/opt/vc/include/interface/vmcs_host/linux)
add_executable( YOUR CODE NAME `YOUR CODE NAME.cpp` RaspiCamControl.c RaspiCLI.c RaspiPreview.c RaspiTex.c RaspiTexUtil.c gl_scenes/teapot.c gl_scenes/models.c gl_scenes/square.c gl_scenes/mirror.c gl_scenes/yuv.c gl_scenes/sobel.c tga.c)
target_link_libraries( `YOUR CODE NAME` /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 pthread ${OpenCV_LIBS} )
compile
cmake .
make
./YOUR CODE NAME
<img src=”/images/raspcam_track/4.jpg” alt=”替代文本” title=”4.jpg” width=auto />
<img src=”/images/raspcam_track/6.jpg” alt=”替代文本” title=”6.jpg” width=auto />
###TOP