Because the current plan is familiar with the language and library, and the image feature extraction theory is very boring, and it is likely to be inefficient, so the computer Vision feature extraction This Part skipped, direct start and deep learning with a closer target detection & recognition part.
This section describes the functions that extract the corner features of an image in OpenCV3:
1# coding=utf-82 Import Cv23Import NumPy asNP4 5 6 " "Corner feature extraction of Harris algorithm" "7 8img = Cv2.imread ('Chess_board.png')9Gray =Cv2.cvtcolor (img,cv2. Color_bgr2gray)TenGray =Np.float32 (gray) one a# {mark Point size, sensitivity (3~ to, the smaller the more sensitive)} - # The OPENCV function Cv2.cornerharris () has four parameters whose function is: -#img-Input image, It should be grayscale and float32 type. the#blockSize-it isThe size of neighbourhood considered forCorner Detection -#ksize-Aperture parameter of Sobel derivative Used. -#k-harris Detector Free parameterinchThe equation, in 0.Genevato 0.05 -DST = Cv2.cornerharris (gray,2, at,0.04) +Img[dst>0.01* Dst.max ()] = [0,0,255] - +Cv2.imshow ('Corners', Img) a Cv2.waitkey () atCv2.destroyallwindows ()
DST = Cv2.cornerharris (gray,2,0.04) the 3rd parameter (23) adjustment affects the result as Follows:
The value is 3 o'clock:
The value is 23 o'clock:
"python" Computer Vision _OPENCV3 Corner features Harris extraction method