1. 程式人生 > >opencv常見bug:could not find a writer for the specified extension in function cv::imwrite_

opencv常見bug:could not find a writer for the specified extension in function cv::imwrite_

在opencv學習中,使用cv.imwrite(‘filename’, img)儲存照片檔案到本地,有時使用失誤可能會出現報錯,error: (-2) could not find a writer for the specified extension in function cv::imwrite_
我的程式碼裡出現這個錯誤是因為‘filename’只寫了檔名字,忘記加副檔名,應加上.jpg或.png等照片副檔名。