From a7757b0eb66eb8120c221beca60e6d08a35b5616 Mon Sep 17 00:00:00 2001 From: orestis Date: Wed, 19 Nov 2014 23:12:58 +0200 Subject: [PATCH] Fix anchor for small symmetrical column filters. In the unoptimized version of small symmetrical column filters, when we try to detect if the kernel, ky, is equal to [1;2;1] or [1;-2;1] we should take into consideration that the anchor points in the middle element. --- modules/imgproc/src/filter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/filter.cpp b/modules/imgproc/src/filter.cpp index d980ca26a4..05db957498 100644 --- a/modules/imgproc/src/filter.cpp +++ b/modules/imgproc/src/filter.cpp @@ -2613,8 +2613,8 @@ struct SymmColumnSmallFilter : public SymmColumnFilter const ST* ky = this->kernel.template ptr() + ksize2; int i; bool symmetrical = (this->symmetryType & KERNEL_SYMMETRICAL) != 0; - bool is_1_2_1 = ky[0] == 1 && ky[1] == 2; - bool is_1_m2_1 = ky[0] == 1 && ky[1] == -2; + bool is_1_2_1 = ky[0] == 2 && ky[1] == 1; + bool is_1_m2_1 = ky[0] == -2 && ky[1] == 1; bool is_m1_0_1 = ky[1] == 1 || ky[1] == -1; ST f0 = ky[0], f1 = ky[1]; ST _delta = this->delta;