Color Detection
Color Detection is another integral part of melanoma detection. The next step within our algorithm detects whether there is any overall color variation within the skin lesion.
01
Changing Colorspace
Using the segmented RGB image of the melanoma, we then convert it into the CIELAB colorspace using the rgb2lab() function. CIELAB is a colorspace based on the opponent color model of human vision and is defined by the three values L*a*b* , L* for perceptual lightness, a* and b* for the four unique colors of human vision: red, green, blue, and yellow. The CIELAB colorspace offers the benefit of being more perceptually uniform, which means that a given numerical change corresponds to a similar perceived change in color. Therefore, the difference in values of L*a*b* colors correspond to visual color differences with the naked eye.
CIE Lab Color Space
Image courtesy of: https://sensing.konicaminolta.asia/what-is-cie-1976-lab-color-space/
02
Mean L*a*b Color
Next, we then take converted L* a*b* image and separate each of the channels out. From this, we use the mean2() function to then find the overall mean of each one of the channels to obtain the mean color values of the overall segmented image. We then multiply these mean values by the size of the overall image to obtain a matrix the size of the image consisting of the mean L*a*b* values.
03
ΔE Color Difference
Using the mean L* a* b* valued image and the Color Difference Equation, we then subtract the mean valued image from the L*a*b* converted image, giving each pixel’s difference in color from the mean. Then, we square each of the individual difference values for each of the three color channels, sum them together and take the square root, to obtain a matrix of each pixel’s color difference from the mean. Then by using the mean2() function, we find the average color difference over the entire image to obtain the average color difference value. As a threshold for the color difference, we used a value of 2.3 which corresponds to the just noticeable color difference within this colorspace.
Color Difference Equation
Image courtesy of: https://en.wikipedia.org/wiki/Color_difference#CIELAB_%CE%94E*
DSP Tool:
Change of Basis
One of the Digital Signal Processing tools that we use in our color detection is change of basis. As previously mentioned, we convert the colorspace of the image from RGB to the CIELAB LAB colorspace in order to better mimic human vision in our color analysis. This conversion is actually founded on the change of basis principle that we learned about in class.
In order to convert from RGB, we are changing the basis vectors that the color vectors are calculated upon. In RGB, the vector space is represented by different proportions of red, green, and blue colors. When we change it to LAB, the colors are represented by different levels of lightness, represented by ‘L’, different proportions of red and green, represented by the letter ‘A’, and different proportions of yellow and blue, represented by the letter ‘B’.