step by step guide to cross compile OpenCV using meta toolchian (Yocto)

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

step by step guide to cross compile OpenCV using meta toolchian (Yocto)

7,899 Views
Mahyar
Contributor II

Hi all,

I want to cross compile OpenCV library on an imx6 board using meta toolchain (Yocto)

Here's the steps I've done:

- building the meta toolchian

bitbake meta-toolchain

- building OpenCV image

bitbake opencv

-adding opencv to the image (adding opencv recipe) by changing the local config file

CORE_IMAGE_EXTRA_INSTALL += "\

       opencv \

"

- building the toolchain again

bitbake meta-toolchain

- install the toolchain

sudo sh \

  tmp/deploy/sdk/poky-eglibc-x86_64-arm-toolchain-<version>.sh

- setup the toolchain environment

source \

  /opt/poky/<version>/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

No I'm having a hard time cross compiling a sample openCV code.

I can see opencv libraries and include files on the Yocto directory (build directory) but I don't see them on /opt/poky/<version/ (which I guess is the directory for cross compilation)

( simple c code is compiled perfectly but there's no opencv libraries and include files to compile opencv)

is there a step I missed to build the toolchain to create openCV files?

any suggestions would be great

Thanks

5 Replies

2,828 Views
andre_silva
NXP Employee
NXP Employee

Hi Mahyar,

you can follow this tutorial to guide you building OpenCV for yocto: http://imxcv.blogspot.com.br/2014/02/building-opencv-24x-for-freescales-imx6.html

regards,

Andre

2,828 Views
EricNelson
Senior Contributor II

Hello Mahyar,

I think the answer might be in this comment:

Re: Help with yocto opencv/openNi

2,828 Views
mahyar1
Contributor II

Thanks Eric,

I guess this is the line I'm looking for:

CORE_IMAGE_EXTRA_INSTALL += "libopencv-core-dev libopencv-highgui-dev libopencv-imgproc-dev libopencv-object-dev libopencv-ml-dev"

but as there's no recipes for those libraries (bitbake-layers how-recipes) there's an error as a result of bitbake (bitbake core-image-x11)

Error: libopencv-object-dev not found in the base feeds (nitrogen6x cortexa9hf-vfp-neon-mx6 cortexa9hf-vfp-neon cortexa9hf-vfp armv7ahf-vfp-neon armv7ahf-vfp armv6hf-vfp armv5ehf-vfp armv5hf-vfp noarch any all).

I'll try to figure it out, but I'm also not quite sure if adding those packages work as opencv recipe itself doesn't provide the include files for the toolchain.

0 Kudos
Reply

2,828 Views
KursadOney
NXP Employee
NXP Employee

I would guess:

bitbake meta-toolchain-sdk

might be what you need.

0 Kudos
Reply

2,828 Views
Mahyar
Contributor II

Thanks Kursad,

meta-toolchain-sdk also didn't create opencv libs and includes on the poky directory

have you tried it on your PC?

0 Kudos
Reply