Thread Subject: Find corresponding y coordinates for given values of x in an image

Subject: Find corresponding y coordinates for given values of x in an image

From: Ashvin

Date: 4 Jul, 2009 01:10:57

Message: 1 of 3

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,

Subject: Find corresponding y coordinates for given values of x in an

From: ImageAnalyst

Date: 4 Jul, 2009 13:43:05

Message: 2 of 3

I can't see the image. Where did you post it? There is nothing
attached.

Can you make x and y arrays? Why did you pick certain sparse values?
What happens at the "in-between" x values?

Subject: Find corresponding y coordinates for given values of x in an

From: Ashvin

Date: 5 Jul, 2009 00:59:59

Message: 3 of 3

On Jul 4, 11:43 pm, ImageAnalyst <imageanal...@mailinator.com> wrote:
> I can't see the image.  Where did you post it?  There is nothing
> attached.
>
> Can you make x and y arrays?  Why did you pick certain sparse values?
> What happens at the "in-between" x values?

Hi ImageAnalyst,

I sent you an email with the image attached.

Thanks,

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com