Opencv-python:surt Demo One

Source: Internet
Author: User

#-*-coding:utf-8-*-#author:lyp TIME:2018/8/3ImportCv2ImportNumPy as Npimg= Cv2.imread ('lyp.jpg') grayimg=Cv2.cvtcolor (IMG, Cv2. Color_bgr2gray) Surf= Cv2.xfeatures2d.SURF_create (upright=True) KP, des=Surf.detectandcompute (grayimg, None) Img2= Cv2.drawkeypoints (IMG, KP, None, (0, 255, 0), Cv2. draw_matches_flags_draw_rich_keypoints) Cv2.imshow ('SURF Image', Img2) Cv2.waitkey () cv2.destroyallwindows ()

0. Function explanation

 retval=cv2xfeatures2d. Surf_create ([, hessianthreshold[, noctaves[, noctavelayers[, extended[, upright] []])                    

hessianthreshold:h matrix thresholds, default value is 100, Key points larger than this threshold will be displayed, the recommended range is 300-500
Extended: Whether to extend the surf description dimension, the default value is False, the extended description of the 128 dimension is computed by the extension, otherwise the description of the 64 dimension is calculated by default (fast)
Upright: whether to calculate the direction of the surf description, the default value is False, and the run is faster without calculation
keypoints=cv2.Feature2D.detect(image[, mask]) 关键点keypoints, descriptors=cv2.Feature2D.compute(image, keypoints[, descriptors]) 特征描述向量

1.参考来自
小林的CV视觉工坊

Opencv-python:surt Demo One

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.