二値画像から縦方向,横方向の最大の長さを求めたい
Ältere Kommentare anzeigen
図のような,すこし複雑な縦長の物体の二値画像から縦方向,横方向それぞれの最大の長さを求めたいのですが,良いアイデアが思い浮かびません.
縦方向は最大何ピクセルというように,長さをピクセル数で求めたいです.
わかりにくい文章ですみませんが,どなたか教えていただきたいです.
よろしくお願いします.

Akzeptierte Antwort
Weitere Antworten (1)
I = imread('image.png');
BW = imbinarize(rgb2gray(I),'adaptive'); % Image Processing Toolboxによる二値化
frts = bwferet(BW,'all') % 最大(最小)フェレ径を求める
imshow(I); hold on % 表示してみる
line(frts.MaxCoordinates{:}(:,1),frts.MaxCoordinates{:}(:,2));
line(frts.MinCoordinates{:}(:,1),frts.MinCoordinates{:}(:,2));
1 Kommentar
大輝 隅岡
am 20 Okt. 2022
Kategorien
Mehr zu コンピューター ビジョンと Simulink finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

