Analyze Color Features on Image Processing.

There are various ways to recognize an image. One of the techniques that can be used in image processing are three basic features in the image, namely color, shape, and texture. Different imagery will have different color, shape, and texture features. In this experiment we will discuss one by one feature and how the three features can recognize the image.

Color Features

Color can distinguish objects in the image. Technically, color is a particular spectrum contained in a perfect light (white). Color is formed from a collection of waves with wavelengths of some basic elements of color. The way the presentation of a mixture of basic elements of color to produce a color is called the color space or color space. There are several kinds of color space in image processing, ie RGB, RG, Normalized RGB, HSV, CIE, CMYK, YCrb, HSL, and TSL. From the several kinds of color space already mentioned, the most often we hear is RGB (Red Green Blue). Based on the RGB value, we can know the values of the other color space. We will discuss the relationship between RGB and other color space.

RGB - RG

RG (Red Green) is a color space that has only green and red values. The value of RG is commonly used to detect skin color. In contrast to RGB, RG has a value between 0 to 1 on each component R and G. For more details, note the colors below.

Figure 1. Color With RGB Value 255,0,0
Figure 1 has a RGB value of 255,0,0 or in other words has perfect red color. Then what about its RG value?

Figure 2. RG Value From Figure 1
It is shown in Figure 2 that the value of RG is 1 for red and 0 for green. This is because on the RGB value, there is only a red color value and there are no values in other colors (green and blue). This will impact the same color with a value of RGB 0.255.0 or perfect green color. The resulting RG value will be 0 for red and 1 for green. Then what about the blue color?

Figure 3. Color With RGB Value 0,0,255
Figure 3 has a color with a RGB value of 0.0255 or a perfect blue color. What about its GG value?

Figure 4. The GER value of Fig. 3
It appears in Figure 4 that RG is 0 for red and 0 for green. This is normal because RG does not record the blue value in the image. Even so, the blue value still affects RG for red and green values. Consider the experiment below,

Figure 5. Color With RGB Value 255,0,100
This time we will use RGB value 255,0,100 in other words using dominant red color with little blue color. Here is the result of the RG value.

Figure 6. The GER value of Fig. 5
In contrast to Figure 2 which uses perfect red color, the results shown in Figure 6 have different results than before. That is because the blue color in Figure 5 affects the red value in the color space of RG. Although the red value does not reach 1, but still more than 0.5 or still dominant red. This is because the blue value in the RGB color space is not more than 128 (half of the maximum RGB value).

RGB - HSV

HSV (Hue Saturation Value) has basic elements of hue, saturation, and value. Hue represents a family of colors that are represented as cylinders. Saturation sensation or intensity of color. Value states the gray or darkness of an image. The base color on HSV depends on the hue value. Because hue is represented like a cylinder, so hue has a value like the degree of the circle, which is between 0 and 360. To be clearer about HSV, please note the illustration below.

Figure 7. Illustration of HSV
The illustration in Figure 7 shows the degree range of the hue value and the effect of the value value. The greater the value, the brighter the color. It is also seen that hue values affect the diversity of colors produced. To prove it please see the experiment below.

Figure 8. Color With RGB Value 255,0,0
Figure 8 is an image with perfect red value. Now we will see what kind of HSV value is generated.

Figure 9. HSV Value of Figure 8
It is shown in Fig. 9 that the value of hue is 0 and the saturation and value is 1. Hue is 0 because the color used in the experiment is red and corresponds to the degree of HSV color shown in the illustration of Figure 7. Saturation is 1 because of the red color used not transparent. Value is worth 1 because the red color used has a good light intensity or in other words not dark. To clarify the effect affecting the saturation's value and values in the image, we will try to convert the HSV value of the image to the RGB value. Here is the experiment.

Figure 10. Effect of Saturation Value (a) 1 (b) 0.8 (c) 0.5 (d) 0.2 (e) 0
Figure 10 shows that the smaller the saturation value, the more visible the image will appear as if transparent and close to white. This can be proved by the value of RGB generated. When saturation and value in HSV are 1, hue value only affects only two color values in RGB. However, if we change the saturation value, then one other value in RGB will change as well. When the saturation is changed close to 0, then another value on the RGB will be close to 255 which means close to the white value. For more details consider Table 1.

Table 1. Mapping of HSV and RGB Values With Saturation Parameters
Once we know the effect that resulted from saturation, we will now know the effect of value by this experiment.

Figure 11. Effect of Value Value (a) 1 (b) 0.8 (c) 0.5 (d) 0.2 (e) 0
Figure 11 shows that the smaller the value of the value, the image will be darker and closer to black. This can be proved by the value of RGB generated. When saturation and value in HSV are 1, hue value only affects only two color values in RGB. However, if we change the value valuenya, then the two colors will be reduced. When the value value is close to 0, the value of both colors on the RGB will be close to 0 as well. For more details see Table 2.

Table 2. Mapping of HSV and RGB Value With Value Parameters

RGB - CIE

