To run OpenCV facedetect on Yocto

cancel
Showing results for 
Search instead for 
Did you mean: 

To run OpenCV facedetect on Yocto

2,174 Views
hjpark71
Contributor III

Hi Guys,

CPU: IMX6Q

Yocto jethro Image: fsl-image-qt5

I have appended below on conf/local.conf  and got opencv libs and xml on the target rootfs and got a facedetect binary in /usr/bin/ of target.  thanks to yocto .. but.

"

CORE_IMAGE_EXTRA_INSTALL += " libopencv-core-dev libopencv-highgui-dev libopencv-imgproc-dev libopencv-objdetect-dev libopencv-ml-dev opencv opencv-samples "

LICENSE_FLAGS_WHITELIST = "commercial"

"

I tried to run facedetect with this command..

"

facedetect --cascade="/usr/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade="/usr/share/OpenCV/haarcascades/haarcascade_eye.xml" --scale=1.3 %1 lena.jpg

"

and faced this error.

"OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-ru3

terminate called after throwing an instance of 'cv::Exception'

what():  /home/smart/yocto/var-som-mx6-yocto-jethro/build-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/opencv/2.4.11+gitAUTOINC+2c9547e314-r0/git/modules/highgui/src/window.cpp:483: error: (-2) The fuw

Aborted

"

It seems that I need to install "libgtk2.0-dev and pkg-config" into my Yoto rootfs and tried to add them on the local.conf and run bitbake again. but, it syas .

ERROR: Nothing RPROVIDES 'libgtk2.0-dev' (but /home/smart/yocto/var-som-mx6-yocto-jethro/sources/meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images/fsl-image-qt5.bb RDEPENDS on or otherwise requires it)

Please let me know how I can solve this problem. if you don't recommend to use Yocto for OpenCV, pls let me move to Ubuntu.

and, I have to change some code on facedetect.cpp and build for IMX6.. but, it is not easy to cross-compile OpenCV samples in the host by using pocky..

please let me know any good recommendation by you..  thanks a lot..

Labels (2)
1 Reply

908 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi hj,

Nerver tried with QT, however please check Computer Vision on i.MX Processors: Building OpenCV-2.4.X for Freescale's i.MX6 BSP (Yocto)

to enable Opencv with FB

Regards