SERVO Magazine is running a multi-part article on OpenCV (a vision library). The series started with the January issue.
Since I am interested in machine vision, I decided to get and build OpenCV.
The problem now is I can not seem to get GCC to find the include files in /usr/local/include/opencv no matter what I do. I have the C_INCLUDE_PATH and CPLUS_INCLUDE_PATH variables set to the standard places and added the path directly to the OpenCV include files also.
Still, when I try to compile one of the OpenCV examples, gcc acts like I don’t even have any include files for OpenCV and doesn’t seem to be aware of them at all.
I am completely new to development under Linux/*NIX, so could use some pointers here.
Wow, I’m amazed at the progress. I learned of OpenCV a few years ago, since my original project was to make a Scout with vision. However, it wasn’t nearly as comprehensive and the documentation was next to nothing, so I decided to work on other things first. It also now uses Intel’s IPP which means on the correct hardware it can run really fast. My guess is Intel contributed some developer time to the project.
Anyway…OpenCV uses a lot of different libraries. The first thing is to make sure you have all the dependencies. My guess is you don’t have the ffmpeg and dependency development libraries. Depending on your issues this FAQ might help opencvlibrary.sourceforge.net/CompileOpenCVUsingLinux.
If its just adding a runtime library path (which you shouldn’t have to do manually), edit /etc/ld.so.conf and then running ldconfig. If it is adding an include or -l compile library, you can modify gcc’s behavior with the -I PATH or -L PATH invocation flags.
If you tried this and still have errors, list them here. If its because Debian puts things is odd places, or you need Debian packages, I might be able to help. However, if it is an OpenCV issue you might want to hit up their forum. Also, OpenCV doesn’t work with gcc 4.0 or 4.1. See opencvlibrary.sourceforge.net/#LinuxVersion. I’d also suggest the make check option and whatever automake environment the project uses to make sure it was installed correctly.
Also are you using the Eclipse IDE Linux version or the plain Linux version?
Note, compiling from source is often a pain. Debian has a libopencv-dev package (apparantly only for stable, but you can download and dpkg -i the older package from the Deboan packages site easily enough) which should do all this for you. However, I understand if you really want to compile from source to learn more about Linux and *NIX development. I recently wasted a good number of hours compiling the xspim MIPS simulator from source when I already had the working xspim Debian package installed, turned out a development tool (flex) had to be in a specific version range to compile correctly.
I guess it didn’t work because I was using GCC 4.1 to compile OpenCV. I uninstalled it all for now.
If you are talking about GCC, I am just using what I installed, so I guess it would be the plain Linux version.
I have been compiling from sources for a long time, with both Linux (Gentoo), and FreeBSD. I even compile KDE from CVS sources sometimes, so I know it can be a pain at times.
Right now I am working on interfacing a Microchip MCP23017 I/O Expander to an Atom. So far, I can only get 7 of 8 bits of port A to light LEDs.