<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
<br>
your image isn't a true binary image but has some gray values
close to 0 (black) and some gray values close to 255 (white). I've
converted it to a pure black-white PNG and now three regions
should be detected. I guess JPG does some anti aliasing which
introduces the additional grey values.<br>
<br>
Christina Rossmanith<br>
<br>
<br>
<br>
On 10.04.2015 14:32, Francisco Lopez de la Franca wrote:<br>
</div>
<blockquote
cite="mid:CAJqi3EJhdJFURuAJFovPWiC1XjNxj5zUpROX-kZfDfbgPpzt5Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi all.<br>
</div>
I've just tested itk::BinaryImageToShapeLabelMapFilter
with an B/W image (see attachment) containing only 3
object.<br>
</div>
<br>
I call the following methods:<br>
<br>
>
binaryImageToShapeLabelMapFilter->ComputePerimeterOn();<br>
>
binaryImageToShapeLabelMapFilter->SetInputForegroundValue(255);<br>
>
binaryImageToShapeLabelMapFilter->SetOutputBackgroundValue(0);<br>
> binaryImageToShapeLabelMapFilter->Update();<br>
<br>
> LabelMapType::Pointer labelMap =
binaryImageToShapeLabelMapFilter->GetOutput();<br>
<br>
> int nrOfLabelObjects =
labelMap->GetNumberOfLabelObjects();<br>
<br>
</div>
When I display the number of of label objects, the result
is 246.<br>
<br>
</div>
Does anybody know why this behaviour?<br>
<br>
</div>
Thanks a lot.<br>
</div>
My best regards.<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_____________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a>
Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/insight-users">http://public.kitware.com/mailman/listinfo/insight-users</a>
</pre>
</blockquote>
<br>
</body>
</html>