Reputation: 2244
I was really confuse between intensity slicing and color map implementation in OpenCV. Is the color maps implementation in OpenCV the same with the concept of intensity slicing? Can anyone clarify this to me. Your help will be very much appreciated. Thank you.
Upvotes: 1
Views: 226
Reputation: 11420
Intensity slicing is more like a thresholding action. You have 2 kinds, one is without background, so black, and the selected greyscale colors are white. In OpenCV this can be achieved with threshold
or inRange
. The second one is with background, which you turn certain greyscale values white and the rest you leave them as they are... I do not know any OpenCV function that do this... but it can be easily achieve with inRange
to get the binary mask and then setTo
with the mask and to color white.
Now, the color mapping is actually as its name says, mapping colors :) This means that for each "colormap" it has a color value for each 8 bit greyscale value, i.e. 256 colors. Then it creates a new colored image by putting a color value that mapped the value of the greyscale pixel intensity. In the "Jet" colormap, 0
in greyscale will be mapped to a dark blue. And 255 in greyscale will mapped to a dark red.
Upvotes: 2