.NET + OpenCV & Python + OpenCV

來源:互聯網
上載者:User

AttributeError: 'module' object has no attribute 'SIFT'

import cv2import numpy as np#import pdb#pdb.set_trace()#turn on the pdb prompt#test cv2 and numpy packageprint cv2.__version__a = np.arange(10)print(a)#read imageimg = cv2.imread('D:\privacy\picture\little girl.jpg',cv2.IMREAD_COLOR)gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)cv2.imshow('tt',img);#basic accessingb,g,r = img[0,0];#blue,green,redprint b,g,rrows,columns,channels = img.shapeprint rows,columns,channelsprint img.size#channels split and mergeb,g,r = cv2.split(img)img = cv2.merge([b,g,r])#SIFTdetector = cv2.SIFT()keypoints = detector.detect(gray,None)img = cv2.drawKeypoints(gray,keypoints)#img = cv2.drawKeypoints(gray,keypoints,flags = cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)cv2.imshow('test',img);cv2.waitKey(0)cv2.destroyAllWindows()




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.