简体   繁体   中英

static opencv cannot find USB webcam on arm Linux busybox?

I have a small busybox system for which I compiled the kernel and added support for USB cameras. When when I connect the camera to the device it gives me some output and I get a /dev/video0 device:

usb 1-1: new high-speed USB device number 3 using orion-ehci
uvcvideo: Found UVC 1.00 device Webcam C170 (046d:082b)
input: Webcam C170 as /devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/input/input1

/ # ls -l /dev/video0
crw-rw----    1 0        0          81,   0 Mar  8 08:08 /dev/video0
/ # 

I have statically compiled opencv2.4 for arm with all needed libs and get no error compiling the code:

Mat frame;
VideoCapture capture(0);
if(!capture.isOpened()){
    printf("Cannot open camera\r\n");
    printf("%s\r\n", cvErrorStr(cvGetErrStatus()));
}

which gives me as output:

Cannot open camera
No Error
/ # 

The camera works fine on my laptop and I have tried multiple camera's all with the same result. I have also tried many different ways of opening the camera trough opencv which also gave me the same results.

How can I get my busybox system and opencv to read from the camera?

You might be missing V4L. I would run the sample code for V4L and investigate that. Did you check with ldd that you have all the libraries you program is linked against?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM