Matlab 2018a中未定义的变量“vision”或类“vision.OpticalFlow”

时间:2018-04-17 17:21:34

标签: matlab computer-vision

我在我的Ubuntu机器上安装了Matlab 2018a(linux版本)。我正在尝试计算视频的光流量,其中出现上述错误。 Google搜索表明,这可能是由两个问题造成的,要么使用旧版本的Matlab(如2009),要么可能未安装计算机视觉工具箱。

我有最新版本的Matlab,但仍然遇到此错误,我还安装了所需的工具箱,可以从ver

的输出命令中看到
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.4.0.813654 (R2018a)
MATLAB License Number: 893265
Operating System: Linux 4.13.0-38-generic #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018 x86_64
Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB                                                Version 9.4         (R2018a)
Simulink                                              Version 9.1         (R2018a)
Aerospace Blockset                                    Version 3.21        (R2018a)
Aerospace Toolbox                                     Version 2.21        (R2018a)
Antenna Toolbox                                       Version 3.1         (R2018a)
Audio System Toolbox                                  Version 1.4         (R2018a)
Automated Driving System Toolbox                      Version 1.2         (R2018a)
Bioinformatics Toolbox                                Version 4.10        (R2018a)
Communications System Toolbox                         Version 6.6         (R2018a)
Computer Vision System Toolbox                        Version 8.1         (R2018a)
Control System Toolbox                                Version 10.4        (R2018a)
Curve Fitting Toolbox                                 Version 3.5.7       (R2018a)
DSP System Toolbox                                    Version 9.6         (R2018a)
Database Toolbox                                      Version 8.1         (R2018a)
Datafeed Toolbox                                      Version 5.7         (R2018a)
Econometrics Toolbox                                  Version 5.0         (R2018a)
Embedded Coder                                        Version 7.0         (R2018a)
Filter Design HDL Coder                               Version 3.1.3       (R2018a)
Financial Instruments Toolbox                         Version 2.7         (R2018a)
Financial Toolbox                                     Version 5.11        (R2018a)
Fixed-Point Designer                                  Version 6.1         (R2018a)
Fuzzy Logic Toolbox                                   Version 2.3.1       (R2018a)
GPU Coder                                             Version 1.1         (R2018a)
Global Optimization Toolbox                           Version 3.4.4       (R2018a)
HDL Coder                                             Version 3.12        (R2018a)
HDL Verifier                                          Version 5.4         (R2018a)
Image Acquisition Toolbox                             Version 5.4         (R2018a)
Image Processing Toolbox                              Version 10.2        (R2018a)
Instrument Control Toolbox                            Version 3.13        (R2018a)
LTE HDL Toolbox                                       Version 1.1         (R2018a)
LTE System Toolbox                                    Version 2.6         (R2018a)
MATLAB Coder                                          Version 4.0         (R2018a)
MATLAB Compiler                                       Version 6.6         (R2018a)
MATLAB Compiler SDK                                   Version 6.5         (R2018a)
MATLAB Report Generator                               Version 5.4         (R2018a)
Mapping Toolbox                                       Version 4.6         (R2018a)
Model Predictive Control Toolbox                      Version 6.1         (R2018a)
Neural Network Toolbox                                Version 11.1        (R2018a)
Optimization Toolbox                                  Version 8.1         (R2018a)
Parallel Computing Toolbox                            Version 6.12        (R2018a)
Partial Differential Equation Toolbox                 Version 3.0         (R2018a)
Phased Array System Toolbox                           Version 3.6         (R2018a)
Polyspace Bug Finder                                  Version 2.5         (R2018a)
Polyspace Code Prover                                 Version 9.9         (R2018a)
Powertrain Blockset                                   Version 1.3         (R2018a)
Predictive Maintenance Toolbox                        Version 1.0         (R2018a)
RF Blockset                                           Version 7.0         (R2018a)
RF Toolbox                                            Version 3.4         (R2018a)
Risk Management Toolbox                               Version 1.3         (R2018a)
Robotics System Toolbox                               Version 2.0         (R2018a)
Robust Control Toolbox                                Version 6.4.1       (R2018a)
Signal Processing Toolbox                             Version 8.0         (R2018a)
SimBiology                                            Version 5.8         (R2018a)
SimEvents                                             Version 5.4         (R2018a)
Simscape                                              Version 4.4         (R2018a)
Simscape Driveline                                    Version 2.14        (R2018a)
Simscape Electronics                                  Version 2.13        (R2018a)
Simscape Fluids                                       Version 2.4         (R2018a)
Simscape Multibody                                    Version 5.2         (R2018a)
Simscape Power Systems                                Version 6.9         (R2018a)
Simulink 3D Animation                                 Version 8.0         (R2018a)
Simulink Check                                        Version 4.1         (R2018a)
Simulink Code Inspector                               Version 3.2         (R2018a)
Simulink Coder                                        Version 8.14        (R2018a)
Simulink Control Design                               Version 5.1         (R2018a)
Simulink Coverage                                     Version 4.1         (R2018a)
Simulink Design Optimization                          Version 3.4         (R2018a)
Simulink Design Verifier                              Version 3.5         (R2018a)
Simulink Report Generator                             Version 5.4         (R2018a)
Simulink Requirements                                 Version 1.1         (R2018a)
Simulink Test                                         Version 2.4         (R2018a)
Stateflow                                             Version 9.1         (R2018a)
Statistics and Machine Learning Toolbox               Version 11.3        (R2018a)
Symbolic Math Toolbox                                 Version 8.1         (R2018a)
System Identification Toolbox                         Version 9.8         (R2018a)
Text Analytics Toolbox                                Version 1.1         (R2018a)
Trading Toolbox                                       Version 3.4         (R2018a)
Vehicle Dynamics Blockset                             Version 1.0         (R2018a)
Vehicle Network Toolbox                               Version 4.0         (R2018a)
Vision HDL Toolbox                                    Version 1.6         (R2018a)
WLAN System Toolbox                                   Version 1.5         (R2018a)
Wavelet Toolbox                                       Version 5.0         (R2018a)

使用命令OpticalFlow计算opticalFlowClass = vision.OpticalFlow('OutputValue', Horizontal and vertical components in complex form', 'Method', 'Horn-Schunck')时出现以下错误:

Undefined variable "vision" or class "vision.OpticalFlow".

Error in Video2OpticalFlow (line 28)
        opticalFlowClass = vision.OpticalFlow('OutputValue', ...

有人可以指导我为什么会收到此错误? 谢谢

1 个答案:

答案 0 :(得分:1)

我发现了为什么它不起作用.. vision.OpticalFlow已从最新版本的Matlab中删除,如果使用opticalFlowHS

,我们建议使用Horn-Schunck method

更多详细信息:https://uk.mathworks.com/help/vision/ref/opticalflow-class.html