Re: Selecting two colours from an image



On Mon, 09 Feb 2009 09:53:29 -0800, Niall 84 wrote:

I have tried this in other groups but cant get a good answer.

Hope this will make sense!!!

I have images from a robotics football simulator. I need to figure out a
way of processing the image so that the only thing that is visible is
the white lines. However there are white lines on the pitch, the nets of
the goal, and some in the background. The only one's I want is the pitch
lines, so I need to find a way of selecting all white lines that are
surrounded by green. This will give me the lines I want. Does anyone
know a way I might be able to do this?

I hope this makes sense, otherwise, is there anyway of attaching a
picture/file so I can show the exact picture which might make it easier
to explain?

Thanks,

Niall.

Extract only the green from the image, set all else to black. Put a
boundary around the pitch using a convex hull (e.g. matlab's 'convhull'),
and set the area outside the hull to gray. Then set all that is black
(the pitch lines) to white, then set all that is gray to black.

OR... if you have robots rolling around on the pitch that you want to
remove from the image of the pitch AND you have a fixed video camera,
composite all of the green from multiple frames until it produces the
complete pitch, and you know what to do from there...

Randy
.


Quantcast