2

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

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.