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)