diff --git a/modules/ximgproc/src/edge_drawing.cpp b/modules/ximgproc/src/edge_drawing.cpp index 655055e7a20..594ac23a154 100644 --- a/modules/ximgproc/src/edge_drawing.cpp +++ b/modules/ximgproc/src/edge_drawing.cpp @@ -5955,6 +5955,7 @@ void EdgeDrawingImpl::MyRGB2LabFast() void EdgeDrawingImpl::ComputeGradientMapByDiZenzo() { + memset(gradImg, 0, sizeof(ushort) * width * height); int max = 0; for (int i = 1; i < height - 1; i++) {