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

3 Ansichten (letzte 30 Tage)
Yogesh Awate
Yogesh Awate am 28 Nov. 2017
Kommentiert: Yogesh Awate am 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!

Akzeptierte Antwort

KSSV
KSSV am 28 Nov. 2017
Bearbeitet: KSSV am 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 Kommentare
KSSV
KSSV am 28 Nov. 2017
Edited...
Yogesh Awate
Yogesh Awate am 28 Nov. 2017
Thanks a lot for help!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by