Detection of vertex in opencv for python

Source: Internet
Author: User

The Python operation can find the pixel point in an image. For example, a white pixel with black pixels will be found. import cv2.cv as cv # load imagefilename = ".. /Video/cat.jpg "image = cv. loadImage (filename) # create one windowwin_name = "test" cv. namedWindow (win_name) win2_name = "test2" cv. namedWindow (win2_name) cv. showImage (win2_name, image) # set created imagesize = cv. getSize (image) # (100,100) depth = 8 channels = 1 # gray operategrey = cv. createImage (size, depth, channels) # create one 100x100 single channels imagecv. cvtColor (image, gray, cv. CV_BGR2GRAY) # create the wanted imageseig = cv. createImage (cv. getSize (gray), 32, 1) temp = cv. createImage (cv. getSize (gray), 32, 1) # the default parametersqualityLevel = 0.01min _ Distance = 10 # search the good pointsfeatures = cv. goodFeaturesToTrack (gray, eig, temp, 100, qualityLevel, min_Distance, None, 3, 0, 0.04) for (x, y) in features: # print ("Good feature: ", x, ',', y) cv. circle (image, (int (x), int (y), 2, (255, 0),-1, 8, 0) cv. showImage (win_name, image) cv. waitKey () cv. destroyAllWindows () processing result

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.