convert to 2d to 3d
古いコメントを表示
The image data in which the numeric data is written is 2d.
(3404 * 2403 size) images want to save 60 images by cutting to 340 * 40 size. That is, 340 * 60 sizes should be stored in 60 dimensions.
What method should I use?
回答 (2 件)
Walter Roberson
2018 年 11 月 23 日
編集済み: Walter Roberson
2018 年 11 月 23 日
reshape(Image(1:340,1:2400),340,40,60)
Andrei Bobrov
2018 年 11 月 23 日
編集済み: Andrei Bobrov
2018 年 11 月 23 日
0 投票
Let A - your image with size [3400 x 2400],
size of small image -> [340 x 40].
p = 340;
n = 40;
[q,w] = size(A);
out = squeeze(permute(reshape(A,p,q/p,n,[]),[1,3,4,2]));
or with mat2cell:
p = 340;
n = 40;
[q,w] = size(A);
C = mat2cell(A,p*ones(q/p,1),n*ones(w/n,1))';
out = cat(3,C{:});
カテゴリ
ヘルプ センター および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!