Measure line length in pixels atomatically

8 ビュー (過去 30 日間)
Aaron Schüddekopf
Aaron Schüddekopf 2020 年 11 月 11 日
回答済み: Tarunbir Gambhir 2021 年 3 月 24 日
Hello,
as i wrote in the title, i would like to know, if it's possible to measure the length of a line. unfortunately it is as you can see in the attachements one long line. but i need the edge length. so i tried to detect the corners with regionprops and detectHarrisFeatures but nothing has worked yet. a scale to calculate the real length in cm is given. just to make it clear: i just need to know how i could possibly detect those corners. if i know the pixels in the corners it is, as far as i can think of, easy to calculate the pixels between.
Thank you.
Cheers... Aaron

回答 (1 件)

Tarunbir Gambhir
Tarunbir Gambhir 2021 年 3 月 24 日
Based on your question, I suggest you use the function imdistline to get the distance between two points on an image in pixels. It consists of an interactive line over an image, paired with a text label that displays the distance between the line endpoints.
Another function that could be helpful is drawpoint. This function would allow you to get the pixel coordinates of a point of your choice on the image.

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by