From 2946ba02f25a7ae605464031099580b3ae2ce22c Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 14 May 2019 10:30:35 +0100 Subject: gofmt --- preproc/sauvola.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'preproc/sauvola.go') diff --git a/preproc/sauvola.go b/preproc/sauvola.go index 2ed9a92..046bb7d 100644 --- a/preproc/sauvola.go +++ b/preproc/sauvola.go @@ -17,7 +17,7 @@ func Sauvola(img *image.Gray, ksize float64, windowsize int) *image.Gray { for x := b.Min.X; x < b.Max.X; x++ { window := surrounding(img, x, y, windowsize) m, dev := meanstddev(window) - threshold := m * (1 + ksize * ((dev / 128) - 1)) + threshold := m * (1 + ksize*((dev/128)-1)) if img.GrayAt(x, y).Y < uint8(threshold) { new.SetGray(x, y, color.Gray{0}) } else { @@ -42,7 +42,7 @@ func IntegralSauvola(img *image.Gray, ksize float64, windowsize int) *image.Gray for y := b.Min.Y; y < b.Max.Y; y++ { for x := b.Min.X; x < b.Max.X; x++ { m, dev := integrals.MeanStdDevWindow(x, y, windowsize) - threshold := m * (1 + ksize * ((dev / 128) - 1)) + threshold := m * (1 + ksize*((dev/128)-1)) if img.GrayAt(x, y).Y < uint8(threshold) { new.SetGray(x, y, color.Gray{0}) } else { @@ -63,7 +63,7 @@ func PreCalcedSauvola(integrals integralimg.WithSq, img *image.Gray, ksize float for y := b.Min.Y; y < b.Max.Y; y++ { for x := b.Min.X; x < b.Max.X; x++ { m, dev := integrals.MeanStdDevWindow(x, y, windowsize) - threshold := m * (1 + ksize * ((dev / 128) - 1)) + threshold := m * (1 + ksize*((dev/128)-1)) if img.GrayAt(x, y).Y < uint8(threshold) { new.SetGray(x, y, color.Gray{0}) } else { -- cgit v1.2.1-24-ge1ad