简体   繁体   English

OpenCV中UMat和Mat有什么区别?

[英]What is the difference between UMat and Mat in OpenCV?

I have been through the documentation and didn't get a clear detailed description about UMat; 我已经阅读了文档,但没有得到关于UMat的详细描述; however I think it has something to relate with GPU and CPU. 但我认为它与GPU和CPU有关。 Please help me out. 请帮帮我。 Thank you. 谢谢。

Perhaps section 3 of this document will help: [link now broken] https://software.intel.com/sites/default/files/managed/2f/19/inde_opencv_3.0_arch_guide.pdf 也许本文档的第3部分将有所帮助:[链接现已破] https://software.intel.com/sites/default/files/managed/2f/19/inde_opencv_3.0_arch_guide.pdf

Specifically, section 3.1: 具体来说,第3.1节:

A unified abstraction cv::UMat that enables the same APIs to be implemented using CPU or OpenCL code, without a requirement to call OpenCL accelerated version explicitly. 统一抽象cv :: UMat,它允许使用CPU或OpenCL代码实现相同的API,而无需显式调用OpenCL加速版本。 These functions use an OpenCL-enabled GPU if exists in the system, and automatically switch to CPU operation otherwise. 如果存在于系统中,这些函数使用支持OpenCL的GPU,否则将自动切换到CPU操作。

and section 3.3: 和第3.3节:

Generally, the cv::UMat is the C++ class, which is very similar to cv::Mat. 通常,cv :: UMat是C ++类,它与cv :: Mat非常相似。 But the actual UMat data can be located in a regular system memory, dedicated video memory, or shared memory. 但实际的UMat数据可以位于常规系统存储器,专用视频存储器或共享存储器中。

Link to usage suggested in the comments by @BourbonCreams : 链接@BourbonCreams评论中建议的用法
https://docs.opencv.org/3.0-rc1/db/dfa/tutorial_transition_guide.html#tutorial_transition_hints_opencl https://docs.opencv.org/3.0-rc1/db/dfa/tutorial_transition_guide.html#tutorial_transition_hints_opencl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM