How do i store Images on database based on extracted features, then retrieve image based on image query?
4 次查看(过去 30 天)
显示 更早的评论
Dear Experiences..
- i have 100 images in folder called (D:\images)..
- i have extracted feature from every single image where the extracted features are represented as matrix (M x 128),
- where M refer to feature matrix rows and 128 are feature extracted columns... for all images columns are fixed but rows are differs based on size of an image...
- feature matrix are numeric matrix...
- so, i need a way to store all images (100 images) in Database or such other structure content based on image features.. and when i need to retrieve an image .. its compare query image feature matrix to those in database then retrieve similar one... (i think here pairwise distance or such other metric must be used)...
so, i will thank any one can give me an advices or help me in this issue...
thanks..
0 个评论
采纳的回答
Walter Roberson
2017-7-23
"so, i need a way to store all images (100 images) in Database or such other structure content based on image features.."
Well, you could use containers.Map to use the features as an index to store values. However, since none of your actual images are likely to result in a feature vector that exactly matches, bit for bit, then this is not going to be useful.
In short, don't do that. Instead just store all of the feature vectors for the known images, and then when a probe image comes in, use pdist2 to compare its feature vector to all of the known ones to find the known image that is most like the probe image.
6 个评论
Walter Roberson
2017-7-25
My code line
this_feature_vector = extract_features(this_file_name);
represents a call to a function that takes in a file name and returns a vector of values.
Glancing at detectSURFFeatures and extractFeatures, it looks to me as if the number of features returned can vary from image to image. The code I have written expects that the same number will be returned each time. It is difficult to define the "distance" between two feature vectors if the two have different sizes.
更多回答(1 个)
Image Analyst
2017-7-23
You can save your (poorly-named) database variable "M" in a .mat file with save().
save(fullFileName, 'M');
You can retrieve M with load().
storedStructure = load(fullFileName); % Get everything fro mfile.
M = storedStructure.M; % Extract the "M" field from the structure.
You can compare your current image's features to M with functions such as find(), ismember(), ismembertol(), or the double equals operator "==", etc.
If you need an "official" database, like Oracle, Access, or something similar, then you might want to get the Database Toolbox.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!