close

Error Problem:

'error: /io/opencv/modules/imgproc/src/imgwarp.cpp:3483: error: (-215) ssize.width > 0 && ssize.height > 0 in function resize'

 

解決方式: 

當讀取影像後,

再加入個判斷式,

確認影像確實有讀取,

才進行resize動作,

程式碼如下:

img = cv2.imread('test.jpg')
if img is not None:
    img = cv2.resize(img, (224, 224), interpolation=cv2.INTER_CUBIC)

 

※查詢其他OpenCV用法如下※

openCV應用總整理: 點擊我

 

arrow
arrow

    楓綺 發表在 痞客邦 留言(0) 人氣()