Python 预期Ptr<;cv::UMat>;对于参数';%s';
完成此步骤后,我无法继续Python 预期Ptr<;cv::UMat>;对于参数';%s';,python,image-processing,computer-vision,Python,Image Processing,Computer Vision,完成此步骤后,我无法继续 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
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(img)
而不是img=cv2.imread(img)