IndentationError: unindent does not match any outer indentation level 一种奇葩的问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_27382047/article/details/80498244

运行了人家的代码,结果中间多了一行'''的注释就出现这个行不匹配的问题,还是经同学想到才发现的= =

注意中间的'''注释''',删了就解决

def PILMat_to_cvMat(image):
	'''
	Change the matrix from the format of PIL to openCV.
	'''
    mat =[]
    for l in image:
        x=[]
        for l2 in l:
            r,g,b = l2[0],l2[1],l2[2]
            x.append([b,g,r])
        mat.append(x)

    new_image = np.asarray(mat)
    return new_image

猜你喜欢

转载自blog.csdn.net/sinat_27382047/article/details/80498244