Thread Subject: Separating connected image regions?

Subject: Separating connected image regions?

From: Sven

Date: 14 Aug, 2008 21:43:02

Message: 1 of 4

Hi there,

I am attempting to separate two blobs on a series of images,
and I am stuck on a certain aspect of the problem.

Imagine two cells in a series of images. Simple thresholding
returns two masks when the cells aren't touching, but only
one mask when they *are* touching.

Unfortunately the blobs aren't brightest at the centre,
dissipating out towards the edges. Instead, they are
brightest along the cell walls.

Therefore I have tried the following approach.

1. Find an image in the series with two separate blobs. Save
this label matrix as a 'template'.

2. Move to the next image in the series and threshold for blobs.

3. If only one (larger) blob is found, compute the distance
function (as per the 'distance transform' doc page).

At this point I am a little stuck. This image usually gives
me two peaks with a valley between. I want to draw a line
down the lowest point in this valley in order to
artificially break my single mask into two separate masks.

Is this a smart way to tackle the problem? How can my final
step be done?

Note that the template computed in (1) will be used to
verify my final two masks, as I expect the artificially
separated masks to overlap quite well with my template.

Any help would be great.

Cheers,
Sven.

Subject: Separating connected image regions?

From: Steve Carano

Date: 15 Aug, 2008 14:52:17

Message: 2 of 4

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.

Subject: Separating connected image regions?

From: Sven

Date: 15 Aug, 2008 19:02:02

Message: 3 of 4

Steve Carano <scarano1@earthlink.net> wrote in message
<b902fd14-8fdc-4d2d-b603-c95b4b140531@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. I 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=292y49t&s=4
(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.

Subject: Separating connected image regions?

From: ImageAnalyst

Date: 17 Aug, 2008 13:56:10

Message: 4 of 4

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

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
watershed Sven 15 Aug, 2008 15:05:06
image Sven 14 Aug, 2008 17:45:07
distance Sven 14 Aug, 2008 17:45:07
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com