zhiqingstudy

Be a young person with knowledge and content

Opencv loads an image and displays it in the window.
To load an image, you only need an api, imread (path, flag)
Two parameters of imread:
  1. Path: Your image path
  2. Flag: There are two commonly used values, IMREAD_ COLOR normally displays the rgb color image. If it is not filled in, it is also the default attribute value. IMREAD_ GRAYSCALE displays gray and white pictures.

import cv2
from cv2 import IMREAD_COLOR
from cv2 import IMREAD_GRAYSCALE

cv2.namedWindow('img',cv2.WINDOW_NORMAL)
# 创建窗口并命名窗口和窗口是否可以改变大小
img=cv2.imread('你的图片路径',IMREAD_COLOR)
# 加载图片,导入图片地址和图片的显示方式
cv2.imshow('img',img)
# 显示图片
cv2.waitKey(0)
# 窗口一直显示

cv2.destroyAllWindows()
# 关闭所有窗口

comment
head sculpture
Code:
Related

Why you shouldn't stay at a job for more than 2 years?

3 harsh facts long-distance relationships

how to keep your girlfriend interested in a long-distance relationship




Unless otherwise specified, all content on this website is original. If the reprinted content infringes on your rights, please contact the administrator to delete it
Contact Email:2380712278@qq.com

Filing number:皖ICP备19012824号