doublerad_fraction=clt_parameters.imp.pmtch_cent_rad;// center circle radius fraction of 0.5* min(width, height) in tiles
doublemax_tile_rad=clt_parameters.imp.pmtch_max_cent_rad;// maximal center radius in tiles (limit pmtch_cent_rad)
doublefill_fraction=clt_parameters.imp.pmtch_cent_fill;// should be populated not less than this
doublefill_fraction_final=clt_parameters.imp.pmtch_cent_final;// should be populated not less than this during final pass
doubleease_nosfm=clt_parameters.imp.pmtch_ease_nosfm;// ease metric_error when no SfM gain == 0;
booleanuse_multi=true;
intheur=15;
intmin_scene=0;
GenericJTabbedDialoggd=newGenericJTabbedDialog("Pairwise Match Parameters",1200,1000);
gd.addMessage("Number of scenes - "+indices.length+
", number of defined pairs - "+num_defined+
", number of undefined pairs - "+num_undefined+
", number of disconnected groups - "+hs.size());
//
gd.addCheckbox("Dry run",dry_run,"Create pairs, do not adjust.");
gd.addCheckbox("Skip existing",skip_exist,"Do not regenerate if match with same or higher resolution exists.");
gd.addCheckbox("Refine existing",refine_exist,"Refine existing matches (false - start from scratch with spiral search).");
gd.addCheckbox("Delete failed",delete_failed,"Delete previous matches if it failed now.");
gd.addCheckbox("Generate inverse matches",gen_inverse,"Generate (refine if exist and enabled) inverse matches.");
gd.addCheckbox("Save state after each match",save_each,"Update state file after each match generation to mitigate possible crashes.");
gd.addCheckbox("Write log file",log_append,"Enable writing log file with matching results.");
gd.addStringField("Log file full path",log_path,150,"Path of the log file to be appended.");
gd.addNumericField("Pairwise match debug level",debugLevel,0,3,"","Debug level during Spiral search.");
gd.addMessage("Initial spiral search for image matching");
gd.addNumericField("Spiral search step",search_step,3,7,"scaled pix","Distance between spiral search probes, in scaled pixels.");
gd.addNumericField("Spiral search radius",search_range,3,7,"scaled pix","Maximal radius of the spiral search, in scaled pixels.");
gd.addNumericField("Mitigate small overlap",double_threshold,3,7,"","For small overlaps increase zoom by 1 and range - twice.");
gd.addNumericField("RMSE to end search",good_rms,3,7,"scaled pix","Maximal RMSE to consider match, in scaled pixels.");
gd.addNumericField("Satisfactory RMSE",max_rms,3,7,"scaled pix","Maximal RMSE to consider match, in scaled pixels.");
gd.addNumericField("Minimal overlap",min_overlap,0,4,"scaled pix ^ 2","Minimal overlap area in square scaled pixels.");
gd.addNumericField("LMA iterations",num_iter_lma,0,2,"","Number of LMA iterations during spiral search.");
gd.addNumericField("RMSE at first iteration",max_rms_iter[0],3,7,"scaled pix","Maximal RMSE at first iteration.");
gd.addNumericField("RMSE at second iteration",max_rms_iter[1],3,7,"scaled pix","Maximal RMSE at second iteration.");
gd.addCheckbox("Ignore worsening RMSE",spiral_ignore_rms,"Ignore worsening/not improving RMSE during spiral search.");
gd.addNumericField("Spiral search debug level",spiral_debug,0,3,"","Debug level during Spiral search.");
gd.addMessage("Final pairwise scenes matching");
gd.addNumericField("Remove fraction of worst matches",frac_remove,3,7,"","When fitting scenes remove this fraction of worst match tiles.");
gd.addNumericField("Maximal metric error",metric_err,3,7,"m","Maximal tolerable fitting error caused by elevation variations.");
gd.addCheckbox("Use scenes' affine",pmtch_use_affine,"Use known scenes' affine matrices, false - start from scratch (unity) ones.");
gd.addNumericField("Central area standard deviation",max_std,3,7,"","Central area limit by the standard deviation.");
gd.addNumericField("Central area minimal radius",min_std_rad,3,7,"tile","Minimal radius of the central area after all LMA passes.");
gd.addCheckbox("Ignore previous RMSE",ignore_prev_rms,"Do not exit full fitting cycles if the RMSE worsened/not improved.");
gd.addNumericField("Number of fitting iterations",num_tries,0,3,"","number of full fittng iterations.");
gd.addNumericField("Central area radius as fraction",rad_fraction,3,7,"","Central area radius as fraction of half minimal WOI dimension.");
gd.addNumericField("Maximal central area radius",max_tile_rad,3,7,"tiles","Absolute limit to the center area radius (eases bad peripheral matching).");
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("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.addNumericField("Heuristics bitmap",heur,0,3,"","Bitmap of modes to suggest the next pair.");
gd.addCheckbox("Use multiple threads",use_multi,"Use multipl tghreads (may be disabled in debug mode).");
//
gd.showDialog();
if(gd.wasCanceled())returnfalse;
dry_run=gd.getNextBoolean();
skip_exist=gd.getNextBoolean();
refine_exist=gd.getNextBoolean();
delete_failed=gd.getNextBoolean();
gen_inverse=gd.getNextBoolean();
save_each=gd.getNextBoolean();
log_append=gd.getNextBoolean();
log_path=gd.getNextString();
debugLevel=(int)gd.getNextNumber();
search_step=gd.getNextNumber();
search_range=gd.getNextNumber();
double_threshold=gd.getNextNumber();
good_rms=gd.getNextNumber();
max_rms=gd.getNextNumber();
min_overlap=(int)gd.getNextNumber();
num_iter_lma=(int)gd.getNextNumber();
max_rms_iter[0]=gd.getNextNumber();
max_rms_iter[1]=gd.getNextNumber();
spiral_ignore_rms=gd.getNextBoolean();
spiral_debug=(int)gd.getNextNumber();
frac_remove=gd.getNextNumber();
metric_err=gd.getNextNumber();
pmtch_use_affine=gd.getNextBoolean();
max_std=gd.getNextNumber();
min_std_rad=gd.getNextNumber();
ignore_prev_rms=gd.getNextBoolean();
num_tries=(int)gd.getNextNumber();
rad_fraction=gd.getNextNumber();
max_tile_rad=gd.getNextNumber();
fill_fraction=gd.getNextNumber();
fill_fraction_final=gd.getNextNumber();
ease_nosfm=gd.getNextNumber();
min_scene=(int)gd.getNextNumber();
heur=(int)gd.getNextNumber();
use_multi=gd.getNextBoolean();
if(dry_run){
PairsGraphpairsGraph=newPairsGraph(
this,// OrthoMapsCollection orthoMapsCollection,
indices,// int [] indices,
use_multi,// boolean multi,
debugLevel);// int debugLevel);
returnpairsGraph.dryRun(
heur,// int heur,
debugLevel);// int debugLevel)
/*
int [][] pairs = getPairsIndices( // maybe update sometimes?
pair_state, // final int [][] pair_state,
groups); // final int [] groups);
*
int num_compact = 10; // compact after each 10 runs
int num_pairs = 0;
int ok_dist = 1;
int [] start_ij = {0,0};
int [] next_pair;
do {
next_pair = suggestPairSingle( // single-connected, no cycles
// add some parameters
heur, // int heur,
pairs, // int [][] pairs,
pair_state, // int [][] pair_state, // = new int [indices.length][indices.length];
overlaps, // double [][] overlaps, // = new double [indices.length][indices.length];
timestamps, // double [] timestamps, // = new double [indices.length];
groups, // int [] groups, // = new int [indices.length];
dist, // int [][] dist) { // = new int [indices.length];
ok_dist, // int ok_dist)
start_ij); // int [] start_ij) // = new int [indices.length];