繁体   English   中英

OpenCV-Python密集SIFT设置

[英]OpenCV-Python Dense SIFT Settings

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

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

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

我有以下问题:

  • 我可以在python中访问任何DenseFeatureDetector属性吗? 设置或至少阅读?
  • c ++ FeatureDetector :: create成为python FeatureDetector_create背后的逻辑是什么? 我如何基于文档( http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_feature_detectors.html )知道呢?
  • 关于VLFeat库的python包装器有什么建议吗? pyvlfeat仍然是要走的路吗(我尝试设置pyvlfeat,但未在Mac上编译)?

谢谢!

您可以通过以下方式查看当前(默认)选项:

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)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM