How to measure the distance between two points in a list of images

조회 수: 3 (최근 30일)
BA
BA 2024년 11월 26일
편집: Drishti 2024년 11월 28일
I need to measure the distance between the ruler stick and the lips which is marked in dotted line for a sequence of images
Just wonder if anyone could suggest a starter for me or a flowcahrt to do that

채택된 답변

Drishti
Drishti 2024년 11월 26일
편집: Drishti 2024년 11월 28일
Hi BA,
I understand that you are trying to measure the distance between the ruler stick and the lips present in the provided image.
To calculate the distance, you can follow the provided steps:
  • You can first detect the lines in the image using method like Hough Transform.
  • After the detection of lines, determine the endpoints of the detected lines that correspond to the ruler and the lips by examining the relevant pixels.
  • Compute the distance between the midpoints of the ruler line and the lips line using the Euclidean distance formula.
Refer to the code snippet to get an understanding of detecting lines using 'hough' function:
% Detect lines using Hough Transform
[H, T, R] = hough(edges);
peaks = houghpeaks(H, 5, 'Threshold', ceil(0.3 * max(H(:))));
lines = houghlines(edges, T, R, peaks, 'FillGap', 20, 'MinLength', 30);
For more information, you can refer to the MATLAB Documentation of 'hough' function:
I hope this helps in getting started.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by