Ask Your Question

Revision history [back]

If you want to go with the cmake compilation follow the steps

Open a terminal and type:

a)

sudo gedit /etc/ld.so.conf.d/opencv.conf

b)in that paste :

usr/local/lib

c)save and close and then open a terminal and type:

pkg-config --cflags opencv

Result:

-I/usr/local/include/opencv -I/usr/local/include

And then tpye:

pkg-config --libs opencv

Result:

/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so

Then you can continue with the cmake tpye compilation

Otherwise there's another method of compilation:

One way of compiling:- 1)chmod +x FILENAME.cpp

2)

g++ -ggdb `pkg-config --cflags opencv` -o `basename FILENAME.cpp .cpp` FILENAME.cpp `pkg-config --libs opencv'

3)./FILENAME image.Ext

Hope this helps you :)

If you want to go with the cmake compilation follow the steps

Open a terminal and type:

a)

sudo gedit /etc/ld.so.conf.d/opencv.conf

or

sudo nano /etc/ld.so.conf.d/opencv.conf

b)in that paste :

usr/local/lib

c)save and close and then open a terminal and type:

pkg-config --cflags opencv

Result:

-I/usr/local/include/opencv -I/usr/local/include

And then tpye:

pkg-config --libs opencv

Result:

/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so

Then you can continue with the cmake tpye compilation

Otherwise there's another method of compilation:

One way of compiling:- 1)chmod +x FILENAME.cpp

2)

g++ -ggdb `pkg-config --cflags opencv` -o `basename FILENAME.cpp .cpp` FILENAME.cpp `pkg-config --libs opencv'

3)./FILENAME image.Ext

Hope this helps you :)

If you want to go with the cmake compilation follow the steps

Open a terminal and type:

a)

sudo gedit /etc/ld.so.conf.d/opencv.conf

or

sudo nano /etc/ld.so.conf.d/opencv.conf

b)in that paste :

usr/local/lib

c)save and close and then open a terminal and type:

pkg-config --cflags opencv

Result:

-I/usr/local/include/opencv -I/usr/local/include

And then tpye:

pkg-config --libs opencv

Result:

/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so

Then you can continue with the cmake tpye compilation

If error still exists add this line to CMakeLists.txt:

include_directories(${OpenCV_INCLUDE_DIR})

Otherwise there's another method of compilation:

One way of compiling:- 1)chmod +x FILENAME.cpp

2)

g++ -ggdb `pkg-config --cflags opencv` -o `basename FILENAME.cpp .cpp` FILENAME.cpp `pkg-config --libs opencv'

3)./FILENAME image.Ext

Hope this helps you :)