Wednesday, 26 October 2011

Initial image analysis

Once the image has been taken using the app, it is converted into a grayscale image using Matlab.  Peaks  with an intensity above 4000 between 54, 85 and 92, 149 where these values correspond to the grey colour value.  Removing these colour shows 2 out of the 5 balls.

Using each colour intensity RGB components, histograms for each pixel were made.  All of the green components were removed.  Using a maximum intensity of 25000, the red values cut off 67-133 and 67-135 gave better values with all 5 balls found but white patches on the table.

Changing the red and blue bands to give the best results, 5 balls found and edge of the table, the felt was blocked out.  If it finds a red between 85 and 151, a blue between 47 and 170, and green between 0 and 255, these values are set to zero and all other values set to 255 (white)

Matlab has a function 'edge' which can apply different edge detection techniques: canny, sobel, log, roberts, prewitt, and zero cross.

The best results were found using the canny technique.

No comments:

Post a Comment