opencv的python接口实现_『OpenCV3』Harris角点特征_API调用及python手动实现

一、OpenCV接口调用示意

介绍了OpenCV3中提取图像角点特征的函数:

1 # coding=utf-8

2 import cv23 import numpy asnp4

5

6 '''Harris算法角点特征提取'''

7

8 img = cv2.imread('chess_board.png')9 gray =cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)10 gray =np.float32(gray)11

12 # {标记点大小,敏感度(3~31,越小越敏感)}13 # OpenCV函数cv2.cornerHarris() 有四个参数 其作用分别为 :14 #img -Input image, it should be grayscale and float32 type.15 #blockSize - It is the size of neighbourhood considered forcorner detection16 #ksize -Aperture parameter of Sobel derivative used.17 #k - Harris detector free parameter in the equation,在0.04到0.05之间18 dst = cv2.cornerHarris(gray,2,23,0.04)19 img[dst>0.01 * dst.max()] = [0,0,255]20

21 cv2.imshow('corners',img)22 cv2.waitKey()23 cv2.destroyAllWindows()

dst = cv2.cornerHarris(gray,2,23,0.04)中第3个参数(23)调整对结果影响如下:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值