for文の中にfigureを3つ入れているのですが、毎回新しいウィンドウで出てしまいます。ウィンドウを固定したいです。
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
慶次郎 釜堀
am 20 Jan. 2022
Kommentiert: 慶次郎 釜堀
am 20 Jan. 2022
for i=1:filenumber
%画像の読み込み
I = imread([path sprintf('%04d.jpg',i)]);
%画像のサイズ変更
FG = imresize(I,bairitu);
sourceimage = imresize(I,bairitu);
%鮮鋭化
FG = imsharpen(FG);
%背景差分
FG1 = imabsdiff(BG1,FG);
%グレースケール変換
G = rgb2gray(FG1);
%2値化
FG2 = imbinarize(G);
%FG2 = G>20;
%morph
SE = strel('disk',15,0);
FG3 = imclose(FG2,SE);
imshow(FG3);
%bwareaope
FG4 = bwareaopen(FG3,300);
%人体領域にバウンディングボックス
s0 = regionprops(FG4,'BoundingBox');
s1 = s0.BoundingBox;
%足領域を抽出
FG4 = imcrop(FG4,[s1(1,1) s1(1,2)+s1(1,4)*0.5 s1(1,3) s1(1,4)*0.5]);
%手のノイズ除去
FG5 = bwareaopen(FG4,300);
%背景画像にも適用
sourceimage_foot = imcrop(sourceimage,[s1(1,1) s1(1,2)+s1(1,4)*0.5 s1(1,3) s1(1,4)*0.5]);
%足領域にバウンディングボックス
s2 = regionprops(FG5,'BoundingBox');
s3 = s2.BoundingBox;
s3(1,5) = l;
s3(1,6) = m;
s3(1,7) = n;
point(i,:) = s3;
point = round(point);
bbox_result = insertShape(sourceimage_foot,'Rectangle',[point(i,1:4)],'LineWidth',3);
imshow(bbox_result);
figure,imshow(FG3);
figure,imshow(FG4);
figure,imshow(FG5);
end
0 Kommentare
Akzeptierte Antwort
Shunichi Kusano
am 20 Jan. 2022
figure(1), imshow(FG3);
figure(2), imshow(FG4);
figure(3), imshow(FG5);
とID指定してしまえば大丈夫です。
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu イメージ算術 finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!