Re: Selecting two colours from an image



"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




.



Relevant Pages

  • Re: Remove speckles in bilevel (bw) image
    ... I suspect freeware with an appeal for contribution ... > pixels, that are not processed. ... To keep all 4 and higher count blobs, ... If you dont want to change the letters at all, ...
    (sci.image.processing)
  • Re: Finding the largest blob in a binary image
    ... just prior to loosing all non-zero pixels. ... Those surviving pixels ... Yes if your blobs are of a similar shape. ... Then, if the blobs are guaranteed to be separated, two projections on X and Y axes would give ...
    (sci.image.processing)
  • Re: Remove speckles in bilevel (bw) image
    ... "ScanFilter" of Jens Dierke, that this thread has been fortunate ... Examples have recently led me to recommend elimination of a ... WHAT ARE 4-CONNECTIVITY BLOBS? ... the standard grid of square pixels. ...
    (sci.image.processing)
  • Separating groups of pixels
    ... RGB, stored in random order. ... These pixels represent two blobs of solid ... These two blobs are not connected by pixels of similar colour. ... fast, standard algorithm for this? ...
    (comp.graphics.algorithms)
  • Discarding pixels by Alpha, Stencil, Depth test
    ... I was trying to see if discard pixels via those test would actually ... discarding all pixels via alpha and stencil does not ...
    (microsoft.public.win32.programmer.directx.graphics)