<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255706</link>
    <title>MATLAB Central Newsreader - Find the last non zero coordinates in a binary image?</title>
    <description>Feed for thread: Find the last non zero coordinates in a binary image?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 09 Jul 2009 10:51:09 -0400</pubDate>
      <title>Find the last non zero coordinates in a binary image?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255706#663893</link>
      <author>Ashvin</author>
      <description>I will try to explain what I am trying to do in more detail.&lt;br&gt;
&lt;br&gt;
Basically I have a binary image and I would like to plot a parabola&lt;br&gt;
across the min y's for x=20:300 for example.&lt;br&gt;
&lt;br&gt;
But there are several values at y=1 in the binary image at x=200 for&lt;br&gt;
example.&lt;br&gt;
&lt;br&gt;
I did it point by point the following way but its not practical for&lt;br&gt;
200 points.&lt;br&gt;
&lt;br&gt;
x1=200;&lt;br&gt;
x2=201;&lt;br&gt;
x3=202;&lt;br&gt;
x4=203;&lt;br&gt;
x5=204;&lt;br&gt;
x6=205;&lt;br&gt;
x7=206;&lt;br&gt;
x8=207;&lt;br&gt;
x11=208;&lt;br&gt;
x12=209;&lt;br&gt;
x13=210;&lt;br&gt;
x14=211;&lt;br&gt;
x15=212;&lt;br&gt;
x16=213;&lt;br&gt;
x17=214;&lt;br&gt;
&lt;br&gt;
[y1]=find(I(:,x1));&lt;br&gt;
[y2]=find(I(:,x2));&lt;br&gt;
[y3]=find(I(:,x3));&lt;br&gt;
[y4]=find(l(:,x4));&lt;br&gt;
[y5]=find(I(:,x5));&lt;br&gt;
[y6]=find(Il(:,x6));&lt;br&gt;
[y7]=find(I(:,x7));&lt;br&gt;
[y8]=find(I(:,x8));&lt;br&gt;
[y11]=find(I(x11));&lt;br&gt;
[y12]=find(I(:,x12));&lt;br&gt;
[y13]=find(I(:,x13));&lt;br&gt;
[y14]=find(I(:,x14));&lt;br&gt;
[y15]=find(I(:,x15));&lt;br&gt;
[y16]=find(I(:,x16));&lt;br&gt;
[y17]=find(I(:,x17));&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
y1=max(y1);&lt;br&gt;
y2=max(y2);&lt;br&gt;
y3=max(y3);&lt;br&gt;
y4=max(y4);&lt;br&gt;
y5=max(y5);&lt;br&gt;
y6=max(y6);&lt;br&gt;
y7=max(y7);&lt;br&gt;
y8=max(y8);&lt;br&gt;
y11=max(y11);&lt;br&gt;
y12=max(y12);&lt;br&gt;
y13=max(y13);&lt;br&gt;
y14=max(y14);&lt;br&gt;
y15=max(y15);&lt;br&gt;
y16=max(y16);&lt;br&gt;
y17=min(y17);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Once I have the points I use p=polyfit(xcoord,ycoord,2) to draw the&lt;br&gt;
parabola which is pretty straightforward.The only problem I am facing&lt;br&gt;
is to get the corresponding minimum y coordinates for given larger&lt;br&gt;
range of x.</description>
    </item>
    <item>
      <pubDate>Thu, 09 Jul 2009 11:49:02 -0400</pubDate>
      <title>Re: Find the last non zero coordinates in a binary image?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255706#663909</link>
      <author>Bruno Luong</author>
      <description>You should read more carefully the help/doc of FIND. What you asked is featured in FIND command.&lt;br&gt;
&lt;br&gt;
Also note that this tool on FEX might be of interest when applied on a matrix : &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/24641&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/24641&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
  </channel>
</rss>

