现在多光谱内配准,然后再和全色配准

This commit is contained in:
nuknal
2024-10-28 17:45:13 +08:00
parent 1161e8d054
commit e423916a79
5 changed files with 146 additions and 66 deletions

View File

@@ -12,11 +12,14 @@ import (
// 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)
func FindEdges(img0 gocv.Mat) gocv.Mat {
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
dst8 := gocv.NewMatWithSize(img0.Rows(), img0.Cols(), gocv.MatTypeCV8U)
defer dst8.Close()
gocv.Normalize(img0, &dst8, 0, 255, gocv.NormMinMax)
dst8.ConvertTo(&dst8, gocv.MatTypeCV8U)
dstEdge := gocv.NewMat()
gocv.Canny(dst8, &dstEdge, 10, 100)
dstEdge.ConvertTo(&dstEdge, gocv.MatTypeCV16U)
return dstEdge
}