gpt4 book ai didi

python - OpenCV-Python 密集 SIFT 设置

转载 作者:太空宇宙 更新时间:2023-11-03 21:26:53 25 4
gpt4 key购买 nike

这是先前发布的关于在 python 中使用 OpenCVs 密集筛选实现的问题的后续问题 (OpenCV-Python dense 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)

关于python - OpenCV-Python 密集 SIFT 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29970191/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com