Wednesday, July 22, 2009

Commode Is Bubbling Up

OpenCV

OpenCV is probably the most well-known collection linked to the computer" vision. " Come for a long time nothing ever happens, it does not seem to lose popularity. I had the opportunity to familiarize themselves with it on a laboratory course and Sensors Vision Systems. In class we used Visual C + +, and now I would like to work with the library in NetBeans on Ubuntu 8.04. It turned out that the desire was very easy to translate into action. Here's what to do: I'm not going to install << "Dodawanie " << it-> latest version from CVS or SVN. I want to use what is in the Ubuntu repositories. We have there an available version 1.0.0. To find out what are the names of packages, type: << " " << it-> apt-cache search << endl;
OpenCV. In response, we get:
libcv-dev - Development files for libcv << "insert into tab values (\""
libcv1 - computer vision library << it-> libcvaux-dev - Development files for libcvaux
libcvaux1 - computer vision extension library <<"\", \""
libhighgui-dev - Development files for libhighgui << it-> libhighgui1 - computer vision GUI library
OpenCV-doc - OpenCV documentation and examples python-<< "\", "
OpenCV - Python bindings for the computer vision library << it-> <<");";
do not need the documentation that is available
here (version 1.0) or

here (for version 1.1)
. The repository is version 1.0. It seems to me that it does not vary much from 1.1, but not reviewed the changelog, so I do not know for sure. In any case, the documentation is on the web, and Python did not intend to use. So
install packages:
sudo apt-get install-dev libcv1 libcv libcvaux1 libcvaux-dev-dev libhighgui1 libhighgui
In response we get:

Reading package lists ... Done Building dependency tree

Reading state information ... Ready
will be installed following packages:

libatk1.0-dev libavcodec-dev libavformat-dev libavutil-dev libcairo2-dev libdc1394-13-dev libexpat1-dev libfontconfig1-dev libfreetype6-dev libglib2.0-dev libgsm1-dev libgtk2 .0-dev libjpeg62-dev Libice-dev libogg-dev libpango1.0-dev libpixman-1-dev libpng12-dev libpthread-stubs0 libpthread-dev-stubs0 libraw1394-dev libtheora-dev libsm-dev libtiff4-dev libvorbis-dev libtiffxx0c2 libx11-dev libxcb libxau-dev-dev-xlib0 libxcb1-dev libxcursor libxcomposite-dev-dev-dev libxdamage libxdmcp libXext-dev-dev-dev libxfixes libXft-dev libxi-dev libxrandr libxinerama-dev-dev-dev libxrender x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-RandR-dev x11proto-render-dev x11proto -Xext-dev x11proto-xinerama-dev xtrans-dev zlib1g-dev Suggested packages << "Result: [" << nRows << ", " << nCols << "]" << endl;

: <= nRows; i++) {
< nCols; j++) {
libcairo2-doc libglib2.0-doc libgtk2.0-doc libpango1.0-doc imagemagick << result[i * nCols + j] << "\t";
libraw1394-doc

will be installed following NEW packages
<< "\t skonwertowany rok: " << rok;
libatk1.0-dev libavcodec-dev libavformat-dev libavutil-dev libcairo2-dev libcv-dev libcv1 libcvaux1 libcvaux-dev libdc1394-13-dev libexpat1-dev libfontconfig1-dev libfreetype6-dev libglib2.0-dev libgsm1 -dev libgtk2.0-dev libhighgui libhighgui1 Libice-dev libjpeg62-dev-dev libogg-dev libpango1.0-dev libpixman-1-dev libpng12-dev libpthread-stubs0 libpthread-dev-stubs0 libraw1394-dev libtheora-dev libsm-dev libtiff4-dev libvorbis-dev libtiffxx0c2-dev libx11-dev libxcb libxau-xlib0-dev-libxcb1 dev-dev libxcomposite libxcursor-dev-dev libxdamage libxdmcp libXext-dev-dev-dev libxfixes libXft-dev-dev libxi libxinerama libxrandr-dev-dev-dev libxrender x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto -fixes-dev x11proto-input-dev x11proto-kb-dev x11proto-RandR-dev x11proto-render-dev x11proto-Xext-dev x11proto-xinerama-dev xtrans-dev zlib1g-dev 0 upgraded

, 59 newly installed, 0 remove and 0 not upgraded. Need to get 0B/17 << endl;
, 3MB archives.
After this operation will be further used 62.9 MB disk space.
Do you want to continue [Y / n]?

answer that, of course, yes. As you can see plenty of other installed packages - from what I can see some are designed to handle different formats of images and movies, and the other to handle the interface (for example, libgtk2.0-dev). When this step is complete header files are installed in / usr / include / OpenCV, and libraries in / usr / lib. << "Zamykanie bazy danych" << endl;
begin now to work with NetBeans:
Create a new project type "C / C + + Application." We give him the name "OpenCV Hello World."

<< endl;

We have a clean design with a single file main.cpp. Now need to tell the compiler where the library, which is to join the project. Right-click in the "Projects" in the current project and go to its properties (Properties). After selecting the "Linker" add the path to the libraries (Additional Library Directories): / usr / lib and libraries (Libraries): cv, cvaux, highgui.


# include "OpenCV / cv.h"
# include "OpenCV / cvaux.h"
# include "OpenCV / highgui.h"
/ *

* * /
int main (int argc, char ** argv) {
/ / create a variable holding the image and the image is loaded from a file, 0 = black and white
IplImage * image = cvLoadImage ("/ home / daniel / Images / hello.jpg ", 0);
/ / create the window named" Hello World
cvNamedWindow ("Hello world");
/ / Displays the image
cvShowImage ("Hello world", image); / / wait for key press, default 0 = infinity cvWaitKey (); / / close the window, you can use cvDestroyAllWindows () cvDestroyWindow ("Hello world");
/ / release the memory occupied by the variable picture
cvReleaseImage (& image);
return (EXIT_SUCCESS);}
effect after pressing F6: