Commit 388be26d authored by Andrey Filippov's avatar Andrey Filippov

Implemented saving parameters with the model version, fixed bugs

parent a8fe8f68
...@@ -504,7 +504,7 @@ public class CLTParameters { ...@@ -504,7 +504,7 @@ public class CLTParameters {
public double gmap_discard_rdisp = 0.02; // discard above/below this fraction of average height public double gmap_discard_rdisp = 0.02; // discard above/below this fraction of average height
public double gmap_pix_size = 0.005; // hdr_x0y0, // in meters public double gmap_pix_size = 0.005; // hdr_x0y0, // in meters
public int gmap_max_image_width = 4000; // 3200; // increase pixel size as a power of 2 until image fits public int gmap_max_image_width = 4000; // 3200; // increase pixel size as a power of 2 until image fits
public double gmap_min_sfm = 10.0; // minimal SfM gain to keep ground map public double gmap_min_sfm = 2.0; //10.0; // minimal SfM gain to keep ground map
public double gmap_frac_sfm = 0.25; // Disregard SfM mask if lower good SfM area public double gmap_frac_sfm = 0.25; // Disregard SfM mask if lower good SfM area
public boolean gmap_crop_empty = true; public boolean gmap_crop_empty = true;
public int gmap_crop_extra = 20; public int gmap_crop_extra = 20;
......
package com.elphel.imagej.correction;
import java.io.File;
import javax.swing.filechooser.FileFilter;
public class MultipleExtensionsFileFilter extends FileFilter {
protected String[] patterns;
protected String description = "JP4 files";
public MultipleExtensionsFileFilter(String[] patterns, String description) {
this.description = description;
this.patterns = patterns.clone();
}
public MultipleExtensionsFileFilter(String[] patterns) {
this.patterns = patterns.clone();
}
@Override
public boolean accept(File file) {
int i;
String name = file.getName();
if (file.isDirectory())
return true;
for (i = 0; i < patterns.length; i++) {
if (name.toLowerCase().endsWith(patterns[i].toLowerCase()))
return true;
}
return false;
}
@Override
public String getDescription() {
return description;
}
}
...@@ -1075,7 +1075,7 @@ public class ErsCorrection extends GeometryCorrection { ...@@ -1075,7 +1075,7 @@ public class ErsCorrection extends GeometryCorrection {
System.arraycopy(deltas0, 0, deltas, 0, deltas0.length); System.arraycopy(deltas0, 0, deltas, 0, deltas0.length);
System.arraycopy(deltas0, 3, deltas, deltas0.length, deltas0.length - 3); System.arraycopy(deltas0, 3, deltas, deltas0.length, deltas0.length - 3);
for (int i = 0; i < deltas.length; i++) deltas[i] *= scale_delta; for (int i = 0; i < deltas.length; i++) deltas[i] *= scale_delta;
int dbg_tile = 7508; // 56:23 // 16629; int dbg_tile = -7508; // 56:23 // 16629;
ErsCorrection scene_ers = scene_QuadClt.getErsCorrection(); ErsCorrection scene_ers = scene_QuadClt.getErsCorrection();
TileProcessor tp = reference_QuadClt.getTileProcessor(); TileProcessor tp = reference_QuadClt.getTileProcessor();
int tilesX = tp.getTilesX(); int tilesX = tp.getTilesX();
......
...@@ -65,7 +65,7 @@ public class IntersceneMatchParameters { ...@@ -65,7 +65,7 @@ public class IntersceneMatchParameters {
public boolean sfm_use = true; // use SfM to improve depth map public boolean sfm_use = true; // use SfM to improve depth map
public double sfm_min_base = 0.6; // 2.0; // use SfM if baseline exceeds this public double sfm_min_base = 0.6; // 2.0; // use SfM if baseline exceeds this
public double sfm_min_gain = 3.0; // 5.0; // Minimal SfM gain to apply SfM to the depth map public double sfm_min_gain = 2.0; // 5.0; // Minimal SfM gain to apply SfM to the depth map
public double sfm_min_frac = 0.5; // Minimal fraction of defined tiles to have SfM correction public double sfm_min_frac = 0.5; // Minimal fraction of defined tiles to have SfM correction
public int sfm_num_pairs = 32; // desired number of SfM pairs to average public int sfm_num_pairs = 32; // desired number of SfM pairs to average
......
...@@ -6492,6 +6492,17 @@ public class OpticalFlow { ...@@ -6492,6 +6492,17 @@ public class OpticalFlow {
start_ref_pointers[0] = earliest_scene; start_ref_pointers[0] = earliest_scene;
start_ref_pointers[1] = ref_index; start_ref_pointers[1] = ref_index;
} }
// temporary fix save/restore linkedModels, sourceDirectory, sourcePaths
// that are copied main-> aux in EyesisCorrectionParameters.updateAuxFromMain()
// quadCLT_main.correctionsParameters
String bkp_linkedModels = quadCLT_main.correctionsParameters.linkedModels;
String bkp_sourceDirectory = quadCLT_main.correctionsParameters.sourceDirectory;
String [] bkp_sourcePaths = quadCLT_main.correctionsParameters.sourcePaths;
quadCLTs[ref_index].saveConfInModelDirectory(); // save all (global) configurations in model/version directory
quadCLT_main.correctionsParameters.linkedModels = bkp_linkedModels;
quadCLT_main.correctionsParameters.sourceDirectory = bkp_sourceDirectory;
quadCLT_main.correctionsParameters.sourcePaths = bkp_sourcePaths;
System.out.println("buildSeries(): DONE"); // System.out.println("buildSeries(): DONE"); //
return quadCLTs[ref_index].getX3dTopDirectory(); return quadCLTs[ref_index].getX3dTopDirectory();
} }
......
...@@ -4979,6 +4979,21 @@ public class QuadCLTCPU { ...@@ -4979,6 +4979,21 @@ public class QuadCLTCPU {
return file_path; return file_path;
} }
public String saveConfInModelDirectory()
{
String x3d_path = getX3dDirectory();
String file_name = image_name + "-SETTINGS";
String file_path = x3d_path + Prefs.getFileSeparator() + file_name;
Properties properties=new Properties();
Eyesis_Correction.saveProperties(
file_path,
null,
true,
properties,
0); // DEBUG_LEVEL >-3);
return file_path;
}
public String saveAVIInModelDirectory( public String saveAVIInModelDirectory(
boolean dry_run, boolean dry_run,
......
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