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

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

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

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章