开发者

Python中OpenCV图像特征和harris角点检测

目录
  • 概念
    • 第一步:计算一个梯度 Ix,Iy
    • 第二步:整合矩阵,计算特征值
    • 第三步:比较特征值的大小
    • 第四步: 非UgcJPgI极大值抑制,把真正的角点留下来,角点周围的过滤掉
  • 代码实现

    概念

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    第一步:计算一个梯度 Ix,Iy

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    第二步:整合矩阵,计算特征值

    Python中OpenCV图像特征和harris角点检测

    第三步:比较特征值的大小

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    第四步: 非极大值抑制,把真正的角点留下来,角点周围的过滤掉

    代码实现

    Python中OpenCV图像特征和harris角点检测

    import cv2
    import numpy as np
    
    img =cv2.imread('pie.png')http://www.cppcns.com
    print('img.shape',img.shape)
    gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
    #gray = np.float32(gray)
    d编程客栈st = cv2.cornerHarris(gray,2,3,0.04)
    print('dst.shape',dst.shape)

    Python中OpenCV图像特征和harris角点检测

    img[dst>0.01*dwww.cppcns.comst.max()]=[0,0,255]
    cv2.imshow('dst',img)
    cv2.wUgcJPgIaitKey(0)
    cv2.destroyAllWindows()

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    Python中OpenCV图像特征和harris角点检测

    到此这篇关于python中OpenCV图像特征和harris角点检测的文章就介绍到这了,更多相关OpenCV-图像特征-harris角点检测内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!

    0

    上一篇:

    下一篇:

    精彩评论

    暂无评论...
    验证码 换一张
    取 消

    最新开发

    开发排行榜