summaryrefslogtreecommitdiff
path: root/binarize
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-04-18 13:24:02 +0100
committerNick White <git@njw.name>2019-04-18 13:24:02 +0100
commit4eb86764539a99b0d7c843d4aa81bfb2955db13c (patch)
tree1af1349c34de6b31829867baf18e31fa218cd191 /binarize
parent75173a030b1f3eb8a1e161ffd1732daa40a5e178 (diff)
Add basic cleanup tool; working, but more refinements planned.
This uses integral image calculations, so they have been exported in the binarization package
Diffstat (limited to 'binarize')
-rw-r--r--binarize/integralimg.go2
-rw-r--r--binarize/sauvola.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/binarize/integralimg.go b/binarize/integralimg.go
index 75e9cce..382b495 100644
--- a/binarize/integralimg.go
+++ b/binarize/integralimg.go
@@ -14,7 +14,7 @@ type integralwindow struct {
height int
}
-func integralimg(img *image.Gray) [][]uint64 {
+func Integralimg(img *image.Gray) [][]uint64 {
b := img.Bounds()
var oldy, oldx, oldxy uint64
var integral [][]uint64
diff --git a/binarize/sauvola.go b/binarize/sauvola.go
index ee773ba..6d9c1af 100644
--- a/binarize/sauvola.go
+++ b/binarize/sauvola.go
@@ -35,7 +35,7 @@ func IntegralSauvola(img *image.Gray, ksize float64, windowsize int) *image.Gray
b := img.Bounds()
new := image.NewGray(b)
- integral := integralimg(img)
+ integral := Integralimg(img)
integralsq := integralimgsq(img)
for y := b.Min.Y; y < b.Max.Y; y++ {