Error with webcam when compiling to Beaglebone Black

asked 2019-04-22 14:44:17 -0600

For more time than I am willing to admit, I have tried getting the Beaglebone Black up and running with OpenCV and a camera. However, having compiled OpenCV 4.0.0/3.4.6/3.4.0 manually and trying to initialize a camera using the Python bindings, it continue to fail.

Using v4l2-ctl I can both view and set formats etc. from the terminal, but when trying something as simple as

import cv2

vs = cv2.VideoCapture(0)
retVal, frame = vs.read()

this yields:

>> select timeout
>> VIDIOC_DQBUF: Resource temporarily unavailable

Camera works perfectly fine on a Raspberry Pi and my PC, and funny thing - on the Beaglebone I tried to install OpenCV using apt-get which made the camera work just fine.

So

sudo apt-get install python-opencv

which installs OpenCV 3.2.0 (without any hardware optimizations for arm) works..

Would any of you happen to know what I am missing here? Is there simply a bug in OpenCV or am I missing something for my build?

For more information I have attached my build overview below:

cmake -D CMAKE_BUILD_TYPE=RELEASE    
      -D CMAKE_INSTALL_PREFIX=/usr/local      
      -D ENABLE_NEON=ON     
      -D ENABLE_VFPV3=ON     
      -D BUILD_TESTS=OFF    
      -D INSTALL_PYTHON_EXAMPLES=OFF     
      -D BUILD_EXAMPLES=OFF 
      -D WITH_JPEG=ON 
      -D BUILD_JPEG=OFF 
      -D JPEG_INCLUDE_DIR=/opt/libjpeg-turbo/include/   
      -D JPEG_LIBRARY=/opt/libjpeg-turbo/lib32/libjpeg.a 
      -D WITH_V4L=ON ..
-- Looking for ccache - not found
-- FP16 is not supported by C++ compiler
-- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") 
-- Could NOT find Jasper (missing:  JASPER_LIBRARIES JASPER_INCLUDE_DIR) 
-- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.8") 
-- Checking for module 'gstreamer-base-1.0'
--   No package 'gstreamer-base-1.0' found
-- Checking for module 'gstreamer-video-1.0'
--   No package 'gstreamer-video-1.0' found
-- Checking for module 'gstreamer-app-1.0'
--   No package 'gstreamer-app-1.0' found
-- Checking for module 'gstreamer-riff-1.0'
--   No package 'gstreamer-riff-1.0' found
-- Checking for module 'gstreamer-pbutils-1.0'
--   No package 'gstreamer-pbutils-1.0' found
-- Checking for module 'gstreamer-base-0.10'
--   No package 'gstreamer-base-0.10' found
-- Checking for module 'gstreamer-video-0.10'
--   No package 'gstreamer-video-0.10' found
-- Checking for module 'gstreamer-app-0.10'
--   No package 'gstreamer-app-0.10' found
-- Checking for module 'gstreamer-riff-0.10'
--   No package 'gstreamer-riff-0.10' found
-- Checking for module 'gstreamer-pbutils-0.10'
--   No package 'gstreamer-pbutils-0.10' found
-- Checking for module 'libdc1394-2'
--   No package 'libdc1394-2' found
-- Checking for module 'libdc1394'
--   No package 'libdc1394' found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Checking for module 'libavresample'
--   No package 'libavresample' found
-- Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
-- Could NOT find Atlas (missing:  Atlas_CLAPACK_INCLUDE_DIR) 
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) 
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- OpenCV Python: during development append to PYTHONPATH: /mnt/ext2/opencv-4.0.0/build/python_loader
-- Excluding from source files list: modules/imgproc/src/corner ...
(more)
edit retag flag offensive close merge delete