RaspiCam: C++ API for using Raspberry camera with/without OpenCv
来源:互联网 发布:金税盘开票软件口令 编辑:程序博客网 时间:2024/05/21 23:33
Main features
Compiling
Using it in your projects
Download the project example at SourceForge
OpenCV Interface
1. cmake problem
I'm new to c++ programming. I found the g++ compiler too confusing so i'm trying to use cmake.
However cmake give the following error output;
- CODE: SELECT ALL
By not providing "Findraspicam.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "raspicam",
but CMake did not find one.
Could not find a package configuration file provided by "raspicam" with any
of the following names:
raspicamConfig.cmake
raspicam-config.cmake
Add the installation prefix of "raspicam" to CMAKE_PREFIX_PATH or set
"raspicam_DIR" to a directory containing one of the above files. If
"raspicam" provides a separate development package or SDK, be sure it has
been installed.
I see the .cmake files are located in /usr/local/lib/cmake
How do I tell cmake where to find them?
- Posts: 10
- Joined: Sun Mar 17, 2013 5:20 pm
- Location: UK
If a package deviates from this convention it is usually documented in a readme file, dand apptopriate instructions on how to progress from there.
Problems are caused buy noy following these instructings and not paying attention to error messages generated buy the convigure script.
when the congigure sfriptģ runsvthtpvwithoiy error it crsstes a nake gikrr thst shouldvworkj
- Posts: 76
- Joined: Mon Jul 21, 2014 9:41 am
What have you got in your CMakeLists.txt file ?
PeterO
- Posts: 1723
- Joined: Sun Jul 22, 2012 4:14 pm
- CODE: SELECT ALL
cmake_minimum_required (VERSION 2.8)
project (tracking)
find_package(raspicam REQUIRED)
find_package(OpenCV)
IF ( OpenCV_FOUND AND raspicam_CV_FOUND)
MESSAGE(STATUS "COMPILING OPENCV TESTS")
add_executable (tracking tracking.cpp)
target_link_libraries (tracking ${raspicam_CV_LIBS})
ELSE()
MESSAGE(FATAL_ERROR "OPENCV NOT FOUND IN YOUR SYSTEM")
ENDIF()
I tried adding this line just before the find_package...
- CODE: SELECT ALL
set(CMAKE_MODULE_PATH "/usr/local/lib/cmake/${CMAKE_MODULE_PATH}")
It then seems to be able to find raspicam, but then give a ton of errors which seem to relate to openCV
2. Raspicam C++ API mmal linking
I have installed the raspicam API as instructed here: http://www.uco.es/investiga/grupos/ava/node/40
It appears to be installed correctly.
When I compile any programs linking libmmal I get the errors:
/usr/bin/ld: cannot find -lmmal
/usr/bin/ld: cannot find -lmmal_core
/usr/bin/ld: cannot find -lmmal_util
I have tried updating the pi and reinstalling the API but I just can't get it to compile.
1 Answer
Try ldconfig -p | grep libmmal
. On raspbian you should get:
libmmal_vc_client.so (libc6,hard-float) => /opt/vc/lib/libmmal_vc_client.so libmmal_util.so (libc6,hard-float) => /opt/vc/lib/libmmal_util.so libmmal_core.so (libc6,hard-float) => /opt/vc/lib/libmmal_core.so libmmal_components.so (libc6,hard-float) => /opt/vc/lib/libmmal_components.so libmmal.so (libc6,hard-float) => /opt/vc/lib/libmmal.so
If not, add to your question the contents of the few short files in /etc/ld.so.conf.d
. If you are not using raspbian, you should give your OS.
This means the relevant libraries are available on the system and if you build an executable linking them, there should not be a problem. However, there may be a problem building the executable; in this case it seems when gcc
invokes the linker, /opt/vc/lib
is not in its path even though it is in the runtime loader path (they are not quite the same). If you use gcc -v
, you'll see there are some non-standard paths being used as options (e.g., /usr/lib/gcc/arm-linux-gnueabihf
), but not that one. However, you can specify it yourself:
gcc test.c -L/opt/vc/lib -lmmal
Should work. You can also:
export LIBRARY_PATH=/opt/vc/lib
This variable is probably not predefined but you'll see those other paths added to it in gcc -v
output. Note it is not the same as LD_LIBRARY_PATH
, which is used by the runtime loader.
- RaspiCam: C++ API for using Raspberry camera with/without OpenCv
- Accessing the Raspberry Pi Camera with OpenCV and Python
- using OpenCV with python for descriptor extraction
- RaspiCam & opencv 单一颜色识别
- Ubuntu Mate: mak Raspberry Pi camera work without raspi-config on Raspberry Pi2
- Using OpenCV with MFC
- Using OpenCV with Qt
- Using API with Catia
- Open the Android native Camera using OpenCV
- raspicam : C++ opencv 调用树莓派的 PiCamera
- Using OpenCV Java with Eclipse
- Using OpenCV Java with Eclipse
- Android Camera API 与 OpenCV API
- 【Opencv】树莓派配置Opencv 3.2 + Raspicam (二) 编译Opencv 3.2 + Raspicam
- Using Vanishing Points for Camera Calibration
- C/C++ Swap without using extra variable
- OpenCV自学笔记23. Raspberry Pi 安装OpenCV(C++)
- Raspberry Pi + surveillance camera
- 九度OJ,题目1089:数字反转
- (4.2.16.2)Android判断当前应用程序处于前台还是后台的两种方法
- 泛型编程
- 黑马程序员——38,IO流(字符流)
- 【学习笔记】浏览器输入一个网址回车后的全过程
- RaspiCam: C++ API for using Raspberry camera with/without OpenCv
- AWS申请图文及连接教程
- JS-基础
- Xcode中自定义代码块,只要在Xcode中操作即可
- 智能聊天机器人小黄鸡及其制作方法
- HIVE中关于collect_set与explode函数妙用
- 单例集合知识点总结
- HDU3488Tour(KM最小费用圈覆盖)
- Python中Threading.Join的案例解析
make
seems to have completed without error. There's a.so
inbuild/src
and some tests inbuild/utils
. – goldilocks♦ Nov 10 '14 at 15:33