CBIR ,read image, index

1 次查看(过去 30 天)
Guys, I want to take 10 images form my image database, read them, index them, find grey level and histogram. make bin to size 15. calculate feature vector of each image. calulate ED or MSE.
I tried with this
mds = imageDatastore(location)
imds = imageDatastore(location,Name,Value)
but, didnt get expected output

采纳的回答

Image Analyst
Image Analyst 2021-5-14
Start with this:
folder = pwd; % Wherever.
filePattern = fullfile(folder, '*.png')
imds = imageDatastore(filePattern)
numFiles = length(imds.Files)
for k = 1 : numFiles
subplot(2, 1, 1);
fullFileName = imds.Files{k};
[folder, baseFileNameNoExt, ext] = fileparts(fullFileName);
rgbImage = imread(imds.Files{k});
imshow(rgbImage);
caption = sprintf('File #%d of %d : %s', k, numFiles, [baseFileNameNoExt, ext]);
title(caption, 'Interpreter', 'none');
subplot(2, 1, 2);
imhist(rgbImage);
drawnow;
promptMessage = sprintf('Do you want to Continue processing,\nor Quit processing?');
titleBarCaption = 'Continue?';
buttonText = questdlg(promptMessage, titleBarCaption, 'Continue', 'Quit', 'Continue');
if contains(buttonText, 'Quit', 'IgnoreCase', true)
return; % or break or continue.
end
end
  2 个评论
Ragini Gaikwad
Ragini Gaikwad 2021-5-15
Thank you so much sir. I will try this out.
Ragini Gaikwad
Ragini Gaikwad 2021-5-16
@Image Analyst, thanks for the code above. Next I am trying this.
%%glcm
glcms = graycomatrix(I)
%%glcm ENE/ENT/COR/CON
stats = graycoprops(glcms,{'contrast','homogeneity','Correlation','Energy'})
I want to get mean and variance ..for texture feature..so how do i start for this calculation

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by