to store SURF features of 10 images in a single variable

1 view (last 30 days)
i have an array called node_2. in that array i have 10 images. what i am trying to do is, detect SURF features for all 10 images and store the SURF features for all 10 images in a single variable db in such a way so that, if i put db(1) then i will get the feature for image 1, db(2) to get the feature of image 2 etc. but i am getting only the feature of the last image that is image 10 in the variable. my code is
for k = 1:number_of_elements_in_node % number of element is 10 in a particular case
db_points_in_node = detectSURFFeatures(images{node(k)});
[db_feature_node, db_points_in_node] = extractFeatures(images{c1(1)}, db_points_in_node);
db_pts = db_feature_node(1:150);
diff = f3 - db_pts;
sum_diff = sum(diff);
end
in this, if i am doing db_feature_node = , then i am only getting the feature point of the 10th image. and if i am doing
db_points_in_node(k) = detectSURFFeatures(images{node(k)});
then it is showing, 'Subscripted assignment dimension mismatch.' any help would be highly appreciated. i am not very good in coding, so i would really appreciate, if nobody posts any rude comment. thank you very much in advance.

Answers (1)

Star Strider
Star Strider on 30 Jun 2015
I can’t run your code, so a wild guess would be that:
db_points_in_node(k) = detectSURFFeatures(images{node(k)});
is attempting to assign a larger array to a single scalar variable. That always fails.
See if:
db_points_in_node{k} = detectSURFFeatures(images{node(k)});
(that is, making a cell array out of ‘db_points_in_node’) helps.

Community Treasure Hunt

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

Start Hunting!