optimization

This commit is contained in:
nuknal
2024-10-24 14:09:20 +08:00
parent 414450c6e6
commit d16a5bd9c0
8 changed files with 77 additions and 73 deletions

View File

@@ -0,0 +1,22 @@
package producer
import (
"fmt"
"gocv.io/x/gocv"
)
// https://medium.com/radix-ai-blog/banishing-the-jitters-stabilizing-satellite-imagery-with-opencvs-phase-correlation-3ba2dc6ac096
// tackle the brightness and contrast problem
// by performing phase correlation on detected
// edges instead of the raw image
func FindEdges(img gocv.Mat) gocv.Mat {
img0 := gocv.IMRead("/Users/lan/workspace/sjy01/image-proc/data/052022/010/PAN/SJY01_PAN_20240520_115428_052022_103_010_L1A.tiff", gocv.IMReadUnchanged)
fmt.Println(img0.Cols(), img0.Rows(), img0.Type().String())
img0.ConvertTo(&img0, gocv.MatTypeCV8U)
dst := gocv.NewMat()
gocv.Canny(img0, &dst, 100, 200)
return dst
}