Measure distance and angle of object

2 ビュー (過去 30 日間)
Moufid Meddeb
Moufid Meddeb 2021 年 4 月 4 日
コメント済み: Image Analyst 2021 年 4 月 7 日
hello my friends, I need help and I trust you, the goal is to measure these measurements in an automatic way
  4 件のコメント
Image Analyst
Image Analyst 2021 年 4 月 4 日
編集済み: Image Analyst 2021 年 4 月 4 日
What do we know about the shape? Is the triangle always in roughly the same location and roughly the same size? Does the shape bulge upwards (like this one does) near the "opening" for all images? Is the bottom always sloping? Can you post two or three more images so we can see what kind of variety we need to plan for? I came up with an algorithm that works for this image but I don't know if it would work for any other image.
Moufid Meddeb
Moufid Meddeb 2021 年 4 月 4 日
the difference between each images are measurements a , b , h and two angle . Yes the triangle always in roughly the same location but not roughly the same size. yes the bottom always sloping. this another image

サインインしてコメントする。

採用された回答

darova
darova 2021 年 4 月 5 日
Here is the algorithm
  • crop the region 1 and find min/max x
[m,n] = size(step1);
[~,x1] = find(step1(:,1:n/2),1,'last');
[~,x2] = find(step1(:,n/2:n),1,'first');
a_value = x2-x1;
  • crop region 2
[~,x] = find(step2);
b_value = x(end) - x(1);
  • region 3
[y,~] = find(step3);
h_value = max(y) - min(y);
  4 件のコメント
Moufid Meddeb
Moufid Meddeb 2021 年 4 月 7 日
Image Analyst
Image Analyst 2021 年 4 月 7 日
x2 = n/2 + find(step1(:,n/2:n),1,'first');

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by