opencv cv2.imshow automatically add padding to small image
问题 I try to use cv2.imshow() to display images, however I find that the result is padded with blank automatically. The code I use is as following: import cv2 if __name__ == '__main__': img = cv2.imread('test2.png') cv2.imshow('dafasf', img) key = cv2.waitKey(0) if key == 27: # ESC cv2.destroyAllWindows() 回答1: By default imshow creates window object with WINDOW_AUTOSIZE attribute. It means that window size is determined by some frontend (GUI) which OpenCV was compiled with. Your image are not