Install OpenCV3.0 on Ubuntu(linaro)12.04 in ARM

      今天尝试用英语写篇技术文档,介绍在ARM板上安装OpenCV3.0。在ARM板上安装软件与我们在Windows下安装

软件有很大的不同,究其原因还是ARM架构下的软件不多,许多软件所需要的依赖库无法在ARM板上使用,又或者是

在ARM 板上无法安装。做嵌入式开发其实就是经验的积累,一些bug只有你遇到过才知道怎么解决,否则只有

自己google查资料解决,这也决定了做嵌入式开发不是一件容易的事。这个时候我们需要有耐心,遇到问题不害怕,

迎难而上,解决问题。在解决问题的过程中积累经验,不断提高自己的能力。

    好了,废话少说,上正文!





How to install opencv3.0 on linaro(12.04) in I.MX6Q?



First,we need to install the necessary dependencies because some program just need some necessaries like they will die without them. So we need to enter the following command on the terminal:

sudo apt-get install build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev  python-dev python-numpy libqt4-dev libgtk2.0-dev ffmpeg


At this point, you will get a message about a conflict with the mesa drivers. Fix it by removing libqt4-opengl-dev, which was automatically installed above (you don't need it)
sudo apt-get remove libqt4-opengl-dev


Then you should download the OpenCV  version that you are interested in before.


After you abtained the OpenCV source code.Note that you are better to make sure the downloading version is suitable for your OS(WinX or linux or MAC). Do the following steps.


$ cd ~

$ unzip opencv-3.0.0-beta.zip

$ cd opencv-3.0.0-beta

$ mkdir build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local-D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_V4L=ON..

$ ccmake .

If you have not installed ccmake,the terminal may suggest you install it.

After that,you are advised to be care to configure the makefile. You may change some variable values. Just turn on or turn off. In our case,we need to witch off the follows items by press [enter]

WITH_CUDA OFF

WITH_CUFFT OFF

WITH_OPENCLAMDBLAS OFF

WITH_OPENCLAMDFFT OFF

WITH_OPENGL OFF

WITH_OPENCL OFF


Finish the configuration and then type


[c]to config


it will then prompt the error on QT5 ... just press [e] to ignore, and then type

[g]to generate the makefile and it is ready to build


It is ready to build and install

$make

$sudo make install

It may take a while.In our case,it do take about 2 hours.So be patient!Patient is good,what do you see?

To get OpenCV work properly, we need to tell linaro:


$sudo /bin/bash -c 'echo "/usr/local/lib">/etc/ld.so.conf.d/opencv.conf'
$ sudo ldconfig

After all is done I recommend rebooting your system.Done!

Congratulations!You have succeeded in installing OpenCV3.0.


Finally,we advised you to make a test with some samples.And OpenCV just have gived us some.So careful it is! Then,do the following step:

$ cd opencv/opencv-3.0.0-beta/samples

$ sudo cmake .

$ sudo make

Now,you can run a sample.I think the drawing example is just so beautiful and inspiring.so I run it like this:

$ cd opencv/opencv-3.0.0-beta/samples/cpp

$ ./cpp-example-starters_video 0

If everything is Ok,you will see an amazing image. Good luck!


你可能感兴趣的:(Install OpenCV3.0 on Ubuntu(linaro)12.04 in ARM)