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

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