Ask Your Question
0

Error clahe opencv 3.0 undefined reference to symbol

asked 2016-02-03 05:53:47 -0500

brunocarazato gravatar image

updated 2016-02-03 06:19:53 -0500

Hello. Before ask here I tried http://answers.opencv.org/question/46... but didn't solve the problem.

This is the code i'm using:

'#include "opencv2/imgcodecs.hpp"

'#include "opencv2/opencv.hpp "

using namespace cv; using namespace

std; using cv::CLAHE;

int main() {

Mat m= imread("teste.png");

imshow("lena_GRAYSCALE",m);

Ptr<clahe> clahe = createCLAHE();

clahe->setClipLimit(4);

Mat dst;

clahe->apply(m,dst);

imshow("lena_CLAHE",dst);

waitKey();

}

The error: g++ -L/usr/local/lib -o "ClaheTeste1" ./main.o -lopencv_imgcodecs -lopencv_highgui -lopencv_core /usr/bin/ld: ./main.o: undefined reference to symbol '_ZN2cv11createCLAHEEdNS_5Size_IiEE' //usr/local/lib/libopencv_imgproc.so.3.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: * [ClaheTeste1] Error 1

Any idea?

edit retag flag offensive close merge delete

Comments

1

read the error again, closely. it complains about missing opencv_imgproc. you have to add that to your linker cmdline

berak gravatar imageberak ( 2016-02-03 07:31:12 -0500 )edit
1

oh, and btw, to format code , use the 10101 button, not the "" button.

(this made it look, like a case problem, which is not there in your original code)

berak gravatar imageberak ( 2016-02-03 07:33:27 -0500 )edit

oh, and btw, to format code here , use the 10101 button, not the "" button.

(this made it look, like a case problem, which is not there in your original code)

berak gravatar imageberak ( 2016-02-03 07:33:48 -0500 )edit

Thank you berak!! I'm using < , but to paste here I put ".. You were sure about missing opencv_imgproc

brunocarazato gravatar imagebrunocarazato ( 2016-02-03 09:10:33 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-12-14 09:58:00 -0500

Akhilesh gravatar image

updated 2016-12-14 21:58:03 -0500

berak gravatar image

If the error is still there, then first you should include header file #include "opencv2/imgproc.hpp" and the compile your code as g++ -L/usr/local/lib -o "ClaheTeste1" ./main.o -lopencv_imgcodecs -lopencv_highgui -lopencv_core -lopencv_imgproc

edit flag offensive delete link more

Comments

(imgproc, not ximgproc)

berak gravatar imageberak ( 2016-12-14 21:58:42 -0500 )edit

yeah, I too suggested imgproc only.

Akhilesh gravatar imageAkhilesh ( 2016-12-14 23:48:24 -0500 )edit

Actually, this error comes because of dynamic compile time linking, so in order to link it we can use -lopencv_imgproc in command line.

Akhilesh gravatar imageAkhilesh ( 2016-12-14 23:53:14 -0500 )edit
0

answered 2016-02-03 06:44:41 -0500

updated 2016-02-03 07:10:43 -0500


C / C++ is case sensitive (because computing systems are naturally case sensitive)


you must to change the line

Ptr<clahe> clahe = createCLAHE();

to

Ptr<CLAHE> clahe = createCLAHE();

also you must to convert your image to GRAYSCALE to apply CLAHE or simply load your image GRAYSCALE

Mat m= imread("teste.png", IMREAD_GRAYSCALE);
edit flag offensive delete link more

Comments

Ok. I did it, but the error still

brunocarazato gravatar imagebrunocarazato ( 2016-02-03 06:54:37 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-02-03 05:53:47 -0500

Seen: 732 times

Last updated: Dec 14 '16