. NET + OpenCV & amp; Python + OpenCV

Source: Internet
Author: User

Recently, we need to make a GUI application for image recognition, weigh Opencv + 1) QT, 2) Python GUI, 3). NET and select. NET...

This article provides references for C # + Opencv and Python + Opencv to save your time.

(1) C #. NET + Opencv

1) download and install the Emgu Library (for opencv on. NET env)

Download @ http://sourceforge.net/projects/emgucv/

2) How to use opencv on C #?

Configure Emgu (database) on)

3) Test on C #. NET

(2) Python + Opencv

According to the Instruction step by step on the official website, you can compile it from the source or directly use a binary file.

Note the following error: undefined cv2.SIFT ():

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

In some cases, it is explained that the high version uses SIFT as a non-free module and requires compilation. For details, refer to this post.

However, I still did not solve the problem after compilation... So try to replace opencv 2.3.1 with opencv, and copy cv2.pyd to python in the Instruction pre-compiled binary file method on the official website ....

PS: I like to take a look at this post on mac... Installing OpenCV 2.4.2 on Mac OSX Mountain Lion with Python support

Finally, paste a python + opencv + numpy test code:

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()


More learning materials about Computer Vision will be updated. Please stay tuned to this blog and Sina Weibo Rachel ____ Zhang.

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.