Friday, January 19, 2007

Blogday 7: Simplicity matters..??

A day of mixed fortunes.

Eohan and Sri Raj found out that two of three servos we have are actually not working. They had a very hard time yesterday programming the AVR for the servos. I gave them company for a while and most of their discussion seemed greek to me. A world of flags, interrupts and clock cycles.....

In the high level coding part, i was in for a surprise. I had an idea to solve some of the problems we were facing yesterday. The averaging (finding the center line ) for the road we had detected was giving some diappointing results. I tried changing the very approach. Instead of a curve fitting thing i went for something which uses the whole of the data we are amassing in each frame. I divided the frame into two, by a vertical line through the center and counted the 'road' pixels on each side. The difference between the sum of the left and right parts gave a fair approximation of the road curvature !! I could improve the results by calculating the percentage of the difference over the total 'road' pixels present. That works nice now. Need to improve the strategy for better results.

Here are some of the frames....
The original image:


The road detected:
The calculations:


Simple ! !

No comments: