Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 53

false coloring of grayscale image

$
0
0
Hello, I have a grayscale image to which I want to apply false coloring. Below is a chunk of my code where I loop through all rows and cols of my matrix (matProcessed). For each pixel value, I lookup the desired RGB values from the user's pre-defined lookup table, and then overwrite the pixel in matProcessed accordingly. This all works just fine, except that all underlying intensity information in the original grayscale image is lost when a range of intensity values is simply replaced with a color. I think what I need is more like what the hue/saturation/colorize function in Photoshop would do, where I can colorize a range of grayscale pixels while retaining the underlying variation in intensity of the grayscale values. So how do I do that? // I first convert to BGR to colorize: cvtColor(matProcessed, matProcessed, CV_GRAY2BGR); int iPxVal=0; int index; int R=0; int G=0; int B =0; for(int i=0; i

Viewing all articles
Browse latest Browse all 53

Trending Articles