Use reshape to image with 3 dims

3 ビュー (過去 30 日間)
cristhian elguera
cristhian elguera 2019 年 10 月 27 日
¡Hola!. Estoy tratando de crear una red neuronal de convolución. Y mi entrada de datos tiene este tamaño ... (60000,28,28) donde 60000 es el número de imágenes y 28x28 es el tamaño de cada imagen.
Desea que mis datos de entrada tengan la siguiente dimensión. (28,28,60000) para usar imshow (datos (:,:, 1)) y ver todas las imágenes.
Mi problema es que la única solución que encontré es usar un bucle for porque la función remodelar no cambia las dimensiones como quiero.
remodelar (datos, [28 28 6000])
Entonces no sé si estoy cantando bien la función.
data = double (cell2mat (struct2cell (load ( 'images_train.mat' , 'images_train' )))) ;; % clase uint8
new_data = rehacer (datos [28 28 60000])
imshow (new_data (:,:, 1))
Y estas son las imágenes.

回答 (1 件)

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato 2019 年 10 月 27 日
A = randn(6000,28,28);
newA = reshape(A,[28 28 6000]);
size(newA)
imshow(newA(:,:,1))
size(newA)
ans =
28 28 6000
This should work.

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by