Ishihara Plate
Colour Blindness Test
Project Description

Deutan anomalous deficiencies are one of the most common type of colour blindness, and are found in around 6% of the male population, A total 5% of these anomalies are deuteranomaly deficiencies and the remaining 1% are Deuteranopia deficiencies. In normal vision, there are three types of cones found in the eyes, which are the red cones, green cone and blue cones. These three types of cones allow us to see colour. In Deuteranopia, the green cones is missing from the eye, and therefore people with this sort of colour blindness are prone to mixing up and confusing Red and Green colours because they tend to appear extremely similar. Colours which happen to be on the same confusion line, (the lines coming out of the co-punctal point of Deuteranopia, which is x=1, y =0 on the Chromaticity Luminance graph), are the colours which are confused whith each other. The Ishihara Test I created in Processing is aimed to be a Colour Blind Test for people with this type of colour blindness. One of the first things I started with to create the Ishihara test was to create the method to calculate two different colours which fall on the same confusion line. The method I created, named calculateColours() starts off by defining the first RGB colour of the Ishihara test, which is (238, 152, 104). The next step was to calculate the second colour to be used in the Ishihara test. To calculate a colour which lies on the same confusion line as the first colour I was required to calculate the equation of the line of the colour. I therefore had to convert my colour from the RGB colour space to the xyY colour space. To do this, I had to follow the following process:

  1. I needed to convert the RGB values ranging from 0 – 255, and bring them to an RGB value which ranges from 0 – 1.
  2. The next step was to convert the new RGB value ranging from 0 – 1, into Linear RGB
  3. I was then required to convert my Linear RGB colour to CIE XYZ
  4. From XYZ, I then converted the colour to the xyY colour space.
  5. Having my colour now converted into xyY, I calculated the equation of the line by finding the gradient and y-intercept of the confusion line.
  6. Having the equation on the line, I then chose a different position of X on the Chromaticity Luminance Graph, and thus I was able to calculate the values of my second colour on the same confusion line. The second colour is still represented in xyY at this point.
  7. Having my second colour in xyY, I then had to reverse the process and go back to RGB 0 – 255.
  8. From xyY I went to XYZ.
  9. I then went from XYZ to linear RGB.
  10. From linear RGB, I was then required to convert to RBG represented on a scale from 0 – 1
  11. The last step of process was to convert the RGB on the scale of 0 – 1 to RGB on a scale of 0 – 255 to obtain the final colour values of my second colour.

After calculating the colours, I used the values to create two ‘Color’ objects named c1 and c2. Having my colours calculated, I then needed to pack many different sized circles, into one big circle, all at random positions. To do this, I created a class named ‘Circle’ which takes the x and y position of the circle and the size of the circle. To create the circles, I created a method named createRandomCircle(). The job of this method is to generate a random sized circle with a random position inside a larger circle. The method check that it collides with a larger, outer circle to make sure that the circles generated will always be inside the main circle of the Ishihara plate. The method returns a circle which is inside the main circle and is at a random position and is of a random size. This method, createRandomCircle(), is being used by another method named called generateCircles(); The function generateCircles() is responsible for generating the set of random sized circles which will be inside the Ishihara plate, and o check that none of the random circles created overlap with each other. This method makes use of the createRandomCircle() method to generate a circle, then each random circle created is checked to see if it collides with any other circles. This is done by using a function named overlapCheck() which I created. If overlapping occurs, the method will continue to generat random sized and randomly positioned circles until one actually fits. If no overlapping occurs, a method named addColor() is used to add colour to that specific circle according to the circles position when compared to the position of the image “five.png” provided for this assignment. The addColor() function will apply the appropriate colour depending on the colour at the same point as the circle, on the image. If the colour on the image is black one colour will be applied, and if the colour on the image is white, a different colour will be applied. After adding the colour, the circle generated will be added to an ArrayList name circleCollection. Once the circle is added to the ArrayList, the drawToScreen() function is called to draw all the circles in circleCollection. The generateCircles() function is run through the draw() method which loops automatically, thus allowing the program to use it to iterate the generateCircle() method according to how many circles we need and depending on the circleCount defined. Once the circles have been generated and drawn, the draw() method is set to noLoop().

Project Details
Download