Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!news.glorb.com!news2.glorb.com!postnews.google.com!j9g2000vbp.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: find Spots in the Image
Date: Tue, 22 Sep 2009 19:29:30 -0700 (PDT)
Organization: http://groups.google.com
Lines: 30
Message-ID: <d0c0f9fb-b8b1-4ef9-aee2-b4af570ed60a@j9g2000vbp.googlegroups.com>
References: <h96qbb$ug$1@fred.mathworks.com> <h96r1t$emm$1@fred.mathworks.com> 
	<3aeaa406-d937-4807-a397-4e46c2ea46ec@s6g2000vbp.googlegroups.com> 
	<h99d10$6ge$1@fred.mathworks.com> <h9a9no$jni$1@fred.mathworks.com> 
	<h9blnq$or4$1@fred.mathworks.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 1253672970 22312 127.0.0.1 (23 Sep 2009 02:29:30 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 23 Sep 2009 02:29:30 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: j9g2000vbp.googlegroups.com; posting-host=75.186.70.56; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
	3.5.21022; AskTB5.5),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:572230


On Sep 22, 7:14 pm, "Yi " <heyinba0...@hotmail.com> wrote:
> hi ImageAnalyst
> i have read your tutorial. this is the code what i learn from your tutorial:
>
> % Read in standard MATLAB demo image
> originalImageX = imread('testImage.JPG');
> originalImage = rgb2gray(originalImageX);
> thresholdValue = 1;
> binaryImage = originalImage < thresholdValue;
> binaryImage = imfill(binaryImage, 'holes');
> labeledImage = bwlabel(binaryImage, 8);
> blobMeasurements = regionprops(labeledImage, originalImage, 'EulerNumber');  
> numberOfBlobs = size(blobMeasurements, 1);
>
> after i run this function
> i got numberOfBlobs = 49 and each of them has a EulerNumber which equal to "1"
> so i really can not understand the meaning of this result.
> could you help me and give me some ideas?
>
> thanks so much
---------------------------------------------------------------------------------
Your problem was that you called
binaryImage = imfill(binaryImage, 'holes');
for some reason.  Why did you do that?  You just filled the holes you
were hoping to count.