optimization
This commit is contained in:
22
pkg/producer/edge_phase_correlation.go
Normal file
22
pkg/producer/edge_phase_correlation.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user