看板 Python 關於我們 聯絡資訊
#OpenCV版本是3.1.0 Python為2.7 先讀取一張圖片 img = cv2.imread("D:/lena.jpg") 我要利用split分別取得b,g,r b, g, r = cv2.split(img) 只是在上面那行就會出現錯誤 Traceback (most recent call last): File "histogram3.py", line 5, in <module> b,g,r = cv2.split(img) ValueError: need more than 0 values to unpack 這是我放置於gist的程式 https://goo.gl/yG2mJd 想請各位幫忙看看 謝謝 :D -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 163.18.42.216 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1464761134.A.F93.html
tiefblau: 你imread沒讀到檔案 路徑錯了之類的~ 06/01 14:38
tiefblau: 所以split回一個空白list 然後就無法unpack給三個變數 06/01 14:39
dwadefans: 了解 謝謝! 他沒有讀取到沒有提示錯誤 06/01 20:34
BlueKidds: 沒有讀取到的要自己寫 06/02 21:49