Find the orientation of the skeletonized image

조회 수: 5 (최근 30일)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 1월 16일
편집: Matt J 2020년 1월 17일
Is there any command that can find the orientation of skeletonized image? like the attached image that average angle of lines with respect to horizontal line.
Capture.JPG

답변 (2개)

Matt J
Matt J 2020년 1월 16일
You can use houghlines to get the endpoints of all the line segments in the image. From that, you can easily calculate their slopes.
  댓글 수: 2
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 1월 17일
Can you explain bit more?
Matt J
Matt J 2020년 1월 17일
편집: Matt J 2020년 1월 17일
Can you explain bit more?
Once you have the end points (x1,y1) and (x2,y2) of a line, you can calculate its angle according to,
angle = atan2d(y2-y1,x2-x1)

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


darova
darova 2020년 1월 16일
You can write your own function:
  • use imline to create a line
  • draw a line aligned with horizontal/vertical one
  • calculate the angle
  • rotate image
  댓글 수: 1
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 1월 16일
@darova
What you mean by creating the line? I already have the line and want to find the angle of all lines in the above image.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by