MATLAB "Subscript indices must either be real positive integers or logicals" -


in matlab examples page computer vision system toolbox, there code object detection in cluttered scene using point feature matching. running same code on system, giving error "subscript indices must either real positive integers or logicals" code tries match similarity between 2 images.

i1 = rgb2gray(imread('kitchen.jpg')); i2 = rgb2gray(imread('loops.jpg')); points1 = detectsurffeatures(i1); points2 = detectsurffeatures(i2); [features1, valid_points1] = extractfeatures(i1, points1); [features2, valid_points2] = extractfeatures(i2, points2); indexpairs = matchfeatures(features1, features2); matchedpoints1 = valid_points1(indexpairs(:, 1), :);    //error matchedpoints2 = valid_points2(indexpairs(:, 2), :); figure; showmatchedfeatures(i1, i2, matchedpoints1, matchedpoints2); 

i new matlab , trying understand concepts got stuck in this. appreciated. thank you.

i tried code (with slight changes) sample image , worked:

//open image = rgb2gray(imread('img_0236.jpg'));  //extract left stereo image i1 = i(:,1:800); //extract right stereo image i2 = i(:,801:1600);  points1 = detectsurffeatures(i1); points2 = detectsurffeatures(i2); [features1, valid_points1] = extractfeatures(i1, points1); [features2, valid_points2] = extractfeatures(i2, points2); indexpairs = matchfeatures(features1, features2); matchedpoints1 = valid_points1(indexpairs(:, 1));     matchedpoints2 = valid_points2(indexpairs(:, 2)); figure; showmatchedfeatures(i1, i2, matchedpoints1, matchedpoints2); 

i downloaded sample image from: http://www.stereomaker.net/java/spva/img_0236.jpg


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -