Commit ba6fb0e3 authored by Andrey Filippov's avatar Andrey Filippov

working on large cluster in low-contarst (clouds in the sky)

parent 08bccd0d
...@@ -24,6 +24,7 @@ public class CLTParameters { ...@@ -24,6 +24,7 @@ public class CLTParameters {
public double shift_x = 0.0; public double shift_x = 0.0;
public double shift_y = 0.0; public double shift_y = 0.0;
public int tileStep = 4; // process tileStep x tileStep cluster of tiles when adjusting lazy eye parameters public int tileStep = 4; // process tileStep x tileStep cluster of tiles when adjusting lazy eye parameters
public int super_radius = 2; // Consolidate multiple clusterts for low-contrast infinity (clouds in the sky) 0 - none, 1 - 3x3, 2 - 5x5,
public int iclt_mask = 15; // which transforms to combine public int iclt_mask = 15; // which transforms to combine
public int tileX = -258; // number of kernel tile (0..163) public int tileX = -258; // number of kernel tile (0..163)
public int tileY = 133; // number of kernel tile (0..122) public int tileY = 133; // number of kernel tile (0..122)
...@@ -899,6 +900,7 @@ public class CLTParameters { ...@@ -899,6 +900,7 @@ public class CLTParameters {
properties.setProperty(prefix+"shift_x", this.shift_x+""); properties.setProperty(prefix+"shift_x", this.shift_x+"");
properties.setProperty(prefix+"shift_y", this.shift_y+""); properties.setProperty(prefix+"shift_y", this.shift_y+"");
properties.setProperty(prefix+"tileStep", this.tileStep+""); properties.setProperty(prefix+"tileStep", this.tileStep+"");
properties.setProperty(prefix+"tileSizeBg", this.super_radius+"");
properties.setProperty(prefix+"iclt_mask", this.iclt_mask+""); properties.setProperty(prefix+"iclt_mask", this.iclt_mask+"");
properties.setProperty(prefix+"tileX", this.tileX+""); properties.setProperty(prefix+"tileX", this.tileX+"");
properties.setProperty(prefix+"tileY", this.tileY+""); properties.setProperty(prefix+"tileY", this.tileY+"");
...@@ -1668,6 +1670,7 @@ public class CLTParameters { ...@@ -1668,6 +1670,7 @@ public class CLTParameters {
if (properties.getProperty(prefix+"shift_y")!=null) this.shift_y=Double.parseDouble(properties.getProperty(prefix+"shift_y")); if (properties.getProperty(prefix+"shift_y")!=null) this.shift_y=Double.parseDouble(properties.getProperty(prefix+"shift_y"));
if (properties.getProperty(prefix+"tileStep")!=null) this.tileStep=Integer.parseInt(properties.getProperty(prefix+"tileStep")); if (properties.getProperty(prefix+"tileStep")!=null) this.tileStep=Integer.parseInt(properties.getProperty(prefix+"tileStep"));
if (properties.getProperty(prefix+"tileSizeBg")!=null) this.super_radius=Integer.parseInt(properties.getProperty(prefix+"tileSizeBg"));
if (properties.getProperty(prefix+"iclt_mask")!=null) this.iclt_mask=Integer.parseInt(properties.getProperty(prefix+"iclt_mask")); if (properties.getProperty(prefix+"iclt_mask")!=null) this.iclt_mask=Integer.parseInt(properties.getProperty(prefix+"iclt_mask"));
if (properties.getProperty(prefix+"tileX")!=null) this.tileX=Integer.parseInt(properties.getProperty(prefix+"tileX")); if (properties.getProperty(prefix+"tileX")!=null) this.tileX=Integer.parseInt(properties.getProperty(prefix+"tileX"));
if (properties.getProperty(prefix+"tileY")!=null) this.tileY=Integer.parseInt(properties.getProperty(prefix+"tileY")); if (properties.getProperty(prefix+"tileY")!=null) this.tileY=Integer.parseInt(properties.getProperty(prefix+"tileY"));
...@@ -2456,6 +2459,8 @@ public class CLTParameters { ...@@ -2456,6 +2459,8 @@ public class CLTParameters {
gd.addNumericField("Lazy eye cluster size", this.tileStep, 0, 6, "tiles", gd.addNumericField("Lazy eye cluster size", this.tileStep, 0, 6, "tiles",
"Process tileStep x tileStep cluster of tiles when adjusting lazy eye parameters"); "Process tileStep x tileStep cluster of tiles when adjusting lazy eye parameters");
gd.addNumericField("Consolidate multiple clusterts around given for low-contrast infinity", this.super_radius, 0, 6, "clusters",
"e.g. for clouds in tghe sky 0 - none, 1 - 3x3, 2 - 5x5");
gd.addNumericField("Bit mask - which of 4 transforms to combine after iclt", this.iclt_mask, 0); gd.addNumericField("Bit mask - which of 4 transforms to combine after iclt", this.iclt_mask, 0);
gd.addNumericField("Tile X to extract (0..163)", this.tileX, 0); gd.addNumericField("Tile X to extract (0..163)", this.tileX, 0);
gd.addNumericField("Tile Y to extract (0..122)", this.tileY, 0); gd.addNumericField("Tile Y to extract (0..122)", this.tileY, 0);
...@@ -3392,6 +3397,7 @@ public class CLTParameters { ...@@ -3392,6 +3397,7 @@ public class CLTParameters {
this.shift_y = gd.getNextNumber(); this.shift_y = gd.getNextNumber();
this.tileStep= (int) gd.getNextNumber(); this.tileStep= (int) gd.getNextNumber();
this.super_radius= (int) gd.getNextNumber();
this.iclt_mask= (int) gd.getNextNumber(); this.iclt_mask= (int) gd.getNextNumber();
this.tileX= (int) gd.getNextNumber(); this.tileX= (int) gd.getNextNumber();
this.tileY= (int) gd.getNextNumber(); this.tileY= (int) gd.getNextNumber();
......
...@@ -631,6 +631,7 @@ private Panel panel1, ...@@ -631,6 +631,7 @@ private Panel panel1,
addButton("CLT disparity scan", panelClt2, color_conf_process); addButton("CLT disparity scan", panelClt2, color_conf_process);
addButton("CLT reset fine corr", panelClt2, color_stop); addButton("CLT reset fine corr", panelClt2, color_stop);
addButton("CLT reset extrinsic corr", panelClt2, color_stop); addButton("CLT reset extrinsic corr", panelClt2, color_stop);
addButton("ERS reset", panelClt2, color_stop);
addButton("CLT show geometry", panelClt2, color_configure); addButton("CLT show geometry", panelClt2, color_configure);
addButton("CLT show fine corr", panelClt2, color_report); addButton("CLT show fine corr", panelClt2, color_report);
addButton("CLT apply fine corr", panelClt2, color_process); addButton("CLT apply fine corr", panelClt2, color_process);
...@@ -711,6 +712,7 @@ private Panel panel1, ...@@ -711,6 +712,7 @@ private Panel panel1,
addButton("LWIR_TEST", panelClt_GPU, color_conf_process); addButton("LWIR_TEST", panelClt_GPU, color_conf_process);
addButton("LWIR_ACQUIRE", panelClt_GPU, color_conf_process); addButton("LWIR_ACQUIRE", panelClt_GPU, color_conf_process);
addButton("ERS reset", panelClt2, color_stop);
addButton("IMU main", panelClt_GPU, color_conf_process); addButton("IMU main", panelClt_GPU, color_conf_process);
addButton("ERS main", panelClt_GPU, color_process); addButton("ERS main", panelClt_GPU, color_process);
addButton("IMU aux", panelClt_GPU, color_conf_process_aux); addButton("IMU aux", panelClt_GPU, color_conf_process_aux);
...@@ -4559,6 +4561,21 @@ private Panel panel1, ...@@ -4559,6 +4561,21 @@ private Panel panel1,
} }
QUAD_CLT.resetExtrinsicCorr(CLT_PARAMETERS); QUAD_CLT.resetExtrinsicCorr(CLT_PARAMETERS);
return; return;
} else if (label.equals("ERS reset")) {
if (QUAD_CLT == null){
QUAD_CLT = new QuadCLT (
QuadCLT.PREFIX,
PROPERTIES,
EYESIS_CORRECTIONS,
CORRECTION_PARAMETERS);
if (DEBUG_LEVEL > 0){
System.out.println("Created new QuadCLT instance, will need to read CLT kernels");
}
}
QUAD_CLT.resetExtrinsicCorr(CLT_PARAMETERS);
return;
} else if (label.equals("CLT show geometry")) { } else if (label.equals("CLT show geometry")) {
if (QUAD_CLT == null){ if (QUAD_CLT == null){
QUAD_CLT = new QuadCLT ( QUAD_CLT = new QuadCLT (
......
...@@ -1647,14 +1647,7 @@ public class GPUTileProcessor { ...@@ -1647,14 +1647,7 @@ public class GPUTileProcessor {
IJ.showMessage("Error", "No GPU kernel: GPU_CALCULATE_TILES_OFFSETS_kernel"); IJ.showMessage("Error", "No GPU kernel: GPU_CALCULATE_TILES_OFFSETS_kernel");
return; return;
} }
if (gpu_debug_level > -1) { int [] GridFullWarps = {1, 1, 1};
System.out.println("num_task_tiles="+num_task_tiles);
}
// kernel parameters: pointer to pointers
// int [] GridFullWarps = {(num_task_tiles + 2 * TILES_PER_BLOCK_GEOM - 1)/TILES_PER_BLOCK_GEOM, 1, 1}; // round up
// int [] ThreadsFullWarps = {num_cams, TILES_PER_BLOCK_GEOM, 1}; // 4,8,1
int [] GridFullWarps = {1, 1, 1}; // round up
int [] ThreadsFullWarps = {1, 1, 1}; // 4,8,1 int [] ThreadsFullWarps = {1, 1, 1}; // 4,8,1
Pointer kernelParameters = Pointer.to( Pointer kernelParameters = Pointer.to(
Pointer.to(gpu_tasks), // struct tp_task * gpu_tasks, Pointer.to(gpu_tasks), // struct tp_task * gpu_tasks,
...@@ -1671,7 +1664,7 @@ public class GPUTileProcessor { ...@@ -1671,7 +1664,7 @@ public class GPUTileProcessor {
kernelParameters, null); // Kernel- and extra parameters kernelParameters, null); // Kernel- and extra parameters
cuCtxSynchronize(); // remove later cuCtxSynchronize(); // remove later
if (gpu_debug_level > -1) { if (gpu_debug_level > -1) {
System.out.println("======execSetTilesOffsets()"); System.out.println("======execSetTilesOffsets(), num_task_tiles="+num_task_tiles);
} }
} }
......
...@@ -1460,10 +1460,12 @@ public class Corr2dLMA { ...@@ -1460,10 +1460,12 @@ public class Corr2dLMA {
return rslt; return rslt;
} }
public double [][] lmaDisparityStrength(
public double [][] lmaDisparityStrength( // restored from git
double lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) double lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
double lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) double lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
double lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) double lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
double lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
double lma_max_area, // maximal half-area (if > 0.0) double lma_max_area, // maximal half-area (if > 0.0)
double lma_str_scale, // convert lma-generated strength to match previous ones - scale double lma_str_scale, // convert lma-generated strength to match previous ones - scale
double lma_str_offset // convert lma-generated strength to match previous ones - add to result double lma_str_offset // convert lma-generated strength to match previous ones - add to result
...@@ -1506,6 +1508,179 @@ public class Corr2dLMA { ...@@ -1506,6 +1508,179 @@ public class Corr2dLMA {
return ds; return ds;
} }
public double [][] lmaDisparityStrength0(
double lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
double lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
double lma_min_max_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
double lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
double lma_max_area, // maximal half-area (if > 0.0)
double lma_str_scale, // convert lma-generated strength to match previous ones - scale
double lma_str_offset // convert lma-generated strength to match previous ones - add to result
){
double [][] ds = new double[numTiles][2];
double [] rms = getRmsTile();
double [][] maxmin_amp = getMaxMinAmpTile();
double [][] abc = getABCTile();
for (int tile = 0; tile < numTiles; tile++) {
ds[tile][0] = Double.NaN;
if (Double.isNaN(maxmin_amp[tile][0])) {
continue;
}
double avg = 0.5*(maxmin_amp[tile][0]+maxmin_amp[tile][1]);
double rrms = rms[tile]/avg;
if (((lma_max_rel_rms > 0.0) && (rrms > lma_max_rel_rms)) ||
(Math.max(abc[tile][0], abc[tile][2]) < lma_min_max_ac)
// || (Math.min(abc[tile][0], abc[tile][2]) < lma_min_min_ac)
) {
continue;
}
if (lma_max_area > 0) {
if ((abc[tile][0] > 0.0) && (abc[tile][2] > 0.0)) {
// double area_old = 1.0/abc[tile][0] + 1.0/abc[tile][2]; // area of a maximum
double area = 1.0/Math.sqrt(abc[tile][0] * abc[tile][2]);
if (area > lma_max_area) {
continue; // too wide maximum
}
} else {
continue; // not a maximum
}
}
double strength = Math.sqrt(avg/rrms);
double disparity = -all_pars[DISP_INDEX + tile*TILE_PARAMS];
if ((strength < lma_min_strength) || Double.isNaN(disparity)) {
continue;
}
// strength = Math.sqrt(strength * Math.sqrt(abc[tile][0] * abc[tile][2])); // / area ); // new strength
ds[tile][0] = disparity;
ds[tile][1] = (strength * lma_str_scale) + lma_str_offset;
}
return ds;
}
public double [][] lmaDisparityStrengthLY(
double lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
double lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
double lma_min_max_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
double lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
double lma_max_area, // maximal half-area (if > 0.0)
double lma_str_scale, // convert lma-generated strength to match previous ones - scale
double lma_str_offset // convert lma-generated strength to match previous ones - add to result
){
double [][] ds = new double[numTiles][2];
double [] rms = getRmsTile();
double [][] maxmin_amp = getMaxMinAmpTile();
double [][] abc = getABCTile();
for (int tile = 0; tile < numTiles; tile++) {
ds[tile][0] = Double.NaN;
if (Double.isNaN(maxmin_amp[tile][0])) {
continue;
}
double avg = 0.5*(maxmin_amp[tile][0]+maxmin_amp[tile][1]);
double rrms = rms[tile]/avg;
if (((lma_max_rel_rms > 0.0) && (rrms > lma_max_rel_rms)) ||
(Math.max(abc[tile][0], abc[tile][2]) < lma_min_max_ac) ||
(Math.min(abc[tile][0], abc[tile][2]) < lma_min_min_ac)) {
continue;
}
if (lma_max_area > 0) {
if ((abc[tile][0] > 0.0) && (abc[tile][2] > 0.0)) {
// double area_old = 1.0/abc[tile][0] + 1.0/abc[tile][2]; // area of a maximum
double area = 1.0/Math.sqrt(abc[tile][0] * abc[tile][2]);
if (area > lma_max_area) {
continue; // too wide maximum
}
} else {
continue; // not a maximum
}
}
double strength = Math.sqrt(avg/rrms);
double disparity = -all_pars[DISP_INDEX + tile*TILE_PARAMS];
if ((strength < lma_min_strength) || Double.isNaN(disparity)) {
continue;
}
strength = Math.sqrt(strength * Math.sqrt(abc[tile][0] * abc[tile][2])); // / area ); // new strength
ds[tile][0] = disparity;
ds[tile][1] = (strength * lma_str_scale) + lma_str_offset;
}
return ds;
}
public double [][] lmaGetExtendedStats(
double lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
double lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
double lma_min_max_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
double lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
double lma_max_area, // maximal half-area (if > 0.0)
double lma_str_scale, // convert lma-generated strength to match previous ones - scale
double lma_str_offset // convert lma-generated strength to match previous ones - add to result
){
// double [][] ds = new double[numTiles][2];
double [][] ext_stats = new double[numTiles][11];
double [] rms = getRmsTile();
double [][] maxmin_amp = getMaxMinAmpTile();
double [][] abc = getABCTile();
for (int tile = 0; tile < numTiles; tile++) {
if (Double.isNaN(maxmin_amp[tile][0])) {
if (ext_stats[tile][10] == 0) ext_stats[tile][10] = 1;
}
ext_stats[tile][0] = maxmin_amp[tile][0];
double avg = 0.5*(maxmin_amp[tile][0]+maxmin_amp[tile][1]);
double rrms = rms[tile]/avg;
ext_stats[tile][1] = avg;
ext_stats[tile][2] = rrms; // -lma_max_rel_rms;
// ext_stats[tile][3] = Math.max(abc[tile][0], abc[tile][2])-lma_min_ac;
if (((lma_max_rel_rms > 0.0) && (rrms > lma_max_rel_rms)) ||
(Math.max(abc[tile][0], abc[tile][2]) < lma_min_max_ac) ||
(Math.min(abc[tile][0], abc[tile][2]) < lma_min_min_ac)) {
if (ext_stats[tile][10] == 0) ext_stats[tile][10] = 2;
// continue;
}
double area = Double.NaN;
double area_old = Double.NaN;
if (lma_max_area > 0) {
ext_stats[tile][5] = abc[tile][0];
ext_stats[tile][6] = abc[tile][2];
if ((abc[tile][0] > 0.0) && (abc[tile][2] > 0.0)) {
area_old = 1.0/abc[tile][0] + 1.0/abc[tile][2]; // area of a maximum
area = 1.0/Math.sqrt(abc[tile][0] * abc[tile][2]);
if (area > lma_max_area) {
if (ext_stats[tile][10] == 0) ext_stats[tile][10] = 3;
// continue; // too wide maximum
}
} else {
if (ext_stats[tile][10] == 0) ext_stats[tile][10] = 4;
// continue; // not a maximum
}
ext_stats[tile][7] = 1.0/area; // area-lma_max_area;
ext_stats[tile][4] = 1.0/area_old;
}
double strength = Math.sqrt(avg/rrms);
ext_stats[tile][9] = (strength * lma_str_scale) + lma_str_offset;
ext_stats[tile][3] = Math.sqrt(strength / area ); // new strength
double disparity = -all_pars[DISP_INDEX + tile*TILE_PARAMS];
if ((strength < lma_min_strength) || Double.isNaN(disparity)) {
if (ext_stats[tile][10] == 0) ext_stats[tile][10] = 5;
continue;
}
ext_stats[tile][8] = -all_pars[DISP_INDEX + tile*TILE_PARAMS];
if (ext_stats[tile][10] == 0) ext_stats[tile][10] = 6;
}
return ext_stats;
}
// ext_stats[tile][3] = Math.max(abc[tile][0], abc[tile][2])-lma_min_ac;
public double [][] getDdNd(){ // this.all_pars should be current public double [][] getDdNd(){ // this.all_pars should be current
double [][] ddnd = new double [NUM_CAMS][2]; double [][] ddnd = new double [NUM_CAMS][2];
for (int nc = 0; nc < NUM_CAMS; nc++) { for (int nc = 0; nc < NUM_CAMS; nc++) {
......
...@@ -2449,7 +2449,8 @@ public class Correlation2d { ...@@ -2449,7 +2449,8 @@ public class Correlation2d {
imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
imgdtt_params.lma_max_area, //double lma_max_area, // maximal half-area (if > 0.0) imgdtt_params.lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
imgdtt_params.lma_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_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 imgdtt_params.lma_str_offset // convert lma-generated strength to match previous ones - add to result
); );
...@@ -2547,6 +2548,7 @@ public class Correlation2d { ...@@ -2547,6 +2548,7 @@ public class Correlation2d {
imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
imgdtt_params.lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
imgdtt_params.lma_max_area, //double lma_max_area, // maximal half-area (if > 0.0) imgdtt_params.lma_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_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 imgdtt_params.lma_str_offset // convert lma-generated strength to match previous ones - add to result
...@@ -2842,6 +2844,7 @@ public class Correlation2d { ...@@ -2842,6 +2844,7 @@ public class Correlation2d {
imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
imgdtt_params.lmas_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) imgdtt_params.lmas_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
imgdtt_params.lmas_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) imgdtt_params.lmas_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
imgdtt_params.lmas_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
imgdtt_params.lmas_max_area, //double lma_max_area, // maximal half-area (if > 0.0) 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_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 imgdtt_params.lma_str_offset // convert lma-generated strength to match previous ones - add to result
......
...@@ -552,6 +552,11 @@ public class GeometryCorrection { ...@@ -552,6 +552,11 @@ public class GeometryCorrection {
extrinsic_corr = new CorrVector(); extrinsic_corr = new CorrVector();
} }
public void resetCorrVectorERS(){// not used in lwir
extrinsic_corr.setIMU(new double[6]);
}
public boolean [] getParMask( // for compatibility with old public boolean [] getParMask( // for compatibility with old
// boolean disparity_only, // boolean disparity_only,
// boolean use_disparity, // boolean use_disparity,
......
...@@ -2151,6 +2151,7 @@ public class ImageDttCPU { ...@@ -2151,6 +2151,7 @@ public class ImageDttCPU {
imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
imgdtt_params.lmas_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) imgdtt_params.lmas_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
imgdtt_params.lmas_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) imgdtt_params.lmas_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
imgdtt_params.lmas_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
imgdtt_params.lmas_max_area, // double lma_max_area, // maximal half-area (if > 0.0) 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_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 imgdtt_params.lma_str_offset // convert lma-generated strength to match previous ones - add to result
...@@ -2202,6 +2203,7 @@ public class ImageDttCPU { ...@@ -2202,6 +2203,7 @@ public class ImageDttCPU {
imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
imgdtt_params.lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
imgdtt_params.lma_max_area, //double lma_max_area, // maximal half-area (if > 0.0) imgdtt_params.lma_max_area, //double lma_max_area, // maximal half-area (if > 0.0)
1.0, // imgdtt_params.lma_str_scale, // convert lma-generated strength to match previous ones - scale 1.0, // imgdtt_params.lma_str_scale, // convert lma-generated strength to match previous ones - scale
0.0); // imgdtt_params.lma_str_offset); // convert lma-generated strength to match previous ones - add to result 0.0); // imgdtt_params.lma_str_offset); // convert lma-generated strength to match previous ones - add to result
...@@ -2269,6 +2271,7 @@ public class ImageDttCPU { ...@@ -2269,6 +2271,7 @@ public class ImageDttCPU {
imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) imgdtt_params.lma_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) imgdtt_params.lma_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) imgdtt_params.lma_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
imgdtt_params.lma_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
imgdtt_params.lma_max_area, //double lma_max_area, // maximal half-area (if > 0.0) imgdtt_params.lma_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_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 imgdtt_params.lma_str_offset); // convert lma-generated strength to match previous ones - add to result
...@@ -3343,6 +3346,7 @@ public class ImageDttCPU { ...@@ -3343,6 +3346,7 @@ public class ImageDttCPU {
imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) imgdtt_params.lmas_max_rel_rms, // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
imgdtt_params.lmas_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS) imgdtt_params.lmas_min_strength, // minimal composite strength (sqrt(average amp squared over absolute RMS)
imgdtt_params.lmas_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line) imgdtt_params.lmas_min_ac, // minimal of A and C coefficients maximum (measures sharpest point/line)
imgdtt_params.lmas_min_min_ac, // minimal of A and C coefficients minimum (measures sharpest point)
imgdtt_params.lmas_max_area, //double lma_max_area, // maximal half-area (if > 0.0) 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_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 imgdtt_params.lma_str_offset // convert lma-generated strength to match previous ones - add to result
......
...@@ -128,6 +128,7 @@ public class ImageDttParameters { ...@@ -128,6 +128,7 @@ public class ImageDttParameters {
public double lmas_max_rel_rms = 0.3; // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) public double lmas_max_rel_rms = 0.3; // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
public double lmas_min_strength = 0.7; // minimal composite strength (sqrt(average amp squared over absolute RMS) public double lmas_min_strength = 0.7; // minimal composite strength (sqrt(average amp squared over absolute RMS)
public double lmas_min_ac = 0.02; // minimal of a and C coefficients maximum (measures sharpest point/line) public double lmas_min_ac = 0.02; // minimal of a and C coefficients maximum (measures sharpest point/line)
public double lmas_min_min_ac = 0.007; // minimal of a and C coefficients minimum (measures sharpest point)
public double lmas_max_area = 0.0; // maximal half-area (if > 0.0) public double lmas_max_area = 0.0; // maximal half-area (if > 0.0)
public boolean lma_gaussian = false; // model correlation maximum as a Gaussian (false - as a parabola) public boolean lma_gaussian = false; // model correlation maximum as a Gaussian (false - as a parabola)
...@@ -163,10 +164,11 @@ public class ImageDttParameters { ...@@ -163,10 +164,11 @@ public class ImageDttParameters {
public double lma_rms_diff = 0.003; // public double lma_rms_diff = 0.003; //
public int lma_num_iter = 10; // public int lma_num_iter = 10; //
// Filtering and strength calculation // Filtering and strength calculation
public double lma_max_rel_rms = 0.2; // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3) public double lma_max_rel_rms = 0.25; // maximal relative (to average max/min amplitude LMA RMS) // May be up to 0.3)
public double lma_min_strength = 1.0; // minimal composite strength (sqrt(average amp squared over absolute RMS) public double lma_min_strength = 1.0; // minimal composite strength (sqrt(average amp squared over absolute RMS)
public double lma_min_ac = 0.05; // minimal of a and C coefficients maximum (measures sharpest point/line) public double lma_min_ac = 0.05; // minimal of a and C coefficients maximum (measures sharpest point/line)
public double lma_max_area = 45.0; // maximal half-area (if > 0.0) public double lma_min_min_ac = 0.015; // minimal of a and C coefficients minimum (measures sharpest point)
public double lma_max_area = 30.0; //45.0; // maximal half-area (if > 0.0)
public double lma_str_scale = 0.2; // convert lma-generated strength to match previous ones - scale public double lma_str_scale = 0.2; // convert lma-generated strength to match previous ones - scale
public double lma_str_offset = 0.05; // convert lma-generated strength to match previous ones - add to result public double lma_str_offset = 0.05; // convert lma-generated strength to match previous ones - add to result
...@@ -388,6 +390,8 @@ public class ImageDttParameters { ...@@ -388,6 +390,8 @@ public class ImageDttParameters {
"Discard tile if composite strength (average amplitude over SQRT of RMS) is below"); "Discard tile if composite strength (average amplitude over SQRT of RMS) is below");
gd.addNumericField("Minimal max (A,C)", this.lmas_min_ac, 6, 8, "", gd.addNumericField("Minimal max (A,C)", this.lmas_min_ac, 6, 8, "",
"Minimal value of max (A,C) coefficients to keep the tile (measures sharpest point/line correlation maximum)"); "Minimal value of max (A,C) coefficients to keep the tile (measures sharpest point/line correlation maximum)");
gd.addNumericField("Minimal min (A,C)", this.lmas_min_min_ac, 6, 8, "",
"Minimal value of min (A,C) coefficients to keep the tile (measures sharpest point correlation maximum)");
gd.addNumericField("Maximal area", this.lmas_max_area, 6, 8, "sq.pix", gd.addNumericField("Maximal area", this.lmas_max_area, 6, 8, "sq.pix",
"Maximal product of maximum half-width by half-height, ignore check if <=0"); "Maximal product of maximum half-width by half-height, ignore check if <=0");
...@@ -453,6 +457,8 @@ public class ImageDttParameters { ...@@ -453,6 +457,8 @@ public class ImageDttParameters {
"Discard tile if composite strength (average amplitude over SQRT of RMS) is below"); "Discard tile if composite strength (average amplitude over SQRT of RMS) is below");
gd.addNumericField("Minimal max (A,C)", this.lma_min_ac, 6, 8, "", gd.addNumericField("Minimal max (A,C)", this.lma_min_ac, 6, 8, "",
"Minimal value of max (A,C) coefficients to keep the tile (measures sharpest point/line correlation maximum)"); "Minimal value of max (A,C) coefficients to keep the tile (measures sharpest point/line correlation maximum)");
gd.addNumericField("Minimal min (A,C)", this.lma_min_min_ac, 6, 8, "",
"Minimal value of min (A,C) coefficients to keep the tile (measures sharpest point correlation maximum)");
gd.addNumericField("Maximal area", this.lma_max_area, 6, 8, "sq.pix", gd.addNumericField("Maximal area", this.lma_max_area, 6, 8, "sq.pix",
"Maximal product of maximum half-width by half-height, ignore check if <=0"); "Maximal product of maximum half-width by half-height, ignore check if <=0");
...@@ -605,6 +611,7 @@ public class ImageDttParameters { ...@@ -605,6 +611,7 @@ public class ImageDttParameters {
this.lmas_max_rel_rms = gd.getNextNumber(); this.lmas_max_rel_rms = gd.getNextNumber();
this.lmas_min_strength = gd.getNextNumber(); this.lmas_min_strength = gd.getNextNumber();
this.lmas_min_ac = gd.getNextNumber(); this.lmas_min_ac = gd.getNextNumber();
this.lmas_min_min_ac = gd.getNextNumber();
this.lmas_max_area = gd.getNextNumber(); this.lmas_max_area = gd.getNextNumber();
this.lma_gaussian= gd.getNextBoolean(); this.lma_gaussian= gd.getNextBoolean();
...@@ -638,6 +645,7 @@ public class ImageDttParameters { ...@@ -638,6 +645,7 @@ public class ImageDttParameters {
this.lma_max_rel_rms = gd.getNextNumber(); this.lma_max_rel_rms = gd.getNextNumber();
this.lma_min_strength = gd.getNextNumber(); this.lma_min_strength = gd.getNextNumber();
this.lma_min_ac = gd.getNextNumber(); this.lma_min_ac = gd.getNextNumber();
this.lma_min_min_ac = gd.getNextNumber();
this.lma_max_area = gd.getNextNumber(); this.lma_max_area = gd.getNextNumber();
this.lma_str_scale = gd.getNextNumber(); this.lma_str_scale = gd.getNextNumber();
...@@ -754,6 +762,7 @@ public class ImageDttParameters { ...@@ -754,6 +762,7 @@ public class ImageDttParameters {
properties.setProperty(prefix+"lmas_max_rel_rms", this.lmas_max_rel_rms +""); properties.setProperty(prefix+"lmas_max_rel_rms", this.lmas_max_rel_rms +"");
properties.setProperty(prefix+"lmas_min_strength", this.lmas_min_strength +""); properties.setProperty(prefix+"lmas_min_strength", this.lmas_min_strength +"");
properties.setProperty(prefix+"lmas_min_ac", this.lmas_min_ac +""); properties.setProperty(prefix+"lmas_min_ac", this.lmas_min_ac +"");
properties.setProperty(prefix+"lmas_min_min_ac", this.lmas_min_min_ac +"");
properties.setProperty(prefix+"lmas_max_area", this.lmas_max_area +""); properties.setProperty(prefix+"lmas_max_area", this.lmas_max_area +"");
properties.setProperty(prefix+"lma_gaussian", this.lma_gaussian +""); properties.setProperty(prefix+"lma_gaussian", this.lma_gaussian +"");
...@@ -788,6 +797,7 @@ public class ImageDttParameters { ...@@ -788,6 +797,7 @@ public class ImageDttParameters {
properties.setProperty(prefix+"lma_max_rel_rms", this.lma_max_rel_rms +""); properties.setProperty(prefix+"lma_max_rel_rms", this.lma_max_rel_rms +"");
properties.setProperty(prefix+"lma_min_strength", this.lma_min_strength +""); properties.setProperty(prefix+"lma_min_strength", this.lma_min_strength +"");
properties.setProperty(prefix+"lma_min_ac", this.lma_min_ac +""); properties.setProperty(prefix+"lma_min_ac", this.lma_min_ac +"");
properties.setProperty(prefix+"lma_min_min_ac", this.lma_min_min_ac +"");
properties.setProperty(prefix+"lma_max_area", this.lma_max_area +""); properties.setProperty(prefix+"lma_max_area", this.lma_max_area +"");
properties.setProperty(prefix+"lma_str_scale", this.lma_str_scale +""); properties.setProperty(prefix+"lma_str_scale", this.lma_str_scale +"");
properties.setProperty(prefix+"lma_str_offset", this.lma_str_offset +""); properties.setProperty(prefix+"lma_str_offset", this.lma_str_offset +"");
...@@ -909,6 +919,7 @@ public class ImageDttParameters { ...@@ -909,6 +919,7 @@ public class ImageDttParameters {
if (properties.getProperty(prefix+"lmas_max_rel_rms")!=null) this.lmas_max_rel_rms=Double.parseDouble(properties.getProperty(prefix+"lmas_max_rel_rms")); if (properties.getProperty(prefix+"lmas_max_rel_rms")!=null) this.lmas_max_rel_rms=Double.parseDouble(properties.getProperty(prefix+"lmas_max_rel_rms"));
if (properties.getProperty(prefix+"lmas_min_strength")!=null) this.lmas_min_strength=Double.parseDouble(properties.getProperty(prefix+"lmas_min_strength")); if (properties.getProperty(prefix+"lmas_min_strength")!=null) this.lmas_min_strength=Double.parseDouble(properties.getProperty(prefix+"lmas_min_strength"));
if (properties.getProperty(prefix+"lmas_min_ac")!=null) this.lmas_min_ac=Double.parseDouble(properties.getProperty(prefix+"lmas_min_ac")); if (properties.getProperty(prefix+"lmas_min_ac")!=null) this.lmas_min_ac=Double.parseDouble(properties.getProperty(prefix+"lmas_min_ac"));
if (properties.getProperty(prefix+"lmas_min_min_ac")!=null) this.lmas_min_min_ac=Double.parseDouble(properties.getProperty(prefix+"lmas_min_min_ac"));
if (properties.getProperty(prefix+"lmas_max_area")!=null) this.lmas_max_area=Double.parseDouble(properties.getProperty(prefix+"lmas_max_area")); if (properties.getProperty(prefix+"lmas_max_area")!=null) this.lmas_max_area=Double.parseDouble(properties.getProperty(prefix+"lmas_max_area"));
if (properties.getProperty(prefix+"lma_gaussian")!=null) this.lma_gaussian=Boolean.parseBoolean(properties.getProperty(prefix+"lma_gaussian")); if (properties.getProperty(prefix+"lma_gaussian")!=null) this.lma_gaussian=Boolean.parseBoolean(properties.getProperty(prefix+"lma_gaussian"));
...@@ -941,6 +952,7 @@ public class ImageDttParameters { ...@@ -941,6 +952,7 @@ public class ImageDttParameters {
if (properties.getProperty(prefix+"lma_max_rel_rms")!=null) this.lma_max_rel_rms=Double.parseDouble(properties.getProperty(prefix+"lma_max_rel_rms")); if (properties.getProperty(prefix+"lma_max_rel_rms")!=null) this.lma_max_rel_rms=Double.parseDouble(properties.getProperty(prefix+"lma_max_rel_rms"));
if (properties.getProperty(prefix+"lma_min_strength")!=null) this.lma_min_strength=Double.parseDouble(properties.getProperty(prefix+"lma_min_strength")); if (properties.getProperty(prefix+"lma_min_strength")!=null) this.lma_min_strength=Double.parseDouble(properties.getProperty(prefix+"lma_min_strength"));
if (properties.getProperty(prefix+"lma_min_ac")!=null) this.lma_min_ac=Double.parseDouble(properties.getProperty(prefix+"lma_min_ac")); if (properties.getProperty(prefix+"lma_min_ac")!=null) this.lma_min_ac=Double.parseDouble(properties.getProperty(prefix+"lma_min_ac"));
if (properties.getProperty(prefix+"lma_min_min_ac")!=null) this.lma_min_min_ac=Double.parseDouble(properties.getProperty(prefix+"lma_min_min_ac"));
if (properties.getProperty(prefix+"lma_max_area")!=null) this.lma_max_area=Double.parseDouble(properties.getProperty(prefix+"lma_max_area")); if (properties.getProperty(prefix+"lma_max_area")!=null) this.lma_max_area=Double.parseDouble(properties.getProperty(prefix+"lma_max_area"));
if (properties.getProperty(prefix+"lma_str_scale")!=null) this.lma_str_scale=Double.parseDouble(properties.getProperty(prefix+"lma_str_scale")); if (properties.getProperty(prefix+"lma_str_scale")!=null) this.lma_str_scale=Double.parseDouble(properties.getProperty(prefix+"lma_str_scale"));
if (properties.getProperty(prefix+"lma_str_offset")!=null) this.lma_str_offset=Double.parseDouble(properties.getProperty(prefix+"lma_str_offset")); if (properties.getProperty(prefix+"lma_str_offset")!=null) this.lma_str_offset=Double.parseDouble(properties.getProperty(prefix+"lma_str_offset"));
...@@ -1059,6 +1071,7 @@ public class ImageDttParameters { ...@@ -1059,6 +1071,7 @@ public class ImageDttParameters {
idp.lmas_max_rel_rms= this.lmas_max_rel_rms; idp.lmas_max_rel_rms= this.lmas_max_rel_rms;
idp.lmas_min_strength= this.lmas_min_strength; idp.lmas_min_strength= this.lmas_min_strength;
idp.lmas_min_ac= this.lmas_min_ac; idp.lmas_min_ac= this.lmas_min_ac;
idp.lmas_min_min_ac= this.lmas_min_min_ac;
idp.lmas_max_area= this.lmas_max_area; idp.lmas_max_area= this.lmas_max_area;
idp.lma_gaussian = this.lma_gaussian; idp.lma_gaussian = this.lma_gaussian;
...@@ -1091,6 +1104,7 @@ public class ImageDttParameters { ...@@ -1091,6 +1104,7 @@ public class ImageDttParameters {
idp.lma_max_rel_rms= this.lma_max_rel_rms; idp.lma_max_rel_rms= this.lma_max_rel_rms;
idp.lma_min_strength= this.lma_min_strength; idp.lma_min_strength= this.lma_min_strength;
idp.lma_min_ac= this.lma_min_ac; idp.lma_min_ac= this.lma_min_ac;
idp.lma_min_min_ac= this.lma_min_min_ac;
idp.lma_max_area= this.lma_max_area; idp.lma_max_area= this.lma_max_area;
idp.lma_str_scale= this.lma_str_scale; idp.lma_str_scale= this.lma_str_scale;
idp.lma_str_offset= this.lma_str_offset; idp.lma_str_offset= this.lma_str_offset;
......
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