最近从3.4.5升级OpenCV。到OpenCV 4.2.0。
[我遵循此针迹示例之前:https://github.com/opencv/opencv/blob/5131619a1a4d1d3a860b5da431742cc6be945332/samples/cpp/stitching_detailed.cpp(尤其是第480行)。升级后,我更改了代码以使其更符合此较新的示例:https://github.com/opencv/opencv/blob/master/samples/cpp/stitching_detailed.cpp(注释行481)。
此新computeImageFeatures
功能存在问题,我发现的功能越来越少。具有相同图像的旧代码为我提供了1400多个功能,但computeImageFeatures
为每个图像提供了500个功能。任何想法如何解决这一问题?我相信这也会导致“捆绑调节器”稍后失败。
根据cv::ORB::create
的文档,cv::ORB::create
参数的默认值为nfeatures
:
第一个参数是500
,您可以将第一个参数设置为刨丝器编号,例如nfeatures
。
以下是构造函数参数:
2000
尝试修改:
static Ptr<ORB> cv::ORB::create (int nfeatures = 500,
float scaleFactor = 1.2f,
int nlevels = 8,
int edgeThreshold = 31,
int firstLevel = 0,
int WTA_K = 2,
int scoreType = ORB::HARRIS_SCORE,
int patchSize = 31,
int fastThreshold = 20
)
到
if (features_type == "orb")
{
finder = ORB::create();
}
如果您不使用ORB,而是使用其他类型的功能,请阅读构造函数的文档。我认为所有类型都有一个限制器参数。