天天看點

[OpenCV基礎] Assertion failed

1.這個問題主要是自己在截取感興趣區域時出現區域為0的想象。這個時候就要去檢查cvsetimageroi的幾個參數是否為0了!

You are probably working outside of the image dimensions. Does any of the values you pass to the cvSetImageROI function lay outside the image boudaries?

錯誤顯示

OpenCV Error: Assertion failed (rect.width >= 0 && rect.height >= 0 && rect.x < image->width && rect.y < image->height && rect.x + rect.width>= (int)(rect.widt h > 0) && rect.y + rect.height >= (int)(rect.height > 0)) in unknown function, f ile ........\ocv\opencv\src\cxcore\cxarray.cpp, line 3000