Itseez/opencv — pull request #3112 by LeszekSwirski (2014-08-15 15:00:20+00:00)
Title: Fix filtering ROIs of images

Reverts one line from 8a4a1bb018426087d332ab2cfe859b5cdc521620. If filtering an ROI, we may want to sample the source image outside of the ROI. But then, `y` may be negative, and passing a negative `y` into `Mat::ptr` results in an assertion fail. Since accessing values outside of the ROI is a bit hacky anyway (that is, requires knowledge of internals), best to leave this as a raw `data + y*step` calculation instead of using `Mat::ptr`.