I am trying to open and save an image in the local folder using cv2.imread and cv2.imwrite in OpenCV using Python. I want that the next time I run the code the previously saved images should be deleted. Is there any method in OpenCV which can delete an image from the specified folder. Please note that I want to delete the image, not overwrite on it.
Any kind of help will be appreciated. Thank you.
import os
try:
os.remove("my.png")
except: pass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With