RGB Color Cluster and Graph Coloring Algorithm for Partial Color Blind Correction

. Partial color blindness is an anomaly occurring to 5-8% of the world's population. Color correction using re-coloring algorithm usually can be used to help partial color blindness patient. One of the existing re-coloring techniques is to use the RGB color cluster technique and combine it by utilizing the brute force algorithm to perform color tracing for correcting the color. It has massive time and memory complexity. This research aims to create a correction technique for color blind people using RGB Color Cluster combined with Graph Coloring Algorithm. The first process is to get the RGB color cluster for color blind subject. After getting RGB color cluster from the subject then the image which want to be corrected is grouped based on RGB color cluster. The threshold of color grouping in image is done by utilizing the upper and lower bound values of the RGB color cluster. After the cluster is grouped, then we can represent neighbourhood between the colors by utilizing graph. The adjacent color group will be a neighbour. The next process is color re-coloring using graph coloring algorithm. In graph coloring algorithm, same color group is prohibited to become neighbour. In this research, graph coloring algorithm is used to prevent 2 colors that are look almost similar for become neighbours because it will cause the subject cannot distinguish it. Re-coloring is done by increasing and decreasing the color intensity of a set of colors. This technique succeeds in decreasing the complexity of the brute force algorithm from O(N 4 ) to O(2N 2 ) where the first N 2 is the complexity of building the cluster group and the second N 2 is the complexity of the re-coloring. In addition, the color of the object becomes more natural because Re-coloring is based on color group not pixel based.


Introduction
Color blindness is one of the disorders that affects 5-8% of the world's population. Color blindness is a genetic disorder. This thing cause's color blindness have no medication or therapy due to abnormalities attached to the gene [1]. Color blindness generally occur in the cone cells. Cone cell itself is located in the retina of the human eye. The cone cell is responsible for representing the color of an object. Anomalies that occur in the cell cone can cause a human to have a wrong color representation. Anomalies in cone cells can cause people with color blindness to have problems distinguishing 2 colors (figure 1). People with color blindness will have difficulty to gather and distinguish information from colored objects.
There are various ways and techniques to help a color blind person getting information from color sensitive objects. There are analog glasses to shift certain wavelengths which is done by Enchroma Vision Company or by using a digital approach using image processing. There are several previous studies that used image processing. Youn K. Kim et al performed an image processing technique to facilitate color blind patients to recognize a simple traffic light [2]. Next was Jia-Bin Huang et al who uses recoloring techniques [3]. Furthermore, there are Ginanjar Fahrul Muttaqin and Iping Supriana Suwandi who simulate color blindness using digital glasses [4], and many other researches [5][6][7][8].
One of the existing research is conducted by Dody Qori et al in 2017 [9]. This study utilizes color clusters and color distances in the human eye. This study has advantages over other studies. This study succeeded in helping people with color blindness to recognize almost all cases in color sensitive objects. While other studies are generally only specific to a certain colors case and certain types of color blindness. But this research has a very big weakness. The method used in this study is a brute force technique which applied into every single pixel in an image and color distance modification theory. Due to using brute force technique, the complexity of this method is O(N 4 ). This happens because this method explores each pixel in a 2-dimensional image domain that has O(N 2 ) complexity. During exploring every pixel, this method then compares the pixels that are being explored with all the pixels in the 2-dimensional image so that we will have complexity O(N 2 ) for each pixel. And if we combine these two processes, we will get complexity O(N 4 ). The effect of this high complexity is the length of processing time and the amount of memory that must be used to process 1 image. Therefore, the research submitted in this paper attempted to improve previous research. This research aim to create an image processing technique to help patients with partial color blindness that can be applied in all color scenarios and all types of partial color blindness but still having low complexity.

Color Blind and Color Cluster
Color blindness is an anomaly condition that occurs when the cone cannot distinguish 2 different color as shown in Figure 1. The effect of this condition will cause 2 different colors look similar. Dody Qori Utama et al published a paper in 2016 about cluster-based color tests [10]. Color Blind Test Quantification using RGB Primary Color Cluster is a color blind test that tries to measure the ability of the eye to distinguish the basic colors of Red, Green and Blue. The results of this test are the color clusters R, G, and B. These clusters will determine a person's ability to distinguish the basic colors of red, green and blue. People with more clusters will have the better the ability.
In the RGB cluster-based quantification test there is a measurement which known as color distance. Color distance is the distance between two different colors in one's RGB color cluster. Smaller distance between 2 colors will cause the colors become more difficult to be distinguished in our eyes, and the greater the distance between 2 colors, it can be more distinguishable by our eyes. Color distance can be formulated in the formula below.
is the distance between the color W1 and the color W2. Where components W1 and W2 will consist of the red component distance among W1 and W2 (Dr (R1, R2)), the distance of the green component between W1 and W2 (Dg (G1, G2)) and the distance of the blue component among W1 and W2 (Db (B1, B2)). According to research by Dody Qori Utama et al, Color blindness occurs when 2 colors have a color distance (D (W1, W2)) smaller than 100% in subject's eyes [10]. Color blindness can be illustrated as in figure 2.

Recoloring Algorithm Based on Color Cluster
Color blindness in a person is caused from 2 colors (color 1 and color 2) having a color distance underneath 100% in a subject's eyes. This causes color 1 and color 2 to be indistinguishable by someone because the distance is below 100%. Therefore, to make these two colors become distinguishable, we must modify color 1 and color 2 so they will have a distance of more than 100% in subject's eyes. Something which can be modified from color 1 and color 2 are red intensity, green intensity and blue intensity. We can illustrate this in figure 3.

