From 6ea56f18bb0409736ca569d139750ff0685a7ec5 Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Wed, 21 Apr 2021 16:16:58 +0300 Subject: [PATCH] Update EDPF.cpp --- EDPF.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EDPF.cpp b/EDPF.cpp index f2ec9f8..454976e 100644 --- a/EDPF.cpp +++ b/EDPF.cpp @@ -93,11 +93,11 @@ short * EDPF::ComputePrewitt3x3() // Then: gx = com1 + com2 + (E-D) = (H-A) + (C-F) + (E-D) = (C-A) + (E-D) + (H-F) // gy = com1 - com2 + (G-B) = (H-A) - (C-F) + (G-B) = (F-A) + (G-B) + (H-C) // - int com1 = srcImg[(i + 1)*width + j + 1] - srcImg[(i - 1)*width + j - 1]; - int com2 = srcImg[(i - 1)*width + j + 1] - srcImg[(i + 1)*width + j - 1]; + int com1 = smoothImg[(i + 1)*width + j + 1] - smoothImg[(i - 1)*width + j - 1]; + int com2 = smoothImg[(i - 1)*width + j + 1] - smoothImg[(i + 1)*width + j - 1]; - int gx = abs(com1 + com2 + (srcImg[i*width + j + 1] - srcImg[i*width + j - 1])); - int gy = abs(com1 - com2 + (srcImg[(i + 1)*width + j] - srcImg[(i - 1)*width + j])); + int gx = abs(com1 + com2 + (smoothImg[i*width + j + 1] - smoothImg[i*width + j - 1])); + int gy = abs(com1 - com2 + (smoothImg[(i + 1)*width + j] - smoothImg[(i - 1)*width + j])); int g = gx + gy;