robocup: image processing team


phase I:
download file rc.zip and extract it into your directory.
-It containes the program source (thresh.c), input (filed.ppm), output (fieldout.ppm), execuable program (thresh), and makefile.
- the program was written by Dr. M.
- make file by typing "make" in the terminal in linux.
- we are working on ppm file format (linux format).
- Simple example of background segmentation for a Robocup football field.
- FIXME: the algorithm currently selects yellow pixels as well as green pixels.
- This program requires the PPM library (part of the netpbm package). Try "man libppm" for documentation.


- Slution: change the formula
if ( pixvalG > 0.9 * pixvalR && pixvalG > 2 * pixvalB && pixvalG > pixvalMax / 4)

to if ( pixvalG > 1.0 * pixvalR && pixvalG > 3 * pixvalB && pixvalG > pixvalMax / 4) ΑΡι§



phase II: loosely tracking the ball: example thresht.c
note, you just little bit modify the make file from zip file above to compile this program
(ie., change thresh.c to thresht.c in the make file)

phase III: background subtraction

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).



phase IV: Color Normalization (May 29, 2004)
thresh_normalizing.c

phase V: template matching

algorithm (from Dr. M. D.)



for (row = r to height - r )
for (col = r to width - r )
x = match (row, col, template)
if x > y then yes
else no

note:y is some value

match
for each template row
for each template col
diff += D (imgPixel, templatePixel)

return 1/diff
note:the smaller the diff value, the better
D:imgPixel, templatePixel
return the sum of RGB
(R1 G1 B1) , ( R2 G2 B2)
return
abs(r1 -r2) + abs (g1 -g2) + abs (b1 - b2)


We develop the program. The reslt is not correct. We're still working on it
tm.c (program)
template.zip picture linux file



###########part II##############
In the October 2004, after a long .... final exam, while some people enjoy the break, we were doing the image processing trying to find and locate the robot on the field in the Cyber-Tech room, activities building, SIIT Rangsit. We made a top of the robot from color paper.






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 ........










Sukasom Chaiyakul
Hosted by www.Geocities.ws

1