类型错误:'>=' “cv2.cuda_GpuMat”实例之间不支持和“浮动”

发布于 2025-01-14 02:23:21 字数 572 浏览 0 评论 0原文

我在 OpenCV 中使用 GPU 加速器,但我在 CPU 中遇到 numpy 阈值控制问题,如何在对象检测中对 GPU 脚本使用阈值控制?

TypeError: '>=' not supported between instances of 'cv2.cuda_GpuMat' and 'float'
gsrc.upload(source)
gtmpl.upload(need)

matcher = cv.cuda.createTemplateMatching(cv.CV_8UC1, cv.TM_CCOEFF_NORMED)
gresult = matcher.match(gsrc, gtmpl)


gresult = matcher.match(gsrc, gtmpl)
resultg = gresult.download()
min_valg, max_valg, min_locg, max_locg = cv.minMaxLoc(resultg)

loc = np.where( gresult >= threshold)

I am using GPU accelerator in OpenCV, but I have problem with numpy threshold control as in CPU, how can I use threshold control for gpu script in object detection?

TypeError: '>=' not supported between instances of 'cv2.cuda_GpuMat' and 'float'
gsrc.upload(source)
gtmpl.upload(need)

matcher = cv.cuda.createTemplateMatching(cv.CV_8UC1, cv.TM_CCOEFF_NORMED)
gresult = matcher.match(gsrc, gtmpl)


gresult = matcher.match(gsrc, gtmpl)
resultg = gresult.download()
min_valg, max_valg, min_locg, max_locg = cv.minMaxLoc(resultg)

loc = np.where( gresult >= threshold)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文