Skip to content

Commit

Permalink
Remove duplicate functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonynsimon committed Aug 25, 2016
1 parent 831bd69 commit 4cb7498
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions segmentation_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package bild

import (
"fmt"
"image"
"testing"
)
Expand Down Expand Up @@ -93,20 +92,7 @@ func TestThreshold(t *testing.T) {
for _, c := range cases {
actual := Threshold(c.img, c.level)
if !grayscaleImageEqual(actual, c.expected) {
t.Error(testFailMessage("Threshold", formatGrayImageString(c.expected), formatGrayImageString(actual)))
t.Error(testFailMessage("Threshold", formatImageGrayString(c.expected), formatImageGrayString(actual)))
}
}
}

func formatGrayImageString(img *image.Gray) string {
var result string
for y := 0; y < img.Bounds().Dy(); y++ {
result += "\n"
for x := 0; x < img.Bounds().Dx(); x++ {
pos := y*img.Stride + x
result += fmt.Sprintf("%#X, ", img.Pix[pos])
}
}
result += "\n"
return result
}

0 comments on commit 4cb7498

Please sign in to comment.