MATLAB Answers

Can anyone help me understand this code?

4 views (last 30 days)
anand rathod
anand rathod on 5 Jul 2020 at 16:25
Commented: anand rathod on 5 Jul 2020 at 18:30
clc;
clear ;
close all;
cl = {'open','close'};
DBL = cell(1,1);
DBR = cell(1,1);
DBM = cell(1,1);
dim = [30 60;
30 60
40 65];
disp('Training left eye');
for ii = 1:2
disp(cl{ii})
fpath = ['C:\Users\DELL\Database\LE\' cl{ii} '/*.bmp'];
D = dir(fpath);
for kk = 1:length(D)
impath = ['C:\Users\DELL\Database\LE\' cl{ii} '/' D(kk).name];
I = imread(impath);
Is = imresize(I,[dim(1,1) dim(1,2)]);
DBL{ii,kk} = Is;
imshow(Is);
pause(0.01)
end
end

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 5 Jul 2020 at 16:31
This crude code reads in images and resizes and displays them. It also (for some reason) stores them in a cell array.

  3 Comments

anand rathod
anand rathod on 5 Jul 2020 at 17:10
DBL{ii,kk} = ls
Does this line stores the image in array?
Image Analyst
Image Analyst on 5 Jul 2020 at 18:18
Yes, it put it into one cell of a cell array. Please see the FAQ for an excellent discussion cell arrays.

Sign in to comment.

More Answers (0)

Categories


Translated by