Files
sjy01-image-proc/pkg/config/config.go
2024-07-17 12:45:29 +08:00

75 lines
3.0 KiB
Go

package config
import (
"github.com/sirupsen/logrus"
"starwiz.cn/sjy01/image-proc/pkg/payload"
)
type Config struct {
CoRegistration CoRegistrationConfig `yaml:"coregistration" mapstructure:"coregistration"`
Radiation RadiationConfig `yaml:"radiation" mapstructure:"radiation"`
BrowserImg BrowserImgConfig `yaml:"browser_img" mapstructure:"browser_img"`
LogLevel logrus.Level `yaml:"log_level" mapstructure:"log_level"`
}
type CoRegistrationConfig struct {
MssBands int `yaml:"mss_bands" mapstructure:"mss_bands"`
PixelBytes int `yaml:"pixel_bytes" mapstructure:"pixel_bytes"`
MssWidth int `yaml:"mss_width" mapstructure:"mss_width"`
PanWidth int `yaml:"pan_width" mapstructure:"pan_width"`
CRBlockNW int `yaml:"cr_block_nw" mapstructure:"cr_block_nw"`
CRBlockNH int `yaml:"cr_block_nh" mapstructure:"cr_block_nh"`
OverlappedBlockLines int `yaml:"overlapped_block_lines" mapstructure:"overlapped_block_lines"`
CRResampleMethod string `yaml:"cr_resample_method" mapstructure:"cr_resample_method"`
FUSBandOrder string `yaml:"fus_band_order" mapstructure:"fus_band_order"`
}
type RadiationConfig struct {
PANRemoveHfNoise bool `yaml:"pan_remove_hf_noise" mapstructure:"pan_remove_hf_noise"`
MSSRemoveHfNoise bool `yaml:"mss_remove_hf_noise" mapstructure:"mss_remove_hf_noise"`
SceneMomentMatching bool `yaml:"scene_moment_matching" mapstructure:"scene_moment_matching"`
HfRadiusRatio float64 `yaml:"hf_radius_ratio" mapstructure:"hf_radius_ratio"`
MinHistLevel float64 `yaml:"min_hist_level" mapstructure:"min_hist_level"`
MaxHistLevel float64 `yaml:"max_hist_level" mapstructure:"max_hist_level"`
HFBandStopWidth int `yaml:"hf_band_stop_width" mapstructure:"hf_band_stop_width"`
}
type BrowserImgConfig struct {
Enhancement string `yaml:"enhancement" mapstructure:"enhancement"`
CumulativeCutLower float64 `yaml:"cumulative_cut_lower" mapstructure:"cumulative_cut_lower"`
CumulativeCutUpper float64 `yaml:"cumulative_cut_upper" mapstructure:"cumulative_cut_upper"`
}
var GCONFIG Config
func init() {
GCONFIG = Config{
LogLevel: logrus.DebugLevel,
CoRegistration: CoRegistrationConfig{
MssBands: 4,
PixelBytes: 2,
PanWidth: payload.PAN_PIXEL_WIDTH,
MssWidth: payload.MSS_PIXEL_WIDTH,
OverlappedBlockLines: 3000,
CRBlockNW: 8,
CRBlockNH: 4,
CRResampleMethod: "down_sample_pan",
FUSBandOrder: "RGB",
},
Radiation: RadiationConfig{
PANRemoveHfNoise: true,
MSSRemoveHfNoise: true,
SceneMomentMatching: false,
MinHistLevel: 0.3,
MaxHistLevel: 0.6,
HfRadiusRatio: 0.49,
HFBandStopWidth: 24,
},
BrowserImg: BrowserImgConfig{
Enhancement: "StretchToCumulativeCutMinMax",
CumulativeCutLower: 0.01,
CumulativeCutUpper: 0.99,
},
}
}