CIE (Commision Internationale de I'Eclairage) is a standard that is based on human perception and is good for color comparison experiments. There are two types of CIE, namely XYZ and LAB. In this lab we just try CIE XYZ. Color space mapping on CIE XYZ is a bit unique, because it is represented as an irregular volume space. For more details please note the illustration below.

Figure 12. Illustration of CIE XYZ
Visible illustration in Figure 12 color mapping like a wake. There is an x-axis and y-axis that represents the color of the wake. The experiment we will be doing at this time is slightly different. We will take the RGB value randomly and match it to its CIE XYZ value. This first experiment we will take the value of RGB 0.0255 which will produce a perfect blue value. If you look at the illustration above, the CIE XYZ value should be between 0.1 and 0.2 for x and 0 to 0.1 for y. Let's prove it.

Figure 13. Results of CIE XYZ From RGB 0,0,255
From Figure 13 it has been proved that the value of x will be in the range of values 0.1 to 0.2 and the value of y is in the range 0 to 0.1. Again we will experiment with random colors. This time we will use the color as in the picture below.

Figure 14. Color With RGB Value 123,111,3
Visually, Figure 14 looks like a dark orange color that looks like brown. The orange color itself in the illustration CIE XYZ lies in the susceptible values of 0.45 to 0.55 for the values of x and 0.35 to 0.5 for the y. Now let's prove its CIE XYZ value.

Figure 15. Results of CIE XYZ From RGB 123,111.3
From Figure 15 it has been proved that the value of x will be in the range of values from 0.45 to 0.55 and the y is in the range of 0.35 to 0.5.

RGB - CMYK

CMYK (Cyan Magenta Yellow Black) is one of the most popular color spaces other than RGB. In theory, cyan is a combination of green and blue in RGB, magenta is a combination of red and blue, yellow is a combination of red and green. Similarly, the blue color on RGB is a combination of cyan and magenta colors, red is a combination of magenta and yellow, and green is a combination of cyan and yellow colors. The black color on CMYK is used to darken the color. Look at the picture below.

Figure 16. Influence of Black Value (a) 1 (b) 0.8 (c) 0.5 (d) 0.2 (e) 0
In Figure 16 it shows that the bigger the black value, the image will be darker and closer to the black color. This can be proved by the value of RGB generated. If we change its value of black, then the color on the RGB will be reduced. When the black value is close to 1, the value of both colors on the RGB will be close to 0 as well. For more details consider Table 3.

Table 3. Mapping of CMYK and RGB Value With Black Value Parameters

RGB - YCrCb

YCrCb is a family of color spaces used as part of a pipeline color image in a video or digital photography system. Here is an example of RGB color converted to YCrCb.

Figure 17. Color With RGB Value 255,0,0
Figure 17 if converted to YCrCb form will be as below.

Figure 18. YCrCb results from Figure 17

RGB - HSL

HSL (Hue Saturation Lightness) almost has a resemblance to HSV. The difference is if HSV has value to set the light-dark image, HSL has lightness. HSL illustration can be seen in the picture below.

Figure 19. HSL Illustration 
The illustration in Figure 19 shows the degree range of the hue value and the effect of the lightness value. The greater the lightness value, the brighter and closer the white the resulting color. It is also seen that hue values affect the diversity of colors produced. The difference between HSV and HSL is that if the value in HSV reaches the maximum value, then the image will bring up the perfect color. However, if the lightness value of HSL reaches the maximum value, then the image will be white.

After we know some color space in the image, some color space can be made its histogram. In the previous lab we tried to make a greyscale histogram. Currently we will try to create a histogram for the color space RGB, CMYK, and HSV. This histogram is very useful to see the existence of color in the image.

Figure 20. Dominant Red Image
Figure 20 is an example of an image with a predominantly red color. We will analyze the results of the histogram that appears.

Figure 21. RGB Histogram Results For Figure 20
The RGB histogram is divided into three sections, namely 255 first values for red, 255 for green, and 255 for blue. Note Figure 21. The highest value on the histogram lies at 255 in red and about the value 0 for green. This is because almost no green color on the image so that the highest value in green is 0. Because the image is a purplish red, the blue color is also slightly dominant there. Visible on the histogram that blue color with a vulnerable value of about less than 600 is also at the top of the blue color.

Figure 22. CMYK Histogram Results For Figure 20
 In harmony with RGB, the CMYK histogram is divided into 4 sections, the first 255 for cyan, 255 for magenta, 255 for yellow, and 255 for black. Seen in Figure 22 that the color distribution of CMYK looks very evenly. This is because CMYK is a combination of several RGB values. So when the CMYK values are spread evenly, then there is a RGB value that is centered in one color only.

Figure 23. HSV Histogram Results For Figure 20
Unlike the two previous histograms, the HSV histogram only takes its hue value only. As mentioned before, the hue value represents the degree of color diversity. Because the dominant image used is red, then the hue that often appears will be around 0 to 30 degrees. Now we will try to use another image.

Figure 24. Dominant White Image
After we use the dominant image of red, we will now try to use a predominantly white image. Here is the histogram result.

Figure 25. RGB Histogram Results For Figure 24
Figure 25 shows that the histogram value, either red, green, or blue, has the same pattern and distribution. The three color values have a spread between 200 and 255. Why is that? This is because the image used has a white color dominant. So the three color values have the same pattern.

Figure 26. CMYK Histogram Results For Figure 24
Figure 26 still has an even distribution of CMYK values. This is because the value of RGB that appears has a prominent spread to one point only.

Figure 27. HSV Histogram Results For Figure 24
Hue value on HSV does not recognize white color, because white color is controlled by value value. So the hue value only captures colors other than white. When seen in Figure 27, the most striking value lies in the range of about 50 to 150. When viewed in the HSV illustration in the previous discussion, the hue values in the 50 to 150 range are green. And if we examine the image used, if we eliminate the white color, then all that remains is green. Then match the histogram value with the image used.











Comments

Post a Comment

Popular posts from this blog

Quantization of Image Data Implementation in C#

Computer Graphics Project "Planet Orbit" Source Code with Glut OpenGL

Computer Graphics Project "MINION" Source Code with Glut OpenGL