相关文章推荐
率性的砖头  ·  Google Advertising ID ...·  1 年前    · 
爱逃课的剪刀  ·  xslt replace \n with ...·  1 年前    · 
想出家的绿茶  ·  有关WiFi ...·  1 年前    · 
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) gray = cv2.medianBlur(gray, 3) edges = cv2.adaptiveThreshold(gray, 255, cv2.ADAPIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 7, 7) cv2.imwrite("./uotput_image.jpg", edges)

它出現下面錯誤。

error    Traceback (most recent call last)
<ipython-input-2-d3dd0507c5b7> in <module>()
      9 img = cv2.imread("people1.jpg")
---> 10 gray = cv2.cvtColor(img, cv2.COLORBGR2GRAY)
     11 gray = cv2.medianBlur(gray, 3)
     12 edges = cv2.adaptiveThreshold(gray, 255, cv2.ADAPIVETHRESHMEANC, cv2.THRESHBINARY, 7, 7)
error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !src.empty() in function 'cvtColor'

請問我該怎麼辦?