"python" Computer Vision _OPENCV3 Corner features Harris extraction method

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.