wasm: tweak params

This commit is contained in:
esimov
2021-09-02 17:49:28 +03:00
parent e17840c7c3
commit 25a54a842c
2 changed files with 7 additions and 7 deletions

View File

@@ -162,9 +162,9 @@ func (d *Detector) clusterDetection(pixels []uint8, width, height int) []pigo.De
} }
cParams := pigo.CascadeParams{ cParams := pigo.CascadeParams{
MinSize: 200, MinSize: 200,
MaxSize: 640, MaxSize: 720,
ShiftFactor: 0.1, ShiftFactor: 0.1,
ScaleFactor: 1.1, ScaleFactor: 1.05,
ImageParams: *imgParams, ImageParams: *imgParams,
} }

View File

@@ -37,7 +37,7 @@ type Canvas struct {
video js.Value video js.Value
showPupil bool showPupil bool
showFace bool showFaceRect bool
showEyeMask bool showEyeMask bool
showMouthMask bool showMouthMask bool
showCoord bool showCoord bool
@@ -91,9 +91,9 @@ func NewCanvas() *Canvas {
c.ctx = c.canvas.Call("getContext", "2d") c.ctx = c.canvas.Call("getContext", "2d")
c.showPupil = true c.showPupil = true
c.showFace = false c.showFaceRect = false
c.showEyeMask = true c.showEyeMask = true
c.showMouthMask = false c.showMouthMask = true
c.drawCircle = false c.drawCircle = false
det = detector.NewDetector() det = detector.NewDetector()
@@ -250,7 +250,7 @@ func (c *Canvas) drawDetection(dets [][]int) {
c.ctx.Set("lineWidth", 3) c.ctx.Set("lineWidth", 3)
c.ctx.Set("strokeStyle", "red") c.ctx.Set("strokeStyle", "red")
if c.showFace { if c.showFaceRect {
if c.drawCircle { if c.drawCircle {
c.ctx.Call("moveTo", row+int(scale/2), col) c.ctx.Call("moveTo", row+int(scale/2), col)
c.ctx.Call("arc", row, col, scale/2, 0, 2*math.Pi, true) c.ctx.Call("arc", row, col, scale/2, 0, 2*math.Pi, true)
@@ -352,7 +352,7 @@ func (c *Canvas) detectKeyPress() {
keyCode := args[0].Get("key") keyCode := args[0].Get("key")
switch { switch {
case keyCode.String() == "q": case keyCode.String() == "q":
c.showFace = !c.showFace c.showFaceRect = !c.showFaceRect
case keyCode.String() == "z": case keyCode.String() == "z":
c.showPupil = !c.showPupil c.showPupil = !c.showPupil
case keyCode.String() == "a": case keyCode.String() == "a":