Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi if you want to make custom colormap, at first step make a table[3x255]. Second step use LUT

I hope you can make it!

Hi if you want to make custom colormap, at colormap,please follow step: At first step make a table[3x255]. table[3x255] or 3 table [1x255]. Second step the source should be convert 3 dimenision, and use LUT,like:

    for(int i=0;i<256;i++)
    {
      M1.at<uchar>(i)=Luta[i][0];
      M2.at<uchar>(i)=Luta[i][1];
     M3.at<uchar>(i)=Luta[i][2];
    }

     Mat r1,r2,r3;

    cv::LUT(temp,M1,r1);
    cv::LUT(temp,M2,r2);
    cv::LUT(temp,M3,r3);
    std::vector<cv::Mat> planes;
    planes.push_back(r1);
    planes.push_back(r2);
    planes.push_back(r3);

    cv::merge(planes,dst);

Third step: merge

I hope you can make it!