Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!news.glorb.com!news2.glorb.com!postnews.google.com!d36g2000prb.googlegroups.com!not-for-mail
From: Ashvin <nkmah2@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Find corresponding y coordinates for given values of x in an image
Date: Fri, 3 Jul 2009 18:10:57 -0700 (PDT)
Organization: http://groups.google.com
Lines: 70
Message-ID: <5eaf58c5-2c43-41cf-8165-fd91cf1986e7@d36g2000prb.googlegroups.com>
NNTP-Posting-Host: 115.130.29.245
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1246669859 3510 127.0.0.1 (4 Jul 2009 01:10:59 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 4 Jul 2009 01:10:59 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: d36g2000prb.googlegroups.com; posting-host=115.130.29.245; 
	posting-account=TvwpjAoAAADbk6Eaohvk4fQgIZs6iF74
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) 
	Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:552738


I will try to explain what I am trying to do in more detail.

Basically I have a binary image (attached) and I would like to plot a
parabola across the min  y's for x=20:300 for example.

But there are several values at y=1 in the binary image at x=200 for
example.

I did it point by point the following way but its not practical for
200 points.

x1=125;
x2=120;
x3=115;
x4=110;
x5=105;
x6=100;
x7=95;
x8=80;
x11=75;
x12=70;
x13=65;
x14=60;
x15=55;
x16=40;
x17=35;

[y1]=find(I(:,x1));
[y2]=find(I(:,x2));
[y3]=find(I(:,x3));
[y4]=find(l(:,x4));
[y5]=find(I(:,x5));
[y6]=find(Il(:,x6));
[y7]=find(I(:,x7));
[y8]=find(I(:,x8));
[y11]=find(I(x11));
[y12]=find(I(:,x12));
[y13]=find(I(:,x13));
[y14]=find(I(:,x14));
[y15]=find(I(:,x15));
[y16]=find(I(:,x16));
[y17]=find(I(:,x17));



y1=min(y1);
y2=min(y2);
y3=min(y3);
y4=min(y4);
y5=min(y5);
y6=min(y6);
y7=min(y7);
y8=min(y8);
y11=min(y11);
y12=min(y12);
y13=min(y13);
y14=min(y14);
y15=min(y15);
y16=min(y16);
y17=min(y17);



Once I have the points I use p=polyfit(xcoord,ycoord,2) to draw the
parabola which is pretty straightforward.The only problem I am facing
is to get the corresponding minimum y coordinates for given larger
range of x.


Best regards,