opencv4学习总结-图像查找表

#include <opencv2/opencv.hpp>
#include <iostream>

using namespace cv;
using namespace std;


int main()
{
    Mat src = imread("E:/opencv_source/opencv_tutorial_data-master/images/malware.png");
    imshow("src", src);

    Mat color = imread("E:/opencv_source/opencv_tutorial_data-master/images/lut.png");
    Mat lut = Mat::zeros(256, 1, CV_8UC3);
    for (int i = 0; i < 256; i++)
    {
        lut.at<Vec3b>(i, 0) = color.at<Vec3b>(10, i);
    }
    imshow("color", color);
    Mat dst;
    LUT(src, lut, dst);
    imshow("lut-demo", dst);

    //自带颜色查找表
    applyColorMap(src, dst, COLORMAP_AUTUMN);
    imshow("colormap-demo", dst);
    



    waitKey(0);
    destroyAllWindows();

    return 0;
}