How to connect lines in a skeletonized image with arcs

조회 수: 2 (최근 30일)
Steve
Steve 2019년 6월 11일
답변: Steve 2019년 6월 12일
Hi,
I'm trying to find a way to have MATLAB connect the lines of the tripods in the first image (i.e., vertex_tripods.bmp) with arcs so that it looks something like the second image (i.e., vertex_tripods_connected.bmp). I would also like to have MATLAB calculate the angles of the tripods in the first image (with respect to the vertical axis). Thanks in advance for your help!

답변 (2개)

darova
darova 2019년 6월 12일
Use bwmorph() to find branch points. I sorted them in counter clock-wise order:
img.png
Find distance and center between neighbor points:
img1.png
Assume arc radius is 1000 pixels. Draw perpendicular vector (length L) from center of a segment - get arc center p0
img2.pngimg3.png
Rotate radius vector using angle and rotation matrix to get points on arc
img4.png
  댓글 수: 4
darova
darova 2019년 6월 12일
can you show how this should looks like?
darova
darova 2019년 6월 12일
are those connections can be just straight lines?

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


Steve
Steve 2019년 6월 12일
It should look like the second attached image (vertex_tripods_connected.bmp). In theory, the connections cannot be straight lines, but they can be arcs with very large radii.

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by