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

2 ビュー (過去 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 Center および File ExchangeImages についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by