I am not able to proceed after this step
f='/content/drive/My Drive/resized'
f_len=len(f)
os.mkdir('grayscale20')
for image in os.listdir(f):
img=os.path.join(f,image)
img = cv2.imread(f)
grayImg = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
#grayImg = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imwrite("grayscale",+f[folderLen:],grayImg)
cv2.destroyAllWindows
而不是img = cv2.imread(f)
你应该使用img = cv2.imread(img)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.