バイナリ画像における水平方向の白領域の広がりを測定したいです。
이전 댓글 표시
人が片足立ちをし、バランスをとる様子を撮影した動画から人体領域を抽出します。そこから手足の広がりを見るために、バイナリ画像の人体領域における水平方向の幅を測定したいのですが、よいプログラムが思いつきません。
%3Dカメラで撮影したので、3次元データを読み込んでいます。
load('C:\Users\thithilab\Desktop\釜堀\Intel RealSense SDK 2.0\matlab\2022\09\13\16\MAT\2022_09_13_164718.mat');
i = 1;
number=600;
%設定
result = zeros(120,212,number);
centroid_data = zeros(number,2);
for i = 1:number
A = Depth_Data(:,:,i);
%背景差分
diff = imabsdiff(A,background);
%閾値処理・二値化
binary = diff>900;
%ノイズ除去
binary1 = bwareaopen(binary,500);
%重心の描写
s = regionprops(binary1,'centroid');
centroids = cat(1,s.Centroid);
%重心データの格納
centroid_data(i,:) = centroids;
imshow(binary1)
hold on
plot(centroids(:,1),centroids(:,2),'r.')
hold off
drawnow;
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 カメラ ビュー에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!