default channel order of OpenCV is BGR

This commit is contained in:
nuknal
2024-05-29 15:24:40 +08:00
parent e15ae9247b
commit 1b0ab9f347
11 changed files with 96 additions and 96 deletions

View File

@@ -3,13 +3,14 @@ package imageproc
import "fmt"
func calculateProj(topLeftX, topLeftY, width, height, resolution float64) string {
var projections []string
// 计算图像的地理范围
bottomRightX := topLeftX + float64(width)*resolution
bottomRightY := topLeftY + float64(height)*resolution
// 根据地理范围和分辨率选择适当的投影信息
// 这里只是一个示例,你需要根据实际情况选择合适的投影系统和参数
projection := fmt.Sprintf(`PROJCS["Custom Projection",
projections = append(projections, fmt.Sprintf(`PROJCS["Custom Projection",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
@@ -30,9 +31,9 @@ func calculateProj(topLeftX, topLeftY, width, height, resolution float64) string
AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH]]`,
(topLeftX+bottomRightX)/2, (topLeftY+bottomRightY)/2)
(topLeftX+bottomRightX)/2, (topLeftY+bottomRightY)/2))
projection = `PROJCS["WGS 84 / UTM zone 51N",
projections = append(projections, `PROJCS["WGS 84 / UTM zone 51N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
@@ -53,9 +54,9 @@ func calculateProj(topLeftX, topLeftY, width, height, resolution float64) string
AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH],
AUTHORITY["EPSG","32651"]]`
AUTHORITY["EPSG","32651"]]`)
projection = `PROJCS["WGS 84 / Pseudo-Mercator",
projections = append(projections, `PROJCS["WGS 84 / Pseudo-Mercator",
GEOGCS["WGS 84",DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
@@ -72,8 +73,8 @@ func calculateProj(topLeftX, topLeftY, width, height, resolution float64) string
AXIS["X",EAST],
AXIS["Y",NORTH],
EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],
AUTHORITY["EPSG","3857"]]`
AUTHORITY["EPSG","3857"]]`)
// 输出投影信息
return projection
return projections[0]
}