Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem using CLAHE opencv c++

Hi there!

I am using Opencv for C++ to translate some algorithms from Matlab. I am trying to use gpu::CLAHE::apply because it seems to be so similar to "adapthisteq" in Matlab. The point is that I am not able to use it since the compilator does not recognize anything about CLAHE.

I am sure I am doing something wrong, but I have tried a thousand different ways and it does not work. My last attempt is this:

include <opencv2 opencv.hpp="">

include "opencv2/imgproc/imgproc.hpp"

include <string>

include <iostream>

include <cstdlib>

include "cxcore.h"

using namespace cv; using namespace std; using cv::CLAHE;

int main( int argc, char** argv ) { Mat m= imread("lena.png",CV_LOAD_IMAGE_GRAYSCALE); //input image imshow("lena_GRAYSCALE",m);

Ptr<clahe> clahe = createCLAHE(); clahe->setClipLimit(4);

Mat dst; clahe->apply(m,dst); imshow("lena_CLAHE",dst);

waitKey(); }

Thank you very much in advance!!

click to hide/show revision 2
No.2 Revision

updated 2013-10-29 04:54:07 -0600

berak gravatar image

Problem using CLAHE opencv c++

Hi there!

I am using Opencv for C++ to translate some algorithms from Matlab. I am trying to use gpu::CLAHE::apply because it seems to be so similar to "adapthisteq" in Matlab. The point is that I am not able to use it since the compilator does not recognize anything about CLAHE.

I am sure I am doing something wrong, but I have tried a thousand different ways and it does not work. My last attempt is this:

include <opencv2 opencv.hpp="">

#include <opencv2/opencv.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include <string>
#include <iostream>
#include <cstdlib>
#include "cxcore.h"
 

include "opencv2/imgproc/imgproc.hpp"

include <string>

include <iostream>

include <cstdlib>

include "cxcore.h"

using namespace cv; using namespace std; using cv::CLAHE;

cv::CLAHE;

int main( int argc, char** argv ) { Mat m= imread("lena.png",CV_LOAD_IMAGE_GRAYSCALE); //input image imshow("lena_GRAYSCALE",m);

imshow("lena_GRAYSCALE",m);

Ptr<clahe> Ptr<CLAHE> clahe = createCLAHE(); clahe->setClipLimit(4);

clahe->setClipLimit(4);

Mat dst; clahe->apply(m,dst); imshow("lena_CLAHE",dst);

imshow("lena_CLAHE",dst);

waitKey(); }

}

Thank you very much in advance!!