OpenCV on Apalis iMX6Q

In my application I am using the analog camera Module with which I would like to capture still images and store on a media…
I would like to understand the steps to enable the OpenCV support in my application i.e. both on my Developmment Host Machine and board… (Apalis iMX6Q module with Ixora carrier board). This is my first time attempting to use OpenCV.

Thanks in Advance.

OpenEmbedded setup would be required. Change the “build/conf/local.conf” file to add the packages

IMAGE_INSTALL_append = " opencv opencv-samples"

and then build the image. The generated image should have opencv included. For the host machine, setup sdk as per the instructions on the article here .

Once the OpenEmbedded and sdk setup is complete, a simple Makefile like below can be used to compile opencv applications.

SYSROOTS ?= /usr/local/oecore-x86_64/sysroots
CC = ${SYSROOTS}/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-g++
INCLUDES = -I${SYSROOTS}/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/include
LIB_PATH = -L${SYSROOTS}/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/lib
LIBS = -lpthread -lopencv_highgui -lopencv_core -lopencv_imgproc -lopencv_objdetect -lm
CFLAGS = -O2 -g -Wall -mfloat-abi=hard --sysroot=${SYSROOTS}/armv7at2hf-vfp-neon-angstrom-linux-gnueabi

	${CC} ${CFLAGS} ${INCLUDES} ${LIB_PATH} ${LIBS} facedetect.cpp -o facedetect

	rm -rf facedetect

Please note that while opkg can also be used to install opencv on the target, for cross compiling and development using a host machine, OpenEmbedded and sdk setup is required and recommended method.