From: Mathew Thomas on
Hello,

Is there a proper way to get all the coordinate points between 2 points in an image (if i know the coordinate values of the two points) ? The issue is that the points are not in a straight line.

For eg, between points [248,80] & points [267,148].

Do let me know if you have any suggestions.

Thanks in advance,

Mathew
From: Matt J on
"Mathew Thomas" <mathew99(a)gmail.com> wrote in message <htubg1$jhm$1(a)fred.mathworks.com>...
> Hello,
>
> Is there a proper way to get all the coordinate points between 2 points in an image (if i know the coordinate values of the two points) ? The issue is that the points are not in a straight line.
>
> For eg, between points [248,80] & points [267,148].
========

Your problem needs clarification.
Do you mean all the sample points that lie *exactly* on the line between these two given points? Or do you mean you imagine the pixels as chekcerboard boxes and want all boxes intersected by this line?
From: Berend on
"Mathew Thomas" <mathew99(a)gmail.com> wrote in message <htubg1$jhm$1(a)fred.mathworks.com>...
> Hello,
>
> Is there a proper way to get all the coordinate points between 2 points in an image (if i know the coordinate values of the two points) ? The issue is that the points are not in a straight line.
>
> For eg, between points [248,80] & points [267,148].
>
> Do let me know if you have any suggestions.
>
> Thanks in advance,
>
> Mathew

Something like this you mean?
a=[248,80];
b=[267,148];

x=[a(1) b(1)];
y=[a(2) b(2)];

X=a(1):b(1);
Y=interp1(x,y,X);
Y=round(Y)
From: Mathew Thomas on
Hey,

I meant:
All the sample points that lie 'exactly' on the line between these two given points. Hope this makes it clear.

Thanks,

Mathew
From: Mathew Thomas on
Thats exactly what I needed.

Thank you and best wishes...

Mathew
 |  Next  |  Last
Pages: 1 2
Prev: higuchi matlab code
Next: higuchi matlab code