OpenCV-Python密集SIFT设置 [英] OpenCV-Python Dense SIFT Settings

查看:244
本文介绍了OpenCV-Python密集SIFT设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

This is a follow-up question to the previously posted question about using OpenCVs dense sift implementation in python (OpenCV-Python dense SIFT).

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

Using the suggested code for a dense sift

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

我有以下问题:

  • Can I access any of the DenseFeatureDetector properties in python? Set or at least read?
  • What is the logic behind c++s FeatureDetector::create becoming pythons FeatureDetector_create? How can I know that based on the documentation (http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_feature_detectors.html)?
  • Any recommendation on a python wrapper for VLFeat Library? Is pyvlfeat still the way to go (I tried to setup pyvlfeat but it didn't compile on my mac)?

谢谢!

推荐答案

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

You can see current (default) options with the following:

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

然后您将得到类似以下的输出:

Then you'd get an output like the following:

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

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

You can alter the options as the following:

dense.setDouble('initFeatureScale', 10)
dense.setInt('initXyStep', 3)

这篇关于OpenCV-Python密集SIFT设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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