I get "Undefined variable "vision" or class "vision.CascadeObjectDetector"" error in matlab

emreturan picture emreturan · Dec 11, 2012 · Viewed 7.5k times · Source

I try to detect faces in image using matlab. I found many demos for this purpose. All demos are using vision.CascadeObjectDetector class. But my matlab always throws exception that is "Undefined variable "vision" or class "vision.CascadeObjectDetector", even trying to call vision class in command window

Computer Vision System Toolbox was already installed.

Where is the problem and how can I solve it?

Installed toolbox list;

MATLAB                                                Version 7.13       (R2011b)
Simulink                                              Version 7.8        (R2011b)
Aerospace Blockset                                    Version 3.8        (R2011b)
Aerospace Toolbox                                     Version 2.8        (R2011b)
Bioinformatics Toolbox                                Version 4.0        (R2011b)
Communications System Toolbox                         Version 5.1        (R2011b)
Computer Vision System Toolbox                        Version 4.1        (R2011b)
Control System Toolbox                                Version 9.2        (R2011b)
Curve Fitting Toolbox                                 Version 3.2        (R2011b)
DO Qualification Kit                                  Version 1.5        (R2011b)
DSP System Toolbox                                    Version 8.1        (R2011b)
Data Acquisition Toolbox                              Version 3.0        (R2011b)
Database Toolbox                                      Version 3.10       (R2011b)
Datafeed Toolbox                                      Version 4.2        (R2011b)
EDA Simulator Link                                    Version 3.4        (R2011b)
Econometrics Toolbox                                  Version 2.0.1      (R2011b)
Embedded Coder                                        Version 6.1        (R2011b)
Filter Design HDL Coder                               Version 2.9        (R2011b)
Financial Derivatives Toolbox                         Version 5.8        (R2011b)
Financial Toolbox                                     Version 4.1        (R2011b)
Fixed-Income Toolbox                                  Version 2.2        (R2011b)
Fixed-Point Toolbox                                   Version 3.4        (R2011b)
Fuzzy Logic Toolbox                                   Version 2.2.14     (R2011b)
Global Optimization Toolbox                           Version 3.2        (R2011b)
IEC Certification Kit                                 Version 2.0        (R2011b)
Image Acquisition Toolbox                             Version 4.2        (R2011b)
Image Processing Toolbox                              Version 7.3        (R2011b)
Instrument Control Toolbox                            Version 3.0        (R2011b)
MATLAB Builder EX                                     Version 2.1        (R2011b)
MATLAB Builder JA                                     Version 2.2.3      (R2011b)
MATLAB Builder NE                                     Version 4.1        (R2011b)
MATLAB Coder                                          Version 2.1        (R2011b)
MATLAB Compiler                                       Version 4.16       (R2011b)
MATLAB Distributed Computing Server                   Version 5.2        (R2011b)
MATLAB Report Generator                               Version 3.11       (R2011b)
Mapping Toolbox                                       Version 3.4        (R2011b)
Model Predictive Control Toolbox                      Version 4.0        (R2011b)
Model-Based Calibration Toolbox                       Version 4.3        (R2011b)
Neural Network Toolbox                                Version 7.0.2      (R2011b)
OPC Toolbox                                           Version 3.1        (R2011b)
Optimization Toolbox                                  Version 6.1        (R2011b)
Parallel Computing Toolbox                            Version 5.2        (R2011b)
Partial Differential Equation Toolbox                 Version 1.0.19     (R2011b)
Phased Array System Toolbox                           Version 1.1        (R2011b)
RF Toolbox                                            Version 2.9        (R2011b)
Robust Control Toolbox                                Version 4.0        (R2011b)
Signal Processing Toolbox                             Version 6.16       (R2011b)
SimBiology                                            Version 4.0        (R2011b)
SimDriveline                                          Version 2.1        (R2011b)
SimElectronics                                        Version 2.0        (R2011b)
SimEvents                                             Version 4.0        (R2011b)
SimHydraulics                                         Version 1.10       (R2011b)
SimMechanics                                          Version 3.2.3      (R2011b)
SimPowerSystems                                       Version 5.5        (R2011b)
SimRF                                                 Version 3.1        (R2011b)
Simscape                                              Version 3.6        (R2011b)
Simulink 3D Animation                                 Version 6.0        (R2011b)
Simulink Code Inspector                               Version 1.0        (R2011b)
Simulink Coder                                        Version 8.1        (R2011b)
Simulink Control Design                               Version 3.4        (R2011b)
Simulink Design Optimization                          Version 2.0        (R2011b)
Simulink Design Verifier                              Version 2.1        (R2011b)
Simulink Fixed Point                                  Version 7.0        (R2011b)
Simulink HDL Coder                                    Version 2.2        (R2011b)
Simulink PLC Coder                                    Version 1.2.1      (R2011b)
Simulink Report Generator                             Version 3.11       (R2011b)
Simulink Verification and Validation                  Version 3.2        (R2011b)
Spreadsheet Link EX                                   Version 3.1.4      (R2011b)
Stateflow                                             Version 7.8        (R2011b)
Statistics Toolbox                                    Version 7.6        (R2011b)
Symbolic Math Toolbox                                 Version 5.7        (R2011b)
System Identification Toolbox                         Version 7.4.3      (R2011b)
SystemTest                                            Version 2.6.2      (R2011b)
Vehicle Network Toolbox                               Version 1.5        (R2011b)
Wavelet Toolbox                                       Version 4.8        (R2011b)
xPC Target                                            Version 5.1        (R2011b)
xPC Target Embedded Option                            Version 5.1        (R2011b)

Answer

gerrit picture gerrit · Dec 11, 2012

This error strongly points toward the computer vision system toolbox not being installed.

To make sure that it is installed, type ver at the Matlab command prompt. For me, this outputs:

>> ver
-------------------------------------------------------------------------------------------------------
MATLAB Version: 8.0.0.783 (R2012b)
MATLAB License Number: xxxxxx (edited out)
Operating System: Linux 2.6.35-32-generic #67-Ubuntu SMP Mon Mar 5 19:39:49 UTC 2012 x86_64
Java Version: Java 1.6.0_26-b03 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------------------------
MATLAB                                                Version 8.0        (R2012b)
Simulink                                              Version 8.0        (R2012b)
Curve Fitting Toolbox                                 Version 3.3        (R2012b)
Fuzzy Logic Toolbox                                   Version 2.2.16     (R2012b)
Global Optimization Toolbox                           Version 3.2.2      (R2012b)
Image Acquisition Toolbox                             Version 4.4        (R2012b)
Image Processing Toolbox                              Version 8.1        (R2012b)
M2HTML Toolbox - A Documentation Generator for ...    Version 1.5                
MATLAB Coder                                          Version 2.3        (R2012b)
MATLAB Compiler                                       Version 4.18       (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)
Partial Differential Equation Toolbox                 Version 1.1        (R2012b)
Signal Processing Toolbox                             Version 6.18       (R2012b)
Statistics Toolbox                                    Version 8.1        (R2012b)
Symbolic Math Toolbox                                 Version 5.9        (R2012b)
System Identification Toolbox                         Version 8.1        (R2012b)
Wavelet Toolbox                                       Version 4.10       (R2012b)

As you can see, I do not have this toolbox installed. Do you?