summaryrefslogtreecommitdiff
path: root/preproc
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-10-02 12:34:34 +0100
committerNick White <git@njw.name>2019-10-02 12:34:34 +0100
commita837c7ff966016f0f18f84d988bf441024d3ff5a (patch)
treed2a1a826b5fd96fcf95fb7366eefdc5c00471846 /preproc
parent94352c6124aed2d85cfb21e83c0dafb6f918fb7d (diff)
gofmt
Diffstat (limited to 'preproc')
-rw-r--r--preproc/cmd/preproc/main.go2
-rw-r--r--preproc/cmd/preprocmulti/main.go4
-rw-r--r--preproc/preprocmulti.go2
-rw-r--r--preproc/wipesides.go6
4 files changed, 7 insertions, 7 deletions
diff --git a/preproc/cmd/preproc/main.go b/preproc/cmd/preproc/main.go
index 898efb5..1c248e0 100644
--- a/preproc/cmd/preproc/main.go
+++ b/preproc/cmd/preproc/main.go
@@ -71,7 +71,7 @@ func main() {
}
}
- if ! *nowipe {
+ if !*nowipe {
log.Print("Wiping sides")
clean = preproc.Wipe(threshimg.(*image.Gray), *wipewsize, *thresh, *min)
} else {
diff --git a/preproc/cmd/preprocmulti/main.go b/preproc/cmd/preprocmulti/main.go
index 7dfdd56..c6c9fe4 100644
--- a/preproc/cmd/preprocmulti/main.go
+++ b/preproc/cmd/preprocmulti/main.go
@@ -79,9 +79,9 @@ func main() {
}
}
- if ! *nowipe {
+ if !*nowipe {
log.Print("Wiping sides")
- clean = preproc.Wipe(threshimg.(*image.Gray), *wipewsize, k * 0.02, *min)
+ clean = preproc.Wipe(threshimg.(*image.Gray), *wipewsize, k*0.02, *min)
} else {
clean = threshimg
}
diff --git a/preproc/preprocmulti.go b/preproc/preprocmulti.go
index e38d0d7..2e7cb06 100644
--- a/preproc/preprocmulti.go
+++ b/preproc/preprocmulti.go
@@ -73,7 +73,7 @@ func PreProcMulti(inPath string, ksizes []float64, binType string, binWsize int,
}
if wipe {
- clean = Wipe(threshimg.(*image.Gray), wipeWsize, k * 0.02, wipeMinWidthPerc)
+ clean = Wipe(threshimg.(*image.Gray), wipeWsize, k*0.02, wipeMinWidthPerc)
} else {
clean = threshimg
}
diff --git a/preproc/wipesides.go b/preproc/wipesides.go
index 1b73791..3d08053 100644
--- a/preproc/wipesides.go
+++ b/preproc/wipesides.go
@@ -55,14 +55,14 @@ func findedges(img integralimg.I, wsize int, thresh float64) (int, int) {
// start 10% left or right of the middle
notcentre := maxx / 10
- for x := maxx / 2 + notcentre; x < maxx-wsize; x++ {
+ for x := maxx/2 + notcentre; x < maxx-wsize; x++ {
if proportion(img, x, wsize) <= thresh {
highedge = findbestedge(img, x, wsize)
break
}
}
- for x := maxx / 2 - notcentre; x > 0; x-- {
+ for x := maxx/2 - notcentre; x > 0; x-- {
if proportion(img, x, wsize) <= thresh {
lowedge = findbestedge(img, x, wsize)
break
@@ -106,7 +106,7 @@ func toonarrow(img *image.Gray, lowedge int, highedge int, min int) bool {
b := img.Bounds()
imgw := b.Max.X - b.Min.X
wipew := highedge - lowedge
- if float64(wipew) / float64(imgw) * 100 < float64(min) {
+ if float64(wipew)/float64(imgw)*100 < float64(min) {
return true
}
return false