Freeing Ram by deleting image matrix
I have a simple code
import cv2
import numpy as np
Image = cv2.imread('blue.jpg')
Threshold = np.zeros(Image.shape, np.uint8)
cv2.threshold(Image, 121, 255, cv2.THRESH_BINARY, Threshold)
cv2.imshow("WindowName", Threshold )
cv2.waitKey(0)
cv2.destroyAllWindows()
I want to delete matrix
"Image" from memeory i.e clear memory to save space in ram
How can i acheive this
Why do you want to do it manually? Just let it go out of scope and python will clean up for you.
what if i want to delete it manually . What syntax shalll i use
Just call deallocate(). That will empty the data from the Mat, but there will be a tiny amount of overhead. This does what you want though.
Is there a deallocate in python?