フィルターのクリア

How to create a .mat file to store multiple images and its histograms.

3 ビュー (過去 30 日間)
Revathi
Revathi 2013 年 1 月 24 日
コメント済み: Fattah Tuhin 2015 年 2 月 23 日
Hi,
I'm new to matlab and would greatly appreciate if anyone could guide me about .MAT file. I'm doing a image retrieval system which requires a database of 1000 images. Currently, i have a .mat file which contains the training data for 100 images but i would like it to increase 1000 images. How do i edit the .mat file or how to do i go about creating a .MAT file which it can store 1000 images and its histograms. Your help is greatly appreciated. Thanks.

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 1 月 24 日
For example,
for K = 1 : 1000
filename = sprintf('image_%04d.tif', K);
I = imread(filename);
IGray = rgb2gray(I);
H = hist(Igray(:), 32); %32 bins in the histogram
imgs(K).image = I;
imgs(K).histogram = H;
end
save('ImageDatabase.mat', 'imgs');
  3 件のコメント
Revathi
Revathi 2013 年 1 月 24 日
Hi, Thanks for the prompt reply. May i know, is this the specific image name (image_%04d.tif)? I'm actually working on a RGB and a HSV color model. How many bins should i declare for both? Thanks so much for your help.
Fattah Tuhin
Fattah Tuhin 2015 年 2 月 23 日
Nice . This helped me lot. Thank you

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by