Commit 1cc8ef8f authored by Andrey Filippov's avatar Andrey Filippov

Implemented configurable parameters for global matching of affines and

intensities.
parent 75c570c2
...@@ -154,16 +154,12 @@ public class ComboMatch { ...@@ -154,16 +154,12 @@ public class ComboMatch {
int gpu_width= clt_parameters.imp.rln_gpu_width; // 3008; int gpu_width= clt_parameters.imp.rln_gpu_width; // 3008;
int gpu_height= clt_parameters.imp.rln_gpu_height; // 3008; int gpu_height= clt_parameters.imp.rln_gpu_height; // 3008;
int zoom_lev = -3; // 0; // +1 - zoom in twice, -1 - zoom out twice int zoom_lev = -3; // 0; // +1 - zoom in twice, -1 - zoom out twice
// boolean show_map_stats = false;
boolean show_combo = false; // true; boolean show_combo = false; // true;
boolean create_overlaps = false; boolean create_overlaps = false;
boolean equalize_overlaps = false; boolean equalize_overlaps = false;
boolean create_map = false; boolean create_map = false;
boolean create_equalize = false; boolean create_equalize = false;
// boolean show_combo_mask = false; // generate image mas (where it is defined)_
// boolean use_alt = false;
// boolean show_centers = true;
boolean use_saved_collection = true; // false; boolean use_saved_collection = true; // false;
boolean save_collection = true; boolean save_collection = true;
boolean process_correlation = true; // use false to save new version of data boolean process_correlation = true; // use false to save new version of data
...@@ -780,19 +776,19 @@ public class ComboMatch { ...@@ -780,19 +776,19 @@ public class ComboMatch {
} }
if (create_map) { if (create_map) {
OrthoMultiLMA.buildOrthoMap( int ok = OrthoMultiLMA.buildOrthoMap(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
maps_collection, // OrthoMapsCollection maps_collection maps_collection, // OrthoMapsCollection maps_collection
orthoMapsCollection_savepath); // String orthoMapsCollection_path orthoMapsCollection_savepath); // String orthoMapsCollection_path
return true; return (ok >= 0);
} }
if (create_equalize) { if (create_equalize) {
OrthoEqualizeLMA.buildEqualize( int ok = OrthoEqualizeLMA.buildEqualize(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
maps_collection, // OrthoMapsCollection maps_collection maps_collection, // OrthoMapsCollection maps_collection
orthoMapsCollection_savepath); // String orthoMapsCollection_path orthoMapsCollection_savepath); // String orthoMapsCollection_path
return true; return (ok >= 0);
} }
if (create_overlaps) { if (create_overlaps) {
......
...@@ -33,6 +33,7 @@ import java.util.ArrayList; ...@@ -33,6 +33,7 @@ import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.CLTParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.GenericJTabbedDialog;
import com.elphel.imagej.tileprocessor.ImageDtt; import com.elphel.imagej.tileprocessor.ImageDtt;
import Jama.Matrix; import Jama.Matrix;
...@@ -51,30 +52,88 @@ public class OrthoEqualizeLMA { ...@@ -51,30 +52,88 @@ public class OrthoEqualizeLMA {
private int [][] pairs = null; private int [][] pairs = null;
private int [][] pairs_ni = null; // non-intersecting pairs for multi-threaded processing private int [][] pairs_ni = null; // non-intersecting pairs for multi-threaded processing
private int [] indices = null; private int [] indices = null;
// private double [][] offsets = null; // scene offsets (rd)
private int num_scenes = 0; private int num_scenes = 0;
private int num_pairs = 0; private int num_pairs = 0;
public static int buildEqualize( public static int buildEqualize(
CLTParameters clt_parameters, CLTParameters clt_parameters,
OrthoMapsCollection maps_collection, OrthoMapsCollection maps_collection,
String orthoMapsCollection_path String orthoMapsCollection_path) {
) { boolean ignore_equalize= clt_parameters.imp.pequ_ignore_equalize; // false; // ignore previous equalization
int debugLevel = 2; boolean use_inv = clt_parameters.imp.pequ_use_inv; // false;
boolean use_inv = false; double scale_weight = clt_parameters.imp.pequ_scale_weight; // 500; // relative weight of scale differences compared to offset differences
double scale_weight = 500; // relative weight of scale differences compared to offset differences double pull_weight = clt_parameters.imp.pequ_pull_weight; // 0.001; // relative weight of offsets and scales differences from 1.0 to pairs mismatch
double pull_weight = 0.001; // relative weight of offsets and scales differences from 1.0 to pairs mismatch double half_weight_sec = clt_parameters.imp.pequ_half_weight_sec; // 300.0; // - time difference to reduce weight twice
double half_weight_sec = 300.0; // - time difference to reduce weight twice double min_weight_sec = clt_parameters.imp.pequ_min_weight_sec; // 0.01; // weight of pairs at very different time
double min_weight_sec = 0.01; // weight of pairs at very different time double overlap_pow = clt_parameters.imp.pequ_overlap_pow; // 2.0; // match weight as overlap fraction to this power
double overlap_pow = 2.0; // match weight as overlap fraction to this power double rms_diff = clt_parameters.imp.pequ_rms_diff; // 0.000001;
double rms_diff = 0.000001; int num_iter = clt_parameters.imp.pequ_num_iter; // 100; // 50;
int num_iter = 100; // 50; int debugLevel = clt_parameters.imp.pequ_debugLevel; // 2;
GenericJTabbedDialog gd = new GenericJTabbedDialog("Pairwise Match Parameters",1200,400);
gd.addCheckbox ("Ignore existing equalization",ignore_equalize, "Ignore existing equalization, start from scratch (a=1, b=0).");
gd.addCheckbox ("Use reversed pairs", use_inv, "Use reversed (late-early timestamps) pairs.");
gd.addNumericField("Relative scale weight", scale_weight, 3,7,"", "Importance of a-coefficient (scale) relative to b-coefficient (offset).");
gd.addNumericField("Pull weight", pull_weight, 3,7,"", "Relative weight of offsets and scales differences from 1.0 to pairs mismatch.");
gd.addNumericField("Half-weight time difference", half_weight_sec, 3,7,"s", "Time difference (in a pair) to reduce weight twice.");
gd.addNumericField("Weight for large time offset",min_weight_sec, 3,7,"", "Weight of pairs at very different time.");
gd.addNumericField("Overlap inportance", overlap_pow, 3,7,"", "Raise overlap fraction (of the smaller image) to this power before using as weight.");
gd.addNumericField("RMSE relative improvement", rms_diff, 8,10,"", "Relative RMSE improvement to exit LMA.");
gd.addNumericField("LMA iterations", num_iter, 0,3,"",".Maximal number of the LMA iterations.");
gd.addNumericField("Debug level for equalization",debugLevel, 0,3,"","Debug level for global (LMA-based) intensity equalization.");
gd.showDialog();
if (gd.wasCanceled()) return -1;
ignore_equalize = gd.getNextBoolean();
use_inv = gd.getNextBoolean();
scale_weight = gd.getNextNumber();
pull_weight = gd.getNextNumber();
half_weight_sec = gd.getNextNumber();
min_weight_sec = gd.getNextNumber();
overlap_pow = gd.getNextNumber();
rms_diff = gd.getNextNumber();
num_iter = (int) gd.getNextNumber();
debugLevel = (int) gd.getNextNumber();
return buildEqualize(
clt_parameters, // CLTParameters clt_parameters,
maps_collection, // OrthoMapsCollection maps_collection,
orthoMapsCollection_path, // String orthoMapsCollection_path,
ignore_equalize, // boolean ignore_equalize,
use_inv, // boolean use_inv,
scale_weight, // double scale_weight,
pull_weight, // double pull_weight,
half_weight_sec, // double half_weight_sec,
min_weight_sec, // double min_weight_sec,
overlap_pow, // double overlap_pow,
rms_diff, // double rms_diff,
num_iter, // int num_iter,
debugLevel); // int debugLevel);
}
public static int buildEqualize(
CLTParameters clt_parameters,
OrthoMapsCollection maps_collection,
String orthoMapsCollection_path,
boolean ignore_equalize,
boolean use_inv,
double scale_weight,
double pull_weight,
double half_weight_sec,
double min_weight_sec,
double overlap_pow,
double rms_diff,
int num_iter,
int debugLevel) {
double lambda = 0.1; double lambda = 0.1;
double lambda_scale_good = 0.5; double lambda_scale_good = 0.5;
double lambda_scale_bad = 8.0; double lambda_scale_bad = 8.0;
double lambda_max = 100; double lambda_max = 100;
boolean last_run = false; boolean last_run = false;
boolean ignore_equalization=false; // ignore previous equalization
int [] indices = maps_collection.getScenesSelection( int [] indices = maps_collection.getScenesSelection(
null, // boolean select_all, null, // boolean select_all,
" to build a map"); // String purpose) " to build a map"); // String purpose)
...@@ -83,7 +142,7 @@ public class OrthoEqualizeLMA { ...@@ -83,7 +142,7 @@ public class OrthoEqualizeLMA {
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
maps_collection, // OrthoMapsCollection maps_collection, maps_collection, // OrthoMapsCollection maps_collection,
indices, // int [] indices, indices, // int [] indices,
ignore_equalization, // boolean ignore_equalization, // ignore previous equalization ignore_equalize, // boolean ignore_equalization, // ignore previous equalization
// scale_weights applies both to pairs mismatch and per-scene values difference from neutral {1.0, 0.0} // scale_weights applies both to pairs mismatch and per-scene values difference from neutral {1.0, 0.0}
scale_weight, // double scale_weight, // relative weight of scale differences compared to offset differences scale_weight, // double scale_weight, // relative weight of scale differences compared to offset differences
pull_weight, // double pull_weight, // relative weight of offsets and scales differences from 1.0 to pairs mismatch pull_weight, // double pull_weight, // relative weight of offsets and scales differences from 1.0 to pairs mismatch
......
...@@ -4453,7 +4453,7 @@ public class OrthoMapsCollection implements Serializable{ ...@@ -4453,7 +4453,7 @@ public class OrthoMapsCollection implements Serializable{
double fill_fraction = clt_parameters.imp.pmtch_cent_fill; // should be populated not less than this double fill_fraction = clt_parameters.imp.pmtch_cent_fill; // should be populated not less than this
double fill_fraction_final = clt_parameters.imp.pmtch_cent_final; // should be populated not less than this during final pass double fill_fraction_final = clt_parameters.imp.pmtch_cent_final; // should be populated not less than this during final pass
double ease_nosfm = clt_parameters.imp.pmtch_ease_nosfm; // ease metric_error when no SfM gain == 0; double ease_nosfm = clt_parameters.imp.pmtch_ease_nosfm; // ease metric_error when no SfM gain == 0;
int min_scene = 0;
GenericJTabbedDialog gd = new GenericJTabbedDialog("Pairwise Match Parameters",1200,1000); GenericJTabbedDialog gd = new GenericJTabbedDialog("Pairwise Match Parameters",1200,1000);
gd.addMessage("Number of scenes - "+num_scenes+ gd.addMessage("Number of scenes - "+num_scenes+
", number of pairs (w/o inverse) - "+num_pairs+ ", number of pairs (w/o inverse) - "+num_pairs+
...@@ -4495,7 +4495,8 @@ public class OrthoMapsCollection implements Serializable{ ...@@ -4495,7 +4495,8 @@ public class OrthoMapsCollection implements Serializable{
gd.addNumericField("Central area minimal fill", fill_fraction, 3,7,"", "Central area minimal fill for all but the last iteration."); gd.addNumericField("Central area minimal fill", fill_fraction, 3,7,"", "Central area minimal fill for all but the last iteration.");
gd.addNumericField("Central area minimal fill final", fill_fraction_final, 3,7,"", "Central area minimal fill for the last iteration."); gd.addNumericField("Central area minimal fill final", fill_fraction_final, 3,7,"", "Central area minimal fill for the last iteration.");
gd.addNumericField("Relax metric error for no-SfM", ease_nosfm, 3,7,"", "Relax metric error for no-SfM scenes (sfm_gain==0)."); gd.addNumericField("Relax metric error for no-SfM", ease_nosfm, 3,7,"", "Relax metric error for no-SfM scenes (sfm_gain==0).");
gd.addNumericField("Start scene (skip all earlier)", min_scene, 0,3,"","To be able to continue skipping some.");
//
gd.showDialog(); gd.showDialog();
if (gd.wasCanceled()) return false; if (gd.wasCanceled()) return false;
...@@ -4533,6 +4534,7 @@ public class OrthoMapsCollection implements Serializable{ ...@@ -4533,6 +4534,7 @@ public class OrthoMapsCollection implements Serializable{
fill_fraction = gd.getNextNumber(); fill_fraction = gd.getNextNumber();
fill_fraction_final= gd.getNextNumber(); fill_fraction_final= gd.getNextNumber();
ease_nosfm = gd.getNextNumber(); ease_nosfm = gd.getNextNumber();
min_scene = (int) gd.getNextNumber();
return generatePairwiseMatches( return generatePairwiseMatches(
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
...@@ -4569,6 +4571,7 @@ public class OrthoMapsCollection implements Serializable{ ...@@ -4569,6 +4571,7 @@ public class OrthoMapsCollection implements Serializable{
ease_nosfm, // double ease_nosfm, ease_nosfm, // double ease_nosfm,
double_threshold, // double double_threshold, double_threshold, // double double_threshold,
max_rms_iter, // double [] max_rms_iter, max_rms_iter, // double [] max_rms_iter,
min_scene, // int min_scene,
debugLevel); // int debugLevel debugLevel); // int debugLevel
} }
...@@ -4609,6 +4612,7 @@ public class OrthoMapsCollection implements Serializable{ ...@@ -4609,6 +4612,7 @@ public class OrthoMapsCollection implements Serializable{
double ease_nosfm, double ease_nosfm,
double double_threshold, double double_threshold,
double [] max_rms_iter, double [] max_rms_iter,
int min_scene,
int debugLevel) { int debugLevel) {
boolean batch_mode = true; boolean batch_mode = true;
...@@ -4653,6 +4657,10 @@ public class OrthoMapsCollection implements Serializable{ ...@@ -4653,6 +4657,10 @@ public class OrthoMapsCollection implements Serializable{
ArrayList<Point> new_pairs = new ArrayList<Point>(); // started from spiral, not from the same or inverse ArrayList<Point> new_pairs = new ArrayList<Point>(); // started from spiral, not from the same or inverse
for (Point pair:pairs) { for (Point pair:pairs) {
int [] ipair = {indices[pair.x], indices[pair.y]}; int [] ipair = {indices[pair.x], indices[pair.y]};
if (ipair[0] < min_scene) {
System.out.println ("Skipping "+ipair[0]+":"+ipair[1]+" until "+min_scene);
continue;
}
boolean direct = indices[pair.x] < indices[pair.y]; boolean direct = indices[pair.x] < indices[pair.y];
int min_zoom_lev = ortho_maps[ipair[0]].getOriginalZoomLevel(); int min_zoom_lev = ortho_maps[ipair[0]].getOriginalZoomLevel();
int max_zoom_lev = ortho_maps[ipair[0]].getOriginalZoomLevel(); int max_zoom_lev = ortho_maps[ipair[0]].getOriginalZoomLevel();
......
...@@ -32,6 +32,7 @@ import java.util.Arrays; ...@@ -32,6 +32,7 @@ import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.CLTParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.GenericJTabbedDialog;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
import com.elphel.imagej.tileprocessor.ImageDtt; import com.elphel.imagej.tileprocessor.ImageDtt;
...@@ -217,18 +218,84 @@ public class OrthoMultiLMA { ...@@ -217,18 +218,84 @@ public class OrthoMultiLMA {
OrthoMapsCollection maps_collection, OrthoMapsCollection maps_collection,
String orthoMapsCollection_path String orthoMapsCollection_path
) { ) {
int debugLevel = 2; boolean move_only = clt_parameters.imp.pmap_move_only; // false;
boolean move_only = false; boolean ignore_affines = clt_parameters.imp.pmap_ignore_affines; // false;
boolean use_inv = clt_parameters.imp.pmap_use_inv; // false;
double skew_pull = clt_parameters.imp.pmap_skew_pull; // 1.0;
double tilt_pull = clt_parameters.imp.pmap_tilt_pull; // 1.0;
double scale_pull = clt_parameters.imp.pmap_scale_pull; // 0.1; // .0;
double position_pull = clt_parameters.imp.pmap_position_pull; // 0.0001;
double overlap_pow = clt_parameters.imp.pmap_overlap_pow; // 2.0; // match weight as overlap fraction to this power
double rms_diff = clt_parameters.imp.pmap_rms_diff; // 0.000001;
int num_iter = clt_parameters.imp.pmap_num_iter; // 100; // 50;
boolean show_result = clt_parameters.imp.pmap_show_result; // false;
int debugLevel = clt_parameters.imp.pmap_debugLevel; // 2;
GenericJTabbedDialog gd = new GenericJTabbedDialog("Pairwise Match Parameters",1200,400);
gd.addCheckbox ("Moves only", move_only, "Moves only, no affine transform.");
gd.addCheckbox ("Ignore existing affines", ignore_affines, "Start from unity matrices, ignore saved affines.");
gd.addCheckbox ("Use reversed pairs", use_inv, "Use reversed (late-early timestamps) pairs.");
gd.addNumericField("Skew pull", skew_pull, 7,10,"", "Intention to have axes perpendicular.");
gd.addNumericField("Tilt pull", tilt_pull, 7,10,"", "Intention to have axes same length.");
gd.addNumericField("Scale pull", scale_pull, 7,10,"", "Intention to have average scale of images = 1.0.");
gd.addNumericField("Position pull", position_pull,7,10,"", "Intension to match IMS (GNSS) coordinates.");
gd.addNumericField("Overlap inportance", overlap_pow, 3,7,"", "Raise overlap fraction (of the smaller image) to this power before using as weight.");
gd.addNumericField("RMSE relative improvement",rms_diff, 8,10,"", "Relative RMSE improvement to exit LMA.");
gd.addNumericField("LMA iterations", num_iter, 0,3,"",".Maximal number of the LMA iterations.");
gd.addCheckbox ("Show result image", show_result, ".");
gd.addNumericField("Debug level for maps", debugLevel, 0,3,"","Debug building for LMA building maps.");
gd.showDialog();
if (gd.wasCanceled()) return -1;
move_only = gd.getNextBoolean();
ignore_affines = gd.getNextBoolean();
use_inv = gd.getNextBoolean();
skew_pull = gd.getNextNumber();
tilt_pull = gd.getNextNumber();
scale_pull = gd.getNextNumber();
position_pull = gd.getNextNumber();
overlap_pow = gd.getNextNumber();
rms_diff = gd.getNextNumber();
num_iter = (int) gd.getNextNumber();
show_result = gd.getNextBoolean();
debugLevel = (int) gd.getNextNumber();
return buildOrthoMap(
clt_parameters, // CLTParameters clt_parameters,
maps_collection, // OrthoMapsCollection maps_collection,
orthoMapsCollection_path, // String orthoMapsCollection_path,
move_only, // boolean move_only,
ignore_affines, // boolean ignore_affines,
use_inv, // boolean use_inv,
skew_pull, // double skew_pull,
tilt_pull, // double tilt_pull,
scale_pull, // double scale_pull,
position_pull, // double position_pull,
overlap_pow, // double overlap_pow,
rms_diff, // double rms_diff,
num_iter, // int num_iter,
show_result, // boolean show_result,
debugLevel); // int debugLevel)
}
public static int buildOrthoMap(
CLTParameters clt_parameters,
OrthoMapsCollection maps_collection,
String orthoMapsCollection_path,
boolean move_only,
boolean ignore_affines,
boolean use_inv,
double skew_pull,
double tilt_pull,
double scale_pull,
double position_pull,
double overlap_pow,
double rms_diff,
int num_iter,
boolean show_result,
int debugLevel) {
double [] val_coord = null; // 1 - valid, 0 - invalid, minimize coordinates errors double [] val_coord = null; // 1 - valid, 0 - invalid, minimize coordinates errors
boolean ignore_affines = false;
boolean use_inv = false;
double overlap_pow = 2.0; // match weight as overlap fraction to this power
double skew_pull = 1.0;
double tilt_pull = 1.0;
double scale_pull = 0.1; // .0;
double position_pull = 0.0001;
boolean corr_avg= (skew_pull > 0) || (tilt_pull > 0) || (scale_pull > 0); boolean corr_avg= (skew_pull > 0) || (tilt_pull > 0) || (scale_pull > 0);
boolean show_result_image = false;
int [] indices = maps_collection.getScenesSelection( int [] indices = maps_collection.getScenesSelection(
null, // boolean select_all, null, // boolean select_all,
" to build a map"); // String purpose) " to build a map"); // String purpose)
...@@ -239,8 +306,6 @@ public class OrthoMultiLMA { ...@@ -239,8 +306,6 @@ public class OrthoMultiLMA {
double lambda_scale_good = 0.5; double lambda_scale_good = 0.5;
double lambda_scale_bad = 8.0; double lambda_scale_bad = 8.0;
double lambda_max = 100; double lambda_max = 100;
double rms_diff = 0.000001;
int num_iter = 100; // 50;
boolean last_run = false; boolean last_run = false;
oml.prepareLMA ( oml.prepareLMA (
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
...@@ -274,7 +339,7 @@ public class OrthoMultiLMA { ...@@ -274,7 +339,7 @@ public class OrthoMultiLMA {
//Get and apply affines //Get and apply affines
oml.updateAffines(maps_collection); oml.updateAffines(maps_collection);
if (show_result_image) { if (show_result) {
double [][][] affines = oml.getAffines(); double [][][] affines = oml.getAffines();
double [] fx = oml.getFx(); double [] fx = oml.getFx();
......
...@@ -148,6 +148,31 @@ public class IntersceneMatchParameters { ...@@ -148,6 +148,31 @@ public class IntersceneMatchParameters {
public String pwise_log_path = "/media/elphel/NVME/lwir16-proc/ortho_videos/debug/sept12-13/overlaps/pairwise_01.log"; public String pwise_log_path = "/media/elphel/NVME/lwir16-proc/ortho_videos/debug/sept12-13/overlaps/pairwise_01.log";
public int pwise_debug = 0; public int pwise_debug = 0;
public boolean pmap_move_only = false;
public boolean pmap_ignore_affines = false;
public boolean pmap_use_inv = false;
public double pmap_skew_pull = 1.0;
public double pmap_tilt_pull = 1.0;
public double pmap_scale_pull = 0.01; // was 0.1;
public double pmap_position_pull = 0.0001;
public double pmap_overlap_pow = 2.0; // match weight as overlap fraction to this power
public double pmap_rms_diff = 0.000001;
public int pmap_num_iter = 100; // 50;
public boolean pmap_show_result = false;
public int pmap_debugLevel = 2;
public boolean pequ_ignore_equalize= false; // ignore previous equalization
public boolean pequ_use_inv = false;
public double pequ_scale_weight = 500; // relative weight of scale differences compared to offset differences
public double pequ_pull_weight = 0.001; // relative weight of offsets and scales differences from 1.0 to pairs mismatch
public double pequ_half_weight_sec =300.0; // - time difference to reduce weight twice
public double pequ_min_weight_sec = 0.0; // 01; // weight of pairs at very different time
public double pequ_overlap_pow = 2.0; // match weight as overlap fraction to this power
public double pequ_rms_diff = 0.000001;
public int pequ_num_iter = 100; // 50;
public int pequ_debugLevel = 2;
public double [] getImsMountATR() { public double [] getImsMountATR() {
return new double [] { return new double [] {
...@@ -779,6 +804,32 @@ public class IntersceneMatchParameters { ...@@ -779,6 +804,32 @@ public class IntersceneMatchParameters {
gd.addStringField ("Log file full path", this.pwise_log_path, 150, "Path of the log file to be appended."); gd.addStringField ("Log file full path", this.pwise_log_path, 150, "Path of the log file to be appended.");
gd.addNumericField("Pairwise match debug level", this.pwise_debug, 0,3,"","Debug level during Spiral search."); gd.addNumericField("Pairwise match debug level", this.pwise_debug, 0,3,"","Debug level during Spiral search.");
gd.addMessage ("Build map with LMA from pairwise matches");
gd.addCheckbox ("Moves only", this.pmap_move_only, "Moves only, no affine transform.");
gd.addCheckbox ("Ignore existing affines", this.pmap_ignore_affines, "Start from unity matrices, ignore saved affines.");
gd.addCheckbox ("Use reversed pairs", this.pmap_use_inv, "Use reversed (late-early timestamps) pairs.");
gd.addNumericField("Skew pull", this.pmap_skew_pull, 3,7,"", "Intention to have axes perpendicular.");
gd.addNumericField("Tilt pull", this.pmap_tilt_pull, 3,7,"", "Intention to have axes same length.");
gd.addNumericField("Scale pull", this.pmap_scale_pull, 3,7,"", "Intention to have average scale of images = 1.0.");
gd.addNumericField("Position pull", this.pmap_position_pull, 3,7,"", "Intension to match IMS (GNSS) coordinates.");
gd.addNumericField("Overlap inportance", this.pmap_overlap_pow, 3,7,"", "Raise overlap fraction (of the smaller image) to this power before using as weight.");
gd.addNumericField("RMSE relative improvement", this.pmap_rms_diff, 3,7,"", "Relative RMSE improvement to exit LMA.");
gd.addNumericField("LMA iterations", this.pmap_num_iter, 0,3,"",".Maximal number of the LMA iterations.");
gd.addCheckbox ("Show result image", this.pmap_show_result, ".");
gd.addNumericField("Debug level for maps", this.pmap_debugLevel, 0,3,"","Debug building for LMA building maps.");
gd.addMessage ("Equalize map intensitieswith LMA from pairwise intensity matches");
gd.addCheckbox ("Ignore existing equalization",this.pequ_ignore_equalize, "Ignore existing equalization, start from scratch (a=1, b=0).");
gd.addCheckbox ("Use reversed pairs", this.pequ_use_inv, "Use reversed (late-early timestamps) pairs.");
gd.addNumericField("Relative scale weight", this.pequ_scale_weight, 3,7,"", "Importance of a-coefficient (scale) relative to b-coefficient (offset).");
gd.addNumericField("Pull weight", this.pequ_pull_weight, 3,7,"", "Relative weight of offsets and scales differences from 1.0 to pairs mismatch.");
gd.addNumericField("Half-weight time difference", this.pequ_half_weight_sec, 3,7,"s", "Time difference (in a pair) to reduce weight twice.");
gd.addNumericField("Weight for large time offset",this.pequ_min_weight_sec, 3,7,"", "Weight of pairs at very different time.");
gd.addNumericField("Overlap inportance", this.pequ_overlap_pow, 3,7,"", "Raise overlap fraction (of the smaller image) to this power before using as weight.");
gd.addNumericField("RMSE relative improvement", this.pequ_rms_diff, 3,7,"", "Relative RMSE improvement to exit LMA.");
gd.addNumericField("LMA iterations", this.pequ_num_iter, 0,3,"",".Maximal number of the LMA iterations.");
gd.addNumericField("Debug level for equalization",this.pequ_debugLevel, 0,3,"","Debug level for global (LMA-based) intensity equalization.");
// //
...@@ -1662,6 +1713,30 @@ public class IntersceneMatchParameters { ...@@ -1662,6 +1713,30 @@ public class IntersceneMatchParameters {
this.pwise_log_path = gd.getNextString(); this.pwise_log_path = gd.getNextString();
this.pwise_debug = (int) gd.getNextNumber(); this.pwise_debug = (int) gd.getNextNumber();
this.pmap_move_only = gd.getNextBoolean();
this.pmap_ignore_affines = gd.getNextBoolean();
this.pmap_use_inv = gd.getNextBoolean();
this.pmap_skew_pull = gd.getNextNumber();
this.pmap_tilt_pull = gd.getNextNumber();
this.pmap_scale_pull = gd.getNextNumber();
this.pmap_position_pull = gd.getNextNumber();
this.pmap_overlap_pow = gd.getNextNumber();
this.pmap_rms_diff = gd.getNextNumber();
this.pmap_num_iter = (int) gd.getNextNumber();
this.pmap_show_result = gd.getNextBoolean();
this.pmap_debugLevel = (int) gd.getNextNumber();
this.pequ_ignore_equalize = gd.getNextBoolean();
this.pequ_use_inv = gd.getNextBoolean();
this.pequ_scale_weight = gd.getNextNumber();
this.pequ_pull_weight = gd.getNextNumber();
this.pequ_half_weight_sec = gd.getNextNumber();
this.pequ_min_weight_sec = gd.getNextNumber();
this.pequ_overlap_pow = gd.getNextNumber();
this.pequ_rms_diff = gd.getNextNumber();
this.pequ_num_iter = (int) gd.getNextNumber();
this.pequ_debugLevel = (int) gd.getNextNumber();
this.center_reference = gd.getNextBoolean(); this.center_reference = gd.getNextBoolean();
this.overlap_sequences = gd.getNextBoolean(); this.overlap_sequences = gd.getNextBoolean();
this.reset_photometric = gd.getNextBoolean(); this.reset_photometric = gd.getNextBoolean();
...@@ -2162,6 +2237,30 @@ public class IntersceneMatchParameters { ...@@ -2162,6 +2237,30 @@ public class IntersceneMatchParameters {
properties.setProperty(prefix+"pwise_log_path", this.pwise_log_path + ""); // String properties.setProperty(prefix+"pwise_log_path", this.pwise_log_path + ""); // String
properties.setProperty(prefix+"pwise_debug", this.pwise_debug + ""); // int properties.setProperty(prefix+"pwise_debug", this.pwise_debug + ""); // int
properties.setProperty(prefix+"pmap_move_only", this.pmap_move_only + ""); // boolean
properties.setProperty(prefix+"pmap_ignore_affines", this.pmap_ignore_affines + ""); // boolean
properties.setProperty(prefix+"pmap_use_inv", this.pmap_use_inv + ""); // boolean
properties.setProperty(prefix+"pmap_skew_pull", this.pmap_skew_pull + ""); // double
properties.setProperty(prefix+"pmap_tilt_pull", this.pmap_tilt_pull + ""); // double
properties.setProperty(prefix+"pmap_scale_pull", this.pmap_scale_pull + ""); // double
properties.setProperty(prefix+"pmap_position_pull", this.pmap_position_pull + ""); // double
properties.setProperty(prefix+"pmap_overlap_pow", this.pmap_overlap_pow + ""); // double
properties.setProperty(prefix+"pmap_rms_diff", this.pmap_rms_diff + ""); // double
properties.setProperty(prefix+"pmap_num_iter", this.pmap_num_iter + ""); // int
properties.setProperty(prefix+"pmap_show_result", this.pmap_show_result + ""); // boolean
properties.setProperty(prefix+"pmap_debugLevel", this.pmap_debugLevel + ""); // int
properties.setProperty(prefix+"pequ_ignore_equalize", this.pequ_ignore_equalize + ""); // boolean
properties.setProperty(prefix+"pequ_use_inv", this.pequ_use_inv + ""); // boolean
properties.setProperty(prefix+"pequ_scale_weight", this.pequ_scale_weight + ""); // double
properties.setProperty(prefix+"pequ_pull_weight", this.pequ_pull_weight + ""); // double
properties.setProperty(prefix+"pequ_half_weight_sec", this.pequ_half_weight_sec + ""); // double
properties.setProperty(prefix+"pequ_min_weight_sec ", this.pequ_min_weight_sec + ""); // double
properties.setProperty(prefix+"pequ_overlap_pow", this.pequ_overlap_pow + ""); // double
properties.setProperty(prefix+"pequ_rms_diff", this.pequ_rms_diff + ""); // double
properties.setProperty(prefix+"pequ_num_iter", this.pequ_num_iter + ""); // int
properties.setProperty(prefix+"pequ_debugLevel", this.pequ_debugLevel + ""); // int
properties.setProperty(prefix+"center_reference", this.center_reference + ""); // boolean properties.setProperty(prefix+"center_reference", this.center_reference + ""); // boolean
properties.setProperty(prefix+"overlap_sequences", this.overlap_sequences + ""); // boolean properties.setProperty(prefix+"overlap_sequences", this.overlap_sequences + ""); // boolean
properties.setProperty(prefix+"reset_photometric", this.reset_photometric + ""); // boolean properties.setProperty(prefix+"reset_photometric", this.reset_photometric + ""); // boolean
...@@ -2624,6 +2723,30 @@ public class IntersceneMatchParameters { ...@@ -2624,6 +2723,30 @@ public class IntersceneMatchParameters {
if (properties.getProperty(prefix+"pwise_log_path")!=null) this.pwise_log_path=(String) properties.getProperty(prefix+ "pwise_log_path"); if (properties.getProperty(prefix+"pwise_log_path")!=null) this.pwise_log_path=(String) properties.getProperty(prefix+ "pwise_log_path");
if (properties.getProperty(prefix+"pwise_debug")!=null) this.pwise_debug=Integer.parseInt(properties.getProperty(prefix+ "pwise_debug")); if (properties.getProperty(prefix+"pwise_debug")!=null) this.pwise_debug=Integer.parseInt(properties.getProperty(prefix+ "pwise_debug"));
if (properties.getProperty(prefix+"pmap_move_only")!=null) this.pmap_move_only=Boolean.parseBoolean(properties.getProperty(prefix+ "pmap_move_only"));
if (properties.getProperty(prefix+"pmap_ignore_affines")!=null)this.pmap_ignore_affines=Boolean.parseBoolean(properties.getProperty(prefix+"pmap_ignore_affines"));
if (properties.getProperty(prefix+"pmap_use_inv")!=null) this.pmap_use_inv=Boolean.parseBoolean(properties.getProperty(prefix+ "pmap_use_inv"));
if (properties.getProperty(prefix+"pmap_skew_pull")!=null) this.pmap_skew_pull=Double.parseDouble(properties.getProperty(prefix+ "pmap_skew_pull"));
if (properties.getProperty(prefix+"pmap_tilt_pull")!=null) this.pmap_tilt_pull=Double.parseDouble(properties.getProperty(prefix+ "pmap_tilt_pull"));
if (properties.getProperty(prefix+"pmap_scale_pull")!=null) this.pmap_scale_pull=Double.parseDouble(properties.getProperty(prefix+ "pmap_scale_pull"));
if (properties.getProperty(prefix+"pmap_position_pull")!=null) this.pmap_position_pull=Double.parseDouble(properties.getProperty(prefix+ "pmap_position_pull"));
if (properties.getProperty(prefix+"pmap_overlap_pow")!=null) this.pmap_overlap_pow=Double.parseDouble(properties.getProperty(prefix+ "pmap_overlap_pow"));
if (properties.getProperty(prefix+"pmap_rms_diff")!=null) this.pmap_rms_diff=Double.parseDouble(properties.getProperty(prefix+ "pmap_rms_diff"));
if (properties.getProperty(prefix+"pmap_num_iter")!=null) this.pmap_num_iter=Integer.parseInt(properties.getProperty(prefix+ "pmap_num_iter"));
if (properties.getProperty(prefix+"pmap_show_result")!=null) this.pmap_show_result=Boolean.parseBoolean(properties.getProperty(prefix+ "pmap_show_result"));
if (properties.getProperty(prefix+"pmap_debugLevel")!=null) this.pmap_debugLevel=Integer.parseInt(properties.getProperty(prefix+ "pmap_debugLevel"));
if (properties.getProperty(prefix+"pequ_ignore_equalize")!=null)this.pequ_ignore_equalize=Boolean.parseBoolean(properties.getProperty(prefix+"pequ_ignore_equalize"));
if (properties.getProperty(prefix+"pequ_use_inv")!=null) this.pequ_use_inv=Boolean.parseBoolean(properties.getProperty(prefix+ "pequ_use_inv"));
if (properties.getProperty(prefix+"pequ_scale_weight")!=null) this.pequ_scale_weight=Double.parseDouble(properties.getProperty(prefix+ "pequ_scale_weight"));
if (properties.getProperty(prefix+"pequ_pull_weight")!=null) this.pequ_pull_weight=Double.parseDouble(properties.getProperty(prefix+ "pequ_pull_weight"));
if (properties.getProperty(prefix+"pequ_half_weight_sec")!=null)this.pequ_half_weight_sec=Double.parseDouble(properties.getProperty(prefix+ "pequ_half_weight_sec"));
if (properties.getProperty(prefix+"pequ_min_weight_sec ")!=null)this.pequ_min_weight_sec =Double.parseDouble(properties.getProperty(prefix+ "pequ_min_weight_sec "));
if (properties.getProperty(prefix+"pequ_overlap_pow")!=null) this.pequ_overlap_pow=Double.parseDouble(properties.getProperty(prefix+ "pequ_overlap_pow"));
if (properties.getProperty(prefix+"pequ_rms_diff")!=null) this.pequ_rms_diff=Double.parseDouble(properties.getProperty(prefix+ "pequ_rms_diff"));
if (properties.getProperty(prefix+"pequ_num_iter")!=null) this.pequ_num_iter=Integer.parseInt(properties.getProperty(prefix+ "pequ_num_iter"));
if (properties.getProperty(prefix+"pequ_debugLevel")!=null) this.pequ_debugLevel=Integer.parseInt(properties.getProperty(prefix+ "pequ_debugLevel"));
if (properties.getProperty(prefix+"center_reference")!=null) this.center_reference=Boolean.parseBoolean(properties.getProperty(prefix+"center_reference")); if (properties.getProperty(prefix+"center_reference")!=null) this.center_reference=Boolean.parseBoolean(properties.getProperty(prefix+"center_reference"));
if (properties.getProperty(prefix+"overlap_sequences")!=null) this.overlap_sequences=Boolean.parseBoolean(properties.getProperty(prefix+"overlap_sequences")); if (properties.getProperty(prefix+"overlap_sequences")!=null) this.overlap_sequences=Boolean.parseBoolean(properties.getProperty(prefix+"overlap_sequences"));
if (properties.getProperty(prefix+"reset_photometric")!=null) this.reset_photometric=Boolean.parseBoolean(properties.getProperty(prefix+"reset_photometric")); if (properties.getProperty(prefix+"reset_photometric")!=null) this.reset_photometric=Boolean.parseBoolean(properties.getProperty(prefix+"reset_photometric"));
...@@ -3113,6 +3236,30 @@ public class IntersceneMatchParameters { ...@@ -3113,6 +3236,30 @@ public class IntersceneMatchParameters {
imp.pwise_log_path = this.pwise_log_path; imp.pwise_log_path = this.pwise_log_path;
imp.pwise_debug = this.pwise_debug; imp.pwise_debug = this.pwise_debug;
imp.pmap_move_only = this.pmap_move_only;
imp.pmap_ignore_affines = this.pmap_ignore_affines;
imp.pmap_use_inv = this.pmap_use_inv;
imp.pmap_skew_pull = this.pmap_skew_pull;
imp.pmap_tilt_pull = this.pmap_tilt_pull;
imp.pmap_scale_pull = this.pmap_scale_pull;
imp.pmap_position_pull = this.pmap_position_pull;
imp.pmap_overlap_pow = this.pmap_overlap_pow;
imp.pmap_rms_diff = this.pmap_rms_diff;
imp.pmap_num_iter = this.pmap_num_iter;
imp.pmap_show_result = this.pmap_show_result;
imp.pmap_debugLevel = this.pmap_debugLevel;
imp.pequ_ignore_equalize = this.pequ_ignore_equalize;
imp.pequ_use_inv = this.pequ_use_inv;
imp.pequ_scale_weight = this.pequ_scale_weight;
imp.pequ_pull_weight = this.pequ_pull_weight;
imp.pequ_half_weight_sec = this.pequ_half_weight_sec;
imp.pequ_min_weight_sec = this.pequ_min_weight_sec ;
imp.pequ_overlap_pow = this.pequ_overlap_pow;
imp.pequ_rms_diff = this.pequ_rms_diff;
imp.pequ_num_iter = this.pequ_num_iter;
imp.pequ_debugLevel = this.pequ_debugLevel;
imp.center_reference = this.center_reference; imp.center_reference = this.center_reference;
imp.overlap_sequences = this.overlap_sequences; imp.overlap_sequences = this.overlap_sequences;
imp.reset_photometric = this.reset_photometric; imp.reset_photometric = this.reset_photometric;
......
...@@ -2459,7 +2459,7 @@ public class TriMesh { ...@@ -2459,7 +2459,7 @@ public class TriMesh {
correctDistortions, // requires backdrop image to be corrected also correctDistortions, // requires backdrop image to be corrected also
geometryCorrection);// final GeometryCorrection geometryCorrection) geometryCorrection);// final GeometryCorrection geometryCorrection)
/* /*
* Triangulate all vertice indices - combine triangulation of same-size equailateral 45-degree * Triangulate all vertice indices - combine triangulation of same-size equilateral 45-degree
* large (tile size) and small (tile subdivisions) and add connections between large and small ones * large (tile size) and small (tile subdivisions) and add connections between large and small ones
*/ */
int [][] triangles = triangulateAll( int [][] triangles = triangulateAll(
......
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