2

这是之前发布的关于在 python 中使用 OpenCVs 密集筛选实现的问题( OpenCV-Python 密集筛选)的后续问题。

使用建议的代码进行密集筛选

    dense=cv2.FeatureDetector_create("Dense")
    kp=dense.detect(imgGray)
    kp,des=sift.compute(imgGray,kp)

我有以下问题:

谢谢!

4

1 回答 1

3

您可以使用以下内容查看当前(默认)选项:

dense = cv2.FeatureDetector_create('Dense')
f = '{} ({}): {}'
for param in dense.getParams():
    type_ = dense.paramType(param)
    if type_ == cv2.PARAM_BOOLEAN:
        print f.format(param, 'boolean', dense.getBool(param))
    elif type_ == cv2.PARAM_INT:
        print f.format(param, 'int', dense.getInt(param))
    elif type_ == cv2.PARAM_REAL:
        print f.format(param, 'real', dense.getDouble(param))
    else:
        print param

然后你会得到如下输出:

featureScaleLevels (int): 1
featureScaleMul (real): 0.10000000149
initFeatureScale (real): 1.0
initImgBound (int): 0
initXyStep (int): 6
varyImgBoundWithScale (boolean): False
varyXyStepWithScale (boolean): True

您可以按以下方式更改选项:

dense.setDouble('initFeatureScale', 10)
dense.setInt('initXyStep', 3)
于 2015-08-27T10:29:44.287 回答