如何在新的OpenCV中替换FeatureDetector函数? [英] How should I replace FeatureDetector function in new OpenCV?

查看:399
本文介绍了如何在新的OpenCV中替换FeatureDetector函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了Java OpenCV的示例代码。在几行代码中,编译器表示已弃用 FeatureDetectore()方法。

I have downloaded a sample code of Java OpenCV. In few lines of the code there is FeatureDetectore() method that the compiler says it's deprecated.

    FeatureDetector detector = FeatureDetector.create(FeatureDetector.MSER);
    detector.detect(mGrey, keypoint);
    listpoint = keypoint.toList();

那么,我应该如何替换这部分代码?是否有其他新选择?
还是可以继续使用不推荐使用的功能?

So, How should I replace this part of code? Are there any new alternative for this? or can I continue use of the deprecated function?

推荐答案

您可以继续执行此操作,它将起作用。弃用意味着建议使用新的替代方法,但是当然,旧代码仍然可以使用。执行此操作的新方法是使用 FastFeatureDetector AgastFeatureDetector 取决于您的用例。我不熟悉OpenCV,因此很遗憾,我无法推荐您需要哪种确切的实现,您需要阅读JavaDoc /其他文档并找出哪种适合您的代码。

You can continue with this and this will work. Deprecation means that there is new recommended alternative, but off course old code will still work. The new way of doing that would be using FastFeatureDetector or AgastFeatureDetector depending on your use case. I am not familiar with OpenCV so unfortunately I can't recommend which exact implementation you need, you need to read JavaDoc/other docs and find out which would fit your code.

这篇关于如何在新的OpenCV中替换FeatureDetector函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