python opencv调用cuda,从python使用Opencv Cuda函数

本文讲述了如何在Python中利用Cython访问OpenCV的CUDA库,特别是cuda::warpPerspective和cv::cuda::DescriptorMatcher::knnMatch()函数。在尝试实现knnMatch时遇到问题,错误提示为'Ptr<DescriptorMatcher>'没有属性'knnMatch'。解决方案是正确地在Cython中定义Ptr,包括其析构函数和解引用操作符。
摘要由CSDN通过智能技术生成

For one of my course projects, I need to use the OpenCVs GPU libraries. I am working on an existing code where OpenCV python is used and my work is to find a way to access the OpenCV Cuda libraries as right now there are no accessible Python bindings to OpenCV's various CUDA modules.

Two of the functions that i extremely need right now are cuda::warpPerspective and cv::cuda::DescriptorMatcher::knnMatch().

i tried to implement the warpPerspective by following what @ostrumvulpes suggested in Accessing OpenCV CUDA Functions from Python (No PyCUDA) and it is working perfectly. Right now i am stuck in DescriptorMatcher::knnMatch(). To be more precise, i need to use the brute-force descriptor matchers knnmatch function (CUDA). i searched online for example written in C++, so that i get an initial idea how to convert it via cython to make it work.

Most of the examples that i found is like following:

Ptr<:descriptormatcher> matcher =

cuda::DescriptorMatcher::createBFMatcher();

vector< vector< DMatch> > matches;

matcher->knnMatch(descriptors_object_Gpu, descriptors_scene_Gpu, matches, 2);

To implement these three lines i first added what i thought was necessary in the .pxd file. My pxd file looks like the following:

GpuWrapper.pxd

from libcpp cimport bool</

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值