Can't access camera with OpenCV on Wandboard

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't access camera with OpenCV on Wandboard

4,946 Views
d_s_e
Contributor I

I tried some basic example code to get a picture from my MIPI camera with OpenCV, but all I get is the following error:

HIGHGUI ERROR: libv4l unable to ioctl S_FMT

HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT

Any hints?

System: Wandboard Quad with Yocto Dora

Camera: e-CAM51IMX6


Access with Gstreamer is working, but only with a low resolution.

Also the same code is working on my dev machine.



0 Kudos
4 Replies

854 Views
varsmolta
Contributor V

OpenCV will not work out of the box with the Freescale MXC camera interface.

Use gstreamer to capture frames and feed this to OpenCV.

0 Kudos

854 Views
olias
Contributor II

Hello Mars Volta,

I have the same issue:

root@nitrogen6x:/usr/bin# DISPLAY=:0 ./camera_test
ov5642_powerdown: powerdown=0, power_gp=0x6
HIGHGUI ERROR: libv4l unable to ioctl S_FMT
HIGHGUI ERROR: libv4l unable to ioctl VIDIOCSPICT

Cannot open initialize camera!
root@nitrogen6x:/usr/bin# ov5642_powerdown: powerdown=1, power_gp=0x6

I did have the camera running via gstreamer on an earlier build on LTIB.  The LTIB however had problems building the latest OpenCV source, so I went to yocto and built OpenCV.

The yocto recipes did not include building of gstreamer.

So, I am wondering can you expand on "Use gstreamer to capture frames and feed this to OpenCV"?  I think this would be workable for me, but I'm not sure of the method you are suggesting.

Or, alternatively, what is the post-box procedure to have OpenCV work with the Freescale MXC camera interface?

Thanx

0 Kudos

854 Views
EdSutter
Senior Contributor II

Very late reply...

I ran into the same issue when using the wandcam.

I did find that disconnecting the wandcam and plugging in a usb camera (Microsoft Lifecam in my case),

I was able to get video, but I changed the demo program a bit...

#include "opencv/highgui.h

int

main(int argc, char** argv)

{

        cvNamedWindow( "Example2", CV_WINDOW_AUTOSIZE );

        CvCapture* capture = cvCreateCameraCapture(-1) ;

        IplImage* frame;

        while(1) {

                frame = cvQueryFrame( capture );

                if( !frame ) break;

                cvShowImage( "Example2", frame );

                char c = cvWaitKey(33);

                if( c == 27 ) break;

        }

        cvReleaseCapture( &capture );

        cvDestroyWindow( "Example2" );

        return(0);

}


cvCreateCameraCapture() doesn't like CV_CAP_ANY, but seems to be happy with -1

(which is supposed to query the user for the camera to use).

Anyway, has anyone managed to get wandcam to work without gstreamer?

Ed

0 Kudos

854 Views
d_s_e
Contributor I

Ok, will this be fixed, or is there a workaround?

It's a little bit strange though, that the example here uses OpenCV for capturing: Fast GPU Image Processing in the i.MX 6x

And: Accessing an attached USB webcam works with OpenCV.

I already tried capturing the frames with gstreamer, but that didn't work with higher resolutions than PAL.

0 Kudos