This commit is contained in:
nuknal
2024-05-27 14:55:59 +08:00
parent e9286e238b
commit 8a15159d05
8 changed files with 469 additions and 32 deletions

View File

@@ -9,9 +9,10 @@ import (
)
type PhaseShiftM struct {
dx float32
dy float32
Block Block
dx float32
dy float32
response float64
Block Block
}
type Block struct {
@@ -20,7 +21,7 @@ type Block struct {
coord image.Point // top-left corner of the block in the original image
}
func (r *Registrator) calculateBlockPhaseShift(panBlock, mssBlock gocv.Mat) gocv.Point2f {
func (r *Registrator) calculateBlockPhaseShift(panBlock, mssBlock gocv.Mat) (gocv.Point2f, float64) {
pan := gocv.NewMat()
mss := gocv.NewMat()
@@ -38,7 +39,7 @@ func (r *Registrator) calculateBlockPhaseShift(panBlock, mssBlock gocv.Mat) gocv
dy := shift.Y
log.Printf("Block shift: dx = %f, dy = %f. response = %f \n", dx, dy, response)
return shift
return shift, response
}
func (r *Registrator) DoMssPhaseShift() error {