Reputation: 2809
What packages do I need to install OpenCV on Ubuntu lucid 10.04 ? Do I need to do anything else to be able to compile a simple C example like setting an env variable or changing the path?
Is gcc a good compiler for OpenCV?
The example I'm trying to compile:
int main( int argc, char** argv ) {
IplImage* img = cvLoadImage( argv[1] );
cvNamedWindow( “Example1”, CV_WINDOW_AUTOSIZE );
cvShowImage( “Example1”, img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( “Example1” );
}
Thanks
Upvotes: 2
Views: 1803
Reputation: 402
There is an opencv library package libcv4 and development files libcv-dev that should work.
Could also try installing from PPA to get very latest version 2.1 http://opencv.willowgarage.com/wiki/Ubuntu_Packages
The OpenCV documentation suggests using g++ to compile, see "Building your own code that uses OpenCV" http://opencv.willowgarage.com/wiki/InstallGuide
For example,
g++ -o my_example my_example.cpp -I<opencv_source_dir>/include[/opencv] \
-L<cmake_binary_dir>/lib -lcxcore -lcv -lcvaux -lhighgui -lml
Upvotes: 1