From c810af4c82c1c932a564c957aa1c773a5dbfc1c5 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 15 Oct 2015 14:49:26 +0200 Subject: Fix pixel surrounding selection --- src/main/java/Filter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/Filter.java b/src/main/java/Filter.java index 2dd81ee..bb87287 100644 --- a/src/main/java/Filter.java +++ b/src/main/java/Filter.java @@ -39,9 +39,9 @@ public final class Filter { for (int row = 0; row < height; ++row) { for (int col = 0; col < width; ++col) { float pixelCore[][] = { - {Filter.at(gray, row+1, col-1),Filter.at(gray, row+1, col),Filter.at(gray, row+1, col+1)}, + {Filter.at(gray, row-1, col-1),Filter.at(gray, row-1, col),Filter.at(gray, row-1, col+1)}, {Filter.at(gray, row, col-1),Filter.at(gray, row, col),Filter.at(gray, row, col+1)}, - {Filter.at(gray, row-1, col-1),Filter.at(gray, row-1, col),Filter.at(gray, row-1, col+1)} + {Filter.at(gray, row+1, col-1),Filter.at(gray, row+1, col),Filter.at(gray, row+1, col+1)} }; for (int i = 0; i < kernel[0].length; i++) { -- cgit v1.2.3