mirror of
https://github.com/opencv/opencv.git
synced 2026-11-17 06:47:47 -06:00
* imgproc: fix stackBlur on sub-matrices and in place The vertical pass stepped between rows by the row width, so a destination that is a region of a larger image was read and written at the wrong rows, and pixels outside the region were overwritten. Step by the real row stride instead. The horizontal pass with a kernel of 9 or fewer pixels reads pixels left of the one it writes, so stackBlur(img, img, ksize) blurred already blurred values. Copy the row first when the blur runs in place. * imgproc: limit the stackBlur in-place copy, parameterize its tests In place, only the row pass for kernels up to 9 pixels wide reads pixels it has already written. A kernel width of 1 skips the row pass, the row branch for wider kernels reads the whole row before writing it, and the column pass always works in place on the destination, so these calls no longer copy the image. Split the sub-matrix and in-place test into two TEST_P tests over depth, channels and kernel size.