Skip to content

Instantly share code, notes, and snippets.

@milkersarac
Created September 3, 2013 16:08
Show Gist options
  • Save milkersarac/6425967 to your computer and use it in GitHub Desktop.
Save milkersarac/6425967 to your computer and use it in GitHub Desktop.
reads first 20 images from 2 directory and shows them in 2 different figure on a grid.
function showImageGrid( dir1, dir2 )
%showImageGrid shows two separete image grid for each directory.
% @milkers
listing1 = dir( dir1 );
figure(1);
for i=3:length(listing1)
[tempX, tempMap] = imread(listing1(i).name);
numCol = 5;
subplot(4, numCol, i-2), imshow(tempX, tempMap, 'Border', 'tight')
end
listing2 = dir( dir2 );
figure(2);
for i=3:length(listing2)
[tempX, tempMap] = imread(listing2(i).name);
numCol = 5;
subplot(4, numCol, i-2), imshow(tempX, tempMap, 'Border', 'tight')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment