Archive for February, 2012

So when i read the rule book I already got a plan in mind about this task.

Since my aim was not to participate in the event I will keep work till calculating speed using Image Processing.

Glowing LEDs or displaying Speed in a small LCD could be easily done using Arduino Processor.

I used following things:1) Camera : Axis 207

2) Eclipse IDE (c++ developer)  with OpenCV

3) Platform : Ubuntu 10.04

This was what i thought first:

—>Read frames from Axis cam     —>   For the first frame segment Red And Green lines    —>    know the position of each pixel that represent Red line and same for Green line    —>    Now in next few frames check it there is any change in Red line    —>    As the change occurs note the system time    —>    Now check for any change in Green line    —>    As the change occurs again note the system time    —>    Now the time difference between above two times will give the time that objects take crossing the two lines    —>    now as we know the time and distance we can calculate the SPEED

The above was some random plan. obviously i would not have worked due to many reasons like a small mechanical vibrations of cam can even give wrong output.

then i came up with another plan (a little similar ):

—>Read frames from Axis cam     —>   For the first frame segment Red And Green lines    —>    Count the number of pixels each  that represent Red line and same for Green line  separately   —>    Now in next few frames check it there is any change in the count of pixels that represent  Red line    —>    As the change occurs note the system time    —>    Now check for any change in count of pixels that represent Green line    —>    As the change occurs again note the system time    —>    Now the time difference between above two times will give the time that objects take crossing the two lines    —>    now as we know the time and distance we can calculate the SPEED.

know for the change in number of pixels assume change to be large enough like around 100 pixels worked for me.

this would eliminate wrong output due to any small mechanical vibrations.

Now other challenge was to calculate time with accuracy. Using Time.h was good option for knowing the system time.

But i noticed  lags existed may be a millisecond small. But definitely these lags would result in wrong output for time (even if the time error in time is of few second or milisecond- it is wrong since we can have a better way out)

So i thought of another way for calculating time, since we know the fps (frame per second ) of the camera, we can simply calculate the number of frames recorded when object travels from Red line to Green line.

Now to know the time we can simple divide total frame by fps.

and so this is what i finally implemented.

Advertisements

INTRAPIDE was an event organised by IEEE (DTU chapter) in their annual tech fest TROIKA in academic session 2011-12.

I am posting the link for the rule book of the event below:

<<<<  RULE BOOK  >>>>

<

     This is the original rule book I downloaded from the Troika website

An amazing thing I found was the fomula IEEE-DTU people put in this book on second page (check it out)

they say speed = time / distance….HAHAHAHA..!!!

Another thing i would like to mention that I guess IEEE-DTU people were confused about deciding colour for the line.

on first page they first wrote that the two lines would be of Red colour, while in their arena image one line  was of Red colour while other was of Green colour.

(Red and Green line was actual case)

I guess they did not review what they write. :-p

>

The event is clearly not an event for Image Processing.

Or I must say that it would be efficient to use some other method.

But, practice my skills i thought to solve the task using Image Processing.

Although I could not participate due to various reasons, major being that I took this initiative very late moreover being little busy but, i have completed this task and would post in my coming posts briefly telling how i did this.