hi i want to read a folder of images and i have to store their properties in a matrix...i.e, first image properties in first column and second image properties in second colum likewise..help me

reading folder containing images and storing their properties in a matrix

2 Comments

what properties? When you read an image you will get RGB matrix, which would be huge to store.
no sir im reading gray images and properties like ..energy,mean... i want to store them in column wise...for second image second column

Sign in to comment.

 Accepted Answer

clc; clear all ;
F = dir('*.jpg'); % your images extension and you are in the present directory of images
nimage = length(F) ; % length of images
E = zeros(nimage,1) ; % initiliaze energy
M = zeros(nimage,1) ; % intiilize mean
% loop for each image
for ii = 1:nimage
I = imread(F(ii).name); % read image
% do what you want, let Ei, Mi be calculated energy and mean
% E(ii) = Ei ;
% M(ii) = Mi ;
end

3 Comments

Folder='D:\mali';
file=fullfile(Folder,'*.jpg');
jpegFiles=dir(file);
numOfFiles=length(jpegFiles);
for i=1:length(jpegFiles)
FileName=jpegFiles(i).name;
fullFileName=fullfile(Folder,FileName);
im=imread(fullFileName);
m(i)=mean(mean(im))
e(i)=entropy(im)
end
i have used above code and im going to use ur code sir thanku sir

Sign in to comment.

More Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Products

Asked:

on 7 Dec 2016

Commented:

on 7 Dec 2016

Community Treasure Hunt

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

Start Hunting!