Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!z66g2000hsc.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Separating connected image regions?
Date: Sun, 17 Aug 2008 06:56:10 -0700 (PDT)
Organization: http://groups.google.com
Lines: 65
Message-ID: <f4729ce2-594c-43e9-a9a5-82c1804ba973@z66g2000hsc.googlegroups.com>
References: <g828t6$5fg$1@fred.mathworks.com> <b902fd14-8fdc-4d2d-b603-c95b4b140531@k30g2000hse.googlegroups.com> 
NNTP-Posting-Host: 75.186.70.56
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1218981371 23791 127.0.0.1 (17 Aug 2008 13:56:11 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 17 Aug 2008 13:56:11 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: z66g2000hsc.googlegroups.com; posting-host=75.186.70.56; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 
Xref: news.mathworks.com comp.soft-sys.matlab:485897



On Aug 15, 3:02=A0pm, "Sven " <sven.holco...@gmail.deleteme.com> wrote:
> Steve Carano <scara...@earthlink.net> wrote in message
>
> <b902fd14-8fdc-4d2d-b603-c95b4b140...@k30g2000hse.googlegroups.com>...
>
> > There are some excellent examples in the image processing
> toolbox that
> > demonstrate the distance function as well as watershed
> (probably more
> > appropriate for your application) segmentation.
>
> > Steve.
>
> Hi Steve, thanks for the pointer. =A0I have had a look at
> watershed, but my results always seemed to be over-split
> (ie, I found too many pools of water).
>
> I thought I should just upload a sample image for clarity.
> You can find it here:http://tinypic.com/view.php?pic=3D292y49t&s=3D4
> (It has been blurred very slightly in this view, but you can
> easily see the two red blobs and where I would like to
> separate them).
>
> I am thinking of doing the following:
>
> 1: Threshold and get a binary of the two blobs combined into
> one blob.
> 2: Caculate the distance function for that blob.
> 3: Select two points, one near the centroid of each of the
> two blobs (as I wrote in my previous post, I think I can
> obtain these)
> 4: Try to watershed the distance function using these two
> points as sources.
>
> I was hoping that this would result in two regions that
> match (reasonably well) the two blobs that I'm looking for.
> I am having trouble though, forcing the watershed function
> to return just two regions. It instead seems to be quite
> arbitrary, splitting each blob into a few small regions on
> some images, and sometimes returning only one of the blobs
> on other images.
>
> I am quite sure that I'm not preparing my image well enough
> to force the watershed algorithm to work how I want it (ie,
> return two regions).
>
> Can anyone help me out with this?
>
> Cheers,
> Sven.

--------------------------------------------------------------
Sven:
I deal with these kinds of blobs frequently.  Here's a method that
often works nicely for me (requires image processing toolbox):
Threshold the blobs by some method.
Erode the thresholded image
Use this eroded image as a "marker" image on the original binary image
during a morphological reconstruction (I forget the name of that
function - maybe it's imreconstruct or something similar).
Parameters include the threshold value and the number of erosions to
do.  If you're lucky, these will work for all blob pairs in the entire
image.  If not, they may need to be adjusted for each connected pair.
Good luck,
ImageAnalyst