Congratulations!

[Valid RSS] This is a valid RSS feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://feeds.feedburner.com/SteveOnImageProcessing

  1.  
  2. <rss version="2.0"
  3. xmlns:content="http://purl.org/rss/1.0/modules/content/"
  4. xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  5. xmlns:dc="http://purl.org/dc/elements/1.1/"
  6. xmlns:atom="http://www.w3.org/2005/Atom"
  7. xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  8. xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  9. >
  10.  
  11. <channel>
  12. <title>Steve on Image Processing with MATLAB</title>
  13. <atom:link href="https://blogs.mathworks.com/steve/feed/" rel="self" type="application/rss+xml" />
  14. <link>https://blogs.mathworks.com/steve</link>
  15. <description>Retired from MathWorks in 2024 after 30 years of service. Can now be found at MATLAB Central, https://hornjourney.com, and https://matrixvalues.com. MathWorks career included image processing, toolbox development, MATLAB development and design, development team management, MATLAB design standards, Steve on Image Processing blog (https://blogs.mathworks.com/steve). Co-author of Digital Image Processing Using MATLAB (https://www.imageprocessingplace.com/DIPUM-3E/dipum3e_main_page.htm). French horn enthusiast, member of Concord Orchestra and Melrose Symphony, member of the board of Cormont Music and the Kendall Betts Horn Camp.</description>
  16. <lastBuildDate>Tue, 26 Mar 2024 16:40:04 +0000</lastBuildDate>
  17. <language>en-US</language>
  18. <sy:updatePeriod>
  19. hourly </sy:updatePeriod>
  20. <sy:updateFrequency>
  21. 1 </sy:updateFrequency>
  22. <generator>https://wordpress.org/?v=6.2.2</generator>
  23. <item>
  24. <title>Retirement!</title>
  25. <link>https://blogs.mathworks.com/steve/2024/03/26/retirement/?s_tid=feedtopost</link>
  26. <comments>https://blogs.mathworks.com/steve/2024/03/26/retirement/#comments</comments>
  27. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  28. <pubDate>Tue, 26 Mar 2024 16:40:04 +0000</pubDate>
  29. <category><![CDATA[Uncategorized]]></category>
  30. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=7483</guid>
  31.  
  32. <description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/steve/files/collage-1200w.jpg" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>The time has come! After more than 30 years of software development at MathWorks, I have decided to retire. Friday, March 29, will be my last day.
  33.  
  34.  
  35. For 18 of those 30 years, I’ve been writing... <a class="read-more" href="https://blogs.mathworks.com/steve/2024/03/26/retirement/">read more >></a></p>]]></description>
  36. <content:encoded><![CDATA[<p>The time has come! After more than 30 years of software development at MathWorks, I have decided to retire. Friday, March 29, will be my last day.</p>
  37.  
  38. <p>
  39. For 18 of those 30 years, I’ve been writing here (600 posts!) about image processing and MATLAB. I am grateful to all of you who have been following along.</p>
  40.  
  41. <p>
  42. Here are few highlights.
  43. </p>
  44.  
  45. <p>
  46. Some favorite deep dives:
  47. </p>
  48.  
  49. <ul>
  50. <li>ROIPOLY and POLY2MASK (<a href="https://blogs.mathworks.com/steve/2006/12/05/poly2mask-and-roipoly-part-1/">part 1</a>, <a href="https://blogs.mathworks.com/steve/2006/12/13/poly2mask-and-roipoly-part-2/">part 2</a>, <a href="https://blogs.mathworks.com/steve/2006/12/22/poly2mask-and-roipoly-part-3/">part 3</a>)</li>
  51. <li><a href="https://blogs.mathworks.com/steve/category/fourier-transforms/">Fourier transforms</a></li>
  52. <li><a href="https://blogs.mathworks.com/steve/category/upslope-area/">Upslope area</a></li>
  53. <li><a href="https://blogs.mathworks.com/steve/category/continental-divide/">Continental divide</a></li>
  54. </ul>
  55.  
  56. <p>
  57. <a href="https://blogs.mathworks.com/steve/2006/10/17/the-story-behind-the-matlab-default-image/">The story behind the default MATLAB image</a>
  58. </p>
  59.  
  60. <p>
  61. Best invented term, <a href="https://blogs.mathworks.com/steve/2007/03/28/neighbor-indexing/">“neighbor indexing”</a>
  62. </p>
  63.  
  64. <p>
  65. Most controversial topics:
  66. </p>
  67.  
  68. <ul>
  69. <li>Implicit expansion (Guests on Loren's Art of MATLAB blog, <a href="https://blogs.mathworks.com/loren/2016/10/24/matlab-arithmetic-expands-in-r2016b/">part 1</a>, <a href="https://blogs.mathworks.com/loren/2016/11/10/more_thoughts_about_implicit_expansion/">part 2</a>)</li>
  70. <li><a href="https://blogs.mathworks.com/steve/category/colormap/">Changing the MATLAB default colormap</a></li>
  71. </ul>
  72.  
  73. <p>
  74. <a href="https://blogs.mathworks.com/steve/2007/07/03/image-processing-in-the-movies/">Favorite comment thread, image processing in the movies</a>
  75. </p>
  76.  
  77. <p>
  78. Some favorite graphics:
  79. </p>
  80.  
  81. <p>
  82. <a href="https://blogs.mathworks.com/steve/files/collage-1200w.jpg"><img decoding="async" loading="lazy" width="1024" height="625" class="alignnone size-large wp-image-7492" src="https://blogs.mathworks.com/steve/files/collage-1200w-1024x625.jpg" alt="" /></a>
  83. </p>
  84.  
  85. <p>
  86. I want to mention a couple of people that I have worked with for most of my time at MathWorks. Roy and I have been sharing deep thoughts about MATLAB and technical computing for 25 years or so, and he has helped me at many points along my career. Ned played a key role in establishing this technical blogging space at <a href="https://blogs.mathworks.com">blogs.mathworks.com</a>, and he has been a never-failing source of inspiration and encouragement. Thanks, guys!
  87. </p>
  88.  
  89. <p>
  90. <a href="https://blogs.mathworks.com/steve/files/ned-steve-roy.jpg"><img decoding="async" loading="lazy" width="300" height="219" class="alignnone size-medium wp-image-7495" src="https://blogs.mathworks.com/steve/files/ned-steve-roy-300x219.jpg" alt="" /></a>
  91. </p>
  92.  
  93. <p>
  94. Thanks to <a href="https://blogs.mathworks.com/loren">Loren</a>, who hired me and taught me how to be a MathWorker and a toolbox developer. Thanks to Michelle, my collaborator for a decade of coaching teams about MATLAB design. Thanks to Cleve, who taught me to use sparse backslash and so many other things about MATLAB. And thanks to Jack, who created and still guides this amazing company and who taught me how to think about design.
  95. </p>
  96.  
  97. <p>
  98. Finally, I’d like to give a shout-out to the MathWorkers who learned about MATLAB and image processing with the help of this blog. I have met and heard from many of you recently, and I appreciate hearing your stories.
  99. </p>
  100.  
  101. <p>
  102. Look for me hanging around the MATLAB community (File Exchange, Answers, and Discussions); here is my <a href="https://www.mathworks.com/matlabcentral/profile/authors/33105506">new community profile</a>. Also, follow my writing about MATLAB at <a href="https://matrixvalues.com">https://matrixvalues.com</a> and about music and French horn at <a href="https://hornjourney.com">https://hornjourney.com</a>.
  103. </p>
  104.  
  105. <p>
  106. <a href="https://blogs.mathworks.com/steve/files/steve-sitting.jpg"><img decoding="async" loading="lazy" width="200" height="300" class="alignnone size-medium wp-image-7498" src="https://blogs.mathworks.com/steve/files/steve-sitting-200x300.jpg" alt="" /></a>
  107. </p>]]></content:encoded>
  108. <wfw:commentRss>https://blogs.mathworks.com/steve/2024/03/26/retirement/feed/</wfw:commentRss>
  109. <slash:comments>13</slash:comments>
  110. </item>
  111. <item>
  112. <title>An Example of Function Argument Validation for an Image Utility Function</title>
  113. <link>https://blogs.mathworks.com/steve/2023/06/09/an-example-of-function-argument-validation-for-an-image-utility-function/?s_tid=feedtopost</link>
  114. <comments>https://blogs.mathworks.com/steve/2023/06/09/an-example-of-function-argument-validation-for-an-image-utility-function/#comments</comments>
  115. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  116. <pubDate>Fri, 09 Jun 2023 15:18:03 +0000</pubDate>
  117. <category><![CDATA[Uncategorized]]></category>
  118. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=7445</guid>
  119.  
  120. <description><![CDATA[<div class="overview-image"><img  class="img-responsive" src="https://blogs.mathworks.com/steve/files/find_image_code_01.png" onError="this.style.display ='none';" /></div><p>
  121. While I was working on a prototype yesterday, I found myself writing a small bit of code that turned out to be so useful, I wondered why I had never done it before. I'd like to show it to you.... <a class="read-more" href="https://blogs.mathworks.com/steve/2023/06/09/an-example-of-function-argument-validation-for-an-image-utility-function/">read more >></a></p>]]></description>
  122. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  123. <div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>While I was working on a prototype yesterday, I found myself writing a small bit of code that turned out to be so useful, I wondered why I had never done it before. I'd like to show it to you. It'll be an opportunity to explore some recent advances in MATLAB that make useful function syntaxes easy to write.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I wrote a simple function called </span><span style=' font-family: monospace;'>imageSizeInXY</span><span>. This function takes a MATLAB Graphics </span><span style=' font-family: monospace;'>Image</span><span> object and returns its total width and height in the spatial x-y units of the axes.</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >out = imageSizeInXY(im)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>(I'll show the full implementation below.) I was using the function like this.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A = imread(</span><span style="color: rgb(167, 9, 245);">"peppers.png"</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >im = imshow(A, XData = [-1 1], YData = [-1 1]);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >axis </span><span style="color: rgb(167, 9, 245);">on</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="029B1D52" prevent-scroll="true" data-testid="output_0" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/find_image_code_01.png" style="width: 515px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imageSizeInXY_v1(im)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="A1FE7EE3" prevent-scroll="true" data-testid="output_1" data-width="1115" style="width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad eoOutputContent" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: italic; color: rgb(97, 97, 97); font-size: 12px;">1×2</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:73,&quot;totalColumns&quot;:&quot;2&quot;,&quot;totalRows&quot;:&quot;1&quot;,&quot;charsPerColumn&quot;:10}" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="variableValue" style="width: 148px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">    2.0039    2.0052
  124. </div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>But this function only works if I have captured the image object in a variable. Usually, I call </span><span style=' font-family: monospace;'>imshow</span><span> with no output argument, and so I don't have the image object:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >imshow(A, XData = [-1 1], YData = [-1 1])</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I thought to myself, it would sure be nice if I could just call </span><span style=' font-family: monospace;'>imageSizeInXY</span><span> with no input arguments, and it would just automatically tell me about the image that's displayed in the current figure. After thinking about this briefly, I wrote the following:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >out = imageSizeInXY(im)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">arguments</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        im </span><span style="color: rgb(160, 82, 45);">(1,1) matlab.graphics.primitive.Image </span><span >= findimage</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">...</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >im = findimage</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    image_objects = imhandles(imgca);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >isempty(image_objects)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        error(</span><span style="color: rgb(167, 9, 245);">"No image object found."</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    im = image_objects(1);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The first interesting piece here is the use of the </span><span style=' font-family: monospace;'>arguments</span><span> block, a MATLAB language syntax that was introduced in R2019b. The </span><a href = "https://www.mathworks.com/help/matlab/ref/arguments.html"><span style=' font-family: monospace;'>arguments</span><span> block</span></a><span>, and more generally the </span><a href = "https://www.mathworks.com/help/matlab/matlab_prog/function-argument-validation-1.html"><span>function argument validation</span></a><span> features, helps to implement function behavior with helpful error messages and useful defaults while writing very little code.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let's look more closely at the beginning of the function.</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >out = imageSizeInXY(im)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">arguments</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        im </span><span style="color: rgb(160, 82, 45);">(1,1) matlab.graphics.primitive.Image </span><span >= findimage</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The </span><span style=' font-family: monospace;'>arguments</span><span> block lets us specify constraints and default behavior for the function's input arguments. The "</span><span style=' font-family: monospace;'>(1,1)</span><span>" part says that the input argument, </span><span style=' font-family: monospace;'>im</span><span>, must have size </span><span texencoding="1 \times 1" style="">$1 \times 1$</span><span>. In other words, it must be a scalar. The next part, "</span><span style=' font-family: monospace;'>matlab.graphics.primitive.Image</span><span>," indicates that </span><span style=' font-family: monospace;'>im</span><span> is required to be that class (or convertible to it).</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>MATLAB will enforce these size and type constraints automatically, issuing specific error messages if they are not met.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/find_image_code_02.png" width = "403" height = "190" alt = "image-size-in-xy-errors.png" style = "vertical-align: baseline; width: 403px; height: 190px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Note that you can get the full class name of MATLAB graphics objects by calling </span><span style=' font-family: monospace;'>class</span><span>:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >class(im)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="F63B52EB" prevent-scroll="true" data-testid="output_2" style="width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="textElement eoOutputContent" data-previous-available-width="1115" data-previous-scroll-height="20" data-hashorizontaloverflow="false" style="max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = </span>'matlab.graphics.primitive.Image'</div></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The "</span><span style=' font-family: monospace;'>= findimage</span><span>" portion is used to automatically provide a default value for the input </span><span style=' font-family: monospace;'>im</span><span>. This can be a constant value or an expression. In this case, </span><span style=' font-family: monospace;'>findimage</span><span> is an expression that calls the local function that I have written:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >im = findimage</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    image_objects = imhandles(imgca);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >isempty(image_objects)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        error(</span><span style="color: rgb(167, 9, 245);">"No image object found."</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    im = image_objects(1);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The functions </span><span style=' font-family: monospace;'>imgca</span><span> and </span><span style=' font-family: monospace;'>imhandles</span><span> are Image Processing Toolbox utilities. The function </span><span style=' font-family: monospace;'>imgca</span><span> returns the most recently current </span><span style=' font-family: monospace;'>axes</span><span> object containing one or more images, and </span><span style=' font-family: monospace;'>imhandles</span><span> returns the </span><span style=' font-family: monospace;'>image</span><span> objects within it.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The last few lines are just me being careful to handle the cases where there are no </span><span style=' font-family: monospace;'>image</span><span> objects to be found, or where there are multiple </span><span style=' font-family: monospace;'>image</span><span> objects in the </span><span style=' font-family: monospace;'>axes</span><span>.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The full implementation, including the simple size calculation, is below.</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >out = imageSizeInXY(im)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">arguments</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        im </span><span style="color: rgb(160, 82, 45);">(1,1) matlab.graphics.primitive.Image </span><span >= findimage</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    pixel_width = extent(im.XData,size(im.CData,2));</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    pixel_height = extent(im.YData,size(im.CData,1));</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    x1 = im.XData(1) - (pixel_width / 2);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    x2 = im.XData(end) + (pixel_width / 2);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    y1 = im.YData(1) - (pixel_height / 2);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    y2 = im.YData(end) + (pixel_height / 2);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    out = [(x2 - x1) (y2 - y1)];</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >im = findimage</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    image_objects = imhandles(imgca);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >isempty(image_objects)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        error(</span><span style="color: rgb(167, 9, 245);">"No image object found."</span><span >);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    im = image_objects(1);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>&nbsp;</div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >e = extent(data,num_pixels)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">if </span><span >(num_pixels &lt;= 1)</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        e = 1;</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">else</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >        e = (data(2) - data(1)) / (num_pixels - 1);</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now I don't have to remember to call </span><span style=' font-family: monospace;'>imshow</span><span> with an output argument in order to use it.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If you haven't already explored using function argument validation and </span><span style=' font-family: monospace;'>arguments</span><span> blocks for writing your own MATLAB functions, I encourage you to give them a try. It's really worth it!</span></div>
  125. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script><a href="https://blogs.mathworks.com/steve/files/find_image_code.mlx"><button class="btn btn-sm btn_color_blue pull-right add_margin_10">Download Live Script</button></a>]]></content:encoded>
  126. <wfw:commentRss>https://blogs.mathworks.com/steve/2023/06/09/an-example-of-function-argument-validation-for-an-image-utility-function/feed/</wfw:commentRss>
  127. <slash:comments>5</slash:comments>
  128. </item>
  129. <item>
  130. <title>Quantitative Video Analysis: Measuring a Container Filling with Liquid</title>
  131. <link>https://blogs.mathworks.com/steve/2023/04/12/quantitative-video-analysis-measuring-a-container-filling-with-liquid/?s_tid=feedtopost</link>
  132. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  133. <pubDate>Wed, 12 Apr 2023 14:16:20 +0000</pubDate>
  134. <category><![CDATA[Uncategorized]]></category>
  135. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=7398</guid>
  136.  
  137. <description><![CDATA[<div class="overview-image"><img  class="img-responsive" src="https://blogs.mathworks.com/steve/files/VideoAnalysisBlogPost_05.png" onError="this.style.display ='none';" /></div><p>
  138. Today's post is by guest blogger Isaac Bruss. Isaac has been a course developer for MathWorks since 2019. His PhD is in computational physics from UMass Amherst. Isaac has helped launch and support... <a class="read-more" href="https://blogs.mathworks.com/steve/2023/04/12/quantitative-video-analysis-measuring-a-container-filling-with-liquid/">read more >></a></p>]]></description>
  139. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  140. <div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span style=' font-style: italic;'>Today's post is by guest blogger Isaac Bruss. Isaac has been a course developer for MathWorks since 2019. His PhD is in computational physics from UMass Amherst. Isaac has helped launch and support several courses on Coursera, on topics such as robotics, machine learning, and computer vision. Isaac's post is based on a lesson from the </span><a href = "https://www.coursera.org/specializations/image-processing?utm_source=mathworks&amp;utm_campaign=blogpost-steveonimageprocessing-april2023-imageprocessing"><span>Image Processing for Engineering and Science Specialization on Coursera</span></a><span>.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Introduction</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In this post, I’ll analyze a video of a container filling with liquid. Now, that might not sound like the most exciting thing in the world, but imagine, for example, you're a quality control engineer responsible for ensuring that the rate of filling bottles is consistent. You need to determine if this rate is constant or varies over time. To answer this question, you’d need to process each individual frame from the video file. But where would you start?</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Well, in this case, I started out with the </span><a href = "https://www.mathworks.com/help/images/ref/videoviewer-app.html"><span>Video Viewer App</span></a><span> to become more familiar with the video. This app allows you to see the video's size, frame rate, and total number of frames along the bottom bar. By using this app, you can quickly get a sense of what I’m working with by playing the video and navigating between frames.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/VideoAnalysisBlogPost_01.gif" width = "382" height = "398" alt = "movie-player.gif" style = "vertical-align: baseline; width: 382px; height: 398px;"></img></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Creating the Segmentation Function</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>With the goal of measuring the liquid within the container, I needed a segmentation function that can separate the liquid from the background. To ensure I develop a robust algorithm, I export a few representative frames to create and test a segmentation function.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/VideoAnalysisBlogPost_02.gif" width = "382" height = "398" alt = "export-frames.gif" style = "vertical-align: baseline; width: 382px; height: 398px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The </span><a href = "https://www.mathworks.com/help/images/image-segmentation-using-the-color-thesholder-app.html"><span>Color Thresholder App</span></a><span> is a powerful tool for interactively segmenting images based on color. This app is particularly useful for images that have distinct color differences between the object of interest and the background. In this case, I used the region selection tool to highlight pixels of interest within the L*a*b* color space. This allowed me to isolate the dark liquid from both the purple background and white foam at the top. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/VideoAnalysisBlogPost_03.gif" width = "680" height = "493" alt = "color-thresholder.gif" style = "vertical-align: baseline; width: 680px; height: 493px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Once I'm satisfied with my thresholding results, I export this segmentation function from the app as a “.m” file named “liquidMask”.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Check the Segmentation Function</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This custom function was </span><span>developed using only the few frames I exported from the video. But to be confident in the results, I need to ensure that it accurately isolates the dark liquid in all the frames. To do this, I first create a </span><a href = "https://www.mathworks.com/help/matlab/ref/videoreader.html"><span>video reader object</span></a><span>.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >v = VideoReader(</span><span style="color: rgb(167, 9, 245);">"liquidVideo.mp4"</span><span >) </span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="41190BA0" prevent-scroll="true" data-testid="output_0" style="width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="textElement eoOutputContent" data-previous-available-width="1115" data-previous-scroll-height="256" data-hashorizontaloverflow="false" style="max-height: 267px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">v = </span></div><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">  VideoReader with properties:
  141.  
  142.   General Properties:
  143.            Name: 'liquidVideo.mp4'
  144.            Path: 'C:\MATLAB Drive\Play\Blog Posts\video analysis'
  145.        Duration: 24
  146.     CurrentTime: 0.1000
  147.       NumFrames: &lt;Calculating...&gt; learn more
  148.  
  149.   Video Properties:
  150.           Width: 120
  151.          Height: 216
  152.       FrameRate: 10
  153.    BitsPerPixel: 24
  154.     VideoFormat: 'RGB24'
  155.  
  156. </div></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Then I loop through the frames using the </span><a href = "https://www.mathworks.com/help/matlab/ref/videoreader.hasframe.html"><span>hasFrame</span></a><span> function. Inside the loop, each frame is passed into the custom liquidMask function, and the resulting mask is displayed side-by-side using the </span><a href = "https://www.mathworks.com/help/images/ref/montage.html"><span>montage</span></a><span> function.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">while </span><span >hasFrame(v) </span><span style="color: rgb(0, 128, 19);">% Loop through all frames</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    img = readFrame(v); </span><span style="color: rgb(0, 128, 19);">% Read a frame</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    bw = liquidMask(img); </span><span style="color: rgb(0, 128, 19);">% Apply the custom segmentation function</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    montage({img,bw},</span><span style="color: rgb(167, 9, 245);">'BorderSize'</span><span >,[20,20],</span><span style="color: rgb(167, 9, 245);">'BackgroundColor'</span><span >,[0.5,0.5,0.5]);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    drawnow</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/VideoAnalysisBlogPost_04.gif" width = "458" height = "420" alt = "mask-generation.gif" style = "vertical-align: baseline; width: 458px; height: 420px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The resulting segmented video frames look great! Further morphological operations to better segment the region of interest are possible, but to get a quick example up and running they aren’t needed. </span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Analyzing Liquid Percentage</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now I can move on to the final part: calculating the percentage of the container that is filled with water at each frame.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>To get started, I need to rewind the video to the beginning using the CurrentTime property of the VideoReader.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >v.CurrentTime = 0; </span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Next, I initialize two variables to store values for each frame: the percentage of the container filled, and the time stamp.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >nFrames = v.NumFrames;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >percents = zeros(nFrames,1);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >times = zeros(nFrames,1); </span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now I’m ready to use a for-loop to read through the video, segment each image, and calculate the percentage of the container filled at each frame. The percentage calculation is done by counting the number of pixels that are filled with liquid and dividing it by the total number of pixels.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >i = 1:nFrames </span><span style="color: rgb(0, 128, 19);">% Loop through all frames</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    img = readFrame(v); </span><span style="color: rgb(0, 128, 19);">% Read a frame</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    bw = liquidMask(img); </span><span style="color: rgb(0, 128, 19);">% Create the binary mask using the custom function</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    liquidPart = nnz(bw); </span><span style="color: rgb(0, 128, 19);">% Calculate the number of liquid (true) pixels</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    perc = liquidPart/numel(bw); </span><span style="color: rgb(0, 128, 19);">% Calculate percentage filled with liquid</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    time = v.CurrentTime; </span><span style="color: rgb(0, 128, 19);">% Mark the current time</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    percents(i) = perc; </span><span style="color: rgb(0, 128, 19);">% Save the fill-percentage value</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    times(i) = time; </span><span style="color: rgb(0, 128, 19);">% Save the time stamp</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now that the data has been gathered, I plot the percentage of the container filled versus time to see how quickly the liquid fills the container.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(times,percents*100)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">'Percentage of Container Filled with Liquid vs Time'</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">'Time (seconds)'</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">'Percentage Filled'</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="E4F05D4F" prevent-scroll="true" data-testid="output_1" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/VideoAnalysisBlogPost_05.png" style="width: 560px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Look at that! The fill rate is not consistent. From the plot, I see that the flow slowed down around 8 seconds, increased at 15 seconds, and slowed again at 20 seconds. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This post is based on a lesson from the </span><a href = "https://www.coursera.org/specializations/image-processing?utm_source=mathworks&amp;utm_campaign=blogpost-steveonimageprocessing-april2023-imageprocessing"><span>Image Processing for Engineering and Science Specialization on Coursera</span></a><span>. There you’ll be able to complete many projects like this one, from segmenting cracks in images of concrete to counting cars in a video of traffic.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>___</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span style=' font-style: italic;'>Thanks, Isaac!</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '></div>
  157. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script>]]></content:encoded>
  158. </item>
  159. <item>
  160. <title>Revised Circularity Measurement in regionprops (R2023a)</title>
  161. <link>https://blogs.mathworks.com/steve/2023/03/21/revised-circularity-measurement-in-regionprops-r2023a/?s_tid=feedtopost</link>
  162. <comments>https://blogs.mathworks.com/steve/2023/03/21/revised-circularity-measurement-in-regionprops-r2023a/#comments</comments>
  163. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  164. <pubDate>Tue, 21 Mar 2023 15:46:29 +0000</pubDate>
  165. <category><![CDATA[Uncategorized]]></category>
  166. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=7371</guid>
  167.  
  168. <description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/steve/files/circularity_update_08.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
  169. For some shapes, especially ones with a small number of pixels, a commonly-used method for computing circularity often results in a value which is biased high, and which can be greater than 1. In... <a class="read-more" href="https://blogs.mathworks.com/steve/2023/03/21/revised-circularity-measurement-in-regionprops-r2023a/">read more >></a></p>]]></description>
  170. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  171. <div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For some shapes, especially ones with a small number of pixels, a commonly-used method for computing circularity often results in a value which is biased high, and which can be greater than 1. In releases prior to R2023a, the function </span><span style=' font-family: monospace;'>regionprops</span><span> used this common method. In R2023a, the computation method has been modified to correct for the bias.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For the full story, read on!</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>What Is Circularity?</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Our definition of circularity is:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span texencoding="c = \frac{4\pi a}{p^2}" style="">$c = \frac{4\pi a}{p^2}$</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>where </span><span style="font-family: STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">a</span><span> is the area of a shape and </span><span style="font-family: STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">p</span><span> is its perimeter. It is a unitless quantity that lies in the range </span><span texencoding="[0,1]" style="">$[0,1]$</span><span>. A true circle has a circularity of 1. Here are the estimated circularity measurements for some simple shapes.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >url = </span><span style="color: rgb(167, 9, 245);">"https://blogs.mathworks.com/steve/files/simple-shapes.png"</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A = imread(url);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >p = regionprops(</span><span style="color: rgb(167, 9, 245);">"table"</span><span >,A,[</span><span style="color: rgb(167, 9, 245);">"Circularity" "Centroid"</span><span >])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="2E2A241F" prevent-scroll="true" data-testid="output_0" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table" id="variableeditor_client_Document_0" widgetid="variableeditor_client_Document_0" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>p = </span><span style="color: rgb(179, 179, 179); font-style: normal;">3×2 table </span></div><div id="variableeditor_TableViewModel_0" widgetid="variableeditor_TableViewModel_0" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border: 1px solid rgb(191, 191, 191); text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; border: 1px solid rgb(191, 191, 191); text-align: center; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Circularity</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>104.0036</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>107.9564</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 126px; min-width: 126px; max-width: 126px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>0.9999</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>327.0258</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>141.0007</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 126px; min-width: 126px; max-width: 126px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>0.6223</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: left; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>619.9921</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>107.9377</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 126px; min-width: 126px; max-width: 126px; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; text-align: right;"><span>0.1514</span></td></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >k = 1:height(p)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    text(p.Centroid(k,1),p.Centroid(k,2),string(p.Circularity(k)),</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        Color = </span><span style="color: rgb(167, 9, 245);">"yellow"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        BackgroundColor = </span><span style="color: rgb(167, 9, 245);">"blue"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        HorizontalAlignment = </span><span style="color: rgb(167, 9, 245);">"center"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        VerticalAlignment = </span><span style="color: rgb(167, 9, 245);">"middle"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        FontSize = 14)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">"Circularity measurements for some simple shapes"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="EAE04AD8" prevent-scroll="true" data-testid="output_1" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/circularity_update_01.png" style="width: 560px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Circularity &gt; 1??</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://www.mathworks.com/matlabcentral/answers/457873-regionprops-circularity-value-1-and-0"><span>Some users</span></a><span> have been understandably puzzled to find that, in previous releases, </span><span style=' font-family: monospace;'>regionprops</span><span> sometimes returned values greater than 1 for circularity. For example:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >url = </span><span style="color: rgb(167, 9, 245);">"https://blogs.mathworks.com/steve/files/small-circle.png"</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >B = imread(url);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(B)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >outlinePixels(size(B))</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >text(7,7,</span><span style="color: rgb(167, 9, 245);">"1.38"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    Color = </span><span style="color: rgb(167, 9, 245);">"yellow"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    BackgroundColor = </span><span style="color: rgb(167, 9, 245);">"blue"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    HorizontalAlignment = </span><span style="color: rgb(167, 9, 245);">"center"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    VerticalAlignment = </span><span style="color: rgb(167, 9, 245);">"middle"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    FontSize = 14)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">"Circularity as measured in previous releases"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="B240F2F9" prevent-scroll="true" data-testid="output_2" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/circularity_update_02.png" style="width: 560px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Measuring Perimeter</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Before going on, I want to pause to note that, while circularity can be a useful measurement, it can also be quite tricky. One can get lost in fractal land when trying to measure perimeter precisely; see Bernard Mandelbrot's famous paper, "How Long Is the Coast of Britain? Statistical Self-Similarity and Fractional Dimension," described on Wikipedia </span><a href = "https://en.wikipedia.org/wiki/How_Long_Is_the_Coast_of_Britain%3F_Statistical_Self-Similarity_and_Fractional_Dimension"><span>here</span></a><span>. Then, add the difficulties introduced by the fact that we are working with digital images, whose pixels we sometimes think of as points on a discrete grid, and sometimes as squares with unit area. See, for example, MATLAB  Answers MVP John D'Errico's </span><a href = "https://www.mathworks.com/matlabcentral/answers/442374-how-to-detect-circularity-more-accurately-than-4-pi-a-p-2?s_tid=srchtitle#answer_358796"><span>commentary</span></a><span> on this topic.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In fact, measuring perimeter is what gets the common circularity computation method in trouble. Measuring the perimeter of objects in digital images is usually done by tracing along from one pixel center to the next, and then adding up weights that are determined by the angles between successive segments.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >b = bwboundaries(B);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(B)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >outlinePixels(size(B))</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(b{1}(:,1),b{1}(:,2),Color = [0.850 0.325 0.098],</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    Marker = </span><span style="color: rgb(167, 9, 245);">"*"</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">off</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="5B103F01" prevent-scroll="true" data-testid="output_3" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/circularity_update_03.png" style="width: 560px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>A few different schemes have been used to assign the weights in order to minimize systematic bias in the perimeter measurement. The weights used by </span><span style=' font-family: monospace;'>regionprops</span><span> are those given in Vossepeol and Smeulders, "Vector Code Probability and Metrication Error in the Representation of Straight Lines of Finite Length," </span><span style=' font-style: italic;'>Computer Graphics and Image Processing</span><span>, vol. 20, pp. 347-364, 1982. See the discussion in Luego, "Measuring boundary length," Cris' Image Analysis Blog: Theory, Methods, Algorithms, Applications, </span><a href = "https://www.crisluengo.net/archives/310/"><span>https://www.crisluengo.net/archives/310/,</span></a><span> last accessed 20-Mar-2023.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The cause of the circularity computation bias can be seen in the figure above. The perimeter is being calculated based on a path that connects pixel centers. Some of the pixels, though, lie partially outside the red curve. The perimeter, then, is being calculated along a curve that does not completely contain all of the square pixels; the curve is just a bit too small. Relative to the area computation, then, the perimeter computation is being underestimated. Since perimeter is in the denominator of the circularity formula, the resulting value is too high.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Can we fix the problem by tracing the perimeter path differently? Let's try with a digitized square at a 45-degree angle.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mask = [ </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 0 0 0 0 0 0 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 0 0 1 0 0 0 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 0 1 1 1 0 0 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 1 1 1 1 1 0 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 1 1 1 1 1 1 1 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 1 1 1 1 1 1 1 1 1 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 1 1 1 1 1 1 1 1 1 1 1 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 1 1 1 1 1 1 1 1 1 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 1 1 1 1 1 1 1 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 1 1 1 1 1 0 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 0 1 1 1 0 0 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 0 0 1 0 0 0 0 0 0</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    0 0 0 0 0 0 0 0 0 0 0 0 0 ];</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here is the path traced by </span><span style=' font-family: monospace;'>regionprops</span><span> for computing the perimeter.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >x = [1 6 11 6 1] + 1;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >y = [6 1 6 11 6] + 1;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(mask)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >outlinePixels(size(mask))</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(x,y,Color = [0.850 0.325 0.098])</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">off</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="9E517038" prevent-scroll="true" data-testid="output_4" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/circularity_update_04.png" style="width: 560px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The perimeter of the red square is </span><span texencoding="4 \cdot 5 \sqrt{2} \approx 28.3" style="">$4 \cdot 5 \sqrt{2} \approx 28.3$</span><span>. The would correspond to an area of </span><span texencoding="(5 \sqrt{2})^2" style="">$(5 \sqrt{2})^2$</span><span>. However, the number of white squares is 61. The estimated perimeter and area are inconsistent with each other, which will result in a biased circularity measurement.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Can we fix it by tracing the perimeter along the outer points of the pixels, like this?</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >x = [1.5 6.5 7.5 12.5 12.5 7.5 6.5 1.5 1.5];</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >y = [6.5 1.5 1.5 6.5 7.5 12.5 12.5 7.5 6.5];</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(mask)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >outlinePixels(size(mask))</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(x,y,Color = [0.850 0.325 0.098])</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">off</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="CADCB1C7" prevent-scroll="true" data-testid="output_5" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/circularity_update_05.png" style="width: 560px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now the calculated perimeter is going to be too high because it corresponds to an area that is much greater than 61, the number of white pixels.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >perim = sum(sqrt(sum(diff([x(:) y(:)]).^2,2)))</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>perim = 32.2843</div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For a square, that perimeter corresponds to this area:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >area = (perim/4)^2</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>area = 65.1421</div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This time, the estimated perimeter is too high with respect to the estimated area, and so the computed circularity will be biased low.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>What if we compute the perimeter by tracing along the pixel edges?</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >x = [1.5 2.5 2.5 3.5 3.5 4.5 4.5 5.5 5.5 6.5 6.5 </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    7.5 7.5 8.5 8.5 9.5 9.5 10.5 10.5 11.5 11.5 12.5 12.5 </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    11.5 11.5 10.5 10.5 9.5 9.5 8.5 8.5 7.5 7.5 6.5 6.5 </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    5.5 5.5 4.5 4.5 3.5 3.5 2.5 2.5 1.5 1.5];</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >y = [7.5 7.5 8.5 8.5 9.5 9.5 10.5 10.5 11.5 11.5 </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    12.5 12.5 11.5 11.5 10.5 10.5 9.5 9.5 8.5 8.5 </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    7.5 7.5 6.5 6.5 5.5 5.5 4.5 4.5 3.5 3.5 2.5 2.5 1.5 1.5 </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    2.5 2.5 3.5 3.5 4.5 4.5 5.5 5.5 6.5 6.5 7.5];</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(mask)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >outlinePixels(size(mask))</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">on</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(x,y,Color = [0.850 0.325 0.098], LineWidth = 5)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >hold </span><span style="color: rgb(167, 9, 245);">off</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="0BCE8ED4" prevent-scroll="true" data-testid="output_8" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/circularity_update_06.png" style="width: 560px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>But now the calculated perimeter is </span><span style=' font-weight: bold;'>WAY</span><span> too high with respect to the area, so the computed circularity would be very low.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >perim = sum(sqrt(sum(diff([x(:) y(:)]).^2,2)))</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>perim = 44</div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Bias Correction Model</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>After all that, we decided to leave the perimeter tracing method alone. Instead, we came up with a simple approximate model for the circularity bias and then used that model to derive a correction factor.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Consider a circle with radius </span><span style="font-family: STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">r</span><span>. We can model the bias by computing circularity using area that is calculated from </span><span style="font-family: STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">r</span><span> and perimeter that is calculated from </span><span texencoding="r - 1/2" style="">$r - 1/2$</span><span>. The result, </span><span texencoding="c'" style="">$c'$</span><span>, is the model of the biased circularity.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span texencoding="c' = \frac{1}{1 - \frac{1}{r} + \frac{0.25}{r^2}} = \frac{1}{\left(1 - \frac{0.5}{r}\right)^2}
  172. " style="">$c' = \frac{1}{1 - \frac{1}{r} + \frac{0.25}{r^2}} = \frac{1}{\left(1 - \frac{0.5}{r}\right)^2}$</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>How well does </span><span texencoding="c'" style="">$c'$</span><span> match what the old </span><span style=' font-family: monospace;'>regionprops</span><span> computation was returning? Here is a comparison performed on digitized circles with a range of radii.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/circularity_update_07.png" width = "594" height = "446" alt = "bias-model-comparison-for-circles.png" style = "vertical-align: baseline; width: 594px; height: 446px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>But what should we do for general shapes? After all, if we already know it's a circle, then there's no big need to compute the circularity metric, right?</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here's the strategy: Given the computed area, </span><span style="font-family: STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">a</span><span>, determine an </span><span style=' font-style: italic;'>equivalent radius</span><span>, </span><span texencoding="r_{\text{eq}}" style="">$r_{\text{eq}}$</span><span>, which is the radius of a circle with the same area. Then, use </span><span texencoding="r_{\text{eq}}" style="">$r_{\text{eq}}$</span><span> to derive a bias correction factor:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span texencoding="c_{\text{corrected}} = c\left(1 - \frac{0.5}{r_{\text{eq}}}\right)^2 = c\left(1-\frac{0.5}{\sqrt{a/\pi}}\right)^2" style="">$c_{\text{corrected}} = c\left(1 - \frac{0.5}{r_{\text{eq}}}\right)^2 = c\left(1-\frac{0.5}{\sqrt{a/\pi}}\right)^2$</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Does It Work?</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>We just made a big assumption there, computing </span><span texencoding="r_{\text{eq}}" style="">$r_{\text{eq}}$</span><span> as if our shape is a circle. Can we really do that? Well, we did a bunch of experiments, using various kinds of shapes, scaled over a large range of sizes, and rotated at various angles. Here are the results for one experiment, using an equilateral triangle with a base rotated off the horizontal axis by 20 degrees. The blue curve is the circularity computed in previous releases; the red curve is the corrected circularity as computed in R2023a, and the horizontal orange line is the theoretical value.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/circularity_update_08.png" width = "686" height = "545" alt = "equilateral-triangle-20-degrees.png" style = "vertical-align: baseline; width: 686px; height: 545px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>We saw similar curves for a broad range of shapes. For some shapes, with a theoretical circularity value below around 0.2, the correction did not improve the result. On balance, however, we decided that the correction method was worthwhile and that </span><span style=' font-family: monospace;'>regionprops</span><span> should be changed to incorporate it.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If you need to get the previously computed value in your code, see the Version History section of the </span><a href = "https://www.mathworks.com/help/images/ref/regionprops.html"><span>regionprops reference page</span></a><span> for instructions.</span></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Helper Function</span></h2><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >outlinePixels(sz)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    M = sz(1);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    N = sz(2);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">for </span><span >k = 1.5:(N-0.5)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        xline(k, Color = [.7 .7 .7]);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">for </span><span >k = 1.5:(M-0.5)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        yline(k, Color = [.7 .7 .7]);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div>
  173. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script><a href="https://blogs.mathworks.com/steve/files/circularity_update.mlx"><button class="btn btn-sm btn_color_blue pull-right add_margin_10">Download Live Script</button></a>]]></content:encoded>
  174. <wfw:commentRss>https://blogs.mathworks.com/steve/2023/03/21/revised-circularity-measurement-in-regionprops-r2023a/feed/</wfw:commentRss>
  175. <slash:comments>2</slash:comments>
  176. </item>
  177. <item>
  178. <title>Identifying Border-Touching Objects Using imclearborder or regionprops</title>
  179. <link>https://blogs.mathworks.com/steve/2023/02/17/objects-touching-border-imclearborder-regionprops/?s_tid=feedtopost</link>
  180. <comments>https://blogs.mathworks.com/steve/2023/02/17/objects-touching-border-imclearborder-regionprops/#comments</comments>
  181. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  182. <pubDate>Fri, 17 Feb 2023 19:22:08 +0000</pubDate>
  183. <category><![CDATA[Uncategorized]]></category>
  184. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=6831</guid>
  185.  
  186. <description><![CDATA[<div class="overview-image"><img  class="img-responsive" src="https://blogs.mathworks.com/steve/files/objects_touching_border_imclearborder_regionprops_04.png" onError="this.style.display ='none';" /></div><p>
  187. I have seen some requests and questions related to identifying objects in a binary image that are touching the image border. Sometimes the question relates to the use of imclearborder, and... <a class="read-more" href="https://blogs.mathworks.com/steve/2023/02/17/objects-touching-border-imclearborder-regionprops/">read more >></a></p>]]></description>
  188. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  189. <div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I have seen some requests and questions related to identifying objects in a binary image that are touching the image border. Sometimes the question relates to the use of </span><span style=' font-family: monospace;'>imclearborder</span><span>, and sometimes the question is about </span><span style=' font-family: monospace;'>regionprops</span><span>. Today, I'll show you how to tackle the problem both ways.</span></div><h2  style = 'margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Using imclearborder</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I'll be using this binary version of the rice.png sample image from the Image Processing Toolbox.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >url = </span><span style="color: rgb(167, 9, 245);">"https://blogs.mathworks.com/steve/files/rice-bw-1.png"</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A = imread(url);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="4F688437" prevent-scroll="true" data-testid="output_0" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_border_imclearborder_regionprops_01.png" style="width: 802px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The function </span><span style=' font-family: monospace;'>imclearborder</span><span> removes all objects touching the border.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >B = imclearborder(A);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(B)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="B91AAE62" prevent-scroll="true" data-testid="output_1" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_border_imclearborder_regionprops_02.png" style="width: 802px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>That seems to be the opposite of what we want. We can, however, convert this into the desired result by using the MATLAB element-wise logical operators, such as </span><span style=' font-family: monospace;'>&amp;</span><span> (and), </span><span style=' font-family: monospace;'>|</span><span> (or), and </span><span style=' font-family: monospace;'>~</span><span> (not). In words, we want the foreground pixels that are in </span><span style=' font-family: monospace;'>A</span><span> and are not in </span><span style=' font-family: monospace;'>B</span><span>. As a MATLAB expression, it looks like this:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >C = A &amp; ~B;</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(C)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="F9E6CBDC" prevent-scroll="true" data-testid="output_2" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_border_imclearborder_regionprops_03.png" style="width: 802px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Using regionprops</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The function </span><span style=' font-family: monospace;'>regionprops</span><span> can compute all sorts of properties of binary image objects. Here is a simple example that computes the area and centroid of each object in our sample image. I'm using the form of </span><span style=' font-family: monospace;'>regionprops</span><span> that returns a table.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props = regionprops(</span><span style="color: rgb(167, 9, 245);">"table"</span><span >,A,[</span><span style="color: rgb(167, 9, 245);">"Area" "Centroid"</span><span >])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="C68135D0" prevent-scroll="true" data-testid="output_3" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_0" widgetid="variableeditor_client_Document_0" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>t = </span><span style="color: rgb(179, 179, 179); font-style: normal;">97×2 table </span></div><div id="variableeditor_TableViewModel_0" widgetid="variableeditor_TableViewModel_0" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Area</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>138</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>121</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>6.4463</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.0579</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>67</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>2.1045</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>85.1940</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>178</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.5056</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>117.5674</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>157</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4650</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>141.2675</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>286</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>11.8007</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>168.5350</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>195</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>12.0872</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>205.2974</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>135</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4296</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>223.0296</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>176</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>21.3693</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>95.9716</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>208</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>12</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>188</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22.1011</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>122.6011</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>13</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>216</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.2778</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>179.4630</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>14</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>143</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.3427</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>251.9720</span></td></tr><tr><th>⋮</th></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>My technique for finding border-touching objects with </span><span style=' font-family: monospace;'>regionprops</span><span> uses the </span><span style=' font-family: monospace;'>BoundingBox</span><span> property, so include that property along with any other properties that you want to measure.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props = regionprops(</span><span style="color: rgb(167, 9, 245);">"table"</span><span >,A,[</span><span style="color: rgb(167, 9, 245);">"Area" "Centroid" "BoundingBox"</span><span >])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="17B4FC0D" prevent-scroll="true" data-testid="output_4" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_1" widgetid="variableeditor_client_Document_1" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>t = </span><span style="color: rgb(179, 179, 179); font-style: normal;">97×3 table </span></div><div id="variableeditor_TableViewModel_1" widgetid="variableeditor_TableViewModel_1" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Area</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th><th colspan="4" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>BoundingBox</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>138</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>13</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>121</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>6.4463</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.0579</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>53.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>13</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>67</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>2.1045</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>85.1940</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>73.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>178</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.5056</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>117.5674</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>102.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>157</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4650</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>141.2675</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>132.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>286</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>11.8007</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>168.5350</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>152.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>33</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>195</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>12.0872</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>205.2974</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>12</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>135</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4296</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>223.0296</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>218.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>176</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>21.3693</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>95.9716</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>86.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>25</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>208</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>18.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>37.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>12</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>188</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22.1011</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>122.6011</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>108.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>29</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>13</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>216</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.2778</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>179.4630</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>166.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>14</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>143</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.3427</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>251.9720</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>18.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>245.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>11</span></td></tr><tr><th>⋮</th></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For any particular object, </span><span style=' font-family: monospace;'>BoundingBox</span><span> is a four-element vector containing the left, top, width, and height of the bounding box. For example, here is the bounding box of the 20th object:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.BoundingBox(20,:)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="AAAF93CA" prevent-scroll="true" data-testid="output_5" data-width="1115" style="width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad eoOutputContent" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: normal; color: rgb(179, 179, 179); font-size: 12px;">1×4</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:73,&quot;totalColumns&quot;:&quot;4&quot;,&quot;totalRows&quot;:&quot;1&quot;,&quot;charsPerColumn&quot;:10}" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="variableValue" style="width: 294px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">   35.5000  113.5000    9.0000   28.0000
  190. </div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>By comparing these values to the size of the image, we can identify which objects touch the image border.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Start by determining the objects that touch specific borders.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >left_coordinate = props.BoundingBox(:,1);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.TouchesLeftBorder = (left_coordinate == 0.5);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >top_coordinate = props.BoundingBox(:,2);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.TouchesTopBorder = (top_coordinate == 0.5);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >right_coordinate = left_coordinate + props.BoundingBox(:,3);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >bottom_coordinate = top_coordinate + props.BoundingBox(:,4);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >[M,N] = size(A);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.TouchesRightBorder = (right_coordinate == (N+0.5));</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.TouchesBottomBorder = (bottom_coordinate == (M+0.5))</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="476EE762" prevent-scroll="true" data-testid="output_6" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_2" widgetid="variableeditor_client_Document_2" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>t = </span><span style="color: rgb(179, 179, 179); font-style: normal;">97×7 table </span></div><div id="variableeditor_TableViewModel_2" widgetid="variableeditor_TableViewModel_2" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Area</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th><th colspan="4" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>BoundingBox</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesLeftBorder</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesTopBorder</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesRightBorder</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesBottomBorder</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>138</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>13</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>121</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>6.4463</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.0579</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>53.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>13</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>67</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>2.1045</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>85.1940</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>73.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>178</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.5056</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>117.5674</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>102.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>157</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4650</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>141.2675</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>132.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>286</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>11.8007</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>168.5350</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>152.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>33</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>195</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>12.0872</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>205.2974</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>12</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>135</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4296</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>223.0296</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>218.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>176</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>21.3693</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>95.9716</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>86.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>25</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>208</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>18.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>37.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>12</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>188</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22.1011</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>122.6011</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>108.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>29</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>13</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>216</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.2778</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>179.4630</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>166.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>14</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>143</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.3427</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>251.9720</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>18.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>245.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>11</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th>⋮</th></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Finally, compute whether objects touch any border using </span><span style=' font-family: monospace;'>|</span><span>, the element-wise OR operator.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.TouchesAnyBorder = props.TouchesLeftBorder | </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    props.TouchesTopBorder | </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    props.TouchesRightBorder | </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    props.TouchesBottomBorder</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="C1571516" prevent-scroll="true" data-testid="output_7" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_3" widgetid="variableeditor_client_Document_3" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>t = </span><span style="color: rgb(179, 179, 179); font-style: normal;">97×8 table </span></div><div id="variableeditor_TableViewModel_3" widgetid="variableeditor_TableViewModel_3" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Area</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th><th colspan="4" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>BoundingBox</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesLeftBorder</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesTopBorder</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesRightBorder</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesBottomBorder</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>TouchesAnyBorder</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>138</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>13</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>121</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>6.4463</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.0579</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>53.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>13</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>67</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>2.1045</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>85.1940</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>73.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>178</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.5056</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>117.5674</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>102.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>157</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4650</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>141.2675</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>132.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>286</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>11.8007</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>168.5350</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>152.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>33</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>195</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>12.0872</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>205.2974</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>12</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>135</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.4296</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>223.0296</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>218.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>176</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>21.3693</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>95.9716</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>9.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>86.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>25</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>208</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>18.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>16</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>37.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>12</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>188</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>22.1011</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>122.6011</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>108.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>10</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>29</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>13</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>216</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.2778</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>179.4630</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>17.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>166.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>14</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>143</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.3427</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>251.9720</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>18.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>245.5000</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 300px; min-width: 300px; max-width: 300px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>11</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 174px; min-width: 174px; max-width: 174px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 182px; min-width: 182px; max-width: 182px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 190px; min-width: 190px; max-width: 190px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 166px; min-width: 166px; max-width: 166px; text-align: center; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th>⋮</th></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I'll finish with a quick visual sanity check of the results.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >L = bwlabel(A);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >L_touches_border = ismember(L,find(props.TouchesAnyBorder));</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshowpair(A,L_touches_border)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="D22F322A" prevent-scroll="true" data-testid="output_8" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_border_imclearborder_regionprops_04.png" style="width: 802px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div>
  191. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script><a href="https://blogs.mathworks.com/steve/files/objects_touching_border_imclearborder_regionprops.mlx"><button class="btn btn-sm btn_color_blue pull-right add_margin_10">Download Live Script</button></a>]]></content:encoded>
  192. <wfw:commentRss>https://blogs.mathworks.com/steve/2023/02/17/objects-touching-border-imclearborder-regionprops/feed/</wfw:commentRss>
  193. <slash:comments>2</slash:comments>
  194. </item>
  195. <item>
  196. <title>Object Sort Order for bwlabel, bwconncomp, and regionprops</title>
  197. <link>https://blogs.mathworks.com/steve/2023/01/30/bwlabel-bwconncomp-regionprops-order/?s_tid=feedtopost</link>
  198. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  199. <pubDate>Mon, 30 Jan 2023 21:28:11 +0000</pubDate>
  200. <category><![CDATA[Uncategorized]]></category>
  201. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=6795</guid>
  202.  
  203. <description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_01.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
  204. Someone recently asked me about the order of objects found by the functions bwlabel, bwconncomp, and regionprops. In this binary image, for example, what accounts for the object order?The functions... <a class="read-more" href="https://blogs.mathworks.com/steve/2023/01/30/bwlabel-bwconncomp-regionprops-order/">read more >></a></p>]]></description>
  205. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  206. <div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Someone recently asked me about the order of objects found by the functions </span><span style=' font-family: monospace;'>bwlabel</span><span>, </span><span style=' font-family: monospace;'>bwconncomp</span><span>, and </span><span style=' font-family: monospace;'>regionprops</span><span>. In this binary image, for example, what accounts for the object order?</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_01.png" width = "366" height = "363" alt = "rice-bw-ul-numbered.png" style = "vertical-align: baseline; width: 366px; height: 363px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The functions </span><span style=' font-family: monospace;'>bwlabel</span><span> and </span><span style=' font-family: monospace;'>bwconncomp</span><span> both scan for objects in the same direction. They look down each column, starting with the left-most column. This animation illustrates the search order:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_02.gif" width = "362" height = "361" alt = "rice-animated.gif" style = "vertical-align: baseline; width: 362px; height: 361px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Because of this search procedure, the object order depends on the top, left-most pixel in each object. Specifically, the order is a lexicographic sort of </span><span texencoding="(c,r)" style="">$(c,r)$</span><span> coordinates, where </span><span style="font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">c</span><span> and </span><span style="font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">r</span><span> are the column and row coordinates of the top, left-most pixel.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If you pass a binary image to </span><span style=' font-family: monospace;'>regionprops</span><span>, the resulting object order is the same as for </span><span style=' font-family: monospace;'>bwconncomp</span><span>, and that is because </span><span style=' font-family: monospace;'>regionprops</span><span> calls </span><span style=' font-family: monospace;'>bwconncomp</span><span> under the hood.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Sometimes, people who are working with images of text ask to change things so that the search proceeds along rows instead of columns. The motivation is to get the object order to be same as the order of characters on each line. (Assuming a left-to-right language, that is.) That generally doesn't work well, though. Consider this text fragment:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_03.png" width = "456" height = "139" alt = "about-larry-75dpi.png" style = "vertical-align: baseline; width: 456px; height: 139px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>With a row-wise search, the letter "b" would be found first, followed by "L" and then "t." This animation shows why that happens:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_04.gif" width = "456" height = "109" alt = "about-larry-animated.gif" style = "vertical-align: baseline; width: 456px; height: 109px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If you want a different sort order, I recommend returning the </span><span style=' font-family: monospace;'>regionprops</span><span> output as a table, and then you can use </span><span style=' font-family: monospace;'>sortrows</span><span>. Here are a couple of examples.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >url = </span><span style="color: rgb(167, 9, 245);">"https://blogs.mathworks.com/steve/files/rice-bw-ul.png"</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A = imread(url);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="C016FF2A" prevent-scroll="true" data-testid="output_0" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_05.png" style="width: 1066.67px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props = regionprops(</span><span style="color: rgb(167, 9, 245);">"table"</span><span >,A,[</span><span style="color: rgb(167, 9, 245);">"Centroid" "Area"</span><span >])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="13C49110" prevent-scroll="true" data-testid="output_1" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_0" widgetid="variableeditor_client_Document_0" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>props = </span><span style="color: rgb(179, 179, 179); font-style: normal;">11×2 table </span></div><div id="variableeditor_TableViewModel_0" widgetid="variableeditor_TableViewModel_0" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Area</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>138</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>87</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.3678</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>60.3563</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>208</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23.8197</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.3443</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.7500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.3500</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>189</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.6349</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19.8783</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>97</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.8454</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.5361</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>115</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2087</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>7.0696</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>70</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61.7857</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2286</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.9231</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>31.8846</span></td></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>You could sort the objects according to their centroids, with the primary sort in the vertical direction and the secondary sort in the horizontal direction.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.Centroid_x = props.Centroid(:,1);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props.Centroid_y = props.Centroid(:,2);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props_by_row = sortrows(props,[</span><span style="color: rgb(167, 9, 245);">"Centroid_y" "Centroid_x"</span><span >])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="FCBB6173" prevent-scroll="true" data-testid="output_2" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_1" widgetid="variableeditor_client_Document_1" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>props_by_row = </span><span style="color: rgb(179, 179, 179); font-style: normal;">11×4 table </span></div><div id="variableeditor_TableViewModel_1" widgetid="variableeditor_TableViewModel_1" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Area</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid_x</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid_y</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23.8197</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.3443</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23.8197</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.3443</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>115</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2087</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>7.0696</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2087</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>7.0696</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>189</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.6349</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19.8783</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.6349</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19.8783</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>208</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.9231</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>31.8846</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.9231</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>31.8846</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>138</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>70</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61.7857</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2286</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61.7857</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2286</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>97</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.8454</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.5361</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.8454</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.5361</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>87</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.3678</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>60.3563</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.3678</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>60.3563</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.7500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.3500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.7500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.3500</span></td></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >k = 1:height(props_by_row)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    x = props_by_row.Centroid_x(k);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    y = props_by_row.Centroid_y(k);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    text(x,y,string(k),Color = </span><span style="color: rgb(167, 9, 245);">"yellow"</span><span >, BackgroundColor = </span><span style="color: rgb(167, 9, 245);">"blue"</span><span >, FontSize = 16, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        FontWeight = </span><span style="color: rgb(167, 9, 245);">"bold"</span><span >, HorizontalAlignment = </span><span style="color: rgb(167, 9, 245);">"center"</span><span >,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        VerticalAlignment = </span><span style="color: rgb(167, 9, 245);">"middle"</span><span >);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="C3780075" prevent-scroll="true" data-testid="output_3" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_06.png" style="width: 1066.67px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>For another example, you could sort by area.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >props_by_area = sortrows(props,</span><span style="color: rgb(167, 9, 245);">"Area"</span><span >,</span><span style="color: rgb(167, 9, 245);">"descend"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="F52DBC2B" prevent-scroll="true" data-testid="output_4" style="width: calc(100% - 5px);"><div class="ClientDocument veSpecifier table constrictHeight" id="variableeditor_client_Document_2" widgetid="variableeditor_client_Document_2" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>props_by_area = </span><span style="color: rgb(179, 179, 179); font-style: normal;">11×4 table </span></div><div id="variableeditor_TableViewModel_2" widgetid="variableeditor_TableViewModel_2" class="table ClientViewDiv hasSummaryBar" data-viewid="__1" style="width: 100%; overflow: auto;"><table cellspacing="0" style="border-spacing: 0px; border-collapse: collapse;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Area</span></th><th colspan="2" style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid_x</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: center; border: 1px solid rgb(191, 191, 191); background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>Centroid_y</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>208</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>24.1971</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.3125</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>199</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>28.1859</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>48.2563</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>189</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.6349</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19.8783</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.6349</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>19.8783</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>138</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.9855</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>35.0870</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>115</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2087</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>7.0696</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2087</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>7.0696</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>97</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.8454</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.5361</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>43.8454</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.5361</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>87</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.3678</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>60.3563</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>5.3678</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>60.3563</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>70</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61.7857</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2286</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61.7857</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>58.2286</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>9</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>61</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23.8197</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.3443</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>23.8197</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>4.3443</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>10</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.9231</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>31.8846</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.9231</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>31.8846</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 6px 3px 3px; width: 34px; text-align: left; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background-color: rgb(245, 245, 245); color: rgba(0, 0, 0, 0.75); font-weight: 700; box-sizing: border-box;"><span>11</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 82px; min-width: 82px; max-width: 82px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>20</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.7500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 150px; min-width: 150px; max-width: 150px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.3500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>26.7500</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; padding: 3px; width: 118px; min-width: 118px; max-width: 118px; text-align: right; border-width: 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>62.3500</span></td></tr></tbody></table></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >k = 1:height(props_by_area)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    x = props_by_area.Centroid_x(k);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    y = props_by_area.Centroid_y(k);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    text(x,y,string(k),Color = </span><span style="color: rgb(167, 9, 245);">"yellow"</span><span >, BackgroundColor = </span><span style="color: rgb(167, 9, 245);">"blue"</span><span >, FontSize = 16, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        FontWeight = </span><span style="color: rgb(167, 9, 245);">"bold"</span><span >, HorizontalAlignment = </span><span style="color: rgb(167, 9, 245);">"center"</span><span >, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >        VerticalAlignment = </span><span style="color: rgb(167, 9, 245);">"middle"</span><span >);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">"Objects sorted by area (biggest to smallest)"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="A12DD40F" prevent-scroll="true" data-testid="output_5" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order_07.png" style="width: 1066.67px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div>
  207. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script><a href="https://blogs.mathworks.com/steve/files/bwlabel_bwconncomp_regionprops_order.mlx"><button class="btn btn-sm btn_color_blue pull-right add_margin_10">Download Live Script</button></a>]]></content:encoded>
  208. </item>
  209. <item>
  210. <title>Fast Local Sums, Integral Images, and Integral Box Filtering</title>
  211. <link>https://blogs.mathworks.com/steve/2023/01/09/integral-image-box-filtering/?s_tid=feedtopost</link>
  212. <comments>https://blogs.mathworks.com/steve/2023/01/09/integral-image-box-filtering/#comments</comments>
  213. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  214. <pubDate>Mon, 09 Jan 2023 21:05:51 +0000</pubDate>
  215. <category><![CDATA[Uncategorized]]></category>
  216. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=6734</guid>
  217.  
  218. <description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/steve/files/fast_local_sums_03.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
  219. In May 2006, I wrote about a technique for computing fast local sums of an image. Today, I want to update that post with additional information about integral image and integral box filtering... <a class="read-more" href="https://blogs.mathworks.com/steve/2023/01/09/integral-image-box-filtering/">read more >></a></p>]]></description>
  220. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  221. <div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><a href = "https://blogs.mathworks.com/steve/2006/05/02/fast-local-sums/"><span>In May 2006, I wrote</span></a><span> about a technique for computing fast local sums of an image. Today, I want to update that post with additional information about integral image and integral box filtering features in the Image Processing Toolbox.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>First, let's review the concept of local sums.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A = magic(7)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="D733C573" prevent-scroll="true" data-testid="output_0" data-width="1115" style="width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad eoOutputContent" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">A = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: normal; color: rgb(179, 179, 179); font-size: 12px;">7×7</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:44,&quot;totalColumns&quot;:&quot;7&quot;,&quot;totalRows&quot;:&quot;7&quot;,&quot;charsPerColumn&quot;:6}" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="variableValue" style="width: 310px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">    30    39    48     1    10    19    28
  222.    38    47     7     9    18    27    29
  223.    46     6     8    17    26    35    37
  224.     5    14    16    25    34    36    45
  225.    13    15    24    33    42    44     4
  226.    21    23    32    41    43     3    12
  227.    22    31    40    49     2    11    20
  228. </div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The local sum of the </span><span texencoding="3 \times 3" style="">$3 \times 3$</span><span> neighborhood around (2,3) element of </span><span style=' font-family: monospace;'>A</span><span> can be computed this way:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >submatrix = A(1:3, 2:4)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="64CF0AC9" prevent-scroll="true" data-testid="output_1" data-width="1115" style="width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad eoOutputContent" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">submatrix = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: normal; color: rgb(179, 179, 179); font-size: 12px;">3×3</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:44,&quot;totalColumns&quot;:&quot;3&quot;,&quot;totalRows&quot;:&quot;3&quot;,&quot;charsPerColumn&quot;:6}" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="variableValue" style="width: 134px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">    39    48     1
  229.    47     7     9
  230.     6     8    17
  231. </div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >local_sum_2_3 = sum(submatrix,</span><span style="color: rgb(167, 9, 245);">"all"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>local_sum_2_3 = 182</div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In image processing applications, we are often interested in the local sum divided by the number of elements in the neighborhood, which is 9 in this case:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >local_sum_2_3/9</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>ans = 20.2222</div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Computing all the local sums for the matrix, divided by the neighborhood size, is the same as performing 2-D filtering with a local mean filter, like this:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >B = imfilter(A,ones(3,3)/9);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >B(2,3)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>ans = 20.2222</div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This is often called a </span><span style=' font-style: italic;'>box filter</span><span>. Computing an </span><span texencoding="N \times N" style="">$N \times N$</span><span> box filter for an entire </span><span texencoding="P \times Q" style="">$P \times Q$</span><span> image would seem to require approximately </span><span texencoding="PQN^2" style="">$PQN^2$</span><span> operations. In other words, for a fixed image size, we might expect the box filter computational time to increase in proportion to </span><span texencoding="N^2" style="">$N^2$</span><span>, where </span><span style="font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(33, 33, 33);">N</span><span> is the local sum window size. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let's see how long </span><span style=' font-family: monospace;'>imfilter</span><span> takes with respect to a changing local sum neighborhood size.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >I = rand(3000,4000);</span></span></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >nn = 15:10:205;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imfilter_times = zeros(size(nn));</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >k = 1:length(nn)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    n = nn(k);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    f = @() imfilter(I,ones(n,n)/n^2);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    imfilter_times(k) = timeit(f);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(nn,imfilter_times)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">"Box filter execution time using imfilter"</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">"window size"</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">"time (s)"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="A92D5E5B" prevent-scroll="true" data-testid="output_5" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/fast_local_sums_01.png" style="width: 1067.33px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The function </span><span style=' font-family: monospace;'>imfilter</span><span> is doing better than expected, with an execution time that increases only linearly with the window size. (That's because </span><span style=' font-family: monospace;'>imfilter</span><span> is taking advantage of filter separability, </span><a href = "https://blogs.mathworks.com/steve/2006/11/28/separable-convolution-part-2/"><span>which I have written about previously</span></a><span>.)</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>But we can compute local sums even faster, by using something called an </span><span style=' font-style: italic;'>integral image</span><span>, also known as a </span><a href = "https://en.wikipedia.org/wiki/Summed-area_table"><span style=' font-style: italic;'>summed-area table</span></a><span>. Let's go back to the magic square example and use the function </span><span style=' font-family: monospace;'>integralImage</span><span>.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >Ai = integralImage(A)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="853E410C" prevent-scroll="true" data-testid="output_6" data-width="1115" style="width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad eoOutputContent" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">Ai = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: normal; color: rgb(179, 179, 179); font-size: 12px;">8×8</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:87,&quot;totalColumns&quot;:&quot;8&quot;,&quot;totalRows&quot;:&quot;8&quot;,&quot;charsPerColumn&quot;:12}" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="variableValue" style="width: 698px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">           0           0           0           0           0           0           0           0
  232.           0          30          69         117         118         128         147         175
  233.           0          68         154         209         219         247         293         350
  234.           0         114         206         269         296         350         431         525
  235.           0         119         225         304         356         444         561         700
  236.           0         132         253         356         441         571         732         875
  237.           0         153         297         432         558         731         895        1050
  238.           0         175         350         525         700         875        1050        1225
  239. </div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Each element of </span><span style=' font-family: monospace;'>Ai</span><span> is the cumulative sum of all the elements in A that are above and to the left. </span><span style=' font-family: monospace;'>Ai(4,3)</span><span>, which is 206, is the sum of all the elements of </span><span style=' font-family: monospace;'>A(1:3,1:2)</span><span>. </span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A(1:3,1:2)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="E98809F0" prevent-scroll="true" data-testid="output_7" data-width="1115" style="width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad eoOutputContent" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: normal; color: rgb(179, 179, 179); font-size: 12px;">3×2</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:44,&quot;totalColumns&quot;:&quot;2&quot;,&quot;totalRows&quot;:&quot;3&quot;,&quot;charsPerColumn&quot;:6}" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="variableValue" style="width: 90px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">    30    39
  240.    38    47
  241.    46     6
  242. </div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >sum(ans,</span><span style="color: rgb(167, 9, 245);">"all"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>ans = 206</div></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >Ai(4,3)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>ans = 206</div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Expressed as a general formula, the integral image is </span><span texencoding="A_i(m,n) = \sum_{p=1}^{m-1} \sum_{q=1}^{n-1} A(p,q)" style="">$A_i(m,n) = \sum_{p=1}^{m-1} \sum_{q=1}^{n-1} A(p,q)$</span><span>. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The really interesting thing about having the integral image, </span><span style=' font-family: monospace;'>Ai</span><span>, is that it lets you compute the sum of </span><span style=' font-style: italic;'>any</span><span> rectangular submatrix of </span><span style=' font-family: monospace;'>A</span><span> by an addition and subtraction of just four numbers. Specifically, the sum of all the elements in </span><span style=' font-family: monospace;'>A(m1:m2,n1:n2)</span><span> is </span><span style=' font-family: monospace;'>Ai(m2+1,n2+1) - Ai(m1,n2+1) - Ai(m2+1,n1) + Ai(m1,n1)</span><span>. Consider computing the sum of all elements in </span><span style=' font-family: monospace;'>A(3:5,2:6)</span><span>.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >m1 = 3;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >m2 = 5;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >n1 = 2;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >n2 = 6;</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A(m1:m2,n1:n2)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsVariableMatrixElement" uid="9CAED7DC" prevent-scroll="true" data-testid="output_10" data-width="1115" style="width: 1145px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="matrixElement veSpecifier saveLoad eoOutputContent" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="veVariableName variableNameElement double" style="width: 1115px; white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="headerElementClickToInteract" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">ans = </span><span class="veVariableValueSummary veMetaSummary" style="white-space: normal; font-style: normal; color: rgb(179, 179, 179); font-size: 12px;">3×5</span></div></div><div class="valueContainer" data-layout="{&quot;columnWidth&quot;:44,&quot;totalColumns&quot;:&quot;5&quot;,&quot;totalRows&quot;:&quot;3&quot;,&quot;charsPerColumn&quot;:6}" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="variableValue" style="width: 222px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">     6     8    17    26    35
  243.    14    16    25    34    36
  244.    15    24    33    42    44
  245. </div><div class="horizontalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="verticalEllipsis hide" style="white-space: nowrap; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div><div class="outputLayer selectedOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer activeOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport" style="white-space: normal; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"></div></div></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >sum(ans,</span><span style="color: rgb(167, 9, 245);">"all"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>ans = 375</div></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >Ai(m2+1,n2+1) - Ai(m1,n2+1) - Ai(m2+1,n1) + Ai(m1,n1)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class='variableElement' style='font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '>ans = 375</div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>If we have the integral image, then, we can compute every element of the box filter output by adding just four terms together. In other words, the box filter computation can be independent of the box filter window size!</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The Image Processing Toolbox function </span><span style=' font-family: monospace;'>integralBoxFilter</span><span> does this for you. You give it the integral image, and it returns the result of the box filter applied to the original image.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let's see how long that takes as we vary the box filter window size.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >integral_box_filter_times = zeros(1,length(nn));</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >k = 1:length(nn)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    n = nn(k);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    h = @() integralBoxFilter(Ai,n);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    integral_box_filter_times(k) = timeit(h);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(nn,integral_box_filter_times, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    nn,imfilter_times)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >legend([</span><span style="color: rgb(167, 9, 245);">"integralBoxFilter" "imfilter"</span><span >], </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    Location = </span><span style="color: rgb(167, 9, 245);">"northwest"</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">"Box filter execution time"</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">"window size"</span><span >)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">"time (s)"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="07CF37E8" prevent-scroll="true" data-testid="output_13" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/fast_local_sums_02.png" style="width: 800px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>That looks great! As expected, </span><span style=' font-family: monospace;'>integralBoxFilter</span><span> is fast, with execution time that is independent of the window size. To be completely fair, though, we should include the time required to compute the integral image.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >integral_box_filter_total_times = zeros(1,length(nn));</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">for </span><span >k = 1:length(nn)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    n = nn(k);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    r = @() integralBoxFilter(integralImage(I),n);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    integral_box_filter_total_times(k) = timeit(r);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >plot(nn,imfilter_times,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    nn,integral_box_filter_times,</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    nn,integral_box_filter_total_times)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >title(</span><span style="color: rgb(167, 9, 245);">"Box filter execution time"</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xlabel(</span><span style="color: rgb(167, 9, 245);">"window size"</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >ylabel(</span><span style="color: rgb(167, 9, 245);">"time (s)"</span><span >)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >legend([</span><span style="color: rgb(167, 9, 245);">"imfilter" "integralBoxFilter" "integralImage + integralBoxFilter"</span><span >],</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    Location = </span><span style="color: rgb(167, 9, 245);">"northwest"</span><span >)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="5CC99928" prevent-scroll="true" data-testid="output_14" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/fast_local_sums_03.png" style="width: 800px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>From the plot, we can see that using the integral image for box filtering is the way to go, even when you take into consideration the time needed to compute the integral image.</span></div>
  246. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script><a href="https://blogs.mathworks.com/steve/files/fast_local_sums.mlx"><button class="btn btn-sm btn_color_blue pull-right add_margin_10">Download Live Script</button></a>]]></content:encoded>
  247. <wfw:commentRss>https://blogs.mathworks.com/steve/2023/01/09/integral-image-box-filtering/feed/</wfw:commentRss>
  248. <slash:comments>7</slash:comments>
  249. </item>
  250. <item>
  251. <title>Objects and Polygonal Boundaries</title>
  252. <link>https://blogs.mathworks.com/steve/2022/12/28/objects-and-polygonal-boundaries/?s_tid=feedtopost</link>
  253. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  254. <pubDate>Wed, 28 Dec 2022 21:12:17 +0000</pubDate>
  255. <category><![CDATA[Uncategorized]]></category>
  256. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=6698</guid>
  257.  
  258. <description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_21.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
  259. In some of my recent perusal of image processing questions on MATLAB Answers, I have come across several questions involving binary image objects and polygonal boundaries, like this.The questions... <a class="read-more" href="https://blogs.mathworks.com/steve/2022/12/28/objects-and-polygonal-boundaries/">read more >></a></p>]]></description>
  260. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  261. <div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>In some of my recent perusal of image processing questions on MATLAB Answers, I have come across several questions involving binary image objects and polygonal boundaries, like this.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/objects_touching_polygon_01.png" width = "334" height = "334" alt = "binary-objects-polygonal-boundaries.png" style = "vertical-align: baseline; width: 334px; height: 334px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The questions vary but are similar:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>How can I determine which objects touch the polygon boundary?</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>How can I get rid of objects outside the boundary?</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>How can I get rid of objects outside or touching the boundary?</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>How can I get rid of objects within a certain distance of the boundary?</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Today I want to show you how to answer all these questions and more besides, using these fundamental operations:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/images/ref/drawpolygon.html"><span style=' font-family: monospace;'>drawpolygon</span></a><span> and </span><a href = "https://www.mathworks.com/help/images/ref/images.roi.polygon.html"><span style=' font-family: monospace;'>images.roi.Polygon</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/images/ref/images.roi.assistedfreehand.createmask.html"><span style=' font-family: monospace;'>createMask</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/images/ref/bwdist.html"><span style=' font-family: monospace;'>bwdist</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><a href = "https://www.mathworks.com/help/images/ref/imreconstruct.html"><span style=' font-family: monospace;'>imreconstruct</span></a></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>relational operators</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>logical operators on binary images</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>(Or, as an alternative to </span><span style=' font-family: monospace;'>drawpolygon</span><span>, </span><span style=' font-family: monospace;'>images.roi.Polygon</span><span>, and </span><span style=' font-family: monospace;'>createMask</span><span>, you can use </span><a href = "https://www.mathworks.com/help/images/ref/roipoly.html"><span style=' font-family: monospace;'>roipoly</span></a><span> and </span><a href = "https://www.mathworks.com/help/images/ref/poly2mask.html"><span style=' font-family: monospace;'>poly2mask</span></a><span>.)</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here is the image I'll be using today:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >image_url = </span><span style="color: rgb(167, 9, 245);">"https://blogs.mathworks.com/steve/files/rice-bw-1.png"</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A = imread(image_url);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="23E9BFA9" prevent-scroll="true" data-testid="output_0" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_02.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>And here is my polygon.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >xy = [ </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    118 31</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    35 116</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    35 219</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    219 245</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    161 186</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    237 56];</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I'll be drawing it using a helper function, </span><span style=' font-family: monospace;'>showpoly</span><span>, which is at the end of this post. The helper function uses </span><span style=' font-family: monospace;'>drawpolygon</span><span>, like this:</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >p = drawpolygon(Position = xy, FaceAlpha = 0.5)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="F1AA240F" prevent-scroll="true" data-testid="output_1" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_03.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="91A12DCE" prevent-scroll="true" data-testid="output_2" style="width: 1145px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div class="textElement eoOutputContent" data-width="1115" data-height="167" data-hashorizontaloverflow="false" style="max-height: 261px; white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;"><span class="variableNameElement" style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">p = </span></div><div style="white-space: pre; font-style: normal; color: rgb(33, 33, 33); font-size: 12px;">  Polygon with properties:
  262.  
  263.    Position: [6×2 double]
  264.       Label: ''
  265.       Color: [0 0.4470 0.7410]
  266.      Parent: [1×1 Axes]
  267.     Visible: on
  268.    Selected: 0
  269.  
  270.  Show all properties
  271. </div></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Note that </span><span style=' font-family: monospace;'>drawpolygon</span><span> creates an </span><span style=' font-family: monospace;'>images.roi.Polygon</span><span> (or just </span><span style=' font-family: monospace;'>Polygon</span><span>). The </span><span style=' font-family: monospace;'>Polygon</span><span> object is one of a variety of </span><a href = "https://www.mathworks.com/help/images/roi-creation-overview.html"><span style=' font-style: italic;'>region-of-interest</span><span> (ROI) objects</span></a><span> in the Image Processing Toolbox. You can customize many aspects of its appearance and behavior, and it is useful for implementing apps that work with ROIs.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Of particular interest for today's topic is the </span><span style=' font-family: monospace;'>Polygon</span><span> function called </span><span style=' font-family: monospace;'>createMask</span><span>. This function returns a binary image with white pixels inside the polygon. </span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >mask = createMask(p);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(mask)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="AD329996" prevent-scroll="true" data-testid="output_3" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_04.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Objects completely or partially inside the polygon</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now we can start answering the object-polygon questions. First up: which objects are inside the polygon, either completely or partially?</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>One of the things that makes MATLAB fun for image processing is using logical operators with binary images. Below, I compute the logical AND of the original binary image with the polygon mask image.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >B = A &amp; mask;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(B)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="7991D074" prevent-scroll="true" data-testid="output_4" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_05.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Next, I apply morphological reconstruction using </span><span style=' font-family: monospace;'>imreconstruct</span><span>. This function takes a </span><span style=' font-style: italic;'>marker image</span><span> and expands its objects outward, while constraining the expansion to include only object pixels in the second input. This is a convenient way to convert partial objects back into their full, original shapes. The result, </span><span style=' font-family: monospace;'>C</span><span>, is an image containing objects that are completely or partially within the polygon.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >C = imreconstruct(B,A);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(C)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="E5DCDA37" prevent-scroll="true" data-testid="output_5" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_06.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Objects touching the perimeter of the polygon</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Next question: which objects touch the edge, or perimeter, of the polygon? I'll start with </span><span style=' font-family: monospace;'>bwperim</span><span> on the polygon mask to compute a perimeter mask.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >perimeter_mask = bwperim(mask);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(perimeter_mask)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="6B092BD2" prevent-scroll="true" data-testid="output_6" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_07.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Going back to the logical </span><span style=' font-family: monospace;'>&amp;</span><span> operator gives us the perimeter pixels that are part of any of the objects.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >D = A &amp; perimeter_mask;</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(D)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="88178A6C" prevent-scroll="true" data-testid="output_7" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_08.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Morphological reconstruct is useful again here, to "reconstruct" the full shapes of objects from the object pixels that lie along the polygon perimeter.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >J = imreconstruct(D,A);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(J)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly();</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="2A6904B8" prevent-scroll="true" data-testid="output_8" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_09.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Objects outside the polygon</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Third question: which objects lie </span><span style=' font-weight: bold;'>completely</span><span> outside the polygon? Recall that image </span><span style=' font-family: monospace;'>C</span><span>, computed above, is the objects that are completely or partially inside the polygon. The objects that we want, then, are the objects that are in </span><span style=' font-family: monospace;'>A</span><span> but not in </span><span style=' font-family: monospace;'>C</span><span>. You can compute this using </span><span style=' font-family: monospace;'>A &amp; ~C</span><span> or </span><span style=' font-family: monospace;'>setdiff(A,C)</span><span>.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >objects_outside = A &amp; ~C;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(objects_outside)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly();</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="39ED80EB" prevent-scroll="true" data-testid="output_9" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_10.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>What about the object near the upper right polygon vertex? Is it really completely outside the polygon?</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >axis([215 230 45 60])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="3690C8DE" prevent-scroll="true" data-testid="output_10" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_11.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>It looks like a sliver of white is inside the polygon. Why is that? </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I'll explain by showing the polygon mask, the outside objects, the polygon itself, and the pixel grid. I'll use </span><a href = "https://www.mathworks.com/help/images/ref/imshowpair.html"><span style=' font-family: monospace;'>imshowpair</span></a><span> to both the polygon mask and the outside-objects mask. (The function </span><span style=' font-family: monospace;'>pixelgrid</span><span> is on the </span><a href = "https://www.mathworks.com/matlabcentral/fileexchange/71622-pixel-grid"><span>File Exchange</span></a><span>.)</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >figure</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshowpair(objects_outside,mask)</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly();</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >axis([215 230 45 60])</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >pixelgrid</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="B19FFCA7" prevent-scroll="true" data-testid="output_11" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_12.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>When a polygon only partially covers a pixel, the </span><span style=' font-family: monospace;'>createMask</span><span> has certain tie-breaking rules to determine whether a pixel is inside or outside. You can see the tie-breaking rules play out in several pixels above.</span></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Objects inside and at least 20 pixels away the polygon boundary</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The fourth question is which objects are not only inside the polygon, but at least 20 pixels away from the polygon boundary? To answer this question, I'll bring in another tool: the </span><span style=' font-style: italic;'>distance transform,</span><span> as computed by </span><span style=' font-family: monospace;'>bwdist</span><span>. </span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>First, though, let's start by applying the logical NOT (or complement) operator, </span><span style=' font-family: monospace;'>~</span><span>. Applying it to the polygon mask image gives us a mask showing the pixels that are outside the polygon. I'll turn the axis box on so you can see the extent of the exterior mask.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >exterior_mask = ~mask;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(exterior_mask)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >axis </span><span style="color: rgb(167, 9, 245);">on</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="28682BAD" prevent-scroll="true" data-testid="output_12" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_13.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The distance transform computes, for every image pixel, the distance between that pixel and the nearest foreground pixel. If a pixel is itself a foreground pixel, then the distance transform at that pixel is 0. By computing the distance transform of the exterior mask, we can find out how far every pixel is from the closest pixel in the polygon exterior.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >G = bwdist(exterior_mask);</span></span></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>(Alternative approach: consider the buffer method of </span><a href = "https://www.mathworks.com/help/matlab/ref/polyshape.html"><span>polyshape</span></a><span> object.)</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>When displaying a distance transform as an image, the autoranging syntax of </span><span style=' font-family: monospace;'>imshow</span><span> is useful. Just specify </span><span style=' font-family: monospace;'>[]</span><span> as the second argument when displaying intensity values, and the minimum value will get automatically scaled to black, and the maximum intensity value will get automatically scaled to white.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(G,[])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="039995B7" prevent-scroll="true" data-testid="output_13" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_14.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Now let's compute a mask of pixels at least 20 pixel units away from the exterior mask by using a relational operator, </span><span style=' font-family: monospace;'>&gt;=</span><span>. </span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >interior_mask_with_buffer = (G &gt;= 20);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(interior_mask_with_buffer)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly();</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="B807C61A" prevent-scroll="true" data-testid="output_14" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_15.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Using the techniques described above, compute an image containing the objects that are completely outside the interior buffered mask.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >H = imreconstruct(A &amp; ~interior_mask_with_buffer, A);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(H)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="4C5DDA4F" prevent-scroll="true" data-testid="output_15" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_16.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Next, find the objects that are in </span><span style=' font-family: monospace;'>A</span><span> but not in </span><span style=' font-family: monospace;'>H</span><span>. </span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >I = A &amp; ~H;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshowpair(I,interior_mask_with_buffer)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly();</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="1C4137A6" prevent-scroll="true" data-testid="output_16" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_17.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><h2  style = 'margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: 700; text-align: left; '><span>Objects not within 20 pixels of the polygon border</span></h2><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The final question for today is which objects are not within 20 pixels of the polygon border. Start by computing the distance transform of the perimeter mask.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >J = bwdist(perimeter_mask);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(J,[])</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="684AE9FB" prevent-scroll="true" data-testid="output_17" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_18.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Use a relational operator to compute a buffered perimeter mask.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >perimeter_mask_with_buffer = (J &lt;= 20);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(perimeter_mask_with_buffer)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="92D0E4C6" prevent-scroll="true" data-testid="output_18" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_19.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Use the techniques described above to find all of the objects that are competely or partially within the buffered perimeter mask region.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >K = A &amp; perimeter_mask_with_buffer;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >L = imreconstruct(K,A);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(L)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="A8C3ADFD" prevent-scroll="true" data-testid="output_19" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_20.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The final answer is the objects that are in the original image, </span><span style=' font-family: monospace;'>A</span><span>, but not in </span><span style=' font-family: monospace;'>L</span><span>.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >M = A &amp; ~L;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshowpair(M,perimeter_mask_with_buffer)</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >showpoly();</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="D287B2AD" prevent-scroll="true" data-testid="output_20" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/objects_touching_polygon_21.png" style="width: 992px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This post demonstrated a number of MATLAB and toolbox functions and operators that work well together:</span></div><ul  style = 'margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; '><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span style=' font-family: monospace;'>createMask</span><span> (or </span><span style=' font-family: monospace;'>poly2mask</span><span>) to create a binary "mask" image from polygons</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Logical operators on binary images to compute things like "in this image or mask but not in this other one"</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span style=' font-family: monospace;'>imreconstruct</span><span> to reconstruct original binary image shapes from partial ones</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span style=' font-family: monospace;'>bwdist</span><span> to compute the distance transform, which tells you how far away every image pixel is from some binary image mask</span></li><li  style = 'margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: pre-wrap; '><span>Relational operators to form masks from distance transform images</span></li></ul><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Have fun with these.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>And Happy New Year!</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">function </span><span >showpoly</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    </span><span style="color: rgb(0, 128, 19);">% Helper function</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    xy = [ </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    118 31</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    35 116</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    35 219</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    219 245</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    161 186</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    237 56];</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '>&nbsp;</div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >    drawpolygon(Position = xy, FaceAlpha = 0.5);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span style="color: rgb(14, 0, 255);">end</span></span></div></div></div>
  272. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script><a href="https://blogs.mathworks.com/steve/files/objects_touching_polygon.mlx"><button class="btn btn-sm btn_color_blue pull-right add_margin_10">Download Live Script</button></a>]]></content:encoded>
  273. </item>
  274. <item>
  275. <title>Avoid Using JPEG for Image Analysis</title>
  276. <link>https://blogs.mathworks.com/steve/2022/12/19/avoid-jpeg-for-image-analysis/?s_tid=feedtopost</link>
  277. <comments>https://blogs.mathworks.com/steve/2022/12/19/avoid-jpeg-for-image-analysis/#comments</comments>
  278. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  279. <pubDate>Mon, 19 Dec 2022 13:59:30 +0000</pubDate>
  280. <category><![CDATA[Uncategorized]]></category>
  281. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=6146</guid>
  282.  
  283. <description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/steve/files/never_use_jpg_03.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
  284.  
  285. Note added 20-Dec-2022: I wrote this post with lossy JPEG in mind. If you work with DICOM data, see Jeff Mather's note in the comments below about the use of lossless JPEG in DICOM.
  286. I have... <a class="read-more" href="https://blogs.mathworks.com/steve/2022/12/19/avoid-jpeg-for-image-analysis/">read more >></a></p>]]></description>
  287. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  288. <div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '>
  289. <p><em>Note added 20-Dec-2022: I wrote this post with lossy JPEG in mind. If you work with DICOM data, see Jeff Mather's note in the comments below about the use of lossless JPEG in DICOM.</em></p>
  290. <span>I have recently been reading a lot of image processing and image analysis questions on MATLAB Answers. Anyone who does the same will quickly come across comments and answers posted by the prolific </span><a href = "https://www.mathworks.com/matlabcentral/profile/authors/1343420"><span>Image Analyst</span></a><span>, a MATLAB Answers MVP who has posted an astounding 34,600+ answers in the last 11 years.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I always enjoy the side commentary that I sometimes find in these answers. For example, I came across this code comment in one answer:</span></div><div class = 'preformatted-matlab' style = 'margin: 10px 3px 10px 55px; padding: 10px 10px 10px 5px; '><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">% This is a horrible image.  NEVER use JPG format </span></span></div><div  style = 'border-left: 0px none rgb(33, 33, 33); border-right: 0px none rgb(33, 33, 33); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px; line-height: 15.6px; min-height: 16px; white-space: pre; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; '><span style="white-space: pre"><span style="color: rgb(0, 128, 19);">% for image analysis.  Use PNG, TIFF, or BMP instead.</span></span></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Today, I want to take the opportunity to endorse this statement and to elaborate on it a bit. Why do we not love JPEG files for image analysis?</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The reason is that JPEG is a </span><span style=' font-style: italic;'>lossy</span><span> image compression format. Lossy compression methods achieve substantial reduction in file size by using </span><a href = "https://en.wikipedia.org/wiki/Lossy_compression"><span>"inexact approximations and partial data discarding to represent the content."</span></a><span> With JPEG compression, roughly speaking, pixels are grouped into blocks, and then the pixel data in each block is quantized and partially discarded. The method is called </span><span style=' font-style: italic;'>lossy</span><span> because you can't get the exact original image pixel data back from a JPEG file; information has been lost.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I've written about lossy vs. lossless compression before; see my </span><a href = "https://blogs.mathworks.com/steve/2013/05/02/jpeg-versus-png-lossy-and-lossless-image-compression/"><span>02-May-2013 post</span></a><span>.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Usually, this form of compression is acceptable for viewing photographs because the compression method exploits properties of human visual perception so that the information loss is relatively imperceptible. In image analysis applications, though, when you are trying to automatically detect or measure things, the pixel data imperfections in the JPEG file could mess it up.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Let me show you a couple of different versions of this picture:</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/never_use_jpg_01.png" width = "396" height = "297" alt = "IMG_6129-reduced-size.png" style = "vertical-align: baseline; width: 396px; height: 297px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The original picture was shot in RAW mode (which is lossless) and saved as a 4032x3024 PNG file, with a file size of 23 MB.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here is a highly magnified view of the center of the picture. You can see the individual pixels.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/never_use_jpg_02.png" width = "468" height = "353" alt = "lossless-magnified.png" style = "vertical-align: baseline; width: 468px; height: 353px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I created a JPEG version of this file with a file size of only about 1 MB. If you look at the entire picture, the JPEG version looks like the original.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/never_use_jpg_03.png" width = "468" height = "353" alt = "lossy-version-reduced.png" style = "vertical-align: baseline; width: 468px; height: 353px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>But if you look at a highly magnified view, you can see that pixel data has been partially discarded in a block-wise fashion.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/never_use_jpg_04.png" width = "468" height = "353" alt = "lossy-magnified.png" style = "vertical-align: baseline; width: 468px; height: 353px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span></span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>You can probably imagine how this might affect object detection and measurement.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>So, as Image Analyst says, stick to lossless formats such as PNG or TIFF for your image analysis applications.</span></div>
  291. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script>]]></content:encoded>
  292. <wfw:commentRss>https://blogs.mathworks.com/steve/2022/12/19/avoid-jpeg-for-image-analysis/feed/</wfw:commentRss>
  293. <slash:comments>8</slash:comments>
  294. </item>
  295. <item>
  296. <title>Finding the Channels</title>
  297. <link>https://blogs.mathworks.com/steve/2022/12/12/finding-the-channels/?s_tid=feedtopost</link>
  298. <comments>https://blogs.mathworks.com/steve/2022/12/12/finding-the-channels/#comments</comments>
  299. <dc:creator><![CDATA[Steve Eddins]]></dc:creator>
  300. <pubDate>Mon, 12 Dec 2022 18:35:07 +0000</pubDate>
  301. <category><![CDATA[Uncategorized]]></category>
  302. <guid isPermaLink="false">https://blogs.mathworks.com/steve/?p=6125</guid>
  303.  
  304. <description><![CDATA[<div class="overview-image"><img src="https://blogs.mathworks.com/steve/files/finding_channels_02.png" class="img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /></div><p>
  305. Last winter, Aktham asked on MATLAB Answers how to find the channels in this image.url = "https://www.mathworks.com/matlabcentral/answers/uploaded_files/880740/image.jpeg";A =... <a class="read-more" href="https://blogs.mathworks.com/steve/2022/12/12/finding-the-channels/">read more >></a></p>]]></description>
  306. <content:encoded><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  307. <div class = rtcContent><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Last winter, Aktham </span><a href = "https://www.mathworks.com/matlabcentral/answers/1640535-filling-one-type-of-holes-in-a-binary-image"><span>asked on MATLAB Answers</span></a><span> how to find the channels in this image.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >url = </span><span style="color: rgb(167, 9, 245);">"https://www.mathworks.com/matlabcentral/answers/uploaded_files/880740/image.jpeg"</span><span >;</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >A = imread(url);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(A)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="DFB0CD41" prevent-scroll="true" data-testid="output_0" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_01.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: right; '><span style=' font-style: italic;'>Image credit: Aktham Shoukry. Used with permission.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Here is an example of what Aktham meant by "channel."</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><img class = "imageNode" src = "https://blogs.mathworks.com/steve/files/finding_channels_02.png" width = "234" height = "169" alt = "channel-example-overlay.png" style = "vertical-align: baseline; width: 234px; height: 169px;"></img></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>This post shows one way to accomplish the task, using erosion, morphological reconstruction, and some image arithmetic.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The channels are relatively thin in one dimension, either horizontally or vertically. So, a morphological erosion can be constructed that will keep a portion of each grain, while completely eliminating the channels.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>First, a bit of preprocessing.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >Ag = im2gray(A);</span></span></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >B = imcomplement(Ag);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(B)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="51CEE25F" prevent-scroll="true" data-testid="output_1" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_03.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The channels are about 10 pixels thick, while the square-ish "grains" are about 50-by-50. Let's erode with a square structuring element with a size that's in between.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >C = imerode(B,ones(25,25));</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(C)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="D3F83703" prevent-scroll="true" data-testid="output_2" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_04.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Next, use morphological reconstruction to restore the original grain shapes.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >D = imreconstruct(C,B);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(D)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="B642CAFF" prevent-scroll="true" data-testid="output_3" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_05.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Complement the image to make the grains dark again.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >E = imcomplement(D);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(E)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="0B2AF505" prevent-scroll="true" data-testid="output_4" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_06.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Subtracting the original grayscale image from </span><span style=' font-family: monospace;'>E</span><span> gets us very close.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >F = E - Ag;</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(F)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="0C5C7254" prevent-scroll="true" data-testid="output_5" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_07.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >G = imbinarize(F);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(G)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="A76E1902" prevent-scroll="true" data-testid="output_6" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_08.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>A final cleanup of the small objects, using either </span><span style=' font-family: monospace;'>bwareafilt</span><span> or </span><span style=' font-family: monospace;'>bwareaopen</span><span>, gives us our result.</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >H = bwareaopen(G,50);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(H)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="A422C95B" prevent-scroll="true" data-testid="output_7" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_09.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>The function </span><span style=' font-family: monospace;'>imoverlay</span><span> gives us a nice visualization of the result. (You could also use </span><span style=' font-family: monospace;'>imfuse</span><span>.)</span></div><div style="background-color: #F5F5F5; margin: 10px 0 10px 0;"><div class="inlineWrapper"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 1px solid rgb(191, 191, 191); border-bottom: 0px none rgb(33, 33, 33); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >K = imoverlay(Ag,H,[.8500 .3250 .0980]);</span></span></div></div><div class="inlineWrapper outputs"><div  style = 'border-left: 1px solid rgb(191, 191, 191); border-right: 1px solid rgb(191, 191, 191); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(191, 191, 191); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; '><span style="white-space: pre"><span >imshow(K)</span></span></div><div  style = 'color: rgb(33, 33, 33); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px; '><div class="inlineElement eoOutputWrapper embeddedOutputsFigure" uid="6CC62090" prevent-scroll="true" data-testid="output_8" style="width: 1145px;"><div class="figureElement eoOutputContent"><img decoding="async" class="figureImage figureContainingNode" src="https://blogs.mathworks.com/steve/files/finding_channels_10.png" style="width: 504px; padding-bottom: 0px;"></div><div class="outputLayer selectedOutputDecorationLayer doNotExport"></div><div class="outputLayer activeOutputDecorationLayer doNotExport"></div><div class="outputLayer scrollableOutputDecorationLayer doNotExport"></div></div></div></div></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>Note, however, that our result isn't quite perfect. There are partially cropped-off grains along the top border that have been identified as channels. Normally, I would recommend using </span><span style=' font-family: monospace;'>imclearborder</span><span> as a preprocessing step, but in this case, </span><span style=' font-family: monospace;'>imclearborder</span><span> eliminates too many of the desired channels.</span></div><div  style = 'margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; '><span>I am open to suggestions about how to refine this method. Leave a comment and let me know what you think.</span></div>
  308. <script type="text/javascript">var css = '.variableValue { width: 100% !important; } .embeddedOutputsMatrixElement,.eoOutputWrapper .matrixElement {    min-height: 18px;    box-sizing: border-box;} .embeddedOutputsMatrixElement .matrixElement,.eoOutputWrapper  .matrixElement,.rtcDataTipElement .matrixElement {    position: relative;} .matrixElement .variableValue,.rtcDataTipElement .matrixElement .variableValue {    white-space: pre;    display: inline-block;    vertical-align: top;    overflow: hidden;} .embeddedOutputsMatrixElement.inlineElement {} .embeddedOutputsMatrixElement.inlineElement .topHeaderWrapper {    display: none;} .embeddedOutputsMatrixElement.inlineElement .veTable .body {    padding-top: 0 !important;    max-height: 100px;} .inlineElement .matrixElement {    max-height: 300px;} .embeddedOutputsMatrixElement.rightPaneElement {} .rightPaneElement .matrixElement,.rtcDataTipElement .matrixElement {    overflow: hidden;    padding-left: 9px;} .rightPaneElement .matrixElement {    margin-bottom: -1px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer,.eoOutputWrapper .matrixElement .valueContainer,.rtcDataTipElement .matrixElement .valueContainer {    white-space: nowrap;    margin-bottom: 3px;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis.hide,.embeddedOutputsMatrixElement .matrixElement .verticalEllipsis.hide,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis.hide,.eoOutputWrapper .matrixElement .verticalEllipsis.hide,.rtcDataTipElement .matrixElement .valueContainer .horizontalEllipsis.hide,.rtcDataTipElement .matrixElement .verticalEllipsis.hide {    display: none;} .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .verticalEllipsis, .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer.hideEllipses .horizontalEllipsis {    display:none;} .embeddedOutputsMatrixElement .matrixElement .valueContainer .horizontalEllipsis,.eoOutputWrapper .matrixElement .valueContainer .horizontalEllipsis {    margin-bottom: -3px;} .eoOutputWrapper .embeddedOutputsVariableMatrixElement .matrixElement .valueContainer {    cursor: default !important;} .embeddedOutputsVariableElement {    white-space: pre-wrap;    word-wrap: break-word;    min-height: 18px;    max-height: 250px;    overflow: auto;} .variableElement {} .embeddedOutputsVariableElement.inlineElement {} .inlineElement .variableElement {} .embeddedOutputsVariableElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .variableElement {    padding-top: 2px;    padding-left: 9px;} .variableNameElement {    margin-bottom: 3px;    display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis {    display: inline-block;    margin-top: 3px;    /* base64 encoded version of images-liveeditor/HEllipsis.png */    width: 30px;    height: 12px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis {    margin-left: 35px;    /* base64 encoded version of images-liveeditor/VEllipsis.png */    width: 12px;    height: 30px;    background-repeat: no-repeat;    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsErrorElement.inlineElement {} .embeddedOutputsErrorElement.rightPaneElement {} /* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;} .embeddedOutputsWarningElement.inlineElement {} .embeddedOutputsWarningElement.rightPaneElement {} /* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;} .diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);} .diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;} .diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);} .diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;} .diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: pre-wrap;} .diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: pre;} .embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: pre;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;} .textElement,.rtcDataTipElement .textElement {    padding-top: 3px;} .embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {} .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;} .rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: Arial, sans-serif;  font-size: 12px;  overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}'; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }</script>]]></content:encoded>
  309. <wfw:commentRss>https://blogs.mathworks.com/steve/2022/12/12/finding-the-channels/feed/</wfw:commentRss>
  310. <slash:comments>3</slash:comments>
  311. </item>
  312. </channel>
  313. </rss>
  314.  

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid RSS" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=http%3A//feeds.feedburner.com/SteveOnImageProcessing

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda