python-openCV展示图像不全的问题
这通常是由于图像分辨率过高导致的问题,有以下解决方案
- 使用
cv2.namedWindow
(该方法会导致图像失真严重)
cv2.namedWindow("image", cv2.WINDOW_GUI_NORMAL)
cv2.imshow("image", image)
- 调整图像尺寸(推荐先使用pyautogui获取当前屏幕大小,按一定比例缩放图像尺寸,也可以手动指定缩放比例)
screen_width, screen_height = pyautogui.size()
scale = screen_height / frame.shape[0]-0.1
frame = cv2.resize(frame, None, fx=scale, fy=scale)
cv2.imshow("image", frame)