Re: Selecting two colours from an image
- From: "Stewart DIBBS" <sjd@xxxxxxxxx>
- Date: Wed, 11 Feb 2009 07:41:11 -0500
"Niall 84" <niall_heavey@xxxxxxxxx> wrote in message
news:b99ce87a-edb5-40a0-96a6-d15c6eae35e4@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
...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
.
- References:
- Selecting two colours from an image
- From: Niall 84
- Selecting two colours from an image
- Prev by Date: Re: window bitmap image header specifications
- Next by Date: Re: Synthetic motion blur
- Previous by thread: Re: Selecting two colours from an image
- Next by thread: CHINA DOG BEDS FACTORY WWW.PETBED-CATTREE.COM Pet bed Exporter Cat tree Supplier Pet Products Manufacturer Iron dog bed
- Index(es):
Relevant Pages
|