Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to draw thin line between different color regions?
Date: Tue, 27 Jan 2009 17:45:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 1
Message-ID: <glnh70$ob0$1@fred.mathworks.com>
References: <gea0gi$nq2$1@aioe.org> <1d3ccafc-fd44-49cc-b289-f8c5f322f641@t42g2000hsg.googlegroups.com> <45e80e7d-08ae-4b57-b846-e656ae560989@s9g2000prm.googlegroups.com> <gln4v1$gfg$1@fred.mathworks.com> <b5e9ea4f-23df-486d-b0dc-aceb63c984bc@w24g2000prd.googlegroups.com> <KAHfl.39892$zr6.19233@newsfe03.iad>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1233078304 24928 172.30.248.35 (27 Jan 2009 17:45:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 27 Jan 2009 17:45:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1343420
Xref: news.mathworks.com comp.soft-sys.matlab:514315


I thought the colors were in the labeled image, but maybe they're in the original image.  If he doesn't yet have the labeled image, but has only the binary image, then he can try to use watershed segmentation (watershed), or the Euclidean distance map (bwdist) to separate blobs.  But it seems like these are often problematic and over segment the object, sending a dividing line across the blob at every little indent in the outline.  He could also try erosion down to "markers" (or even to the "utlimate eroded set") and then use the markers to morphologically "reconstruct" the objects (basically dilating out again but don't let blobs join together).  Or if he has just a few images, there's always the manual way - just use freehanddraw (file exchange) to trace a curve and then blacken the binary image under the curve, then call bwlabel.