opencv doesn't work to display window in imx8qxpc0mek

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

opencv doesn't work to display window in imx8qxpc0mek

1,845 Views
yibhan
Contributor III

Hi guys, I have some trouble to run opencv app in imx8qxpc0mek. I am using kernel 4.14.98.2.3.0 and

DISTRO=fsl-imx-xwayland MACHINE=imx8qxpc0mek source fsl-setup-release.sh -b build-xwayland

$ bitbake fsl-image-validation-imx and add opencv package in /conf/local.conf : CORE_IMAGE_EXTRA_INSTALL += " opencv libopencv-core-dev libopencv-highgui-dev libopencv-imgproc-dev libopencv-objdetect-dev libopencv-ml-dev"

when I run opencv app, opencv app doesn't work and error is below: : terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.0.1) /usr/src/debug/opencv/4.0.1.imx-r0/git/modules/highgui/src/window.cpp:610: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'

I have checked /usr/lib/libopencv*.so and sdk as well. Should I add something to display appropriate opencv app or add some of packeges in yocto?

0 Kudos
7 Replies

1,839 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello yibhan,

Looks like you need the appropriate package to run opencv, Check this page from the community:

https://github.com/opencv/opencv/issues/8537

 

Regards

 

 

0 Kudos

1,833 Views
yibhan
Contributor III

Hi guys,

Thank you for answering. It would be helpful and I have additional question.

I don't know what packages are suitable to add or do to fix my issue?

it would be problem for someone to run opencv app in imx8qxpmek.

I have added opencv packages based on default package, but opencv doesn't show window that means opencv can't connect UI backend package, so to fix my issue, 

I don't have any idea what packages of yocto are needed to run opencv app appropriately.

 

0 Kudos

1,826 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

I you have one of our latest BSP, you don´t need to install an external package, Since it comes by default.

 

Regards

 

0 Kudos

1,805 Views
yibhan
Contributor III

Hi Bio_TICFSL,

I have upgraded kernel version to 5.4.70-2.3.0 and opencv would be okay, but when I play video file(mp4 and avi) in opencv api func: 

VideoCapture video ("chaplin.mp4");

video.read(frame); imshow(frame)

but, shown window is small and mp4 decoding doesn't work correctly

Is there any limitation on display media file in opencv in imx8qxp?

 

0 Kudos

1,803 Views
yibhan
Contributor III

Hi Bio_TICFSL,

for your information, gtk-play is okay when mp4 file is played, but avi file doesn't work.

 

0 Kudos

1,811 Views
yibhan
Contributor III

Hi Bio_TICFSL,

Thank you for answering. it would sound great.

I am gonna to use kernel 5.4.70.2.3.0.

Don't i need to apply an additional packages for opencv in kernel 5.4.70.2.3.0?

Please confirm my concern.

Thanks,

0 Kudos

1,798 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

No, you don´t need external packages

 

 

0 Kudos