OpenCV practice-installing and using Python

Source: Internet
Author: User

OpenCV practice-installing and using Python

Since the next step is to start to study deep learning, many algorithms and applications in the deep learning field are implemented using Python. It takes too much time to convert Python into C ++ code, it is better to directly learn the Python direct medical Python code. Building a Python environment is very time-consuming, but now I think there are not many steps, mainly because various strange problems will always occur when I don't understand it. Now, let's record the correct steps.

Environment setup:

1. There is nothing to say about installing Python. Just keep going to the next step. I installed Python2.7.11. Select to add environment variables during installation.

2. IDE uses Pycharm Community.

3. Install numpy.

4. Find cv2.pyd in the * \ opencv \ build \ python \ 2.7 \ x64 folder and copy it to the * \ Python2.7.11 \ Lib \ site-packages folder of the Python Installation File.

Then you can. Based on my memories, this is enough. Open Pycharm and Create new project, right-click the project created after creation, and choose new and Python file.

Enter your first Python version of opencv program:

Import cv2import numpy as npimg = cv2.imread ("D: \ miao1.jpg") cv2.imshow ("miao", img) cv2.waitKey (10000)

It seems to be simpler than C ++, And the configuration process is simpler than.

The running result is as follows:

Here we only use opencv, which we are most familiar with, to familiarize ourselves with Python. More in-depth application is yet to be studied.

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.