Following the "Freescale Yocto Project User's Guide" document, I was able to build the "fsl-image-gui" with "Wayland" back end and booted my iMX6Q device from SD card using the built image.
Then I used "bitbake opencv" and generated the rpm files for opencv 2.4.9, I modified the "opencv_2.4.bb" by adding "WITH_QT=OFF \" for the EXTRA_OECMAKE settings. These all went well. But when I installed those *opencv*.rpm files on the target, rpm command always complaints that some Qt package dependencies are needed:
root@imx6qsabresd:~/pkgs# rpm -i *opencv*
error: Failed dependencies:
libQt5Core.so.5 is needed by libopencv-highgui2.4-2.4.9+git0+df8e28283f-r0.cortexa9hf_vfp_neon
libQt5Widgets.so.5 is needed by libopencv-highgui2.4-2.4.9+git0+df8e28283f-r0.cortexa9hf_vfp_neon
qtbase >= 5.3.2 is needed by libopencv-highgui2.4-2.4.9+git0+df8e28283f-r0.cortexa9hf_vfp_neon
libQt5Gui.so.5 is needed by libopencv-highgui2.4-2.4.9+git0+df8e28283f-r0.cortexa9hf_vfp_neon
libQt5Test.so.5 is needed by libopencv-highgui2.4-2.4.9+git0+df8e28283f-r0.cortexa9hf_vfp_neon
root@imx6qsabresd:~/pkgs# exit
After further digging in the sources/ folder, I found that there is a .bbappend file which uses "WITH_QT" like below:
[u@ubuntu:~/imx6q/fsl-release-bsp]$ cat sources/meta-fsl-bsp-release/imx/meta-fsl-arm/recipes-graphics/opencv/opencv_%.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI_append_mx6 = " file://0001-MGS-515-ccc-Opencv-app-can-t-run-on-imx6sx-with-cam.patch"
EXTRA_OECMAKE += "-DBUILD_TIFF=ON \
-DBUILD_opencv_ocl=OFF \
-DBUILD_opencv_gpu=OFF \
-DWITH_CUDA=OFF \
-DWITH_GTK=OFF \
-DWITH_LIBV4L=OFF \
-DWITH_OPENCL=OFF \
-DOE_QMAKE_PATH_EXTERNAL_HOST_BINS=${STAGING_DIR}/${BUILD_SYS}/${bindir}/qt5 \
-D_qt5gui_OPENGL_INCLUDE_DIR=${STAGING_DIR_HOST} \
"
PACKAGECONFIG = "eigen jpeg png tiff v4l qt"
PACKAGECONFIG[qt] = "-DWITH_QT=ON,-DWITH_QT=OFF,qtbase"
...
I am wondering if this .bbappend file caused the dependency of opencv_highgui to qtbase somehow?
Updates: after manually install the qtbase package on target, then opencv packages can be installed. But the highgui package behind imshow() alike functions seems still depend on "xcb" library which I don't know how to make it work in "Wayland" environment.
Does this mean that to try OpenCV on iMX6Q, one has to use the "fsl-image-qt5" with X11 back end (not Wayland)?
Also I noticed that features like "OPENCL", "GPU", GSTREAMER are all turned off, aren't they available for iMX6Q device? or they are available in iMX6Q but still doesn't match the requirements of OpenCV?
Regards,
yanfeng
Hello Yanfeng Liu,
The Qt images do require X11 backend so I would recommend baking with X11 instead.
I found the following link which may be helpful as it’s similar to what you are looking for:
Computer Vision on i.MX Processors: Building OpenCV-2.4.X for Freescale's i.MX6 BSP (Yocto)
I hope this helps!