i have 10 folders and in each folder i have 20 images...for a folder i need to extract histogram normalization values of images and i need to store them for further use...i have written code but im unable to get stored values...help me ..thanks

조회 수: 4 (최근 30일)
clear all;
close all;
Folder='G:\C\New folder (2)\(2)';
file1=fullfile(Folder,'*.png');
pngimages1=dir(file1);
numOfFiles=length(pngimages1);
for i=1:length(pngimages1)
FileName1=pngimages1(i).name;
fullFileName1=fullfile(Folder,FileName1);
im1=imread(fullFileName1);
im11=rgb2gray(im1);
im111=imhist(im11)./numel(im11);
im112=im111(i,:);
end
xlswrite('myFile.xlsx',im112);

채택된 답변

Jan
Jan 2017년 7월 25일
Do you mean
im112(i,:) = im111;
instead of
im112=im111(i,:);
  댓글 수: 7
Jan
Jan 2017년 7월 27일
@Gohan: Okay. Then what exactly is your question? Creating a loop over the folders? Before I could suggest some code for this, you have to explain, how the set of folders is recognized. Perhaps all subfolders of a specific base folder?
FolderList = dir(BaseFolder);
FolderList = FolderList([FolderList.isdir]);
FolderName = fullfile(BaseFolder, {FolderList.name});
Then run a loop over the folders.
Please explain "but im unable to get stored values" with any details. It is much easier to fix a problem than to guess what the problem is.
Image Analyst
Image Analyst 2017년 7월 27일
I don't even know what "histogram normalization values" are. Please explain in detail. The histogram() function can return 'pdf' and 'probability' versions of the histogram, if that's what you want - see its options.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by