double scale_window = clt_parameters.imp.cuas_scale_wnd = 2.0; //; When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15)
double scale_window = clt_parameters.imp.cuas_scale_wnd; // = 2.0; //; When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15)
// int start_frame = 0;
int num_corr_samples = (scene_titles.length - getSeqLength() - start_frame) / getCorrInc();
@@ -511,6 +516,9 @@ public class CuasMotion {
noise_map = getNoiseMap(
scale_window, // final double scale_window, // 1.0->8, 2.0 - 16.
fpixels_avg); // final float [] fpixels_avg)
noise_map8 = getNoiseMap(
1.0, // final double scale_window, // 1.0->8, 2.0 - 16.
fpixels_avg); // final float [] fpixels_avg)
return;
}
@@ -1748,7 +1756,7 @@ public class CuasMotion {
return effective_strength;
}
/*
private static void setBadHorizon(
final double [][][] target_sequence,
final double horizon_y,
@@ -1778,6 +1786,45 @@ public class CuasMotion {
ImageDtt.startAndJoin(threads);
}
}
*/
private static void setBadHorizon(
final double [][][] target_sequence,
final double horizon_y, // <0 - do not filter by horizon
final double [] noise8, // null - do not filter by noise
final double noise_max,
final int tilesX){
final int num_seq = target_sequence.length;
final int num_tiles = target_sequence[0].length;
final int tilesY = num_tiles/tilesX;
final int ihorizon = (horizon_y > 0) ?( (int) Math.ceil(horizon_y/GPUTileProcessor.DTT_SIZE)) : -1; // tiles with tileY >= ihorizon are removed
final int ntile_horizon = (ihorizon > 0) ? (ihorizon * tilesX) : num_tiles;
if ((ihorizon > 0) || (noise8 != null)){
final Thread[] threads = ImageDtt.newThreadArray();
final AtomicInteger ai = new AtomicInteger(0);
for (int ithread = 0; ithread < threads.length; ithread++) {
public double cuas_lma_rms = 1.5; // 1.5; // Maximal RMS (should always match, regardless if A)
public double cuas_lma_arms = 0.37; // 0.06; // Maximal absolute RMS (should match one of cuas_lma_arms OR cuas_lma_rrms (0.484)
public double cuas_lma_rrms = 0.28; // 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
public double cuas_lma_mina = 0.4; // 1.0; // Minimal A (amplitude) = 1.0 (< 2.0)
public double cuas_lma_rrms = 0.5; // 0.35; // 0.28; // 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
public double cuas_lma_rrms2 = 0.35; // 0.28; // 0.15; // Maximal relative to A rms. OK is when (RMS < cuas_lma_arms) || (RMS < cuas_lma_rrms * A)
public double cuas_lma_mina = 0.25; // 0.4; // 1.0; // Minimal A (amplitude) = 1.0 (< 2.0)
public double cuas_lma_mina2 = 0.4; // 1.0; // Minimal A (amplitude) = 1.0 (< 2.0)
public double cuas_lma_pre_mina = 0.5; // scale cuas_lma_mina to filter initial candidates (if there are > one of them)
public int cuas_min_keep = 2; // keep at least this number of candidates before using cuas_lma_pre_mina filter
@@ -913,6 +917,7 @@ min_str_neib_fpn 0.35
public double cuas_offcenter = 0.6; // maximal off-center relative to the tile size (0.5 - how it was, +/-4 pix)
public double cuas_scale_wnd = 2.0; // When building noise map, scale search window range from original -8..+7 (2.0 -> -16..+15).
public double cuas_noisemax = 10.0; // when (max-min) of a 16-pixel tile exceeds this, do not fail on far offcenter
public double cuas_noisemax8 = 50.0; // when (max-min) of a 8-pixel tile exceeds this, do not consider it
public boolean cuas_fail_mismatch = false; // fail high mismatch early
public boolean cuas_ignore_mismatch = false; // calculate mismatch but do not remove
@@ -2847,9 +2852,13 @@ min_str_neib_fpn 0.35
"Maximal RMS for target that should match always, regardless of the amplitude.");
if (properties.getProperty(prefix+"cuas_lma_rms")!=null) this.cuas_lma_rms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rms"));
if (properties.getProperty(prefix+"cuas_lma_arms")!=null) this.cuas_lma_arms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_arms"));
if (properties.getProperty(prefix+"cuas_lma_rrms")!=null) this.cuas_lma_rrms=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rrms"));
if (properties.getProperty(prefix+"cuas_lma_rrms2")!=null) this.cuas_lma_rrms2=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_rrms2"));
if (properties.getProperty(prefix+"cuas_lma_mina")!=null) this.cuas_lma_mina=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_mina"));
if (properties.getProperty(prefix+"cuas_lma_mina2")!=null) this.cuas_lma_mina2=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_mina2"));
if (properties.getProperty(prefix+"cuas_lma_pre_mina")!=null) this.cuas_lma_pre_mina=Double.parseDouble(properties.getProperty(prefix+"cuas_lma_pre_mina"));
if (properties.getProperty(prefix+"cuas_min_keep")!=null) this.cuas_min_keep=Integer.parseInt(properties.getProperty(prefix+ "cuas_min_keep"));
@@ -7039,6 +7058,7 @@ min_str_neib_fpn 0.35
if (properties.getProperty(prefix+"cuas_offcenter")!=null) this.cuas_offcenter=Double.parseDouble(properties.getProperty(prefix+"cuas_offcenter"));
if (properties.getProperty(prefix+"cuas_scale_wnd")!=null) this.cuas_scale_wnd=Double.parseDouble(properties.getProperty(prefix+"cuas_scale_wnd"));
if (properties.getProperty(prefix+"cuas_noisemax")!=null) this.cuas_noisemax=Double.parseDouble(properties.getProperty(prefix+"cuas_noisemax"));
if (properties.getProperty(prefix+"cuas_noisemax8")!=null) this.cuas_noisemax8=Double.parseDouble(properties.getProperty(prefix+"cuas_noisemax8"));
if (properties.getProperty(prefix+"cuas_fail_mismatch")!=null) this.cuas_fail_mismatch=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_fail_mismatch"));
if (properties.getProperty(prefix+"cuas_ignore_mismatch")!=null) this.cuas_ignore_mismatch=Boolean.parseBoolean(properties.getProperty(prefix+"cuas_ignore_mismatch"));