loading multiple.im7 images into Matlab using readimx function
Show older comments
Hi folks,
I'm working with 20000 of .im7 (Davis) images. How could I read and load these images into Matlab (uint16)? Here is my simple code. I used 'readimx' function but it only works for single image.
filename = 'C:\....\n_2000_075';
im7_files = dir([filename,'/*.im7']);
imgNum = length(im7_files);
for i = 1:imgNum
A = readimx([filename, im7_files(i).name]); % Load the image infomation
A_rot = imrotate(A.Data(:, :), -90);
A_flip = fliplr(A_rot);
D(:, :, i) = A_flip(:, :); % Saving in Matrix D
i = i+1;
end
1 Comment
Adam Meziane
on 20 Feb 2025
Have you found a solution to this?
Answers (1)
Walter Roberson
on 20 Feb 2025
filename = 'C:\....\n_2000_075';
im7_files = dir([filename,'/*.im7']);
imgNum = length(im7_files);
A_flip_old = [];
for i = 1:imgNum
A = readimx([filename, im7_files(i).name]); % Load the image infomation
A_rot = imrotate(A.Data(:, :), -90);
A_flip = fliplr(A_rot);
if i ~= 1
A_flip = imresize(A_flip, size(A_flip_old));
end
D(:, :, i) = A_flip(:, :); % Saving in Matrix D
A_flip_old = A_flip;
end
There is no way to have readimx() read many files at at the same time.
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!