|
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,
|