内存使用优化

This commit is contained in:
nuknal
2024-09-23 17:04:31 +08:00
parent d3cf743b71
commit 97a375996a
5 changed files with 32 additions and 5 deletions

View File

@@ -161,6 +161,7 @@ func (r *Registrator) CalcDownPhaseCorrelation() error {
// 将PAN将采样作为轮廓匹配基准图像
downsampledPanImage := gocv.NewMat()
defer downsampledPanImage.Close()
gocv.Resize(r.PanImage, &downsampledPanImage,
image.Point{X: r.MssWidth, Y: r.MssHeight}, 0, 0, gocv.InterpolationCubic)
log.Println("down sampled PAN images size:", downsampledPanImage.Size())
@@ -385,6 +386,9 @@ func (r *Registrator) DoCoRegistration() error {
gocv.InterpolationCubic,
gocv.BorderConstant,
color.RGBA{0, 0, 0, 0})
mapX.Close()
mapY.Close()
}
// 裁掉末尾的的 MSS 480 行 和 PAN 的 480*4 行