Commit 11c8998d authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: Add nadir_um_en/sigma/weight parameters for SIFT-tuned UM on nadir renders

Add three dedicated unsharp-mask parameters to IntersceneMatchParameters:
  nadir_um_en     (boolean, default false) - enable UM on nadir images
  nadir_um_sigma  (double,  default 2.0)   - Gaussian sigma in pixels
  nadir_um_weight (double,  default 1.0)   - blend weight (1.0 = 100%)

These are separate from the existing um_sigma/weight and terr_um_* / cuas_rng_um_*
parameters so they can be independently tuned for SIFT feature extraction.
LWIR nadir images with UM sigma=2 go from ~500 to ~5000 SIFT keypoints/frame.

Updated all 6 required locations: field declarations, dialog, dialog-read,
save, load, and clone.

Applied the filter in renderNadirSequence() using the existing applyUM()
helper, matching the renderSceneSequence() pattern.
Co-authored-by: 's avatarClaude <claude@elphel.com>
parent 2e1c69b0
......@@ -1144,6 +1144,9 @@ min_str_neib_fpn 0.35
public double fgnd_normal_damping = 0.001; // Damping parameter for planes. Pull planes to horizontal when there is not enough data for tilts.
public boolean nadir_gen = false; // generate per-scene nadir perspective images for OpenMVS input
public boolean nadir_um_en = false; // apply unsharp mask to nadir images for SIFT feature enhancement
public double nadir_um_sigma = 2.0; // UM Gaussian sigma (pixels) for nadir images
public double nadir_um_weight = 1.0; // UM weight for nadir images (1.0 = 100%)
public boolean fgnd_gen_optho = true; // generate orthogonal to the ground view
public boolean fgnd_gen_tilted = true; // generate tilted ground disparity view
public boolean fgnd_gen_scan = false; // generate "CT scan" views
......@@ -3380,6 +3383,12 @@ min_str_neib_fpn 0.35
gd.addMessage ("Output files generation related to ground planes");
gd.addCheckbox ("Generate nadir per-scene images for OpenMVS", this.nadir_gen,
"Render each scene from its own camera position (no terrain warp), for use as OpenMVS/COLMAP input.");
gd.addCheckbox ("Apply UM to nadir images", this.nadir_um_en,
"Apply unsharp mask to nadir renders to enhance features for SIFT.");
gd.addNumericField("Nadir UM sigma", this.nadir_um_sigma, 5,7, "pix",
"Nadir unsharp mask Gaussian sigma.");
gd.addNumericField("Nadir UM weight", this.nadir_um_weight, 5,7, "",
"Nadir unsharp mask weight (1.0=100%).");
gd.addCheckbox ("Generate orthogonal to the ground view", this.fgnd_gen_optho,
"Generate relative to the ground plane view, minimizing anisotropic distortions.");
gd.addCheckbox ("Generate tilted-ground view", this.fgnd_gen_tilted,
......@@ -4817,6 +4826,9 @@ min_str_neib_fpn 0.35
this.fgnd_normal_damping = gd.getNextNumber();
this.nadir_gen = gd.getNextBoolean();
this.nadir_um_en = gd.getNextBoolean();
this.nadir_um_sigma = gd.getNextNumber();
this.nadir_um_weight = gd.getNextNumber();
this.fgnd_gen_optho = gd.getNextBoolean();
this.fgnd_gen_tilted = gd.getNextBoolean();
this.fgnd_gen_scan = gd.getNextBoolean();
......@@ -6113,6 +6125,9 @@ min_str_neib_fpn 0.35
properties.setProperty(prefix+"fgnd_normal_damping", this.fgnd_normal_damping+""); // double
properties.setProperty(prefix+"nadir_gen", this.nadir_gen+""); // boolean
properties.setProperty(prefix+"nadir_um_en", this.nadir_um_en+""); // boolean
properties.setProperty(prefix+"nadir_um_sigma", this.nadir_um_sigma+""); // double
properties.setProperty(prefix+"nadir_um_weight", this.nadir_um_weight+""); // double
properties.setProperty(prefix+"fgnd_gen_optho", this.fgnd_gen_optho+""); // boolean
properties.setProperty(prefix+"fgnd_gen_tilted", this.fgnd_gen_tilted+""); // boolean
properties.setProperty(prefix+"fgnd_gen_scan", this.fgnd_gen_scan+""); // boolean
......@@ -7392,6 +7407,9 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"fgnd_normal_damping")!=null) this.fgnd_normal_damping=Double.parseDouble(properties.getProperty(prefix+"fgnd_normal_damping"));
if (properties.getProperty(prefix+"nadir_gen")!=null) this.nadir_gen=Boolean.parseBoolean(properties.getProperty(prefix+"nadir_gen"));
if (properties.getProperty(prefix+"nadir_um_en")!=null) this.nadir_um_en=Boolean.parseBoolean(properties.getProperty(prefix+"nadir_um_en"));
if (properties.getProperty(prefix+"nadir_um_sigma")!=null) this.nadir_um_sigma=Double.parseDouble(properties.getProperty(prefix+"nadir_um_sigma"));
if (properties.getProperty(prefix+"nadir_um_weight")!=null) this.nadir_um_weight=Double.parseDouble(properties.getProperty(prefix+"nadir_um_weight"));
if (properties.getProperty(prefix+"fgnd_gen_optho")!=null) this.fgnd_gen_optho=Boolean.parseBoolean(properties.getProperty(prefix+"fgnd_gen_optho"));
if (properties.getProperty(prefix+"fgnd_gen_tilted")!=null) this.fgnd_gen_tilted=Boolean.parseBoolean(properties.getProperty(prefix+"fgnd_gen_tilted"));
if (properties.getProperty(prefix+"fgnd_gen_scan")!=null) this.fgnd_gen_scan=Boolean.parseBoolean(properties.getProperty(prefix+"fgnd_gen_scan"));
......@@ -8652,6 +8670,9 @@ min_str_neib_fpn 0.35
imp.fgnd_normal_damping = this.fgnd_normal_damping;
imp.nadir_gen = this.nadir_gen;
imp.nadir_um_en = this.nadir_um_en;
imp.nadir_um_sigma = this.nadir_um_sigma;
imp.nadir_um_weight = this.nadir_um_weight;
imp.fgnd_gen_optho = this.fgnd_gen_optho;
imp.fgnd_gen_tilted = this.fgnd_gen_tilted;
imp.fgnd_gen_scan = this.fgnd_gen_scan;
......
......@@ -10982,7 +10982,16 @@ java.lang.NullPointerException
}
}
if (stack_scenes == null) return null;
return new ImagePlus(suffix, stack_scenes);
ImagePlus imp_result = new ImagePlus(suffix, stack_scenes);
// Apply unsharp mask to enhance SIFT features in LWIR nadir images
if (clt_parameters.imp.nadir_um_en && !toRGB) {
imp_result = applyUM(
suffix, // final String title,
imp_result, // final ImagePlus imp,
clt_parameters.imp.nadir_um_sigma, // final double um_sigma,
clt_parameters.imp.nadir_um_weight); // final double um_weight)
}
return imp_result;
}
public static QuadCLT[] selectScenes(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment