Field Color Detector - TJArk-Robotics/coderelease_2016 GitHub Wiki

##Here are image processing steps:


a. Convert every frame of image to HSV color Space.

Fig. 1 Image of Field:

Image of Field


b. Find histogram of S channel.

Fig. 2 Typical S channel histogram:

Typical S channel histogram


c. Using GMM algorithm fit the histogram.

Fig 3. Fit with GMM (K = 3):

Fit with GMM (K = 3)


d. As we know, for green color, S-channel should be greater than 100, so we choose the wave with a peak greater than 100 as potential green seeds.

Fig 4. Potential Green Seeds:

Potential Green Seeds


e. For potential green seeds, we fit its H-channel with GMM.

Fig. 5 Fit H-channel with GMM:

Fit H-channel with GMM


f. We choose the wave with the highest peak as green seeds, and we get green threshold in HSV color space.

Fig. 6 Green parts on field:

 Green parts on field