Please help me with this .tif to .mat file conversion

4 vues (au cours des 30 derniers jours)
Yogesh Awate
Yogesh Awate le 28 Nov 2017
Commenté : Yogesh Awate le 28 Nov 2017
pic1 = imread('IMG_1.tif');
pic2 = imread('IMG_2.tif');
pic3 = imread('IMG_3.tif');
pic4 = imread('IMG_4.tif');
pic5 = imread('IMG_5.tif');
save('MultiUAV1.mat', 'pic1', 'pic2', 'pic3', 'pic4', 'pic5');
I am trying to convert these .tif images(960 x 1280 uint16) into a single .mat file(960 x 1280 x 5 uint16), instead it is creating separate files(960 x 1280 unit6) into mutliple.
Please help me getting single .mat file(960 x 1280 x 5 uint16)
Thank you in advance!

Réponse acceptée

KSSV
KSSV le 28 Nov 2017
Modifié(e) : KSSV le 28 Nov 2017
images = {'IMG_1.tif','IMG_2.tif','IMG_3.tif','IMG_4.tif','IMG_5.tif'} ;
N = length(images) ;
I = zeros(960,1280,N) ;
for i = 1:N
I1 = imread(images{i}) ;
I(:,:,i) = I1 ;
end
save MultiUAV1.mat I ;
  3 commentaires
KSSV
KSSV le 28 Nov 2017
Edited...
Yogesh Awate
Yogesh Awate le 28 Nov 2017
Thanks a lot for help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import and Analysis dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by