『python』電腦視覺_OpenCV3角點特徵Harris提取方法

來源:互聯網
上載者:User

標籤:alt   介紹   color   nump   str   free   param   調整   key   

因為當下的計劃是熟悉語言和庫,而映像特徵提取脫離理論就很沒意思了,並且很可能事倍功半,所以電腦視覺特徵提取這部分跳過,直接開始和深度學習結合較為緊密的目標檢測&識別部分。

本節介紹了OpenCV3中提取映像角點特徵的函數:

 1 # coding=utf-8 2 import cv2 3 import numpy as np 4  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 for corner 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)調整對結果影響如下:

取值為3時:

取值為23時:

『python』電腦視覺_OpenCV3角點特徵Harris提取方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.