Opencv-python Learning Notes __python

Source: Internet
Author: User

* * output picture

**
Import the CV2 package in OpenCV, and then have functions like imread,imshow to read and display the picture.

Cv2.waitkey (0) to keep the window, waiting for the keyboard input, if the keyboard does not enter, it will always wait.
Cv2.destroyallwindows () deletes any window that we want to delete.

Focus on Cv2.namedwindow ("image", Cv2. Window_normal), it allows the displayed picture to automatically resize the shape. Without this line of code, there is no corresponding effect.

Import cv2

img=cv2.imread (' 09.jpg ')
Cv2.namedwindow ("image", Cv2. Window_normal)
cv2.imshow ("image", img)
cv2.waitkey (0)
cv2.destroyallwindows ()

Diagram:

Original:

To stretch a picture manually:

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.