2017-02-28 1 views
1

파노라마 이미지 스티칭 작업 중이며 imread 기능에서 형식 오류가 발생했습니다. PNG 파일의 서명이 잘못되었습니다. 봤지만 아무 것도 찾지 못했습니다. 오류의 원인을 설명해 주시겠습니까?PNG 파일의 서명이 올바르지 않습니다.

편집 : baseInputPath + 내가 그렇게 corrupted.Now가 성공 작업을 재 변환 파일을 PNG로 JPEG 파일을 변환 시작 부분에서 경로 = 입력/PanoramaImage30/image1.png

baseInputPath='Input/' 
baseOutputPath='Output/' 

def imread(path='in.png'): 
    '''reads a PNG RGB image at baseInputPath+path and return a numpy array organized along Y, X, channel. 
    The values are encoded as float and are linearized (i.e. gamma is decoded)''' 
    global baseInputPath 
    print baseInputPath+path 
    reader=png.Reader(baseInputPath+path) 
    im=reader.asFloat() 
    a=numpy.vstack(im[2]) 
    if im[3]['greyscale']: 
     raise NameError('Expected an RGB image, given a greyscale one')   
    x, y=im[0], im[1] 
    a.resize(y, x, 3) 
    a**=2.2 
    return a 
+1

아마도 PNG 파일 중 하나가 손상되었거나 전혀 PNG 파일이 아닙니다. 이미지 뷰어에서 열 수 있습니까? – DyZ

+0

코멘트를 주셔서 감사합니다. 내가 png로 jpeg 파일을 변환 했으므로 파일이 손상되었습니다. 이제는 다시 변환하고 성공으로 작업합니다. –

답변

0

.