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.
1 Answers
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.

- 11,070
- 4
- 41
- 57
-
But somehow they are the same, am I correct? The same in a way that when a certain value of a grey pixel falls within a specific range, it is assigned black or white or leaves as it is in intensity slicing but in color mapping , colors are assigned to a specific pixel that falls within the corresponding range of the pixel. – alyssaeliyah Apr 13 '18 at 06:25
-
1Well you can say so as well, if the colormap that you use is white for certain range and black for the rest, then you have a place where both do the same. However the concepts are different, the idea of colormaps in OpenCV is to map colors to greyscale values while intensity slicing is to binarize the image (without background) or to highlight specific values (with background). – api55 Apr 13 '18 at 08:22