Re: Finding the largest blob in a binary image



im not known to matlab, but if you use anything like c, what's wrong
using recursive asking for the value of 4 neighbours. i have been
doing this, and the speed was ok, even using python. at least it's the
easiest way. no matter if you need the size or the area, this will
work. and if this is still too slow for you, drive it through the
assembler, and you have your speed.



On Jan 30, 7:24 pm, Harris <xgeorg...@xxxxxxxxxxxxx> wrote:
"Leszek L." <lles...@xxxxxxxxxxxxxxxx> wrote innews:epae95$ni2$1@xxxxxxxx:



U ytkownik "Chuck Dillon" <spaml...@xxxxxxxxxxxxx> napisa³ w
wiadomo¶cinews:ep2ogb$v9p$1@xxxxxxxxxxxxxxxxxxxxxxx

Another approach is to do repeated erosions until you find the binary
just prior to loosing all non-zero pixels. Those surviving pixels
are at the heart of the largest blobs. Then do a templated dilation
of the

Yes if your blobs are of a similar shape. But if you have two
rectangular blobs and one is 1x20 pixels while the other is 3*3, then
the second one will survive more erosions, even though it is less than
half the size its competitor (in terms of area).

Good luck,
Leszek.

I think the term "largest" has to be defined first, i.e., if it is in terms of maximum size or in terms of
area. Then, if the blobs are guaranteed to be separated, two projections on X and Y axes would give
two histogram-like cummulative distributions per dimension. From the form and the properties of those
two histograms, distinct the mass center and rough sizes of distinct objects can be identified very fast.
This method (back-projection) has been used successfully in early 3D recostruction s/w in radiology,
although you normally need 5 or more such projections (most commonly in the FFT domain) to get a
usable resolution in the 3D model. However, I believe in this case it should work fine even with only two
projections (X and Y) and no further processing (non-orthogonal projections, no FFT).

--
Harris


.



Relevant Pages

  • 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: Selecting two colours from an image
    ... segment the image to remove any unwanted pixels. ... white blobs that don't adjoin green blobs can be ... Once you find a non-green pixel, ... check and discard the region. ...
    (sci.image.processing)
  • 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: 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)