How to get parallel lines in a binary image?

I want to find parallel lines in a binary image and calculate the distance between them....
Can anyone help me with the code?

댓글 수: 7

KSSV
KSSV 2020년 10월 3일
Attach pictorial example.
Matt J
Matt J 2020년 10월 3일
I see no lines in this example image, just some weird shaped curve.
I've got these lines, is this correct?
I want to calculate the distance between the lines.
Assuming you have the coordinates of the red and yellow x's, I'd use sqrt(), though some might use norm().
There are no lines in the attched binary image??
https://in.mathworks.com/matlabcentral/answers/604144-how-to-get-parallel-lines-in-a-binary-image#comment_1035754
Can you give an example code?

댓글을 달려면 로그인하십시오.

답변 (1개)

Priysha LNU
Priysha LNU 2020년 10월 6일

0 개 추천

You may simply calculate the distance between two lists of points as :
Let data1 and data2 be two set of points.
data = data1 - data2;
dist = sqrt(data(:,1).^2+data(:,2).^2);
DISCLAIMER: These are my own views and in no way depict those of MathWorks.

질문:

2020년 10월 3일

답변:

2020년 10월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by