Python OpenCV – destroyWindow() Function
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
img = cv2.imread( "Documents/Image3.jpg" ,
cv2.IMREAD_COLOR)
cv2.imshow( "I1" , img)
cv2.imshow( "I2" , img)
cv2.waitKey( 0 )
cv2.destroyWindow( "I2" )
|
Output:
Last Updated :
03 Jan, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...