2

我对 MATLAB 版本 R2012b 有疑问。insertShape和都是detectMinEigenFeatures“计算机视觉系统工具箱”的功能。我已经安装了“计算机视觉系统工具箱”。这是 的输出ver,显示了所有已安装的工具箱。

MATLAB Version: 8.0.0.783 (R2012b)
MATLAB License Number: 724504
Operating System: Microsoft Windows 7 Version 6.2 (Build 9200)
Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode

MATLAB                                                Version 8.0        (R2012b)
Simulink                                              Version 8.0        (R2012b)
Bioinformatics Toolbox                                Version 4.2        (R2012b)
Computer Vision System Toolbox                        Version 5.1        (R2012b)
Curve Fitting Toolbox                                 Version 3.3        (R2012b)
DSP System Toolbox                                    Version 8.3        (R2012b)
Fuzzy Logic Toolbox                                   Version 2.2.16     (R2012b)
Global Optimization Toolbox                           Version 3.2.2      (R2012b)
Image Processing Toolbox                              Version 8.1        (R2012b)
MATLAB Builder NE                                     Version 4.1.2      (R2012b)
MATLAB Compiler                                       Version 4.18       (R2012b)
MATLAB Report Generator                               Version 3.13       (R2012b)
Mapping Toolbox                                       Version 3.6        (R2012b)
Neural Network Toolbox                                Version 8.0        (R2012b)
Optimization Toolbox                                  Version 6.2.1      (R2012b)
Parallel Computing Toolbox                            Version 6.1        (R2012b)
Signal Processing Toolbox                             Version 6.18       (R2012b)
Spreadsheet Link EX                                   Version 3.1.6      (R2012b)
Statistics Toolbox                                    Version 8.1        (R2012b)
System Identification Toolbox                         Version 8.1        (R2012b)
Wavelet Toolbox

我测试的代码是这样的:

%Create System objects for reading and displaying video and for drawing a bounding box of the object.
videoFileReader = vision.VideoFileReader('visionface.avi');
videoPlayer = vision.VideoPlayer('Position', [100, 100, 680, 520]);

%Read the first video frame, which contains the object, define the region.
objectFrame = step(videoFileReader);
objectRegion = [264, 122, 93, 93];

%As an alternative, you can use the following commands to select the object region using a mouse. The object must occupy the majority of the region. 
figure; imshow(objectFrame);
objectRegion=round(getPosition(imrect))

%Show initial frame with a red bounding box.
objectImage = insertShape(objectFrame, 'Rectangle', objectRegion,'Color', 'red'); 
figure; imshow(objectImage); title('Yellow box shows object region');

%Detect interest points in the object region.
points = detectMinEigenFeatures(rgb2gray(objectFrame), 'ROI', objectRegion);

当我运行此代码时,我收到此错误:

未定义函数“insertShape”和“detectMinEigenFeatures”,用于“single”和“double”类型的输入参数

问题是什么?

4

2 回答 2

4

似乎两者detectMinEigenFeatures都是insertShape从 matlab 版本开始引入的r2013a。您正在运行r2012b,这些功能在计算机视觉工具箱中尚不存在。

因此,如果您能够升级到r2013a我认为您的问题应该得到解决。

于 2013-04-11T06:58:37.983 回答
2

R2012b 中有一个解决方法。您可以使用 vision.CornerDetector 系统对象,它还实现了最小特征值角点检测算法。

于 2013-10-17T14:09:56.080 回答