<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260301</link>
    <title>MATLAB Central Newsreader - outer perimeter binary blobs - vectorisation</title>
    <description>Feed for thread: outer perimeter binary blobs - vectorisation</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 08 Sep 2009 12:47:41 -0400</pubDate>
      <title>outer perimeter binary blobs - vectorisation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260301#678716</link>
      <author>Brendan</author>
      <description>I have a binary image with many (~2000) blobs. Each blob is separated&lt;br&gt;
by at least two pixels. The image has been despurred and cleaned with&lt;br&gt;
bwmorph and bwlabeled. I need to extract the outer perimeter(1 pixel&lt;br&gt;
width) of each blob and give it the same label as its blob. This is&lt;br&gt;
easily done by looping through the blobs, and taking the difference of&lt;br&gt;
the blob and the blob enlarged by one pixel. Easily done but very&lt;br&gt;
slow.&lt;br&gt;
&lt;br&gt;
The above would extract the 8-connected outer perimeter. How would I&lt;br&gt;
extract the 4-connected perimeter?&lt;br&gt;
&lt;br&gt;
Any suggestions to vectorise or otherwise speed up this operation?&lt;br&gt;
&lt;br&gt;
Thanks</description>
    </item>
    <item>
      <pubDate>Tue, 08 Sep 2009 13:10:08 -0400</pubDate>
      <title>Re: outer perimeter binary blobs - vectorisation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260301#678722</link>
      <author>Brendan</author>
      <description>On Sep 8, 9:47&#160;am, Brendan &amp;lt;brendandetra...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; I have a binary image with many (~2000) blobs. Each blob is separated&lt;br&gt;
&amp;gt; by at least two pixels. The image has been despurred and cleaned with&lt;br&gt;
&amp;gt; bwmorph and bwlabeled. I need to extract the outer perimeter(1 pixel&lt;br&gt;
&amp;gt; width) of each blob and give it the same label as its blob. This is&lt;br&gt;
&amp;gt; easily done by looping through the blobs, and taking the difference of&lt;br&gt;
&amp;gt; the blob and the blob enlarged by one pixel. Easily done but very&lt;br&gt;
&amp;gt; slow.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The above would extract the 8-connected outer perimeter. How would I&lt;br&gt;
&amp;gt; extract the 4-connected perimeter?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Any suggestions to vectorise or otherwise speed up this operation?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks&lt;br&gt;
&lt;br&gt;
Scratch the stupid 4-connected vs 8-connected perimeter question.&lt;br&gt;
Suggestions on speed would still be appreciated.</description>
    </item>
    <item>
      <pubDate>Tue, 08 Sep 2009 14:03:53 -0400</pubDate>
      <title>Re: outer perimeter binary blobs - vectorisation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260301#678737</link>
      <author>ImageAnalyst</author>
      <description>Brendan:&lt;br&gt;
Your algorithm gets the enclosing perimeter - pixels that are outside&lt;br&gt;
the blob, not part of the blob.  You can erode the entire image (no&lt;br&gt;
need to loop over individual blobs), and then subtract that from the&lt;br&gt;
original image to get the perimeters.  This way the perimeters will&lt;br&gt;
actually be a part of your blob - the outermost layer of pixels that&lt;br&gt;
are still contained within your blob.  You can race that algorithm&lt;br&gt;
against the built-in bwboundaries() to see which is faster.&lt;br&gt;
Good luck,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Wed, 09 Sep 2009 00:04:07 -0400</pubDate>
      <title>Re: outer perimeter binary blobs - vectorisation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260301#678869</link>
      <author>Brendan</author>
      <description>On Sep 8, 11:03&#160;am, ImageAnalyst &amp;lt;imageanal...@mailinator.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Brendan:&lt;br&gt;
