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.