Fig. 3. Intensity Modification
We can apply the color intensity modification of 2 colors to help subject with a color blindness distinguish that 2 colors to help them getting information from colored objects. The image is basically a collection of color intensity scattered in a 2-dimensional domain. The image is consist of pixels where every one pixel stores color intensity information (Figure 4). Therefore, to help a person with partial color blindness retrieving information from an image, we must ensure that all pixels in the image have a distance of more than 100% in subject's eyes. This occurs because if the color distance is less than 100%, people with color blind will never be able to distinguish the colors and retrieve information from them. Therefore, the basis of the recoloring algorithm that utilizes color clusters is that we have to explore all pixel values from pixels (x1,y1) to pixels (xn,yn). After that, we have to check all the adjacent pixels to make sure that there is no adjacent pixel which have distance less than 100% that can cause someone to not be able to retrieve information from the image.
This algorithm can be applied to all cases of color blindness and all types of partial color blindness because the relativity of each subject will be measured from the number of clusters and the distance formula for each subject. But this algorithm is very wasteful both time and space because we have to explore all pixel values numerous times to check whether the distance between pixels is more than 100% or not. Therefore then, we try to offer a new algorithm that uses graph coloring algorithms to save space and time.

Graph Coloring Algorithm for Partial Color Blind Correction
The recoloring algorithm which utilizes graph coloring is basically trying to minimize checking all pixel values repeatedly when doing the coloring process. By doing that we can save time and space. This algorithm consists of 3 basic parts, image segmentation, graph construction and coloring using the principle of graph coloring.

Image Segmentation
The first process carried out in this technique is image segmentation. Image segmentation aims to group content in an image based on its color. The image segmentation process is intended to minimize checking for every single pixel in recoloring algorithm. For image segmentation we can use various algorithms. But in this study we used the region growing algorithm. In the region growing algorithm, we will choose many random center points to start segmentation. From each selected center point then we will check all the pixels around the center of the pixel. If the intensity difference of each pixel around is still below the threshold, then it will be considered as the same color group. By utilizing the image segmentation then we can then convert a large set of pixels intensity in an images into a set of color groups as shown in figure 5. The complexity of this algorithm will depend on the image segmentation algorithm chosen. But the maximum value for the algorithms is O(N 2 ) where the algorithm with the highest complexity will explore the entire pixel.

Image Segment to Graph
The second process is the process of converting the previously built color group into a graph. This process aims to classify the color segment into the form of a graph and then we can apply graph coloring algorithm. In this process we have to check each color group. Each color group that is adjacent will become a neighbours in the graph which will be constructed. While the color groups that are far apart will not state as neighbour. The illustration of this process can be seen in Figure 6. The complexity of this section is O(N) where N is the only color group available.

Graph Coloring for Recoloring
The last process in this algorithm is the recoloring process. In the recoloring process we use the principle of the graph coloring algorithm. In the graph coloring algorithm, it is explained that 2 neighboured nodes cannot have the same color. If we apply it in the principle of recoloring, we will change the state to 2 neighboured nodes should not have a color distance below 100%. If 2 neighbouring nodes have a distance below 100%, then the 2 color groups cannot be distinguished by those with partial color blindness (Figure 7). The reference recoloring point is the starting point where we do the process of image segmentation. After the distance between the centre points of the node is found and modified, all members of the color group will be changed same with the value changed of the centre point. If the pixel value of the red centre point is changed by 15 intensity values upwards then all members of the group must be increased by 15 red intensity values. If the centre of the intensity value is decreased, all members of the group must be reduced as well.

Result and Conclusion
In this study, the hardware computer used was ASUS GL553VD. It uses Intel Core i7 7700 HQ. LCD sRGB color reproduction 93%. For the test subjects, they have cluster specifications like stated in figure 8. From the color cluster we can conclude that the subject has problems in red and blue. For processed images, we use a standard Ishihara plate. The focus of this research is to find a recoloring algorithm that has a faster processing time. Therefore, the color-blind subject we used is only to ensure that the coloring algorithm is indeed still successful and running well.

Result
The test results can be seen in the table below. Based on the test results, we can see that: -Subject 2 and Subject 1 can distinguish all Ishihara plates properly after the recoloring process is based on graph coloring.

-
The processing time of recoloring using graph algorithms has a much better performance than processing time using brute force algorithm. - The difference between brute force and using graph coloring has a time difference of up to 90 times faster when we use graph coloring algorithm.
-Recoloring results using recoloring graphs will have different results for each processing and cases.

Conclusion
The method that use graph coloring algorithm in this study can help people with color blindness to more easily get information from objects that are color sensitive. Graph coloring method combined with color cluster can produce image recoloring with a processing time that is much faster than using a brute force algorithm combined with color clusters for coloring. This is because the graph-based method does not check every single pixel as many times as the brute force algorithm. An algorithm that utilizes graph coloring algorithm is able to cut time because the single pixel matching process is replaced by just one color grouping and then the coloring process is continued using the principle of graph coloring. Algorithms that utilize graph coloring are proven to be 90 times faster than brute force algorithms. This technique is succeeds in decreasing the complexity of the algorithm O(N 4 ) to O (2N 2 ) where the first N 2 is the complexity of building the cluster group and the second N 2 is the complexity of the re-coloring.
The result of recoloring algorithm based on graph coloring will produce different recoloring images even though the original image is the same. This happen because there are several random parameters such as parameters in the region growth when the image is in segmentation process. Although producing different images, this algorithm is still able to make subjects with partial color blindness retrieve information from light sensitive objects. In the future work, we can develop a recoloring algorithm based on graph coloring which is able to produce consistent results. This is very necessary when we will make real-time devices for people with color blindness, so the consistency of the results is the most important thing.