this presentation is about colormaps. the definition of colormap with the syntax for the function of applying colormaps is provided. the names for the 22 standard colormaps along with their indices are also provided. the code and output image for each of the colormap are also provided.
2. COLORMAPS
• Color mapping is a function that maps the colors of one image to the colors of
another image.
• A color mapping may be referred to as the algorithm that results in the mapping
function or the algorithm that transforms the image colors.
• A colored image consists of three channels namely the Red, Green and Blue.
• So the colormap function maps colors to the given RGB image.
• Colormap is like a filter which uses gradients of different colors.
• A colormap seen in the previous presentation is the HSV.
• The HSV maps the temperature color for the RGB image.
3. COLORMAP IN OPENCV
• The function used for the colormap is known as applyColorMap.
• cv2.applyColorMap(image location, mode)
• The first argument is the location of the read image. This is simply a variable which
is used to store the read image from the cv2.imread function.
• The second argument is the mode we are going to use. This refers to the type of
colormap we are going to use.
• This is done by calling the name of the colormap…like COLORMAP_BONE
• This will use the bone type of colormap on the input image.
• Also we have to use imshow and waitKey functions.
4. INDICES
• The commands given in the mode argument are a bit longer.
• So there are indices for each mode of colormap.
• In python version of OpenCV there are about 22 different standard colormaps
available.
• These colormaps are indexed from 0 to 21.
• For example, COLORMAP_AUTUMN has the index of 0.
• So instead of typing the entire command, we can just type the index number for the
respective colormap to access it.
• The indices for the standard colormaps are given in the next slide.