Python OpenCV - destroyWindow() Function Last Updated : 03 Jan, 2023 Comments Improve Suggest changes Like Article Like Report Python Opencv destroyWindow() function is used to close particular windows. This function takes one parameter that is window name which you want to close or destroy and it doesn't return anything. Syntax: cv2.destroyWindow(window_name) Parameter: window_name: name of the window which you want to destroy Return: This function doesn't return anything destroyWindow() Function - Examples In this example, we will read one image and create multiple windows of it. Then we will destroy any particular window by using the destroyWindow() function. Python3 # import cv2 library import cv2 # Read an image img = cv2.imread("Documents/Image3.jpg", cv2.IMREAD_COLOR) # create two windows of images and # give different window name to each cv2.imshow("I1", img) cv2.imshow("I2", img) # we will wait for user to press any key cv2.waitKey(0) # after user pressed any key only 'I2' named # window will be closed and another image # remains as it is. cv2.destroyWindow("I2") Output: Comment More infoAdvertise with us Next Article Python OpenCV - destroyWindow() Function P patildhanu4111999 Follow Improve Article Tags : Python OpenCV Python-OpenCV Practice Tags : python Similar Reads Python OpenCV - destroyAllWindows() Function Python Opencv destroyAllWindows() function allows users to destroy or close all windows at any time after exiting the script. If you have multiple windows open at the same time and you want to close then you would use this function. It doesn't take any parameters and doesn't return anything. It is s 2 min read Python OpenCV - waitKey() Function waitkey() function of Python OpenCV allows users to display a window for given milliseconds or until any key is pressed. It takes time in milliseconds as a parameter and waits for the given time to destroy the window, if 0 is passed in the argument it waits till any key is pressed. Example: Pythonim 2 min read Python OpenCV - waitKeyEx() Function Python OpenCv waitKeyEx() method is similar to waitKey() method but it also returns the full key code. The key code which is returned is implementation-specific and depends on the used backend: QT/GTK/Win32/etc. Syntax: cv2.waitKey(delay) Parameters: delay: The time in milliseconds after which windo 2 min read Python OpenCV - moveWindow() Function When we show the image using the imshow() function output window will open at the center or default position of a computer screen. Even if there are multiple image windows all windows will be displayed at the same position and we have to move windows manually. If we want to show image windows at a s 2 min read Python OpenCV - namedWindow() Function Python OpenCV namedWindow() method is used to create a window with a suitable name and size to display images and videos on the screen. The image by default is displayed in its original size, so we may need to resize the image for it to fit our screen. Created windows are referred by their names and 3 min read Like