Selecting two colours from an image
Message-ID:<b99ce87a-edb5-40a0-96a6-d15c6eae35e4@m42g2000yqb.googlegroups.com>
Subject:
Selecting two colours from an image
Date:Mon, 9 Feb 2009 18:53:29 +0100
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.
Message-ID:<7c37456a-b454-4438-b725-3eefe200fd2e@r41g2000yqm.googlegroups.com>
Subject:
Re: Selecting two colours from an image
Date:Tue, 10 Feb 2009 00:39:55 +0100
On Feb 9, 12:53=A0pm, Niall 84 <niall_hea...@yahoo.com> 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. ---------------------------------------------------------------------------= --------- Niall: Yes. It makes sense. But since you have white lines all over the place, the only way to do it is the way the NFL does it to calibrate the screen image as a function of the angles of orientation of their camera. That's really simplifying what they actually do (you can probably find web sites that discuss it). It's not a weekend project! Regards, ImageAnalyst
Message-ID:<69098$4992c766$d1d95423$9326@PRIMUS.CA>
Subject:
Re: Selecting two colours from an image
Date:Wed, 11 Feb 2009 13:41:11 +0100
"Niall 84" <niall_heavey@yahoo.com> wrote in message news:b99ce87a-edb5-40a0-96a6-d15c6eae35e4@m42g2000yqb.googlegroups.com... >...so I need to find a way of selecting all white lines that are surrounded >by green. Before getting bogged down in code and algorithms, its often helpful to analyse how you do this visually i.e. ignore all non green or white pixels; white regions with any non green surrounding areas are discarded. So here's a possible approach. For simplification I assume that white and green areas are of homogeneous colour for the moment. 1. segment the image to remove any unwanted pixels. Set them to say, black. This step is not essential, just removes any noise and confusion. Greenish pixels can be set to green, whitish to white if this is an issue. 2. use blob identification (eg line#, pixel#, runlength) to create a list of region descriptors in green and white. 3. white blobs that don't (by blob coord analysis) adjoin green blobs can be discarded (eg set to black). 4. discard the green blobs. Here's a simplification: 0. Segment the image if this will help. 1. Identify the while blobs or regions. 2. Calculate the 1 pixel wide path around each white region. If all the pixels are green, keep the region. Once you find a non-green pixel, stop the check and discard the region. ou may want to allow for a minimum number of non-green pixels. -- All or most of the above can be done with PiXLC IP commands. regards, Stewart DIBBS ========================================== PiXCL 8: The Advanced Image Analysis Suite is affordable and available now. Download the free version today! ========================================== ========================================== www.pixcl.com
Message-ID:<C9GdnZHj8ZpAszfUnZ2dnUVZ_gQLAAAA@giganews.com>
Subject:
Re: Selecting two colours from an image
Date:Sun, 1 Mar 2009 07:44:45 +0100
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
Message-ID:<b99ce87a-edb5-40a0-96a6-d15c6eae35e4@m42g2000yqb.googlegroups.com>
Subject:
Selecting two colours from an image
Date:Mon, 9 Feb 2009 18:53:29 +0100
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.
Message-ID:<7c37456a-b454-4438-b725-3eefe200fd2e@r41g2000yqm.googlegroups.com>
Subject:
Re: Selecting two colours from an image
Date:Tue, 10 Feb 2009 00:39:55 +0100
On Feb 9, 12:53=A0pm, Niall 84 <niall_hea...@yahoo.com> 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. ---------------------------------------------------------------------------= --------- Niall: Yes. It makes sense. But since you have white lines all over the place, the only way to do it is the way the NFL does it to calibrate the screen image as a function of the angles of orientation of their camera. That's really simplifying what they actually do (you can probably find web sites that discuss it). It's not a weekend project! Regards, ImageAnalyst
Message-ID:<69098$4992c766$d1d95423$9326@PRIMUS.CA>
Subject:
Re: Selecting two colours from an image
Date:Wed, 11 Feb 2009 13:41:11 +0100
"Niall 84" <niall_heavey@yahoo.com> wrote in message news:b99ce87a-edb5-40a0-96a6-d15c6eae35e4@m42g2000yqb.googlegroups.com... >...so I need to find a way of selecting all white lines that are surrounded >by green. Before getting bogged down in code and algorithms, its often helpful to analyse how you do this visually i.e. ignore all non green or white pixels; white regions with any non green surrounding areas are discarded. So here's a possible approach. For simplification I assume that white and green areas are of homogeneous colour for the moment. 1. segment the image to remove any unwanted pixels. Set them to say, black. This step is not essential, just removes any noise and confusion. Greenish pixels can be set to green, whitish to white if this is an issue. 2. use blob identification (eg line#, pixel#, runlength) to create a list of region descriptors in green and white. 3. white blobs that don't (by blob coord analysis) adjoin green blobs can be discarded (eg set to black). 4. discard the green blobs. Here's a simplification: 0. Segment the image if this will help. 1. Identify the while blobs or regions. 2. Calculate the 1 pixel wide path around each white region. If all the pixels are green, keep the region. Once you find a non-green pixel, stop the check and discard the region. ou may want to allow for a minimum number of non-green pixels. -- All or most of the above can be done with PiXLC IP commands. regards, Stewart DIBBS ========================================== PiXCL 8: The Advanced Image Analysis Suite is affordable and available now. Download the free version today! ========================================== ========================================== www.pixcl.com
Message-ID:<C9GdnZHj8ZpAszfUnZ2dnUVZ_gQLAAAA@giganews.com>
Subject:
Re: Selecting two colours from an image
Date:Sun, 1 Mar 2009 07:44:45 +0100
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



RSS News Feed