How to test OpenCV on Ubuntu 9.10

How can I confirm if OpenCV is installed correctly on my computer? Is there any quick command line? I'm on Ubuntu 9.10

+59
linux ubuntu opencv
Mar 11 '10 at 4:20
source share
6 answers

The correct answer to my question!

pkg-config --modversion opencv

+121
Sep 16 '12 at 18:38
source share

With OpenCV 2.4.x:

You can use "CV_VERSION" or "CV_MAJOR_VERSION", "CV_MINOR_VERSION", "CV_SUBMINOR_VERSION" from a simple C / C ++ program.

Example "main.c":

#include <stdio.h> #include <cv.h> int main(void) { printf("%s\r\n", CV_VERSION); printf("%u.%u.%u\r\n", CV_MAJOR_VERSION, CV_MINOR_VERSION, CV_SUBMINOR_VERSION); } 

Here is the compilation line:

 g++ `pkg-config --cflags opencv` main.c `pkg-config --libs opencv` -o main 
+9
Oct 20 '15 at 20:01
source share

Here is an easy way to check. Assuming you installed using the default configuration.

In /usr/local/lib you should have the following libraries

 libcvaux.so -> libcvaux.so.2.0 libcvaux.so.2.0 -> libcvaux.so.2.0.0 libcvaux.so.2.0.0 libcv.so -> libcv.so.2.0 libcv.so.2.0 -> libcv.so.2.0.0 libcv.so.2.0.0 libcxcore.so -> libcxcore.so.2.0 libcxcore.so.2.0 -> libcxcore.so.2.0.0 libcxcore.so.2.0.0 libhighgui.so -> libhighgui.so.2.0 libhighgui.so.2.0 -> libhighgui.so.2.0.0 libhighgui.so.2.0.0 libml.so -> libml.so.2.0 libml.so.2.0 -> libml.so.2.0.0 libml.so.2.0.0 

And in /usr/local/include/opencv you should have the following header files.

 cvaux.h, cvcompat.h, cv.hpp, cvver.h, cvwimage.h, cxcore.hpp, cxflann.h, cxmisc.h, cxtypes.h, highgui.hpp, cvaux.hpp, cv.h, cvtypes.h, cvvidsurv.hpp, cxcore.h, cxerror.h, cxmat.hpp, cxoperations.hpp, highgui.h, ml.h 

I assume that you are using the latest version 2.0.

+8
Mar 11
source share

Here is the C ++ version

 // https://www.solarianprogrammer.com/2014/04/21/opencv-beaglebone- black-ubuntu/ // Test to check the OpenCV version // Build on Linux with: // g++ test_1.cpp -o test_1 -lopencv_core #include <opencv2/opencv.hpp> #include <iostream> int main() { std::cout << "Hello, OpenCV version "<< CV_VERSION << std::endl; return 0; } 
+1
Dec 23 '16 at 19:03
source share

I found this to be the easiest way:

/usr/bin/opencv_version

0
Oct 24 '18 at 18:37
source share

You can use dpkg .

$ dpkg -l | grep libopencv

Or if you are using a version of Python:

 $ python >>>> import cv2 
0
Jul 12 '19 at 8:15
source share



All Articles