Commit 440719d9 authored by Andrey Filippov's avatar Andrey Filippov

Working snapshot, will add selective disabling of terrain, vegetatio,

alpha adjustment
parent e72b18ee
...@@ -34,8 +34,8 @@ public class OpticalFlowParameters { ...@@ -34,8 +34,8 @@ public class OpticalFlowParameters {
public double tolerance_absolute_ref = 0.25; // absolute disparity half-range in each tile public double tolerance_absolute_ref = 0.25; // absolute disparity half-range in each tile
public double tolerance_relative_ref = 0.2; // relative disparity half-range in each tile public double tolerance_relative_ref = 0.2; // relative disparity half-range in each tile
public double center_occupancy_ref = 0.25; // fraction of remaining tiles in the center 8x8 area (<1.0) public double center_occupancy_ref = 0.25; // fraction of remaining tiles in the center 8x8 area (<1.0)
public int num_laplassian = 100; public int num_laplacian = 100;
public double change_laplassian = 0.005 ; public double change_laplacian = 0.005 ;
public double tolerance_absolute_inter = 0.25; // absolute disparity half-range in each tile public double tolerance_absolute_inter = 0.25; // absolute disparity half-range in each tile
public double tolerance_relative_inter = 0.2; // relative disparity half-range in each tile public double tolerance_relative_inter = 0.2; // relative disparity half-range in each tile
public double occupancy_inter = 0.25; // fraction of remaining tiles in the center 8x8 area (<1.0) public double occupancy_inter = 0.25; // fraction of remaining tiles in the center 8x8 area (<1.0)
...@@ -99,9 +99,9 @@ public class OpticalFlowParameters { ...@@ -99,9 +99,9 @@ public class OpticalFlowParameters {
"Filter reference scene tiles in a macrotile by disparity (relative to disparity)"); "Filter reference scene tiles in a macrotile by disparity (relative to disparity)");
gd.addNumericField("Minimal fraction of disparity-compliant tiles in the reference center", this.center_occupancy_ref, 4,6,"", gd.addNumericField("Minimal fraction of disparity-compliant tiles in the reference center", this.center_occupancy_ref, 4,6,"",
"Discard reference macrotile with less fraction of remaining tiles after filtering by the same disparity in the center 8x8 of the 16x16 macrotile"); "Discard reference macrotile with less fraction of remaining tiles after filtering by the same disparity in the center 8x8 of the 16x16 macrotile");
gd.addNumericField("Number of replace-NaN Laplassian passes", this.num_laplassian, 0,4,"", gd.addNumericField("Number of replace-NaN Laplacian passes", this.num_laplacian, 0,4,"",
"Maximal number of repetitions replacing the removed by disparity filtered tiles by weighted average of the 8 neighbors"); "Maximal number of repetitions replacing the removed by disparity filtered tiles by weighted average of the 8 neighbors");
gd.addNumericField("Maximal change threshold for Laplassian NaN replacement", this.change_laplassian, 5,8,"", gd.addNumericField("Maximal change threshold for Laplacian NaN replacement", this.change_laplacian, 5,8,"",
"Exit replacement passes when maximal change falls below this threshold"); "Exit replacement passes when maximal change falls below this threshold");
gd.addNumericField("Absolute disparity interscene tolerance", this.tolerance_absolute_inter, 3,6,"pix", gd.addNumericField("Absolute disparity interscene tolerance", this.tolerance_absolute_inter, 3,6,"pix",
"Filter scene tiles in a macrotile by interscene disparity comparison (absolute term)"); "Filter scene tiles in a macrotile by interscene disparity comparison (absolute term)");
...@@ -207,8 +207,8 @@ public class OpticalFlowParameters { ...@@ -207,8 +207,8 @@ public class OpticalFlowParameters {
this.tolerance_absolute_ref = gd.getNextNumber(); this.tolerance_absolute_ref = gd.getNextNumber();
this.tolerance_relative_ref = gd.getNextNumber(); this.tolerance_relative_ref = gd.getNextNumber();
this.center_occupancy_ref = gd.getNextNumber(); this.center_occupancy_ref = gd.getNextNumber();
this.num_laplassian = (int) gd.getNextNumber(); this.num_laplacian = (int) gd.getNextNumber();
this.change_laplassian = gd.getNextNumber(); this.change_laplacian = gd.getNextNumber();
this.tolerance_absolute_inter = gd.getNextNumber(); this.tolerance_absolute_inter = gd.getNextNumber();
this.tolerance_relative_inter = gd.getNextNumber(); this.tolerance_relative_inter = gd.getNextNumber();
this.occupancy_inter = gd.getNextNumber(); this.occupancy_inter = gd.getNextNumber();
...@@ -265,8 +265,8 @@ public class OpticalFlowParameters { ...@@ -265,8 +265,8 @@ public class OpticalFlowParameters {
properties.setProperty(prefix+"tolerance_absolute_ref", this.tolerance_absolute_ref+""); properties.setProperty(prefix+"tolerance_absolute_ref", this.tolerance_absolute_ref+"");
properties.setProperty(prefix+"tolerance_relative_ref", this.tolerance_relative_ref+""); properties.setProperty(prefix+"tolerance_relative_ref", this.tolerance_relative_ref+"");
properties.setProperty(prefix+"center_occupancy_ref", this.center_occupancy_ref+""); properties.setProperty(prefix+"center_occupancy_ref", this.center_occupancy_ref+"");
properties.setProperty(prefix+"num_laplassian", this.num_laplassian+""); properties.setProperty(prefix+"num_laplacian", this.num_laplacian+"");
properties.setProperty(prefix+"change_laplassian", this.change_laplassian+""); properties.setProperty(prefix+"change_laplacian", this.change_laplacian+"");
properties.setProperty(prefix+"tolerance_absolute_inter", this.tolerance_absolute_inter+""); properties.setProperty(prefix+"tolerance_absolute_inter", this.tolerance_absolute_inter+"");
properties.setProperty(prefix+"tolerance_relative_inter", this.tolerance_relative_inter+""); properties.setProperty(prefix+"tolerance_relative_inter", this.tolerance_relative_inter+"");
properties.setProperty(prefix+"occupancy_inter", this.occupancy_inter+""); properties.setProperty(prefix+"occupancy_inter", this.occupancy_inter+"");
...@@ -320,8 +320,8 @@ public class OpticalFlowParameters { ...@@ -320,8 +320,8 @@ public class OpticalFlowParameters {
if (properties.getProperty(prefix+"tolerance_absolute_ref")!=null) this.tolerance_absolute_ref=Double.parseDouble(properties.getProperty(prefix+"tolerance_absolute_ref")); if (properties.getProperty(prefix+"tolerance_absolute_ref")!=null) this.tolerance_absolute_ref=Double.parseDouble(properties.getProperty(prefix+"tolerance_absolute_ref"));
if (properties.getProperty(prefix+"tolerance_relative_ref")!=null) this.tolerance_relative_ref=Double.parseDouble(properties.getProperty(prefix+"tolerance_relative_ref")); if (properties.getProperty(prefix+"tolerance_relative_ref")!=null) this.tolerance_relative_ref=Double.parseDouble(properties.getProperty(prefix+"tolerance_relative_ref"));
if (properties.getProperty(prefix+"center_occupancy_ref")!=null) this.center_occupancy_ref=Double.parseDouble(properties.getProperty(prefix+"center_occupancy_ref")); if (properties.getProperty(prefix+"center_occupancy_ref")!=null) this.center_occupancy_ref=Double.parseDouble(properties.getProperty(prefix+"center_occupancy_ref"));
if (properties.getProperty(prefix+"num_laplassian")!=null) this.num_laplassian=Integer.parseInt(properties.getProperty(prefix+"num_laplassian")); if (properties.getProperty(prefix+"num_laplacian")!=null) this.num_laplacian=Integer.parseInt(properties.getProperty(prefix+"num_laplacian"));
if (properties.getProperty(prefix+"change_laplassian")!=null) this.change_laplassian=Double.parseDouble(properties.getProperty(prefix+"change_laplassian")); if (properties.getProperty(prefix+"change_laplacian")!=null) this.change_laplacian=Double.parseDouble(properties.getProperty(prefix+"change_laplacian"));
if (properties.getProperty(prefix+"tolerance_absolute_inter")!=null) this.tolerance_absolute_inter=Double.parseDouble(properties.getProperty(prefix+"tolerance_absolute_inter")); if (properties.getProperty(prefix+"tolerance_absolute_inter")!=null) this.tolerance_absolute_inter=Double.parseDouble(properties.getProperty(prefix+"tolerance_absolute_inter"));
if (properties.getProperty(prefix+"tolerance_relative_inter")!=null) this.tolerance_relative_inter=Double.parseDouble(properties.getProperty(prefix+"tolerance_relative_inter")); if (properties.getProperty(prefix+"tolerance_relative_inter")!=null) this.tolerance_relative_inter=Double.parseDouble(properties.getProperty(prefix+"tolerance_relative_inter"));
if (properties.getProperty(prefix+"occupancy_inter")!=null) this.occupancy_inter=Double.parseDouble(properties.getProperty(prefix+"occupancy_inter")); if (properties.getProperty(prefix+"occupancy_inter")!=null) this.occupancy_inter=Double.parseDouble(properties.getProperty(prefix+"occupancy_inter"));
...@@ -378,8 +378,8 @@ public class OpticalFlowParameters { ...@@ -378,8 +378,8 @@ public class OpticalFlowParameters {
ofp.tolerance_absolute_ref = this.tolerance_absolute_ref; ofp.tolerance_absolute_ref = this.tolerance_absolute_ref;
ofp.tolerance_relative_ref = this.tolerance_relative_ref; ofp.tolerance_relative_ref = this.tolerance_relative_ref;
ofp.center_occupancy_ref = this.center_occupancy_ref; ofp.center_occupancy_ref = this.center_occupancy_ref;
ofp.num_laplassian = this.num_laplassian; ofp.num_laplacian = this.num_laplacian;
ofp.change_laplassian = this.change_laplassian; ofp.change_laplacian = this.change_laplacian;
ofp.tolerance_absolute_inter = this.tolerance_absolute_inter; ofp.tolerance_absolute_inter = this.tolerance_absolute_inter;
ofp.tolerance_relative_inter = this.tolerance_relative_inter; ofp.tolerance_relative_inter = this.tolerance_relative_inter;
ofp.occupancy_inter = this.occupancy_inter; ofp.occupancy_inter = this.occupancy_inter;
......
...@@ -6875,7 +6875,7 @@ public class TexturedModel { ...@@ -6875,7 +6875,7 @@ public class TexturedModel {
/** /**
* Fill NaN pixel by averaging from neighbors (Laplassian == 0) * Fill NaN pixel by averaging from neighbors (Laplacian == 0)
* @param combo_texture [slice][pixel] combined texture from all sensors, pixels that * @param combo_texture [slice][pixel] combined texture from all sensors, pixels that
* are NaN in this array will not be filled * are NaN in this array will not be filled
* @param combo_occluded_texture [slice][pixel] texture from occluded sensors. Only pixels that * @param combo_occluded_texture [slice][pixel] texture from occluded sensors. Only pixels that
......
...@@ -989,6 +989,9 @@ public class TileNeibs{ ...@@ -989,6 +989,9 @@ public class TileNeibs{
final boolean [] tiles, final boolean [] tiles,
final boolean [] prohibit) final boolean [] prohibit)
{ {
if (grow <= 0) {
return;
}
// if it is not in multithreaded mode - run multithreaded version instead; // if it is not in multithreaded mode - run multithreaded version instead;
if (isMainThread()) { if (isMainThread()) {
growSelectionMulti ( growSelectionMulti (
......
...@@ -8693,7 +8693,7 @@ ImageDtt.startAndJoin(threads); ...@@ -8693,7 +8693,7 @@ ImageDtt.startAndJoin(threads);
} }
/** /**
* Generate a hint for a final replacing NaN with averaging neighbors (Laplassian). Replace all * Generate a hint for a final replacing NaN with averaging neighbors (Laplacian). Replace all
* NaN in input data[] with the corresponding values from the matching low-res data_scaled[]. * NaN in input data[] with the corresponding values from the matching low-res data_scaled[].
* @param data full resolution input data containing NaN values to be replaced. This array * @param data full resolution input data containing NaN values to be replaced. This array
* is MODIFIED by this method * is MODIFIED by this method
...@@ -8772,7 +8772,7 @@ ImageDtt.startAndJoin(threads); ...@@ -8772,7 +8772,7 @@ ImageDtt.startAndJoin(threads);
} }
/** /**
* Fill NaN values in 2D array from neighbors using Laplassian==0 * Fill NaN values in 2D array from neighbors using Laplacian==0
* @param data data array (in line-scan order) with NaN values to be filled, * @param data data array (in line-scan order) with NaN values to be filled,
* non-NaN values will not be modified. * non-NaN values will not be modified.
* @param prohibit optional (may be null) boolean array of the same size specifying * @param prohibit optional (may be null) boolean array of the same size specifying
...@@ -8809,7 +8809,7 @@ ImageDtt.startAndJoin(threads); ...@@ -8809,7 +8809,7 @@ ImageDtt.startAndJoin(threads);
} }
/** /**
* Fill NaN values in 2D array from neighbors using Laplassian==0 * Fill NaN values in 2D array from neighbors using Laplacian==0
* @param data data array (in line-scan order) with NaN values to be filled, * @param data data array (in line-scan order) with NaN values to be filled,
* non-NaN values will not be modified. * non-NaN values will not be modified.
* @param data_nan optional "original" data with NaN values to be replaced. If null, * @param data_nan optional "original" data with NaN values to be replaced. If null,
......
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