<< return to Pixycam.com

Detecting Lines on 400m Running Track

Hi,

I would like to detect the lines on a normal running track using the CMUcam5. This should lead to a navigation system, where pixy tells the runner wether he crosses a white line.
As the lines are white and the rest of the track is orange, I am trying to achieve this by negative detecting. My problem is, that I get too many or not enough blocks/ that the white lines are too narrow. Most of the times the blocks don’t end at the lines or I have about 5 blocks between two lines.

I have tried an algorithm where I take just the biggest block pixy sees and compare its x coordinate to the middle of the field of view as well as one, where my board compares all blocks with the right signature in their position and if there are two blocks left and right of the middle it compares their distance to the middle.
The problem is that with both ways my programm always “pulls” to the left side and I don’t know what to do about it.

Is there a way to use the view I get when I start pixymon Without having a Color set? You know, the one with many equally sized white sqares that sees corners and stuff fairly well (this one: http://i74.photobucket.com/albums/i241/cmucam/Image%20043_zpsnjzpxikc.png )? I think the main problem is that because of the view my lines seem not parallel but like a triangle to pixy, so it can’t detect them right.

Does anyone have an idea how to solve this?

Hello Annika,
Just to make sure — you are just trying to detect a line (or lines) using Pixy?

Pixy might have some trouble detecting lines accurately because Pixy’s color algorithm is meant to detect objects. Fast and accurate line detection is something we are working on though. It sounds like this is what you need, although it may not be ready in the timeframe you need (probably 6 months).

One thing I don’t understand is how you are going to detect if the runner crosses the white line. Can you describe?

Edward

Hi Edward,

Yes, I am trying to detect lines with Pixy.

At the moment I use an algorithm with 4 cases:
Case 1: Pixy detects one block of the orange ground color. Then it compares the x coordinate to the middle of the frame and gives signals to make them equal.

Case 2: Pixy detects two blocks of orange ground (hopefully separated by a white line). Then it corrects the position towards the x coordinate closest to the middle.

Case 3: Pixy detects three blocks of orange ground (also hopefully seperated by white lines). It then takes the block in the middle and does the same as in case 1.

Case 4: Many blocks. The programm then takes the biggest block and uses it as in case 1.

With these cases I try to keep the runner on track. It works better than my former sketches but it is not perfect. It seems case 2 is the most frequent one, because most of the time I am walking more or less on top of a white line when I test the sketch. But that doesn’t really matter, as long as the runner is kept within two lanes of the track.

Sadly my timeframe is indeed shorter than 6 months, but I am happy to hear you are working on line detection.

Annika

Hi Annika,
Thanks for the description – sounds cool!

It’s good to know someone is interested in line following. :slight_smile:

Edward