From d41c941ded0f478e3bf4e87d2c0f137f7c91ee22 Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Sun, 19 Aug 2018 16:28:14 +0900 Subject: [PATCH] transforms: Fix the logic which getting a size of image --- transforms/pixels.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transforms/pixels.go b/transforms/pixels.go index 744c4ac..378e1b5 100644 --- a/transforms/pixels.go +++ b/transforms/pixels.go @@ -11,7 +11,7 @@ import ( // Rgb2Gray function converts RGB to a gray scale array. func Rgb2Gray(colorImg image.Image) [][]float64 { bounds := colorImg.Bounds() - w, h := bounds.Max.X, bounds.Max.Y + w, h := bounds.Max.X-bounds.Min.X, bounds.Max.Y-bounds.Min.Y pixels := make([][]float64, h) for i := range pixels {