here is the Simple example of background segmentation for a Robocup football
field.
We label each color by its pure color.
thresh4_25.c


the picture above is not for processing. It is for an illustration only. It's a JPG format. Our works only process picture in ppm format (linux).


At that time, we have two cameras. One camera can cover the whole area. Another has the wide len, and it cover area a lot more than we needed. A wide len camera produce an image with ..... If i remember it correctly, in the cybertech room, the camera was attached to the roof, around 3 meters far from the ground. We tested many times with the color papers robot. Our program could detect the robot. We used template matching technique to find the robot. First, we made the template. Then we compare this template to every area on the image. Then we calculate which area is the most similar to the area on the field.
We could find the robot exactly where it is on the field. Then trying to find the orientation was not easy. It included some trigometric. We got the algorithm from Dr. M. D. Finally, we could find the location and orientation of the robot (color papers). We were doing it for like two weeks.
We had a competition on the Saturday morning. On Thursday, we went to Mahidol University (Salaya Campus) to test our image processing. Actually, we already knew that the real field is around 4 meter highs from the ground. In Cyber-Tech, we were practicing with the camera 3 meter high from the ground. I thought that we just change the template then it will be fine. The template may getting smaller.
Well, then it's not quite like what we thought. Thing get's worse and i was very sad (lots of working hour, tired, and finally it doesn't work). The image getting from the real field is a whole lot different. The robot is very small. Then our template matching algorithm may not work. In the prequalify round, our camera needed cover half of the field. The camera that we were using for practicing in the Cyber-Tech room could cover the whole area that we want. Then we try another camera, the wide len camera, then it cover more than we want. The worse thing when using the wide len is that it also distort the image. Well, i almost want to quit. Fang discuss this issue with the Dr. M. D. They decided to find a new len. I don't know whether Fang will be able to find it. I was tired.

Fang could get us a new len. Then we need to find a new place which is similar to the real field in Mahidol. Dr. M. D. could arranged for us to use the field in FOE to test our image processing software. For a while, we could find the location and orientation of the robot.
We went back from the FOE to the Cyber-Tech room. We were still continuing testing. We had to put the field up on the wall to test, and we put the camera 4 meters away.
We, actually i, though that we are ready for the image processing part. What can i say, when the Saturday come, we were there, Mahidol Salaya, and our image processing software did not work. The important thing is the light. The light make the color on the top of the robot fade away. The blue color is not blue anymore. We just screwed up then, huh. We were concerning about the light. If i remember it correctly, we normalized the image to reduce the effect of light. What can i say, the light in the day of competion was ........