&amp;gt; Your algorithm gets the enclosing perimeter - pixels that are outside&lt;br&gt;
&amp;gt; the blob, not part of the blob. &#160;You can erode the entire image (no&lt;br&gt;
&amp;gt; need to loop over individual blobs), and then subtract that from the&lt;br&gt;
&amp;gt; original image to get the perimeters. &#160;This way the perimeters will&lt;br&gt;
&amp;gt; actually be a part of your blob - the outermost layer of pixels that&lt;br&gt;
&amp;gt; are still contained within your blob. &#160;You can race that algorithm&lt;br&gt;
&amp;gt; against the built-in bwboundaries() to see which is faster.&lt;br&gt;
&amp;gt; Good luck,&lt;br&gt;
&amp;gt; ImageAnalyst&lt;br&gt;
&lt;br&gt;
Thanks for the answer.&lt;br&gt;
&lt;br&gt;
I am trying replicate a cloud masking paper in which edge pixels are&lt;br&gt;
determined by thresholding cluster shade. The paper then compares the&lt;br&gt;
mean pixel value for each edge against the mean pixel value for each&lt;br&gt;
interior. My starting point is a bitmap of unsorted edge pixels. I&lt;br&gt;
think I am stuck with looping unless I use the inner perimeter,&lt;br&gt;
however this will disqualify small blobs.</description>
    </item>
    <item>
      <pubDate>Wed, 09 Sep 2009 01:27:53 -0400</pubDate>
      <title>Re: outer perimeter binary blobs - vectorisation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260301#678876</link>
      <author>ImageAnalyst</author>
      <description>On Sep 8, 8:04&#160;pm, Brendan &amp;lt;brendandetra...@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Thanks for the answer.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am trying replicate a cloud masking paper in which edge pixels are&lt;br&gt;
&amp;gt; determined by thresholding cluster shade. The paper then compares the&lt;br&gt;
&amp;gt; mean pixel value for each edge against the mean pixel value for each&lt;br&gt;
&amp;gt; interior. My starting point is a bitmap of unsorted edge pixels. I&lt;br&gt;
&amp;gt; think I am stuck with looping unless I use the inner perimeter,&lt;br&gt;
&amp;gt; however this will disqualify small blobs.&lt;br&gt;
-------------------------------------------------------------------------------------------------------------&lt;br&gt;
Brendan:&lt;br&gt;
I thought your starting point was the labeled image like you said in&lt;br&gt;
your first post.  Well either way, I just don't see how looping over&lt;br&gt;
individual blobs is necessary.  You can process the whole image just&lt;br&gt;
by doing what I said.  The only way that this could be considered&lt;br&gt;
looping is if you write the erosion routine by yourself and by looping&lt;br&gt;
you mean that you raster scan over every pixel in the image (which is&lt;br&gt;
a nested for loop) and then scan an n-by-n window in there (another&lt;br&gt;
nested for loop).  but I just can't understand how you'd need to do&lt;br&gt;
looping over blobs like this&lt;br&gt;
for blobNumber = 1 : totalNumberOfBlobs&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;% Extract the portion of the image that is the blob into a small&lt;br&gt;
sub-image.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% process that sub image&lt;br&gt;
end&lt;br&gt;
I just don't think you need to do this.  You CAN but I believe it's&lt;br&gt;
unnecessary and may take longer.  imerode() may have the 4 nested for&lt;br&gt;
loops internally but as far as you're concerned, it's a one line&lt;br&gt;
function call.&lt;br&gt;
&lt;br&gt;
I also don't see why you say that subtracting the eroded image from&lt;br&gt;
the original image will &quot;disqualify&quot; small blobs.  The outlines of the&lt;br&gt;
small blobs will be there using that algorithm even if they are only&lt;br&gt;
1, 2, 3, etc. pixels big.  Not sure what you mean by disqualify as&lt;br&gt;
this will get their outlines.&lt;br&gt;
&lt;br&gt;
And if you want the boundaries as separate objects instead of a binary&lt;br&gt;
image, just use bwboundaries() on the binary image like I said.&lt;br&gt;
&lt;br&gt;
But your description of the &quot;cloud masking paper&quot; didn't sound like a&lt;br&gt;
pure binary operation - it sounded like it had some candidate edge&lt;br&gt;
pixels (a binary image found by some preprocessing) and then it's&lt;br&gt;
trying to refine whether an edge pixel in that binary image really IS&lt;br&gt;
a true edge pixel by doing some gray scale processing on the original&lt;br&gt;
image.&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Thu, 10 Sep 2009 18:36:47 -0400</pubDate>
      <title>Re: outer perimeter binary blobs - vectorisation</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/260301#679387</link>
      <author>Brendan</author>
      <description>On Sep 8, 10:27&#160;pm, ImageAnalyst &amp;lt;imageanal...@mailinator.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; On Sep 8, 8:04&#160;pm, Brendan &amp;lt;brendandetra...@yahoo.com&amp;gt; wrote:&amp;gt; Thanks for the answer.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I am trying replicate a cloud masking paper in which edge pixels are&lt;br&gt;
