全图配准

This commit is contained in:
nuknal
2024-11-01 15:52:53 +08:00
parent 9e58fbaed3
commit 921ca0b049
3 changed files with 15 additions and 22 deletions

View File

@@ -45,7 +45,7 @@ func CV_PhaseCorrelate(panBlock, mssBlock gocv.Mat) (gocv.Point2f, float64) {
return shift, response
}
func (r *ImgProc) fileterPhaseShift(thredholds []float64, greaterThan bool) error {
func (r *ImgProc) fileterPhaseShift(thredholds []float64) error {
if len(thredholds) > 4 {
return errors.New("thredholds length should be less than 4")
}
@@ -57,10 +57,7 @@ func (r *ImgProc) fileterPhaseShift(thredholds []float64, greaterThan bool) erro
return false
}
if greaterThan {
return value.dy > float32(th)
}
return value.dy < float32(th)
return value.dy > float32(th-20) && value.dy < float32(th+20)
})
}