i have data set of images first i read the image then i convert it to grey and i want to save it after dividing each grey image by 255 i try
files = os.listdir(path)
for file in files:
folder = os.listdir(newdir+'\\'+file)
for f in folder:
folder2 = os.listdir(newdir+'\\'+file+'\\'+f)
if not os.path.exists(dstpath+'\\'+file+'\\'+f):
os.makedirs(dstpath+'\\'+file+'\\'+f)
for image in folder2:
img = cv2.imread(os.path.join(newdir+'\\'+file+'\\'+f+'\\',image))
pic = asarray(img)
pic = pic.astype('float32')
gray = cv2.cvtColor(pic,cv2.COLOR_BGR2GRAY)
dist = dstpath+'\\'+file+'\\'+f+'\\'+image
cv2.imwrite(dist,(gray / 255).astype('uint8'))
but when i check photos they are all black