&amp;gt; &amp;gt; determined by thresholding cluster shade. The paper then compares the&lt;br&gt;
&amp;gt; &amp;gt; mean pixel value for each edge against the mean pixel value for each&lt;br&gt;
&amp;gt; &amp;gt; interior. My starting point is a bitmap of unsorted edge pixels. I&lt;br&gt;
&amp;gt; &amp;gt; think I am stuck with looping unless I use the inner perimeter,&lt;br&gt;
&amp;gt; &amp;gt; however this will disqualify small blobs.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ---------------------------------------------------------------------------&#173;----------------------------------&lt;br&gt;
&amp;gt; Brendan:&lt;br&gt;
&amp;gt; I thought your starting point was the labeled image like you said in&lt;br&gt;
&amp;gt; your first post. &#160;Well either way, I just don't see how looping over&lt;br&gt;
&amp;gt; individual blobs is necessary. &#160;You can process the whole image just&lt;br&gt;
&amp;gt; by doing what I said. &#160;The only way that this could be considered&lt;br&gt;
&amp;gt; looping is if you write the erosion routine by yourself and by looping&lt;br&gt;
&amp;gt; you mean that you raster scan over every pixel in the image (which is&lt;br&gt;
&amp;gt; a nested for loop) and then scan an n-by-n window in there (another&lt;br&gt;
&amp;gt; nested for loop). &#160;but I just can't understand how you'd need to do&lt;br&gt;
&amp;gt; looping over blobs like this&lt;br&gt;
&amp;gt; for blobNumber = 1 : totalNumberOfBlobs&lt;br&gt;
&amp;gt; &#160; &#160;% Extract the portion of the image that is the blob into a small&lt;br&gt;
&amp;gt; sub-image.&lt;br&gt;
&amp;gt; &#160; &#160; % process that sub image&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; I just don't think you need to do this. &#160;You CAN but I believe it's&lt;br&gt;
&amp;gt; unnecessary and may take longer. &#160;imerode() may have the 4 nested for&lt;br&gt;
&amp;gt; loops internally but as far as you're concerned, it's a one line&lt;br&gt;
&amp;gt; function call.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I also don't see why you say that subtracting the eroded image from&lt;br&gt;
&amp;gt; the original image will &quot;disqualify&quot; small blobs. &#160;The outlines of the&lt;br&gt;
&amp;gt; small blobs will be there using that algorithm even if they are only&lt;br&gt;
&amp;gt; 1, 2, 3, etc. pixels big. &#160;Not sure what you mean by disqualify as&lt;br&gt;
&amp;gt; this will get their outlines.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; And if you want the boundaries as separate objects instead of a binary&lt;br&gt;
&amp;gt; image, just use bwboundaries() on the binary image like I said.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; But your description of the &quot;cloud masking paper&quot; didn't sound like a&lt;br&gt;
&amp;gt; pure binary operation - it sounded like it had some candidate edge&lt;br&gt;
&amp;gt; pixels (a binary image found by some preprocessing) and then it's&lt;br&gt;
&amp;gt; trying to refine whether an edge pixel in that binary image really IS&lt;br&gt;
&amp;gt; a true edge pixel by doing some gray scale processing on the original&lt;br&gt;
&amp;gt; image.&lt;br&gt;
&amp;gt; Regards,&lt;br&gt;
&amp;gt; ImageAnalyst&lt;br&gt;
&lt;br&gt;
If I erode the image, blobs will all merge since they are separated by&lt;br&gt;
two pixels. Sounds like if can decide to define only one pixel as&lt;br&gt;
edge, then life will be easier. My problem, however, remains the same.&lt;br&gt;
I need a common label for a blob boundary and its interior.</description>
    </item>
  </channel>
</rss>

