I want to create a database of images,containing various fields like image name,brightness value of image and colorfulness of image etc.after filling the values in database ,i want to retrieve specific images based on brightness & colorfulness features of image.how can i do this?

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 7 Aug. 2015

1 Stimme

Use a struct array, one entry per file.
When it comes time to search on (say) brightness, then
all_brightness = [YourStruct.brightness];
bright_match = all_brightness >= min_to_match & all_brightness <= max_to_match;
matching_entries = YourStruct(bright_match);
Now matching_entries is the subset that match on brightness. You can process them further. For example,
fprintf('The %d images that match are:\n', length(matching_entries));
disp({matching_entries.filename});

7 Kommentare

sweta arya
sweta arya am 10 Aug. 2015
Thanks. i want to show images that satisfy some this condition on a single screen .i used subplot function but problem is that it do not know number of images beforehand.if u have any idea,please tell me.
Arun Badigannavar
Arun Badigannavar am 10 Aug. 2015
You can write automate script for this, 1) Check the total number of images first, 2) And make this number counts as a subplot in your plot Dont fix the subplots numbers, Rather write a script
sweta arya
sweta arya am 10 Aug. 2015
could u give me one example of automate script because i m new to matlab
sweta arya
sweta arya am 10 Aug. 2015
Bearbeitet: Walter Roberson am 10 Aug. 2015
i have write following code to achieve it
database=cell(5);
for i=1:5
database{i}=imread(['Images/Database/' int2str(i) '.jpg']);
subplot(3,2,i),imshow(database{i});
end
but it is giving error-"Undefined function or method 'sublpot' for input arguments of type 'double'"
Your error message says "sublpot" which would be a misspelling of "subplot"
Continuing on from what I wrote earlier:
imgdir = 'Images/Database';
nument = length(matching_entries);
for K = 1 : nument
subplot(nument, 1, K)
thisimgfile = fullfile(imgdir, matching_entries(K).image_name);
thisimg = imread(thisimgfile);
imshow(thisimg);
end
sweta arya
sweta arya am 11 Aug. 2015
Thank you
sweta arya
sweta arya am 11 Aug. 2015
from where i can collect images (of poor,average & high quality) for my analysis?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by