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

Réponse acceptée
Plus de réponses (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 commentaire
大輝 隅岡
le 20 Oct 2022
Catégories
En savoir plus sur コンピューター ビジョンと Simulink dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

