Main Content

Install and UseComputer Vision ToolboxInterface for OpenCV inMATLAB

Installation

After you install third-party support files, you can use the data with the Computer Vision Toolbox™ product. To install the Add-on support files, use one of the following methods:

  • SelectGet Add-onsfrom theAdd-onsdrop-down menu from the MATLAB®desktop. The Add-on files are in the “MathWorks Features” section.

  • TypevisionSupportPackagesin a MATLAB Command Window and follow the prompts.

Note

You must have write privileges for the installation folder.

When a new version of MATLAB software is released, repeat this process to check for updates. You can also check for updates between releases.

Support Package Contents

The Computer Vision Toolbox Interface for OpenCV in MATLAB support files are installed in thevisionopencvfolder. To find the path to this folder, type the following command:

fileparts(which('mexOpenCV'))
Thevisionopencv文件夹包含这些文件和文件夹。

Files Contents
clibopencvfolder

Prebuilt utility functions based on the MATLABclibpackage for OpenCV interface.

mexOpenCV.mfile

Function to build MEX-files.

examplefolder Template Matching, Foreground Detector, and Oriented FAST and Rotated BRIEF (ORB) examples using MEX-files. Each subfolder in the example folder contains aREADME.txtfile with step-by-step instructions.
registryfolder Registration files.
README.txtfile Help file.

Themexfunction uses prebuilt OpenCV libraries, which ship with the Computer Vision Toolbox product. Your compiler must be compatible with the one used to build the libraries. The following compilers are used to build the OpenCV libraries for MATLAB host:

Operating System Compatible Compiler
Windows®64 bit Microsoft®Visual Studio®2015 or later (Professional or Community editions)
Linux®64 bit gcc-4.9.3 (g++)
Mac64 bit Xcode 6.2.0 (Clang++)