Can I use opencv for imx6?

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

Can I use opencv for imx6?

1,167 Views
zhiyuan_song
Contributor II

Can I use opencv for imx6?

When I use the gst-launch command。
   gst-launch 1.0 imxv4l2src device=/dev/video0! Imxv4l2sink device = / dev/video16

  /dev/video0 mean ov5640           /dev/video16 mean display device

It can display the image of the camera on the display device。

when i use opencv,error

VIDEOIO ERROR: libv4l unable to ioctl S_FMT
VIDEOIO ERROR: libv4l unable to ioctl VIDIOCSPICT

source :
#include <opencv2/ opencv.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui. hpp>
#include <opencv2/videoio. hpp>
#include <iostream>
using nanespace CV;
using namespace std;
int main()
{
cout<<"Built with opencv"<<CV_ VERSION<<endl;
VideoCapture capture(0);
if( !capture. isopened())
cout<<"open camera failed."<<endl;
return - 1;
}
Mat frame;
while( 1)
capture>>frame ;
if(frame . empty())
break;
imshow( "video" , frame);
if(waitKey(20)>0)
break;
}
return 0;

I didn't make any changes to the kernel,I just wrote a test program to test opencv。

Why the error?

Or how do I pass the data from gst-launch to opencv?

VideoCapture capture(gst-launch .......“”);

May I do that?

If so, what should be the order?

thank you!

Labels (1)
0 Kudos
3 Replies

1,081 Views
b36401
NXP Employee
NXP Employee

You can download L4.14.98_2.0.0_MX6QDLSOLOX BSP here:
https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/embedded-...
it has OpenCV.

0 Kudos

1,081 Views
zhiyuan_song
Contributor II

I've downloaded opencv, set up opencv's cross-compilation environment, and ported it to the imx6 development board.

This is not the reason for BSP, is it? Does imx6 support the use of opencv?

0 Kudos

1,081 Views
andre_silva
NXP Employee
NXP Employee

Yes, it does, if you are not going to use any hardware acceleration OpenCV, you can ran with no problem, but if you want something like OVX or OCL support, then you need to move to i.MX8.  You can check some info about opencv and imx6 at www.imxcv.blogspot.com

regards,

Andre

0 Kudos