Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of OpenCV Image processing in python

Shulou Source: shulou.com Published: 2022-06-03 17:37:12 09月27日 Update

This article mainly introduces the example analysis of OpenCV image processing in python, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

OpenCV is commonly used in dealing with pictures. In this article, let's take a look at its specific use.

1. The data reads the image.

# read color picture data img = cv2.imread (r "C:\ Users\ admin\ Desktop\ ztz.jpg") print (img)

2, the display of pictures, you can also create multiple windows.

Img = cv2.imread (r "C:\ Users\ admin\ Desktop\ ztz.jpg") # Image display, you can also create multiple windows # Parameter 1: picture name Custom Parameter 2: picture object cv2.imshow ('img', img) # waiting time for image display, millisecond: 0 indicates that any key terminates cv2.waitKey (0) cv2.destroyAllWindows ()

3, the attribute of the picture, the number of rows corresponds to the y on the axis, that is, it represents the height of the image. The number of columns corresponds to the y on the axis, that is, the height of the image.

Img = cv2.imread (r "C:\ Users\ admin\ Desktop\ ztz.jpg") print (img.shape) # number of rows, columns, color channels print (img.size) # Pixels of the picture Thank you for reading this article carefully. I hope the article "sample Analysis of OpenCV Image processing in python" shared by the editor will be helpful to you. At the same time, I hope you will support it and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Pictures images articles processing image processing examples analysis parameters coordinates axes multiple data height number value pixels interest at the same time name object Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Linux Huawei Microsoft