Stuck on computer vision example

1 view (last 30 days)
okey
okey on 6 Nov 2013
Answered: Walter Roberson on 17 Jul 2015
Hi I am trying to implement the computer vision example found on
and this is my code:
clear
clc
%%Step1: Read images
% Read reference Image containing the object to be recognised
boxImage = imread('stapleRemover.jpg');
%Convert image to 2D grayscale. Needed by detectSURFFeatures() function.
grayscaleboxImage = rgb2gray(boxImage);
figure; imshow(grayscaleboxImage);
title('Image of a box');
% Read the target image containing the cluttered scene
sceneImage = imread('clutteredImage.jpg');
%Convert image to 2D grayscale. Needed by detectSURFFeatures() function.
grayscaleSceneImage = rgb2gray(sceneImage);
figure; imshow(grayscaleSceneImage);
title('Image of a Cluttered Scene');
%%Step2: Detect Feature Points
%Detect feature points in both images
boxPoints = detectSURFFeatures(grayscaleboxImage);
scenePoints = detectSURFFeatures(grayscaleSceneImage);
% visualize the strongest feature points found in the reference image
figure; imshow(grayscaleboxImage);
title('100 strongest feature points from Box Image');
hold on;
plot(boxPoints.selectStrongest(100));
% visualize the strongest feature points found in the target image
figure; imshow(grayscaleSceneImage);
title('3000 stongest feature points from scene Image');
hold on;
plot(scenePoints.selectStrongest(300));
%%Step3: Extract feature descriptors
% xtract feature descriptors at the interest points in both images
[boxFeatures,boxPoints] = extractFeatures(grayscaleboxImage,boxPoints);
[sceneFeatures,scenePoints] = extractFeatures(grayscaleSceneImage,scenePoints);
%%Step4: Find Putative (assumed) Point Matches
%Match the features using their descriptors.
boxPairs = matchFeatures(boxFeatures,sceneFeatures);
%Display putatively matched features
matchedBoxPoints = boxPoints(boxPairs(:,1),:);
matchedScenePoints = scenePoints(boxPairs(:,2),:);
figure;
showMatchedFeatures(grayscaleboxImage,grayscaleSceneImage,matchedBoxPoints,matchedScenePoints,'montage');
title('Putatively Matched Points (Including Outliers)');
I get this error message:
Warning: Image is too big to fit on screen; displaying at 50%
> In imuitools\private\initSize at 72
In imshow at 259
In ComputerVisionExample at 20
Warning: Image is too big to fit on screen; displaying at 50%
> In imuitools\private\initSize at 72
In imshow at 259
In ComputerVisionExample at 35
Error using assert
Too many input arguments.
Error in cvstGetCoordsChoice (line 47)
assert(strncmp(clientName, 'fcn', 3) || ...
Error in extractFeatures (line 128)
isXY = cvstGetCoordsChoice('fcnExtractFeatures');
Error in ComputerVisionExample (line 43)
[boxFeatures,boxPoints] = extractFeatures(grayscaleboxImage,boxPoints);
I do not know where I went wrong. Can anyone help out?

Answers (1)

Walter Roberson
Walter Roberson on 17 Jul 2015
Checking around, it appears most probably that you have your own assert.m that is being used instead of the MATLAB assert.m . Please check with
which -all assert
and probably the first entry is something you have added to your MATLAB path.

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!