Python calls Opencv3 and pythonopencv3

Source: Internet
Author: User

Python calls Opencv3 and pythonopencv3

1. First download the current python version 2.7.10

2. Use pip install numpy to install numpy.

An error may occur. Install the c compiler. Follow the prompts to download the corresponding version aka. ms/vcpython27.

Run "pip install numpy" again to install numpy.

3. Download opencv3.0 directly from the official website. It is an exe installation package and will automatically complete the installation.

4. Copy the installation package corresponding to "\ OpenCV \ build \ python \ 2.7" under the opencv installation directory to "\ Lib \ site-packages" under the Python27 directory.

5. Continue using:

Import cv2img = cv2.imread ("a.jpg") cv2.namedWindow ("Image") cv2.imshow ("Image", img) cv2.waitKey (0) cv2.destroyAllWindows ()

Display a.jpg in the current directory.

Note that "cv2" is still called here.


OpenCV3.0.0 is used to test the KNearest method. It is always reported that this module cannot be found and OpenCV2.4.8 is re-installed. It is found that this method can be used. I don't know if OpenCV3 is not installed properly.

-- The KNearest method in OpenCV is invalid and the corresponding method is not found.




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.