From 56de4b6fc4f4ddbc9c183965abe169b611d6cb02 Mon Sep 17 00:00:00 2001 From: DXC Date: Sat, 9 May 2026 09:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DStep3=E5=8E=BB=E8=80=80?= =?UTF-8?q?=E6=96=91=E6=A8=A1=E5=9D=97=E4=B8=89=E5=A4=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9ASUGAR=E5=88=86=E6=94=AF=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E3=80=81Kutser=E5=8F=82=E6=95=B0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=E9=94=99=E8=AF=AF=E3=80=81=E6=B3=A2=E6=AE=B5?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E7=B1=BB=E5=9E=8B=E7=BB=9F=E4=B8=80=E8=BD=AC?= =?UTF-8?q?=E4=B8=BAint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../water_quality_inversion_pipeline_GUI.py | 18 +++++++-------- src/gui/panels/step3_panel.py | 22 +++++++++---------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/core/water_quality_inversion_pipeline_GUI.py b/src/core/water_quality_inversion_pipeline_GUI.py index d32fe92..e4e24c4 100644 --- a/src/core/water_quality_inversion_pipeline_GUI.py +++ b/src/core/water_quality_inversion_pipeline_GUI.py @@ -1887,16 +1887,16 @@ class WaterQualityInversionPipeline: elif method == "sugar": # 强行转换暗号,兼容中文和各种格式 - raw_method = str(sugar_glint_mask_method).lower() - if 'cdf' in raw_method or '累积' in raw_method: - sugar_glint_mask_method = 'cdf' - elif 'otsu' in raw_method or '大津' in raw_method: - sugar_glint_mask_method = 'otsu' + sugar_glint_mask_method_raw = str(sugar_glint_mask_method).lower() + if 'cdf' in sugar_glint_mask_method_raw or '累积' in sugar_glint_mask_method: + sugar_glint_mask_method_fixed = 'cdf' + elif 'otsu' in sugar_glint_mask_method_raw or '大津' in sugar_glint_mask_method: + sugar_glint_mask_method_fixed = 'otsu' else: # 默认回退到 cdf 确保不崩溃 - sugar_glint_mask_method = 'cdf' + sugar_glint_mask_method_fixed = 'cdf' - print(f"使用方法: SUGAR (迭代次数={sugar_iter}, 掩膜方法={sugar_glint_mask_method})") + print(f"使用方法: SUGAR (迭代次数={sugar_iter}, 掩膜方法={sugar_glint_mask_method_fixed})") # 确定输出路径 output_path = str(self.deglint_dir / "deglint_sugar.bsq") @@ -1930,7 +1930,7 @@ class WaterQualityInversionPipeline: corrected_images = correction_iterative( image_array, iter=None, bounds=sugar_bounds, estimate_background=sugar_estimate_background, - glint_mask_method=sugar_glint_mask_method, + glint_mask_method=sugar_glint_mask_method_fixed, termination_thresh=sugar_termination_thresh, water_mask=mask_for_algorithm, output_path=None # 不传递output_path,使用pipeline保存 @@ -1940,7 +1940,7 @@ class WaterQualityInversionPipeline: corrected_images = correction_iterative( image_array, iter=sugar_iter, bounds=sugar_bounds, estimate_background=sugar_estimate_background, - glint_mask_method=sugar_glint_mask_method, + glint_mask_method=sugar_glint_mask_method_fixed, water_mask=mask_for_algorithm, output_path=None # 不传递output_path,使用pipeline保存 ) diff --git a/src/gui/panels/step3_panel.py b/src/gui/panels/step3_panel.py index 77fcc03..5311df5 100644 --- a/src/gui/panels/step3_panel.py +++ b/src/gui/panels/step3_panel.py @@ -99,24 +99,22 @@ class Step3Panel(QWidget): self.oxy_band = QSpinBox() self.oxy_band.setRange(0, 200) - self.oxy_band.setValue(8) + self.oxy_band.setValue(38) kutser_layout.addRow("氧吸收波段索引:", self.oxy_band) - self.lower_oxy = QDoubleSpinBox() - self.lower_oxy.setDecimals(2) - self.lower_oxy.setRange(0, 1000) - self.lower_oxy.setValue(756.54) - kutser_layout.addRow("下氧吸收波长(nm):", self.lower_oxy) + self.lower_oxy = QSpinBox() + self.lower_oxy.setRange(0, 200) + self.lower_oxy.setValue(36) + kutser_layout.addRow("下氧吸收波段索引:", self.lower_oxy) - self.upper_oxy = QDoubleSpinBox() - self.upper_oxy.setDecimals(2) - self.upper_oxy.setRange(0, 1000) - self.upper_oxy.setValue(766.54) - kutser_layout.addRow("上氧吸收波长(nm):", self.upper_oxy) + self.upper_oxy = QSpinBox() + self.upper_oxy.setRange(0, 200) + self.upper_oxy.setValue(49) + kutser_layout.addRow("上氧吸收波段索引:", self.upper_oxy) self.nir_band = QSpinBox() self.nir_band.setRange(0, 200) - self.nir_band.setValue(65) + self.nir_band.setValue(47) kutser_layout.addRow("NIR波段索引:", self.nir_band) self.kutser_group.setLayout(kutser_layout)