フィルターのクリア

Divide the new images

1 回表示 (過去 30 日間)
Stavros
Stavros 2022 年 6 月 28 日
コメント済み: Chunru 2022 年 6 月 29 日
How can i divide the generated images so i can have them seperated instead of having them all in one image?
  4 件のコメント
Stavros
Stavros 2022 年 6 月 29 日
I use the code from this link https://www.mathworks.com/help/deeplearning/ug/train-generative-adversarial-network.html , just with different images.
Chunru
Chunru 2022 年 6 月 29 日
The example code generates images
XGeneratedNew = predict(netG,ZNew);
All generated images are stored in the variable XGeneratedNew. To display the image in tled format, the example code performs the following
% Display the images.
I = imtile(extractdata(XGeneratedNew));
I = rescale(I);
Instead of tiled format, you can plot individual images by looking the data from "predict"
x = extractdata(XGeneratedNew)

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

採用された回答

Chunru
Chunru 2022 年 6 月 28 日
編集済み: Chunru 2022 年 6 月 29 日
x = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1048515/image.jpeg');
figure;
imshow(x)
% divide image into two
m = size(x, 2)
m = 1396
x1 = x(:, 1:m/2, :);
x2 = x(:, m/2+1:end, :);
x1 = x1(50:464, 187:647, :);
figure; imshow(x1); hold on
%xline(187); xline(647); yline(50); yline(464)
figure; imshow(x2);
[m1, m2, m3] = size(x1);
m1new = floor(m1/5); m2new = floor(m2/5);
for i=1:5
for j=1:5
y{j, i} = x1((i-1)*m1new+(1:m1new), (j-1)*m2new+(1:m2new));
end
end
figure
montage(y, BorderSize = [5,5])
%whos
  2 件のコメント
Stavros
Stavros 2022 年 6 月 28 日
Actually i want to divide your x1 image into 25 seperate images, thank you.
Chunru
Chunru 2022 年 6 月 29 日
See the update above.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by