for文の中にfig​ureを3つ入れてい​るのですが、毎回新し​いウィンドウで出てし​まいます。ウィンドウ​を固定したいです。

4 ビュー (過去 30 日間)
慶次郎 釜堀
慶次郎 釜堀 2022 年 1 月 20 日
コメント済み: 慶次郎 釜堀 2022 年 1 月 20 日
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

採用された回答

Shunichi Kusano
Shunichi Kusano 2022 年 1 月 20 日
figure(1), imshow(FG3);
figure(2), imshow(FG4);
figure(3), imshow(FG5);
とID指定してしまえば大丈夫です。
  1 件のコメント
慶次郎 釜堀
慶次郎 釜堀 2022 年 1 月 20 日
できました!ありがとうございます。

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchangeイメージ についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!