3d aray of images to 2d image

2 ビュー (過去 30 日間)
Kris zenitis
Kris zenitis 2014 年 2 月 19 日
回答済み: David Young 2014 年 2 月 19 日
I ve got a 3d array of images 60000x28x28 (28x28 image size) and I want to plot the first image for example. A = a(1,:,:) creates a 3d array 1x28x28. I want to create just the 28x28 2d array image in order to plot it. How can i do so? A = a(1,:,:); imshow(A), return
??? Error using ==> imageDisplayValidateParams>validateCData at 114 Unsupported dimension
Error in ==> imageDisplayValidateParams at 31 common_args.CData = validateCData(common_args.CData,image_type);
Error in ==> imageDisplayParseInputs at 79 common_args = imageDisplayValidateParams(common_args);
Error in ==> imshow at 199 [common_args,specific_args] = ...

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 19 日
編集済み: Azzi Abdelmalek 2014 年 2 月 19 日
im=rand(60000,28,28)
out=permute(im,[3 2 1])
out(:,:,1); % is the first image
out(:,:,2); % is the second image
%and so on

David Young
David Young 2014 年 2 月 19 日
A = squeeze(a(1, :, :));

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by