Mat applyLookUp(const Mat& image, const Mat& lookup) {
Mat result;
LUT(image, lookup, result);
return result;
}
int main(int argc, char** argv) {
Mat image = imread("cat.jpg", 0);
if (!image.data) return -1;
Histogram1D h;
int dim(256);
Mat lut(1, &dim, CV_8U);
for (int i = 0; i < 256; ++i) {
lut.at<uchar>(i) = 255 - 1;
std::cout << lut.at<char>(i) << "\n";
}
namedWindow("cat");
imshow("cat", image);
namedWindow("Simple");
imshow("Simple", h.applyLookUp(image, lut));
returning value from 'applyLookUp' did't show correct window.
it's only show empty white window screen.
and i found another example to tried, but it didn't work neither.
i use window10, visual studio2017 and openCV 3.4