I'm trying to save an image with the same name after editing on opencv. I can save with the same name. But I can't save in different file. So, this is my code:
import cv2
import numpy as np
import glob
filename = [img for img in glob.glob("./mypath_1/*.jpg")]
flist=sorted(filename)
images = []
path='./mypath_2/'
for image in flist:
img= cv2.imread(image)
alpha=2
beta=-420
img2=cv2.addWeighted(img,alpha,np.zeros(img.shape,img.dtype),0,beta)
hsv = cv2.cvtColor(img2, cv2.COLOR_BGR2HSV)
cv2.imwrite( path+image, hsv)
Additionally, I tried this: cv2.imwrite( './mypath_2/'+image, hsv).
I do not save the image and I do not have a message error in this code.
Some suggestion?