我尝试安装 OpenCV 几次,但总是返回相同的错误。我在 Beaglebone Black 中运行 Linux - Debian。
配置如下:
root@beaglebone:~# uname -a
Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux
有人告诉我,错误可能出在 GitHub 上的 OpenCV 代码中。我用来克隆 openCV 的命令是:
git clone https://github.com/Itseez/opencv.git
git clone https://github.com/Itseez/opencv_contrib.git
我在 Cmake 中使用的标志是:
cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules/ \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON ..
错误是:
[ 54%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gstreamer.cpp.o
[ 54%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_libv4l.cpp.o
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:329:27: error: field 'cap' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:330:22: error: field 'inp' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:331:23: error: field 'form' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:332:21: error: field 'crop' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:333:24: error: field 'cropcap' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:334:31: error: field 'req' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:335:32: error: field 'compr' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:336:24: error: field 'control' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:338:26: error: field 'queryctrl' has incomplete type
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp: In function 'int try_init_v4l2(CvCaptureCAM_V4L*, char*)':
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:488:5: error: 'CvCaptureCAM_V4L' has no member named 'cap'
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:488:5: error: 'CvCaptureCAM_V4L' has no member named 'cap'
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:1823:24: error: 'V4L2_BUF_TYPE_VIDEO_CAPTURE' was not declared in this scope
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:1824:42: error: 'VIDIOC_STREAMOFF' was not declared in this scope
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:1827:64: error: 'CvCaptureCAM_V4L' has no member named 'req'
.... a lot of lines
[ 54%] /home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp: In function 'double icvGetPropertyCAM_V4L(CvCaptureCAM_V4L*, int)':
/home/nathan/opencv/modules/videoio/src/cap_libv4l.cpp:1495:1: error: control reaches end of non-void function [-Werror=return-type]
Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/src/align.cpp.o
cc1plus: some warnings being treated as errors
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_libv4l.cpp.o] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 54%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/opencl_kernels_photo.cpp.o
Linking CXX shared library ../../lib/libopencv_photo.so
[ 54%] Built target opencv_photo
make: *** [all] Error 2
root@beaglebone:/home/nathan/opencv/build#
错误总是在文件中
opencv/modules/videoio/src/cap_libv4l.cpp
我安装了所有必需的软件包并按照此站点中的步骤进行操作:http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/
我尝试从不同的来源下载 OpenCV,但错误总是相同的。
有什么想法吗?谢谢大家