summaryrefslogtreecommitdiff
path: root/cmd/preprocmulti/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-07-24 18:59:51 +0100
committerNick White <git@njw.name>2020-07-24 18:59:51 +0100
commit797a8dca9408eb58620bc33dde9b5da51bbfee5f (patch)
tree30f164405261c2ef09a896a3dc3d4704e24b0fd1 /cmd/preprocmulti/main.go
parent70e3b595b02977e90c533756a8837c019d51d182 (diff)
Update commands to use the updated interfacesv0.2.0
Diffstat (limited to 'cmd/preprocmulti/main.go')
-rw-r--r--cmd/preprocmulti/main.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/preprocmulti/main.go b/cmd/preprocmulti/main.go
index 911c791..b99909a 100644
--- a/cmd/preprocmulti/main.go
+++ b/cmd/preprocmulti/main.go
@@ -59,8 +59,6 @@ func main() {
log.Fatalf("Could not decode image: %v\n", err)
}
b := img.Bounds()
- gray := image.NewGray(image.Rect(0, 0, b.Dx(), b.Dy()))
- draw.Draw(gray, b, img, b.Min, draw.Src)
if *binwsize == 0 {
*binwsize = autowsize(b)
@@ -72,11 +70,14 @@ func main() {
var clean, threshimg image.Image
log.Print("Precalculating integral images")
- integrals := integralimg.ToAllIntegralImg(gray)
+ intImg := integralimg.NewImage(b)
+ draw.Draw(intImg, b, img, b.Min, draw.Src)
+ intSqImg := integralimg.NewSqImage(b)
+ draw.Draw(intSqImg, b, img, b.Min, draw.Src)
for _, k := range ksizes {
log.Print("Binarising")
- threshimg = preproc.PreCalcedSauvola(integrals, gray, k, *binwsize)
+ threshimg = preproc.PreCalcedSauvola(*intImg, *intSqImg, img, k, *binwsize)
if *btype == "zeroinv" {
threshimg, err = preproc.BinToZeroInv(threshimg.(*image.Gray), img.(*image.RGBA))