Main Content

Install and Use Computer Vision Toolbox Interface for OpenCV in MATLAB

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:

  • If you are viewing the current page using installed documentation, click

  • Select Get Add-ons from the Add-ons drop-down menu from the MATLAB® desktop. The Add-on files are in the “MathWorks Features” section.

  • Type visionSupportPackages in 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 the visionopencv folder. To find the path to this folder, type the following command:

fileparts(which('mexOpenCV')) 
The visionopencv folder contain these files and folder.

FilesContents
clibopencv folder

Prebuilt utility functions based on the MATLAB clib package for OpenCV interface.

mexOpenCV.m file

Function to build MEX-files.

example folderTemplate Matching, Foreground Detector, and Oriented FAST and Rotated BRIEF (ORB) examples using MEX-files. Each subfolder in the example folder contains a README.txt file with step-by-step instructions.
registry folderRegistration files.
README.txt fileHelp file.

The mex function 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 bitMicrosoft® Visual Studio® 2015 or later (Professional or Community editions)
Linux® 64 bitgcc-4.9.3 (g++)
Mac 64 bitXcode 6.2.0 (Clang++)