Files
sjy01-image-proc/pkg/producer/edge_phase_correlation.go
2024-10-24 14:09:20 +08:00

23 lines
683 B
Go

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
}