OpenCV support for i.MX6 Capture Drivers

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

OpenCV support for i.MX6 Capture Drivers

2,364 Views
gruger
Contributor III

Dear community,

We are working on a project with analog cameras, captured by ADV7280-M device. We have it working as a subdevice of mxc_v4l2_capture driver using GStreamer and using the TVin unit test app.

Now, we are trying to work with OpenCV.

We are using Yocto Krogoth release (kernel 4.1.15) and we can run OpenCV code using a USB Camera, but the same code does not work when using cameras attached to ADV7280-M.

Also, the USB Camera performance is very poor, since it does not use the hardware accelerators from i.MX6 processor. We have done a research on this matter and found out that the mxc_v4l2_capture driver is not compatible with OpenCV.

However, we have found some people that could make it work (see https://github.com/andreluizeng/v4l_opencv_wrapper). We would like some suggestions on this matter. OpenCV is great, but without hardware acceleration, the application will not work as expected.

Thank you!

Labels (2)
Tags (1)
4 Replies

1,517 Views
andre_silva
NXP Employee
NXP Employee

Hi Mauricio,

For this camera or MIPI you need to use or V4L or Gstreamer as suggested by the link you posted, the idea is to capture using our mxc_v4l_src plugin into a mapped G2D buffer, and then you use the cv::Mat just pointing to this G2D buffer.

I have a similar sample using the ov10635 camera, which requires a different driver, I am going to check if that can work on your side. 

Which imx6 board are you using ?

0 Kudos

1,517 Views
gruger
Contributor III

Dear Andre,

Thank you for your interest in our problem. It is much appreciated.

I tried to open the camera as a GStreamer pipeline within OpenCV, but I could not get the pipeline working on OpenCV (app crashes due to compatibility between imxv4l2videosrc and OpenCV's appsink).

We are running a custom board, but if you can access a MIPI camera from OpenCV, then that is very likely to work on our case too.

Can your example be shared? Is it written in C++ or Python for OpenCV?

Thank you!

0 Kudos

1,517 Views
andre_silva
NXP Employee
NXP Employee

Hi Mauricio,

it is in C/C++, please find it attached, this application was used in this project: piano tiles - robot player test 5 - YouTube 

V4L +  G2D + Opencv.

cheers,

Andre

1,517 Views
gruger
Contributor III

This seems very promissing!

I will study it.

Thank you for sharing (and the video is awesome!).