I'm trying to run a code that divides a video into frames while filtering it to greyscale (using threads) and I've got this error trying to run my code:
File "C:\Users\USER\PycharmProjects\ASCIIPICproject\venv\lib\site-packages\matplotlib\artist.py", line 1160, in _update_props raise AttributeError( AttributeError: Line2D.set() got an unexpected keyword argument 'cmap'
this is my code (of the function for the filtering thread):
def saveFramesFiltered():
currentFrame = 0
framemax = 215
while currentFrame < framemax:
while not os.path.exists("./framesBefore/frame" + str(currentFrame) + '.jpg'):
time.sleep(0.01)
lock.acquire()
image = pltim.imread("./framesBefore/frame" + str(currentFrame) + '.jpg')
lock.release()
r, g, b = image[:, :, 0], image[:, :, 1], image[:, :, 2]
grayImage = 0.299 * r + 0.587 * g + 0.114 * b
plt.plot(grayImage, cmap="gray")
plt.axis("off")
lock.acquire()
plt.savefig("./framesAfter/grayImage" + str(currentFrame) + ".jpg", bbox_inches='tight', pad_inches=0)
lock.release()
time.sleep(0.01)