Thursday, November 24, 2011

F3F Training System: first tests

I had it in the back of my head for some time now. And I am sure many F3F pilots had it as well...
What about a automated base detection system?
Well, let's think about it... a camera... connected to a laptop... some algorithms for motion detecting... some signal to trigger a siren... let's try !
I discovered the open source "Processing" software language a few weeks ago. It is a developing coding system which is probably used as well by scientists, artists, and other geeks because it is the perfect tool for custom image processing. So I wanted to try it out with this progamming environment, especially since it is alsmost the same language as Arduino, which I already know.
What I lacked, was some video footage from behind an F3F base. Since my Danish buddy pilot Jesper Christensen also expriments automatic F3F base triggering, he had a nice demo video on his web site. I wrote him my intentions and asked if he could lend me his video footage. So I could soon start experimenting myself, a few evenings ago.
First, I had to cut some of the video footage to limit to "action", trying to keep mainly gliders flying in the sky.
After having succeded in loading and displaying the video in a Processing window with my program (called a "sketch"), I started trying to access frames and pixels until I was able to manipulate and process stuff in the images. On the way, I discovered "blobs" which are handy objects for following motion. I discovered "frame differencing", method which segregates only the pixels which are modified from video frame to video frame. I learned how to draw color limits around moving gliders, how to average the screen location of multiple detected moving entities, how to calculate algorithms in memory while displaying something else, etc. Finally, I learned how to record the processing results of my investigations into some new video footage.
Well, I learned quite a lot every evening in the last week, and there is still a lot ahead to optimize. But overall, I am quite glad with the first tests and results. I am even certain that in the coming spring, I'll be using this system in the field for F3F training !
In the meantime, here are two short clips showing approximately how effective I could get in such short development time. By the way, the small green numbers and the red circles in the first clip are from Jesper's experimentations. In my tests, the glider crossing base is (quite sometimes) marked by a vertical red flashing line. My system detects what is moving above the horizontal line. The center and horizon lines can be precisely placed with the keyboard. The yellow dot is the approximation of the glider's center of gravity.
Cheers and happy winter.

No comments:

Post a Comment