From cfe967717f24f09036d2a89891432e3da9d42640 Mon Sep 17 00:00:00 2001 From: HolyWu Date: Sat, 19 Mar 2016 00:51:17 +0800 Subject: [PATCH] Fix an error in SIMD code of the Sobel operator --- TCanny/TCanny.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TCanny/TCanny.cpp b/TCanny/TCanny.cpp index da701fd..5dbb5b7 100644 --- a/TCanny/TCanny.cpp +++ b/TCanny/TCanny.cpp @@ -249,9 +249,9 @@ static void detectEdge(float * _srcp, float * _gimg, float * _dimg, const int wi - Vec8f().load_a(srcp + x + stride - 1) - Vec8f().load(srcp + x + stride) - Vec8f().load(srcp + x + stride + 1)) * pointFive; } else { dx = Vec8f().load(srcp + x - stride + 1) + mul_add(two, Vec8f().load(srcp + x + 1), Vec8f().load(srcp + x + stride + 1)) - - Vec8f().load_a(srcp + x - stride - 1) - mul_sub(two, Vec8f().load_a(srcp + x - 1), Vec8f().load_a(srcp + x + stride - 1)); + - Vec8f().load_a(srcp + x - stride - 1) - mul_add(two, Vec8f().load_a(srcp + x - 1), Vec8f().load_a(srcp + x + stride - 1)); dy = Vec8f().load_a(srcp + x - stride - 1) + mul_add(two, Vec8f().load(srcp + x - stride), Vec8f().load(srcp + x - stride + 1)) - - Vec8f().load_a(srcp + x + stride - 1) - mul_sub(two, Vec8f().load(srcp + x + stride), Vec8f().load(srcp + x + stride + 1)); + - Vec8f().load_a(srcp + x + stride - 1) - mul_add(two, Vec8f().load(srcp + x + stride), Vec8f().load(srcp + x + stride + 1)); } sqrt(mul_add(dx, dx, dy * dy)).store(gimg + x);