Commit f18a76e7 authored by Andrey Filippov's avatar Andrey Filippov

Fixing ranging, working version with debug

parent e1f8ed4a
......@@ -157,18 +157,22 @@ public class CuasMotion {
* @return window[2*half_range + 1], sum values = 1.0;
*/
public double [] getSegmentWindow(
boolean smooth) {
boolean smooth,
boolean normalize) {
final int half_range = getSeqLength()/2;
final double [] window_full = new double [2*half_range + 1];
double s0 = 1.0;
window_full[half_range] = 1.0;
double k = Math.PI/2/(half_range +0.5);
for (int i = 1; i <= half_range; i ++) {
window_full[half_range+i] = smooth ? (Math.cos(i*k)):1.0;
window_full[half_range + i] = smooth ? (Math.cos(i*k)):1.0;
window_full[half_range - i] = smooth ? (Math.cos(i*k)):1.0;
s0+= 2 * window_full[half_range+i];
}
for (int i = 0; i < window_full.length; i ++) {
window_full[i] /= s0;
if (normalize) {
for (int i = 0; i < window_full.length; i ++) {
window_full[i] /= s0;
}
}
return window_full;
......@@ -2688,6 +2692,45 @@ public class CuasMotion {
return pXpYDs;
}
public ImagePlus showPxPyDs(
double [][][] pXpYDs,
int nseq, // center
String title,
boolean show) {
int num_scenes = pXpYDs.length;
int frame_center= getFrameCenter(nseq);
int start_scene = frame_center - (num_scenes + 1)/2;
int num_tiles = pXpYDs[0].length;
String [] titles_slices = {"pX","pY","Disparity"};
String [] titles_scenes = new String[num_scenes];
for (int i = 0; i < num_scenes; i++) {
titles_scenes[i] = getSceneTitles()[i+start_scene];
}
double [][][] data_img = new double [titles_slices.length][num_scenes][num_tiles];
for (int nslice = 0; nslice < data_img.length; nslice++) {
for (int nscene = 0; nscene < num_scenes; nscene++) {
Arrays.fill(data_img[nslice][nscene], Double.NaN);
}
}
for (int nscene = 0; nscene < num_scenes; nscene++) {
for (int ntile = 0; ntile < num_tiles; ntile++) if (pXpYDs[nscene][ntile] != null){
for (int nslice = 0; nslice < data_img.length; nslice++) {
data_img[nslice][nscene][ntile] = pXpYDs[nscene][ntile][nslice];
}
}
}
ImagePlus imp = ShowDoubleFloatArrays.showArraysHyperstack(
data_img, // double[][][] pixels,
tilesX, // int width,
title, // String title, "time_derivs-rt"+diff_time_rt+"-rxy"+diff_time_rxy,
titles_scenes, // String [] titles, // all slices*frames titles or just slice titles or null
titles_slices, // CuasMotionLMA.LMA_TITLES, // String [] frame_titles, // frame titles or null
show); // show); // boolean show)
return imp;
}
/**
......
......@@ -4440,6 +4440,7 @@ public class GpuQuad{ // quad camera description
{
return setInterTasks(
false, // final boolean accumulate,
1.0, // final double global_scale, // <=1.0
num_cams, // final int num_cams,
img_width, // final int img_width, // should match pXpYD
calcPortsCoordinatesAndDerivatives,// final boolean calcPortsCoordinatesAndDerivatives, // GPU can calculate them centreXY
......@@ -4455,6 +4456,7 @@ public class GpuQuad{ // quad camera description
public static TpTask[] setInterTasks(
final boolean accumulate,
final double global_scale, // <=1.0
final int num_cams,
final int img_width, // should match pXpYD
final boolean calcPortsCoordinatesAndDerivatives, // GPU can calculate them centreXY
......@@ -4521,7 +4523,7 @@ public class GpuQuad{ // quad camera description
disparity); // + disparity_corr);
tp_task.setDispDist(disp_dist);
tp_task.xy = new float [centersXY_main.length][2];
tp_task.setScale(1.0, accumulate);
tp_task.setScale(global_scale, accumulate);
for (int i = 0; i < centersXY_main.length; i++) {
if ( (centersXY_main[i][0] < min_px) || (centersXY_main[i][0] > max_px) ||
(centersXY_main[i][1] < min_py[i]) || (centersXY_main[i][1] > max_py[i])) {
......@@ -4574,6 +4576,7 @@ public class GpuQuad{ // quad camera description
final int threadsMax){ // maximal number of threads to launch
return setInterTasksMotionBlur(
false, // final boolean accumulate,
1.0, // final double global_scale, // <=1.0
num_cams, // final int num_cams,
img_width, // final int img_width, // should match pXpYD
calcPortsCoordinatesAndDerivatives, // final boolean calcPortsCoordinatesAndDerivatives, // GPU can calculate them centreXY
......@@ -4593,6 +4596,7 @@ public class GpuQuad{ // quad camera description
public static TpTask[][] setInterTasksMotionBlur(
final boolean accumulate,
final double global_scale, // <=1.0
final int num_cams,
final int img_width, // should match pXpYD
final boolean calcPortsCoordinatesAndDerivatives, // GPU can calculate them centreXY
......@@ -4665,9 +4669,9 @@ public class GpuQuad{ // quad camera description
double mb_len = Math.sqrt(dx*dx+dy*dy); // in pixels/s -> 0
double [] centerXY_sub = centerXY;
if (mb_len < min_len) { // No MB correction
tp_task.setScale(1.0, accumulate);
tp_task.setScale(global_scale, accumulate);
tp_task_sub.task = 0; // disable
tp_task_sub.setScale(-min_sub);
tp_task_sub.setScale(-min_sub * global_scale);
tp_task_sub.setCenterXY(centerXY);
} else {
dx /= mb_len; // unit vector
......@@ -4696,8 +4700,8 @@ public class GpuQuad{ // quad camera description
if (gain_sub > -min_sub) {
gain_sub = -min_sub;
}
tp_task.setScale(gain, accumulate);
tp_task_sub.setScale(gain_sub);
tp_task.setScale(gain * global_scale, accumulate);
tp_task_sub.setScale(gain_sub * global_scale);
}
boolean bad_margins = false;
if (calcPortsCoordinatesAndDerivatives) { // for non-GPU?
......
......@@ -95,7 +95,9 @@ public class Corr2dLMA {
final int num_pairs;
final int tile_params;
double [] all_pars;
double [] all_pars_saved;
private boolean [] par_mask;
private boolean [] par_or_mask; // if was enabled at least on one pass
private int [] par_map;
private double [] vector;
private ArrayList<Sample> samples = new ArrayList<Sample>();
......@@ -883,6 +885,7 @@ public class Corr2dLMA {
return true;
}
/**
* Set/modify parameters mask. May be called after preparePars () or after updateFromVector() if LMA was ran
* @param adjust_disparities null to adjust all (1 or 2) disparities or a boolean array of per maximum
......@@ -1008,6 +1011,14 @@ public class Corr2dLMA {
}
}
toVector();
if (par_or_mask == null) { // if was enabled at least on one pass
par_or_mask = par_mask.clone();
} else {
for (int i = 0; i < par_mask.length; i++) {
par_or_mask[i] |= par_mask[i];
}
}
return true;
}
......@@ -2396,6 +2407,16 @@ public class Corr2dLMA {
return rslt;
}
public void saveSolution() {
all_pars_saved = all_pars.clone();
}
public void restoreSolution() {
all_pars = all_pars_saved.clone();
}
public void toVector() { // USED in lwir
int np = 0;
for (int i = 0; i < par_mask.length; i++) if (par_mask[i]) np++;
......@@ -2969,6 +2990,7 @@ public class Corr2dLMA {
public double [][] getMaxMinAmpTile(){
return getMaxMinAmpTile(0);
}
public double [][] getMaxMinAmpTile(int nmax){
double [][] maxmins = new double[numTiles][2];
for (int tile = 0; tile < numTiles; tile++) {
......@@ -2976,7 +2998,8 @@ public class Corr2dLMA {
maxmins[tile][0] = Double.NaN;
maxmins[tile][1] = Double.NaN;
for (int i = 0; i <num_pairs; i++) {
if (par_mask[G0_INDEX + i + offs]) {
/// if (par_mask[G0_INDEX + i + offs]) {
if (par_or_mask[G0_INDEX + i + offs]) { // if some where disabled on a second pass 09/2025
if (!(all_pars[G0_INDEX + i + offs] <= maxmins[tile][0])) { // NaN will trigger true
maxmins[tile][0] = all_pars[G0_INDEX + i + offs];
}
......
......@@ -5541,21 +5541,25 @@ public class Correlation2d {
if (npass > 0) {
adjust_disparities = null;
}
boolean en_shape = (npass == 0) || ! imgdtt_params.bimax_disp_only2;
lma.setParMask(
adjust_disparities, // null, // boolean [] adjust_disparities, // null - adjust all, otherwise - per maximum
common_scale, //boolean [] common_scale, // per-maximum, if true - common scale for all pairs
imgdtt_params.lmas_adjust_wm, // boolean adjust_width, // adjust width of the maximum - lma_adjust_wm
imgdtt_params.lmas_adjust_ag, // boolean adjust_scales, // adjust 2D correlation scales - lma_adjust_ag
imgdtt_params.lmas_adjust_wy, // boolean adjust_ellipse, // allow non-circular correlation maximums lma_adjust_wy
en_shape && imgdtt_params.lmas_adjust_wm, // boolean adjust_width, // adjust width of the maximum - lma_adjust_wm
en_shape && imgdtt_params.lmas_adjust_ag, // boolean adjust_scales, // adjust 2D correlation scales - lma_adjust_ag
en_shape && imgdtt_params.lmas_adjust_wy, // boolean adjust_ellipse, // allow non-circular correlation maximums lma_adjust_wy
false, // (adjust_ly ? imgdtt_params.lma_adjust_wxy : false), //imgdtt_params.lma_adjust_wxy, // boolean adjust_lazyeye_par, // adjust disparity corrections parallel to disparities lma_adjust_wxy
false, // (adjust_ly ? imgdtt_params.lma_adjust_ly1: false), // imgdtt_params.lma_adjust_ly1, // boolean adjust_lazyeye_ortho, // adjust disparity corrections orthogonal to disparities lma_adjust_ly1
0.0, // (adjust_ly ? imgdtt_params.lma_cost_wy : 0.0), // imgdtt_params.lma_cost_wy, // double cost_lazyeye_par, // cost for each of the non-zero disparity corrections lma_cost_wy
0.0); // (adjust_ly ? imgdtt_params.lma_cost_wxy : 0.0) //imgdtt_params.lma_cost_wxy // double cost_lazyeye_odtho // cost for each of the non-zero ortho disparity corrections lma_cost_wxy
if (debug_level > 1) { // 1) {
if (debug_level > 2) { // 1) {
System.out.println("Input data:");
lma.printInputDataFx(false);
lma.printParams();
}
if (npass > 0) {
lma.saveSolution();
}
lmaSuccess = lma.runLma(
imgdtt_params.lmas_lambda_initial, // double lambda, // 0.1
imgdtt_params.lma_lambda_scale_good, // double lambda_scale_good,// 0.5
......@@ -5569,13 +5573,42 @@ public class Correlation2d {
System.out.println("Found bad tile/pair during single (probably wrong initial maximum - try around preliminary? "+lma.getBadTile());
}
}
if (!lmaSuccess && (npass > 0) && en_shape) { // only if not already filtered
if (debug_level > -3) {
System.out.println("LMA failed on pass2. Disabling some adjustments and re-trying.");
}
lma.restoreSolution();
// TODO: fine tune which to disable, maybe not all
lma.setParMask(
adjust_disparities, // null, // boolean [] adjust_disparities, // null - adjust all, otherwise - per maximum
common_scale, //boolean [] common_scale, // per-maximum, if true - common scale for all pairs
false, // en_shape && imgdtt_params.lmas_adjust_wm, // boolean adjust_width, // adjust width of the maximum - lma_adjust_wm
false, // en_shape && imgdtt_params.lmas_adjust_ag, // boolean adjust_scales, // adjust 2D correlation scales - lma_adjust_ag
false, // en_shape && imgdtt_params.lmas_adjust_wy, // boolean adjust_ellipse, // allow non-circular correlation maximums lma_adjust_wy
false, // (adjust_ly ? imgdtt_params.lma_adjust_wxy : false), //imgdtt_params.lma_adjust_wxy, // boolean adjust_lazyeye_par, // adjust disparity corrections parallel to disparities lma_adjust_wxy
false, // (adjust_ly ? imgdtt_params.lma_adjust_ly1: false), // imgdtt_params.lma_adjust_ly1, // boolean adjust_lazyeye_ortho, // adjust disparity corrections orthogonal to disparities lma_adjust_ly1
0.0, // (adjust_ly ? imgdtt_params.lma_cost_wy : 0.0), // imgdtt_params.lma_cost_wy, // double cost_lazyeye_par, // cost for each of the non-zero disparity corrections lma_cost_wy
0.0); // (adjust_ly ? imgdtt_params.lma_cost_wxy : 0.0) //imgdtt_params.lma_cost_wxy // double cost_lazyeye_odtho // cost for each of the non-zero ortho disparity corrections lma_cost_wxy
lmaSuccess = lma.runLma(
imgdtt_params.lmas_lambda_initial, // double lambda, // 0.1
imgdtt_params.lma_lambda_scale_good, // double lambda_scale_good,// 0.5
imgdtt_params.lma_lambda_scale_bad, // double lambda_scale_bad, // 8.0
imgdtt_params.lma_lambda_max, // double lambda_max, // 100
imgdtt_params.lmas_rms_diff, // double rms_diff, // 0.001
imgdtt_params.lmas_num_iter, // int num_iter, // 20
debug_level); // imgdtt_params.lma_debug_level1); // 4); // int debug_level) // > 3
if (!lmaSuccess) {
if (debug_level > -3) {
System.out.println("Still did not help - LMA failed.");
}
}
}
}
if (lmaSuccess) {
lma.updateFromVector();
double [][][] dispStrs = lma.lmaDisparityStrengths( //TODO: add parameter to filter out negative minimums ?
imgdtt_params.lmamask_dbg, // false, // boolean bypass_tests, // keep even weak for later analysis. Normally - only in test mode
imgdtt_params.lmamask_bypass || imgdtt_params.lmamask_dbg, // false, // boolean bypass_tests, // keep even weak for later analysis. Normally - only in test mode
imgdtt_params.lmas_min_amp, // minimal ratio of minimal pair correlation amplitude to maximal pair correlation amplitude
imgdtt_params.lmas_min_amp_bg, // minimal ratio of minimal pair correlation amplitude to maximal pair correlation amplitude
imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
......
......@@ -3506,7 +3506,7 @@ public class ImageDtt extends ImageDttCPU {
lma_rms = lma_dual.getRmsTile()[0];
boolean dbg_dispStrs = (debug_lma != null);
double [][][] dispStrs = lma_dual.lmaDisparityStrengths( //TODO: add parameter to filter out negative minimums ?
dbg_dispStrs, // false, // boolean bypass_tests, // keep even weak for later analysis. Normally - only in test mode
imgdtt_params.lmamask_bypass || dbg_dispStrs || debug_print_targets, // false, // boolean bypass_tests, // keep even weak for later analysis. Normally - only in test mode
imgdtt_params.lmas_min_amp, // minimal ratio of minimal pair correlation amplitude to maximal pair correlation amplitude
imgdtt_params.lmas_min_amp_bg, // minimal ratio of minimal pair correlation amplitude to maximal pair correlation amplitude
imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
......@@ -3516,7 +3516,7 @@ public class ImageDtt extends ImageDttCPU {
imgdtt_params.lmas_max_area, //double lma_max_area, // maximal half-area (if > 0.0)
imgdtt_params.lma_str_scale, // convert lma-generated strength to match previous ones - scale
imgdtt_params.lma_str_offset, // convert lma-generated strength to match previous ones - add to result
dbg_dispStrs || debug_print_targets, // false // boolean dbg_mode
imgdtt_params.lmamask_bypass || dbg_dispStrs || debug_print_targets, // false // boolean dbg_mode
imgdtt_params.lma_ac_offset, // Add to A, C coefficients for near-lines where A,C could become negative because of window
imgdtt_params.lma_relax_indiv_max// double lma_relax_indiv_max // double relax_indiv_max
);
......
......@@ -102,6 +102,8 @@ public class ImageDttParameters {
public int bimax_min_num_samples = 4; // minimal number of samples per pair per maximum
public int bimax_min_num_pairs = 8; // minimal number of used pairs
public boolean bimax_dual_pass = true; // First pass - do not adjust disparity
public boolean bimax_disp_only2 = false;// Disparity only on second pass (keep scales and shape - some CUAS where failing on second pass)
public boolean bimax_common_fg = true; // Common gains for foreground/single correlation maximum
public boolean bimax_common_bg = true; // Common gains for background correlation maximum
public boolean bimax_post_LMA = true; // When dual max, LMA with two maximums, then select. If false,select before LMA
......@@ -111,6 +113,7 @@ public class ImageDttParameters {
public boolean bimax_dual_only = false; // process only tiles with dual maximums (requires bimax_dual_LMA)
//lmamask_
public boolean lmamask_bypass = false; // Bypass solution tests, OK weak
public boolean lmamask_dbg = false; // show LMA images, exit after single BG
public boolean lmamask_en = false; // Use disparity-based LMA samples filter
public double lmamask_magic = 0.85; // Now only used for initial disparity from estimated by CM/Poly
......@@ -574,8 +577,10 @@ public class ImageDttParameters {
"Minimal number of samples per pair per maximum to use this pair by LMA (each of the maximums used)");
gd.addNumericField("Minimal number of used pairs", this.bimax_min_num_pairs, 0, 3, "",
"Do not use LMA if total number of used pairs is lower");
gd.addCheckbox ("Dual-pass LMA", this.bimax_dual_pass,
gd.addCheckbox ("Dual-pass LMA (no disparity on first)", this.bimax_dual_pass,
"First adjust other parameters (keeping disparities), then add disparities");
gd.addCheckbox ("Disparity only on second pass", this.bimax_disp_only2,
"Sometimes failed for CUAS on second pass, mitigate by disparity only (keep others from pass1).");
gd.addCheckbox ("Common gains for foreground/single correlation maximum", this.bimax_common_fg,
"Use common gain for all pairs for FG/single correlation (unchecked - use individual gain for each pair)");
gd.addCheckbox ("Common gains for background correlation maximum", this.bimax_common_bg,
......@@ -591,6 +596,8 @@ public class ImageDttParameters {
"May be used to determine BG after refining FG. First refine with false and mode = 3 (FG), then with true and mode = 4 (BG)");
gd.addMessage("LMA samples filter based on estimated disparity");
gd.addCheckbox ("Bypass LMA solution tests, use anyway", this.lmamask_bypass,
"Bypass solution tests, OK weak.");
gd.addCheckbox ("Debug LMA", this.lmamask_dbg,
"Generate debug images and exit after first clt_process_tl_correlations() while generating background image");
gd.addCheckbox ("Use disparity-based LMA samples filtering", this.lmamask_en,
......@@ -1031,6 +1038,7 @@ public class ImageDttParameters {
this.bimax_min_num_samples= (int) gd.getNextNumber();
this.bimax_min_num_pairs= (int) gd.getNextNumber();
this.bimax_dual_pass = gd.getNextBoolean();
this.bimax_disp_only2 = gd.getNextBoolean();
this.bimax_common_fg = gd.getNextBoolean();
this.bimax_common_bg = gd.getNextBoolean();
this.bimax_post_LMA = gd.getNextBoolean();
......@@ -1038,6 +1046,7 @@ public class ImageDttParameters {
this.bimax_dual_LMA = gd.getNextBoolean();
this.bimax_dual_only = gd.getNextBoolean();
this.lmamask_bypass = gd.getNextBoolean();
this.lmamask_dbg = gd.getNextBoolean();
this.lmamask_en = gd.getNextBoolean();
this.lmamask_magic = gd.getNextNumber();
......@@ -1279,6 +1288,7 @@ public class ImageDttParameters {
properties.setProperty(prefix+"bimax_min_num_samples", this.bimax_min_num_samples +"");
properties.setProperty(prefix+"bimax_min_num_pairs", this.bimax_min_num_pairs +"");
properties.setProperty(prefix+"bimax_dual_pass", this.bimax_dual_pass +"");
properties.setProperty(prefix+"bimax_disp_only2", this.bimax_disp_only2 +"");
properties.setProperty(prefix+"bimax_common_fg", this.bimax_common_fg +"");
properties.setProperty(prefix+"bimax_common_bg", this.bimax_common_bg +"");
properties.setProperty(prefix+"bimax_post_LMA", this.bimax_post_LMA +"");
......@@ -1286,6 +1296,7 @@ public class ImageDttParameters {
properties.setProperty(prefix+"bimax_dual_LMA", this.bimax_dual_LMA +"");
properties.setProperty(prefix+"bimax_dual_only", this.bimax_dual_only +"");
properties.setProperty(prefix+"lmamask_bypass", this.lmamask_bypass +"");
properties.setProperty(prefix+"lmamask_dbg", this.lmamask_dbg +"");
properties.setProperty(prefix+"lmamask_en", this.lmamask_en +"");
properties.setProperty(prefix+"lmamask_magic", this.lmamask_magic +"");
......@@ -1529,6 +1540,7 @@ public class ImageDttParameters {
if (properties.getProperty(prefix+"bimax_min_num_samples")!=null) this.bimax_min_num_samples=Integer.parseInt(properties.getProperty(prefix+"bimax_min_num_samples"));
if (properties.getProperty(prefix+"bimax_min_num_pairs")!=null) this.bimax_min_num_pairs=Integer.parseInt(properties.getProperty(prefix+"bimax_min_num_pairs"));
if (properties.getProperty(prefix+"bimax_dual_pass")!=null) this.bimax_dual_pass=Boolean.parseBoolean(properties.getProperty(prefix+"bimax_dual_pass"));
if (properties.getProperty(prefix+"bimax_disp_only2")!=null) this.bimax_disp_only2=Boolean.parseBoolean(properties.getProperty(prefix+"bimax_disp_only2"));
if (properties.getProperty(prefix+"bimax_common_fg")!=null) this.bimax_common_fg=Boolean.parseBoolean(properties.getProperty(prefix+"bimax_common_fg"));
if (properties.getProperty(prefix+"bimax_common_bg")!=null) this.bimax_common_bg=Boolean.parseBoolean(properties.getProperty(prefix+"bimax_common_bg"));
if (properties.getProperty(prefix+"bimax_post_LMA")!=null) this.bimax_post_LMA=Boolean.parseBoolean(properties.getProperty(prefix+"bimax_post_LMA"));
......@@ -1536,6 +1548,7 @@ public class ImageDttParameters {
if (properties.getProperty(prefix+"bimax_dual_LMA")!=null) this.bimax_dual_LMA=Boolean.parseBoolean(properties.getProperty(prefix+"bimax_dual_LMA"));
if (properties.getProperty(prefix+"bimax_dual_only")!=null) this.bimax_dual_only=Boolean.parseBoolean(properties.getProperty(prefix+"bimax_dual_only"));
if (properties.getProperty(prefix+"lmamask_bypass")!=null) this.lmamask_bypass=Boolean.parseBoolean(properties.getProperty(prefix+"lmamask_bypass"));
if (properties.getProperty(prefix+"lmamask_dbg")!=null) this.lmamask_dbg=Boolean.parseBoolean(properties.getProperty(prefix+"lmamask_dbg"));
if (properties.getProperty(prefix+"lmamask_en")!=null) this.lmamask_en=Boolean.parseBoolean(properties.getProperty(prefix+"lmamask_en"));
if (properties.getProperty(prefix+"lmamask_magic")!=null) this.lmamask_magic=Double.parseDouble(properties.getProperty(prefix+"lmamask_magic"));
......@@ -1794,6 +1807,7 @@ public class ImageDttParameters {
idp.bimax_min_num_samples= this.bimax_min_num_samples;
idp.bimax_min_num_pairs= this.bimax_min_num_pairs;
idp.bimax_dual_pass= this.bimax_dual_pass;
idp.bimax_disp_only2 = this.bimax_disp_only2;
idp.bimax_common_fg= this.bimax_common_fg;
idp.bimax_common_bg= this.bimax_common_bg;
idp.bimax_post_LMA= this.bimax_post_LMA;
......@@ -1801,6 +1815,7 @@ public class ImageDttParameters {
idp.bimax_dual_LMA= this.bimax_dual_LMA;
idp.bimax_dual_only= this.bimax_dual_only;
idp.lmamask_bypass = this.lmamask_bypass;
idp.lmamask_dbg= this.lmamask_dbg;
idp.lmamask_en= this.lmamask_en;
idp.lmamask_magic= this.lmamask_magic;
......@@ -1992,7 +2007,9 @@ public class ImageDttParameters {
lma_ac_offset = imp.cuas_ac_offset;
lmas_min_max_ac = imp.cuas_min_max_ac;
lmas_min_min_ac = imp.cuas_min_min_ac;
bimax_dual_pass = imp.cuas_dual_pass;
bimax_disp_only2 = imp.cuas_disp_only2;
lmamask_bypass = imp.cuas_lma_bypass;
}
......
......@@ -1843,7 +1843,8 @@ public class QuadCLT extends QuadCLTCPU {
int threadsMax,
final int debugLevel){
return preRenderGPUFromDSI( // will return PxPyD
false, // final boolean accumulate,
false, // final boolean accumulate,
1.0, // final double global_scale, // <=1.0
sensor_mask, // final int sensor_mask,
merge_channels, // final boolean merge_channels,
discard_border, // final int discard_border,
......@@ -1869,7 +1870,8 @@ public class QuadCLT extends QuadCLTCPU {
public static double [][] preRenderGPUFromDSI( // will return PxPyD
final boolean accumulate,
final boolean accumulate,
final double global_scale, // <=1.0
final int sensor_mask,
final boolean merge_channels,
final int discard_border,
......@@ -1979,6 +1981,7 @@ public class QuadCLT extends QuadCLTCPU {
if (mb_vectors!=null) {
tp_tasks = GpuQuad.setInterTasksMotionBlur( // "true" reference, with stereo actual reference will be offset
accumulate, // final boolean accumulate,
global_scale, // final double global_scale, // <=1.0
scene.getNumSensors(),
rendered_width, // should match output size, pXpYD.length
!scene.hasGPU(), // final boolean calcPortsCoordinatesAndDerivatives, // GPU can calculate them centreXY
......@@ -1997,6 +2000,7 @@ public class QuadCLT extends QuadCLTCPU {
tp_tasks = new TpTask[1][];
tp_tasks[0] = GpuQuad.setInterTasks( // "true" reference, with stereo actual reference will be offset
accumulate, // final boolean accumulate,
global_scale, // final double global_scale, // <=1.0
scene.getNumSensors(),
rendered_width, // should match output size, pXpYD.length
!scene.hasGPU(), // final boolean calcPortsCoordinatesAndDerivatives, // GPU can calculate them centreXY
......@@ -2033,7 +2037,7 @@ public class QuadCLT extends QuadCLTCPU {
int [] wh = (full_woi_in == null)? null: new int[]{
full_woi_in.width * GPUTileProcessor.DTT_SIZE,
full_woi_in.height * GPUTileProcessor.DTT_SIZE};
int erase_clt = show_nan ? 1:0;
int erase_clt = accumulate? -1 : ( show_nan ? 1:0); // do not erase if accumulate !
// boolean test1 = true;
if (mb_vectors!=null) {// && test1) {
image_dtt.setReferenceTDMotionBlur( // change to main?
......@@ -6197,7 +6201,7 @@ if (debugLevel < -100) {
int nsens_col = nImg % num_sens_col;
int nsens = nsens_col / num_col;
int ncol = nsens_col % num_col;
double [] img_src = scenes[nscene].getImageData()[nsens][ncol];
double [] img_src = scenes[nscene].getOrigImageData()[nsens][ncol];
if (!unsharped && um_en) {
System.arraycopy(img_src, 0, img_buf, 0, img_buf.length);
gb.blurDouble(
......
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