Skip to content

Commit

Permalink
Update EDPF.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
sturkmen72 committed Apr 21, 2021
1 parent 586cfdd commit 6ea56f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions EDPF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6ea56f1

Please sign in to comment.