logo
Loading...

cv2的讀取問題 - Cupoy

Hi,我已經安裝完 openCV,但是似乎無法讀取到 cv2 的參數,請問該如何解決?程式碼如下:i...

cv2的讀取問題

2019/11/25 12:30 PM
電腦視覺深度學習論壇
觀看數:0
回答數:2
收藏數:0

Hi,我已經安裝完 openCV,但是似乎無法讀取到 cv2 的參數,請問該如何解決?


程式碼如下:


import numpy as np

import cv2


img_path = 'data/lena.png'


# Load an color image in grayscale

img = cv2.imread('messi5.jpg',0)


cv2.imshow('image',img)

cv2.waitKey(0)

cv2.destroyAllWindows()




然後出現的4個錯誤訊息如下:


Module 'cv2' has no 'imread' member

Module 'cv2' has no 'imshow' member

Module 'cv2' has no 'waitKey' member

Module 'cv2' has no 'destroyAllWindows' member