UMat和OpenCV中的Mat有什么区别? [英] What is the difference between UMat and Mat in OpenCV?
问题描述
我已经阅读了文档,但没有获得有关UMat的清晰详细描述;但是我认为它与GPU和CPU有关.请帮帮我. 谢谢.
I have been through the documentation and didn't get a clear detailed description about UMat; however I think it has something to relate with GPU and CPU. Please help me out. Thank you.
推荐答案
本文档的第3节可能会有所帮助:[现在断开链接] https://software.intel.com/sites /default/files/managed/2f/19/inde_opencv_3.0_arch_guide.pdf
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.1节:
Specifically, section 3.1:
一个统一的抽象cv :: UMat,它可以使用CPU或OpenCL代码实现相同的API,而无需显式调用OpenCL加速版本.如果系统中存在这些功能,则使用启用了OpenCL的GPU,否则将自动切换到CPU操作.
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. These functions use an OpenCL-enabled GPU if exists in the system, and automatically switch to CPU operation otherwise.
和第3.3节:
通常,cv :: UMat是C ++类,与cv :: Mat非常相似.但是实际的UMat数据可以位于常规系统内存,专用视频内存或共享内存中.
Generally, the cv::UMat is the C++ class, which is very similar to cv::Mat. But the actual UMat data can be located in a regular system memory, dedicated video memory, or shared memory.
链接到 @BourbonCreams 的注释中建议的用法:
https://docs.opencv.org/3.0-rc1/db /dfa/tutorial_transition_guide.html#tutorial_transition_hints_opencl
Link to usage suggested in the comments by @BourbonCreams:
https://docs.opencv.org/3.0-rc1/db/dfa/tutorial_transition_guide.html#tutorial_transition_hints_opencl
这篇关于UMat和OpenCV中的Mat有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!