[問題] OpenCV: Assertion Failed in cv::Mat
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++ 2010
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
OpenCV
問題(Question):
我執行的動作是讀取兩張圖片來進行比對。
圖片數量有幾十張,所以用一個迴圈依序讀進兩張圖片。
例:第一次讀01.jpg + 02.jpg
第二次02.jpg留著,再讀一張新的03.jpg
比對時只針對特定區域,故使用cv::MAT(圖, cv::Rect(x,y,width,height))截取區域
錯誤結果(Wrong Output):
迴圈第一次順利完成,
進行第二次時,02.jpg也順利截取特定區域,
03.jpg讀入也沒有問題,但是截取區域時出現下面錯誤
OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x +
roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <=
m.rows) in Mat, file
/Users/user/slave/ios_framework/src/opencv/modules/core/src/matrix.cpp, line
322
google之後發現很可能是OpenCV本身的bug,
不知道有沒有辦法避開這個bug?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.46.8
→
02/26 16:02, , 1F
02/26 16:02, 1F
推
02/26 17:07, , 2F
02/26 17:07, 2F
→
02/26 17:07, , 3F
02/26 17:07, 3F
→
02/26 17:08, , 4F
02/26 17:08, 4F
→
02/26 18:14, , 5F
02/26 18:14, 5F
→
02/26 18:15, , 6F
02/26 18:15, 6F
推
02/26 19:01, , 7F
02/26 19:01, 7F
推
02/27 01:55, , 8F
02/27 01:55, 8F
→
02/27 01:56, , 9F
02/27 01:56, 9F
推
02/27 01:59, , 10F
02/27 01:59, 10F
→
02/27 08:41, , 11F
02/27 08:41, 11F
→
02/27 08:41, , 12F
02/27 08:41, 12F
→
02/27 08:42, , 13F
02/27 08:42, 13F