Main Content

安装和使用电脑视觉工具箱OpenCV接口金宝app

您可以通过使用opulink模型导入OpenCV代码金宝appOpenCV进口商应用。该OpenCV进口商应用程序仅在安装后可用Simulink中OpenCV的计算机Vision Tool™接口金宝app®金宝app支持包。

安装

要安装支持包,请首先单击金宝appAdd-Onsdrop-down list on the MATLAB®选项卡,然后选择获取附加组件。在里面Add-OnsExplorer window, find and click the电脑视觉工具箱OpenCV接口Simulink金宝app支持包,然后单击安装

将OpenCV代码导入金宝app

To start theOpenCV进口商,点击应用在Matlab Toolstrip上。单击向下箭头以显示更多选项。下My Apps,点击theOpenCV进口商应用图标。或者,您可以启动OpenCV进口商从命令行界面。在MATLAB命令行,输入:

Simulink.OpenCVImporter

该OpenCV import wizard opens to a Welcome page.

  1. 在里面项目名字段,为导入指定名称。您可以启动从以前导入保存的新导入或加载文件。项目保存在。m文件格式。要从上一个导入中浏览保存的文件,请选择Load a file saved from a previous import。点击下一个

  2. 在“指定OpenCV库”页面中,指定C ++库信息。如果导入以前保存的项目文件,则所有字段都是自动划分的。

    • Project root folder:您要保存输出文件(包装文件和Simulink库)的可写文件夹路径。金宝app

    • 源文件:OpenCV source file path. Specify the.cpp.文件格式。如果你提供一个绝对路径the wizard uses the file from the specified location. If you do not provide the absolute path, then the wizard uses the path relative to the project root.

    • 包含文件:标题文件路径。指定.HPP.文件格式。如果你提供一个绝对路径the wizard uses the file from the specified location. If you do not provide the absolute path, then the wizard uses the path relative to the project root.

    • Include paths:定义任何其他包含文件夹(文件夹信息)。Matlab OpenCV包括文件。

    • 图书馆路径:指定path to external library files.

    如果您有多个文件或文件夹指定,请使用分号分隔的文件或文件夹列表。点击下一个

  3. 要查找导入的功能和类型,请单击分析库金宝app下一个。分析完成后,单击下一个

  4. 在里面What to Import page, the functions that电脑视觉工具箱OpenCV接口Simulink金宝app支持支持。选择要导入Simulink库的函数,然后单击金宝app下一个

  5. I / O类型对应于映射到Simulink模型中的OpenCV函数参数。金宝app这些不同I / O类型支持:金宝app

    • Input- for input arguments

    • 输出- 用于输出参数

    • 输入输出- 用于输入输出参数

    To select the input/output types, double-click the输出option in theI / O类型列下拉列表,然后单击下一个

  6. 在里面Create Simulink Library page, you can generate either just a subsystem block or a subsystem block and a C Caller block of the selected function. A C Caller block integrates your OpenCV data into Simulink. The generated subsystem block contains C Caller blocks configured by using data conversion blocks.

    To generate a subsystem block and a C Caller block, selectCreate a single C-caller block for the OpenCV function那and then click下一个

    如果OpenCV代码包含一个数据类型,默认输出大小为(720,1280,3)默认的底层类型是uint8.。对于vector,默认大小是100。您可以根据您的型号要求更改默认大小。

  7. A Simulink libraryprojectname_lib.slx.从OpenCV代码创建到项目根文件夹中。该库包含子系统块和C调用程序块。

    您可以将任何这些块拖到模型中,将它们连接到模型中的现有块,并运行模型仿真。

    该wizard also creates wrapper files for source and header files.

Limitations

电脑视觉工具箱OpenCV接口Simulink金宝app支持包:

  • 使用OpenCV作为MATLAB第三方支持的一部分。金宝app您可以获得OpenCV的其他功能Add-Ons(电脑视觉工具箱)。

  • 不支持外部Open金宝appCV库(例如,opencv_contrib)。

  • 不支持金宝appInnoorararry.OutporArray.那andinputOutputarray.数据类型。

  • Requires微软®视觉工作室®2015年或2017年专业和社区版用于Windows 64操作系统。有关编译器的更多信息,请参阅用于构建OpenCV库的编译器

  • Supports C++ code generation that uses row-major array layout.

也可以看看

|

Related Topics