How to find vertices of triangle approximated from binary image

8 ビュー (過去 30 日間)
Kiran K
Kiran K 2022 年 12 月 22 日
コメント済み: Kiran K 2022 年 12 月 26 日
The purpose is to analyse uniformity of images like below(The shape changes slightly based on device parameters).
I need to find the areas of 3 sub regions drawn by connecting centroid to 3 vertices.
The movement of centroid and variation in these sub areas are required for further analysis(with different device parameters).
For this, cordinates of vertices are required.
(Centroid is obtained from regionprop/blob analysis)
I know that this image is not in actual triangle shape. But is there any method to find the 3 vertices by any approximation method?
I could not find a solution with bounding box, bwboundaries...

採用された回答

Image Analyst
Image Analyst 2022 年 12 月 22 日
You can find the centroid, then the distance of the perimeter to the centroid and then call findpeaks on that distance to find the 3 vertexes. I do that in my attached demo.
  1 件のコメント
Kiran K
Kiran K 2022 年 12 月 26 日
This method was helpful to find the vertices.
In the attached image case, as the triangle edges are not sharp, all of the peaks on the distance array do not have high prominence. By adjusting the MinPeakProminence, it is able to identify the peaks.

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

その他の回答 (1 件)

KSSV
KSSV 2022 年 12 月 22 日
I = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1239812/image.png') ;
[y,x] = find(I) ;
mx = mean(x) ; my = mean(y) ;
d = sqrt((mx-x).^2+(my-y).^2) ;
idx = isoutlier(d) ;
x(idx) =[] ; y(idx) =[] ;
idx = convhull(x,y) ;
x = x(idx) ; y = y(idx) ;
imshow(I)
hold on
plot(x,y,'.-r')

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by