different enhancement method for different sensor type

This commit is contained in:
nuknal
2024-07-18 10:24:07 +08:00
parent 17124e8396
commit 0d1fea2f5d
5 changed files with 21 additions and 13 deletions

View File

@@ -11,7 +11,7 @@ import (
"starwiz.cn/sjy01/image-proc/pkg/config"
)
func GTiffToJPG(ftiff, fjpg string, reversed bool) error {
func GTiffToJPG(ftiff, fjpg, sensor string, reversed bool) error {
// 打开 TIFF 文件
ds, err := godal.Open(ftiff)
if err != nil {
@@ -58,8 +58,12 @@ func GTiffToJPG(ftiff, fjpg string, reversed bool) error {
}
channels := gocv.Split(img)
enhancement, ok := config.GCONFIG.BrowserImg.Enhancement[sensor]
if !ok {
enhancement = "NoEnhancement"
}
for i, ch := range channels {
switch config.GCONFIG.BrowserImg.Enhancement {
switch enhancement {
case StretchToCumulativeCutMinMax:
channels[i] = cumulativeCountCutEnhancement(ch,
config.GCONFIG.BrowserImg.CumulativeCutLower,