Java中的OpenCv:已弃用DescriptorExtractor.我该怎么用呢? [英] OpenCv in Java: DescriptorExtractor is deprecated. What do I use instead?

查看:708
本文介绍了Java中的OpenCv:已弃用DescriptorExtractor.我该怎么用呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些示例代码,该示例代码使用OpenCV(Java包装器)将2张图像缝合在一起.它是指已弃用的"DescriptorExtractor"类.我在官方Web文档或源代码中找不到有关我应该使用的内容的任何信息.当某些东西被弃用时,我总是很生气,它没有告诉您应该使用什么.

I have some sample code which uses OpenCV (Java wrapper) to stitch 2 images together. It refers to a class "DescriptorExtractor" which is deprecated. I can't find any information in the official web documentation or the source-code about what I should use instead. I always get annoyed when something is deprecated and it doesn't tell you what you should use instead.

有人可以帮助我吗?

我正在使用带有预建Windows库的OpenCV 3.4.1.

I'm using OpenCV 3.4.1 with pre-built Windows libraries.

该类的官方文档似乎在此处.

The official documentation for the class seems to be here.

"FeatureDetector"类同样已被弃用,同样也没有任何提示.

The "FeatureDetector" class is likewise deprecated, likewise without any hint about what to use instead.

推荐答案

我同意Java中的Deprecated批注应该带有必需的参数,该参数将提供有关不赞成使用的元素的后继者的信息(如果有的话).

I agree that Deprecated annotation in Java should have come with a required parameter which would provide information about the successor of the deprecated element, if any.

在C ++ docs的OpenCV版本3.4.5(可能更早)中,DescriptorExtractor被定义为Feature2D的类型别名(请参见

In OpenCV version 3.4.5 (and maybe earlier) in C++ docs DescriptorExtractor is defined as a type alias for Feature2D (see here):

typedef Feature2D DescriptorExtractor

所以我相信您应该切换到 类,将适当地更新其用法.

so I believe you should switch to org.opencv.features2d.Feature2D class in your Java code updating its usages as appropriate.

使用OpenCV包装器(包括用于Java和Python的包装器)以及相应的自动生成的文档,通常很难推断出任何使用情况信息-与C ++源代码和文档进行协商是一个好主意,这似乎是手工的.

With OpenCV wrappers (including ones for Java and Python) and corresponding auto-generated documentation, it is usually hard to infer any usage information - it is a good idea to consult with C++ sources and documentation, which appears to be hand-written.

这篇关于Java中的OpenCv:已弃用DescriptorExtractor.我该怎么用呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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