Access violation when using cv::sum() on ROI of a Matrix
cv::Mat mask(45, 45, CV_32F, 0);
cv::Mat roi1(mask, cv::Rect(0, 0, 15, 15));
cv::Mat roi2(mask, cv::Rect(15, 0, 15, 15));
cv::sum(roi1); // no access violation
cv::sum(roi2); // access violation
Why is there an access violation when trying to get the sum of roi2
? It seems that it's clearly inside the boundaries of mask
.
Using Visual Studio 2010 and OpenCV 2.4.10
nice test case (reproducable on win and linux, opencv 2.4 and 3.0), - looks like a valid bug, please make an official issue here
(it seems to call simd instructions, without checking, if the pointer to the roi data is properly aligned)
Thanks, I've reported the bug. Hope you don't mind that I've quoted you.
^^ well done, thanks, no problem.
As Alexander Alekhin points out in the bug tracker, it's merely the wrongly called constructor of
mask
.oh, right, i did not see it earlier, sorry..