OpenCv3.2.0+python
来源:互联网 发布:keep 知乎 编辑:程序博客网 时间:2024/06/05 06:32
原始版本:import numpy as npimport cv2from matplotlib import pyplot as pltimg = cv2.imread('simple.jpg',0)# Initiate FAST object with default valuesfast = cv2.FastFeatureDetector()# find and draw the keypointskp = fast.detect(img,None)img2 = cv2.drawKeypoints(img, kp, color=(255,0,0))# Print all default paramsprint "Threshold: ", fast.getInt('threshold')print "nonmaxSuppression: ", fast.getBool('nonmaxSuppression')print "neighborhood: ", fast.getInt('type')print "Total Keypoints with nonmaxSuppression: ", len(kp)cv2.imwrite('fast_true.png',img2)# Disable nonmaxSuppressionfast.setBool('nonmaxSuppression',0)kp = fast.detect(img,None)print "Total Keypoints without nonmaxSuppression: ", len(kp)img3 = cv2.drawKeypoints(img, kp, color=(255,0,0))cv2.imwrite('fast_false.png',img3)修改版本:import numpy as npimport cv2from matplotlib import pyplot as pltimg = cv2.imread('../data/empire.jpg',0)# Initiate FAST object with default valuesfast = cv2.FastFeatureDetector_create()# find and draw the keypointskp = fast.detect(img,None)img2 = cv2.drawKeypoints(img, kp, None, color=(255,0,0))# Print all default params# print "Threshold: ", fast.getThreshold()# print "nonmaxSuppression: ", fast.getNonmaxSuppression()# print "neighborhood: ", fast.getType()# print "Total Keypoints with nonmaxSuppression: ", len(kp)cv2.imwrite('fast_true.png',img2)# Disable nonmaxSuppressionfast.setNonmaxSuppression(0) #this is differentkp = fast.detect(img,None)print "Total Keypoints without nonmaxSuppression: ", len(kp)img3 = cv2.drawKeypoints(img, kp, None, color=(255,0,0))cv2.imwrite('fast_false.png',img3)版本问题,将流传的一部分代码修改即可运行~
附上document:http://docs.opencv.org/3.2.0/df/d0c/tutorial_py_fast.html
0 0
- OpenCv3.2.0+python
- Ubuntu16.04+opencv3.2.0+python 版本切换
- python调用Opencv3
- python opencv3 安装
- Python+opencv3.0配置
- Python OpenCV3 图像操作
- Python Opencv3 图片读取
- ubuntu 16.04 安装 opencv3.2.0 with python 3.5
- python opencv3 —— findContours
- Python+OpenCV3 视频文件无法读取
- python-opencv3 kmeans图像分类
- python-opencv3 kmeans图像分类
- Python Opencv3 定位蓝色图片
- VS2015配置opencv3.2.0
- 编译VS2013+opencv3.2.0
- win10x64+opencv3.2.0+vs2017
- 交叉编译opencv3.2.0
- ubuntu16.04+opencv3.2.0
- CSU 1869 中南大学网络赛C题 树上最大值
- HDU4586 Play the Dice (期望)
- springmvc中的注解
- 第八周算法分析与设计:Permutation Sequence
- 学习淘淘商城第二十四课(前台系统工程搭建)
- OpenCv3.2.0+python
- 警车
- POJ 2631 Roads in the North 树上最长路 树型DP
- git推送项目到github
- (map简单使用) Flying to the Mars
- poj 3279 Fliptile(开关问题)
- HDU2586【LCA在线算法】
- java直接输出对象
- opencv2.4.9经典版本在VS2010下的安装