MathWorks - Mobile View
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
MathWorks
  • Products
  • Solutions
  • Academia
  • Support
  • Community
  • Events
  • Get MATLAB
  • Sign In to Your MathWorks AccountSign In to Your MathWorks Account
  • Access your MathWorks Account
    • My Account
    • My Community Profile
    • Link License
    • Sign Out

Videos and Webinars

  • MathWorks
  • Videos
  • Videos Home
  • Search
  • Videos Home
  • Search
  • Contact sales
  • Trial software
  Register to watch video
  • Description
  • Full Transcript
  • Related Resources

Computer Vision Toolbox OpenCV Interface for Simulink

Kautilya V, MathWorks

The Computer Vision Toolbox™ OpenCV Interface for Simulink® simplifies converting programs created with OpenCV, an open source computer vision library, into Simulink blocks that can be used to integrate computer vision capabilities into a control system. The interface needs Computer Vision Toolbox and can be installed as an add-on.

The interface has options to name the blocks being created, select various functions, specify whether the arguments are inputs or outputs, and set the default parameters. From this information, the interface automatically creates Simulink blocks that can be integrated into any Simulink model.

An example is shown using smile detection OpenCV code to analyze The Mona Lisa’s smile. For more information, various discovery pages and documentation pages are available.

Welcome to a video on the OpenCV Interface in Simulink.

OpenCV is an open source computer vision library. This video shows you the ease of converting programs created with OpenCV into Simulink blocks that you can use to integrate computer vision capabilities into your control system.

To use the OpenCV interface in Simulink Add-On, you will need the Computer Vision Toolbox. To install this Add-On, open the “Add-On Explorer” by clicking on “Add-Ons” in “Home”. Search for “OpenCV in Simulink” and click on the “Computer Vision Toolbox Interface for OpenCV in Simulink” to open it. Install it.

To show you how to use the interface, “let’s use an example to detect if someone is smiling in an image. To run the interface, you can open it from the “APPS” tab or run it from the command window by entering the command to open the app. Enter a project name such as “SmileDetectionDemo”, select “Start a new import”, and click the “next” button. Specify the information on where the files are located and click “next” twice to start the parsing. Parsing analyzes the files to find functions and types that may be imported. Once the parsing is complete, open the next page and select the functions you want to import and click “next”.

Specify whether an argument is an input, output or both. This is done to define the inputs and outputs for the Simulink block being created.For this example, we change the “img” argument to an “Input” and click next.

Finally, we change the default parameters as needed and click next. A new window with newly created blocks should appear. These are Simulink blocks of the OpenCV SmileDetection code. Close the interface window. To test the newly created block, open “smileDetect.slx”. This is a model that uses the newly created block to identify whether a person in an image is smiling. We will use this model to identify whether the Mona Lisa is really smiling. Integrate the subsystem block into it and change the image parameters and click run. A window pops up with Looks like she isn’t smiling.

For more information on the Add-on tool and to see various examples, please refer to the documentation page: “OpenCV Interface Support for Simulink”.

Thank you for watching.

Related Products

  • Computer Vision Toolbox
  • Simulink

Feedback

Featured Product

Computer Vision Toolbox

  • Request Trial
  • Get Pricing

Up Next:

2:13
What Is Computer Vision Toolbox?

Related Videos:

42:27
Machine Learning and Computer Vision for Medical Imaging...
40:27
Machine Learning and Computer Vision for Biological Imaging...
7:35
Deep Learning for Computer Vision with MATLAB (Highlights)
46:56
Computer Vision with MATLAB for Object Detection and...

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • Contact sales
  • Trial software

Explore Products

  • MATLAB
  • Simulink
  • Student Software
  • Hardware Support
  • File Exchange

Try or Buy

  • Downloads
  • Trial Software
  • Contact Sales
  • Pricing and Licensing
  • How to Buy

Learn to Use

  • Documentation
  • Tutorials
  • Examples
  • Videos and Webinars
  • Training

Get Support

  • Installation Help
  • Answers
  • Consulting
  • License Center
  • Contact Support

About MathWorks

  • Careers
  • Newsroom
  • Social Mission
  • Contact Sales
  • About MathWorks

MathWorks

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Discover…

  • Select a Web Site United States
  • Patents
  • Trademarks
  • Privacy Policy
  • Preventing Piracy
  • Application Status
  • Modern Slavery Act Transparency Statement

© 1994-2021 The MathWorks, Inc.

  • Facebook
  • Twitter
  • Instagram
  • YouTube
  • LinkedIn
  • RSS

Join the conversation