I'm trying to convert pixel (4 channels) to it's grayscale value.
Image looks like a jet colormap:
and I am trying to convert it to this:
When I'll have it converted, I want to set transparency to the original by it's grayscale value. My conversion looks like this:
uchar v = (inMat.at<cv::Vec4b>(i,j)[0]*0.07f) +
(inMat.at<cv::Vec4b>(i,j)[1]*0.72f) +
(inMat.at<cv::Vec4b>(i,j)[2]*0.21f);
I thought these values (0,07;0,72;0,21
) will convert them, but it convert the pixel to something which looks more like this:
What values should I use to convert it right way?