缺少OpenCV透明API UMat [英] OpenCV Transparent API UMat is missing
问题描述
我试图在桌面Java应用程序中使用OpenCV
Transparent API
UMat
类进行硬件加速,但是我找不到UMat
类的实现.我正在使用OpenCV version 4.1
,其中说T-API
java绑定可以从version 3.0
上获取,如
I tried to use OpenCV
Transparent API
UMat
class for hardware acceleration in my desktop java application but I couldn't find the UMat
class implementation. I'm using OpenCV version 4.1
, where T-API
java bindings are said to be available up from version 3.0
as said here:
引入了T-API(透明API),这是透明的GPU 加速层使用OpenCL.它不增加任何编译时间或 OpenCL的运行时依赖项.当OpenCL可用时,它会被检测到 和使用,但可以在编译时或运行时禁用它.它 涵盖约100个OpenCV函数.这项工作是按合同完成的, 在AMD和Intel公司的大力支持下.
T-API (transparent API) has been introduced, this is transparent GPU acceleration layer using OpenCL. It does not add any compile-time or runtime dependency of OpenCL. When OpenCL is available, it’s detected and used, but it can be disabled at compile time or at runtime. It covers ~100 OpenCV functions. This work has been done by contract and with generous support from AMD and Intel companies.
-
T-API
是否已弃用?是的话,用什么取代它? - 顺便说一句,什么是
OpenCV Graph API
G-API ?是T-API
的替代品吗? - Is
T-API
deprecated? If yes, what replaces it? - And by the way what is the
OpenCV Graph API
G-API? Is it a replacement for theT-API
?
推荐答案
让我们分解这个问题.
是否已弃用T-API?如果是,则用什么代替?
否,T-API没有被有效地弃用.您可以在此处看到它, T-API在OpenCV 4.1.2版本标记下仍然有效. 您的主要问题是T-API没有实际的Java包装器,因为我们可以看到UMat 实现.opencv.org/3.4/javadoc/org/opencv/core/package-summary.html"rel =" nofollow noreferrer> OpenCV Java文档.
No, T-API is not effectively deprecated. You can see it here, that the T-API is still alive under the OpenCV 4.1.2 version tag. Your main issue is that there is no actual Java wrapper for the T-API, as we can see at this answer and we can't see a UMat implementation under the OpenCV Java Docs.
那么,OpenCV Graph API G-API是什么?它是T-API的替代品吗?
再次,查看文档,我们阅读了:
Again, looking at the docs, we read:
OpenCV 3.0引入了透明API(或T-API),该API允许将OpenCV函数调用透明地卸载到OpenCL设备,并使用cv :: UMat保存主机/设备上的数据传输,这是向前迈出的一大步.但是,T-API是动态API –用户代码仍然不受限制,并且OpenCL内核以任意顺序排队,从而消除了进一步的管道级优化潜力. G-API将隐式图形模型引入了OpenCV 4.0.图形模型捕获了管道中的所有操作及其数据依赖性,因此为G-API框架提供了额外的信息来进行管道级的优化.
OpenCV 3.0 introduced Transparent API (or T-API) which allowed to offload OpenCV function calls transparently to OpenCL devices and save on Host/Device data transfers with cv::UMat – and it was a great step forward. However, T-API is a dynamic API – user code still remains unconstrained and OpenCL kernels are enqueued in arbitrary order, thus eliminating further pipeline-level optimization potential. G-API brings implicit graph model to OpenCV 4.0. Graph model captures all operations and its data dependencies in a pipeline and so provides G-API framework with extra information to do pipeline-level optimizations.
正如所记载的那样,G-API似乎不是替代品",而是OpenCV硬件加速计划的改进和改进. G-API不仅对未组织的内核进行了一些优化的操作,还为新版本的OpenCV带来了面向管道/图形的范例.
As it is documented, the G-API doesn't seems to be a "replacement", but more like and improvement of the OpenCV hardware accelerating initiatives. Instead of having just some optimized operations over unorganized kernels, G-API brings a pipe-line/graph oriented paradigm to the newer versions of OpenCV.
这篇关于缺少OpenCV透明API UMat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!