Commit 6346b15e authored by Andrey Filippov's avatar Andrey Filippov

updated ImageDttCPU:cltMeasureLazyEye() for variable number of sensors

parent 624db0c0
......@@ -101,6 +101,9 @@ public class ImageDttParameters {
public boolean mcorr_hor_multi = true; // all horizontal
public boolean mcorr_vert = true; // all vertical (2 pairs for quad, 8 - for lwir16)
public boolean mcorr_vert_multi = true; // all vertical
//final int corr_sel, // +1 - all, +2 - dia, +4 - sq, +8 - neibs, +16 - hor + 32 - vert
public int mcorr_sel_ly = 1; // +1 - all, +2 - dia, +4 - sq, +8 - neibs, +16 - hor + 32 - vert
public int mcorr_sel_ly_multi = 2+4+8; // +1 - all, +2 - dia, +4 - sq, +8 - neibs, +16 - hor + 32 - vert
public boolean mcorr_cons_all = true; // consolidate all available pairs
......@@ -270,6 +273,10 @@ public class ImageDttParameters {
return (numSens > mcorr_multi) ? mcorr_vert_multi : mcorr_vert;
}
public int getMcorrSelLY(int numSens) {
return (numSens > mcorr_multi) ? mcorr_sel_ly_multi : mcorr_sel_ly;
}
public void dialogQuestions(GenericJTabbedDialog gd) {
gd.addCheckbox ("Debug CPU->GPU matching", this.gpu_mode_debug,
......@@ -410,8 +417,10 @@ public class ImageDttParameters {
"All vertical pairs. N: 2 for quad, 8 for lwir16");
gd.addCheckbox ("Calculate vertical pairs for multi cameras", this.mcorr_vert_multi,
"All vertical pairs. N: 2 for quad, 8 for lwir16");
gd.addNumericField ("Select correlation pairs for LY for small cameras", this.mcorr_sel_ly, 0, 3, "",
" +1 - all, +2 - dia, +4 - sq, +8 - neibs, +16 - hor + 32 - vert");
gd.addNumericField ("Select correlation pairs for LY for multi cameras", this.mcorr_sel_ly_multi, 0, 3, "",
" +1 - all, +2 - dia, +4 - sq, +8 - neibs, +16 - hor + 32 - vert");
gd.addCheckbox ("Combine all pairs", this.mcorr_cons_all,
"Combine all calculated correlation pairs");
......@@ -718,6 +727,9 @@ public class ImageDttParameters {
this.mcorr_vert = gd.getNextBoolean();
this.mcorr_vert_multi = gd.getNextBoolean();
this.mcorr_sel_ly= (int) gd.getNextNumber();
this.mcorr_sel_ly_multi=(int)gd.getNextNumber();
this.mcorr_cons_all = gd.getNextBoolean();
this.mcorr_cons_dia = gd.getNextBoolean();
this.mcorr_cons_sq = gd.getNextBoolean();
......@@ -902,6 +914,9 @@ public class ImageDttParameters {
properties.setProperty(prefix+"mcorr_vert", this.mcorr_vert +"");
properties.setProperty(prefix+"mcorr_vert_multi", this.mcorr_vert_multi +"");
properties.setProperty(prefix+"mcorr_sel_ly", this.mcorr_sel_ly +"");
properties.setProperty(prefix+"mcorr_sel_ly_multi", this.mcorr_sel_ly_multi +"");
properties.setProperty(prefix+"mcorr_cons_all", this.mcorr_cons_all +"");
properties.setProperty(prefix+"mcorr_cons_dia", this.mcorr_cons_dia +"");
properties.setProperty(prefix+"mcorr_cons_sq", this.mcorr_cons_sq +"");
......@@ -1088,6 +1103,8 @@ public class ImageDttParameters {
if (properties.getProperty(prefix+"mcorr_hor_multi")!=null) this.mcorr_hor_multi=Boolean.parseBoolean(properties.getProperty(prefix+"mcorr_hor_multi"));
if (properties.getProperty(prefix+"mcorr_vert")!=null) this.mcorr_vert=Boolean.parseBoolean(properties.getProperty(prefix+"mcorr_vert"));
if (properties.getProperty(prefix+"mcorr_vert_multi")!=null) this.mcorr_vert_multi=Boolean.parseBoolean(properties.getProperty(prefix+"mcorr_vert_multi"));
if (properties.getProperty(prefix+"mcorr_sel_ly")!=null) this.mcorr_sel_ly=Integer.parseInt(properties.getProperty(prefix+"mcorr_sel_ly"));
if (properties.getProperty(prefix+"mcorr_sel_ly_multi")!=null) this.mcorr_sel_ly_multi=Integer.parseInt(properties.getProperty(prefix+"mcorr_sel_ly_multi"));
if (properties.getProperty(prefix+"mcorr_cons_all")!=null) this.mcorr_cons_all=Boolean.parseBoolean(properties.getProperty(prefix+"mcorr_cons_all"));
if (properties.getProperty(prefix+"mcorr_cons_dia")!=null) this.mcorr_cons_dia=Boolean.parseBoolean(properties.getProperty(prefix+"mcorr_cons_dia"));
......@@ -1273,6 +1290,9 @@ public class ImageDttParameters {
idp.mcorr_vert= this.mcorr_vert;
idp.mcorr_vert_multi= this.mcorr_vert_multi;
idp.mcorr_sel_ly= this.mcorr_sel_ly;
idp.mcorr_sel_ly_multi= this.mcorr_sel_ly_multi;
idp.mcorr_cons_all= this.mcorr_cons_all;
idp.mcorr_cons_dia= this.mcorr_cons_dia;
idp.mcorr_cons_sq= this.mcorr_cons_sq;
......
......@@ -4967,6 +4967,7 @@ public class QuadCLT extends QuadCLTCPU {
// use new, LMA-based mismatch calculation
double [][] lazy_eye_data = null;
if ((gpuQuad == null) || !(isAux()?clt_parameters.gpu_use_aux_adjust : clt_parameters.gpu_use_main_adjust)) { // CPU
/*
lazy_eye_data = image_dtt.cltMeasureLazyEye ( // returns d,s lazy eye parameters
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
tile_op, // per-tile operation bit codes
......@@ -4997,6 +4998,35 @@ public class QuadCLT extends QuadCLTCPU {
clt_parameters.tileY, // final int debug_tileY,
threadsMax,
debugLevel - 2);
*/
lazy_eye_data = image_dtt.cltMeasureLazyEye ( // returns d,s lazy eye parameters
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
tile_op, // final int [][] tile_op, // [tilesY][tilesX] - what to do - 0 - nothing for this tile
disparity_array, // final double [][] disparity_array, // [tilesY][tilesX] - individual per-tile expected disparity
image_data, // final double [][][] imade_data, // first index - number of image in a quad
saturation_imp, // final boolean [][] saturation_imp, // (near) saturated pixels or null
tilesX * image_dtt.transform_size, // final int width,
clt_parameters.getFatZero(isMonochrome()), // final double corr_fat_zero, // add to denominator to modify phase correlation (same units as data1, data2). <0 - pure sum
clt_parameters.corr_red, // final double corr_red,
clt_parameters.corr_blue, // final double corr_blue,
clt_parameters.getCorrSigma(image_dtt.isMonochrome()), // final double corr_sigma,
min_corr_selected, // 0.0001; //final double min_corr, // 0.02; // minimal correlation value to consider valid
geometryCorrection, // final GeometryCorrection geometryCorrection,
null, // final GeometryCorrection geometryCorrection_main, // if not null correct this camera (aux) to the coordinates of the main
clt_kernels, // final double [][][][][][] clt_kernels, // [channel_in_quad][color][tileY][tileX][band][pixel] , size should match image (have 1 tile around)
clt_parameters.kernel_step, // final int kernel_step,
clt_parameters.clt_window, // final int window_type,
shiftXY, // final double [][] shiftXY, // [port]{shiftX,shiftY}
disparity_corr, // final double disparity_corr, // disparity at infinity
clt_parameters.shift_x, // final double shiftX, // shift image horizontally (positive - right) - just for testing
clt_parameters.shift_y, // final double shiftY, // shift image vertically (positive - down)
clt_parameters.tileStep, // final int tileStep, // process tileStep x tileStep cluster of tiles when adjusting lazy eye parameters
clt_parameters.img_dtt.getMcorrSelLY(getNumSensors()), // final int mcorr_sel, // +1 - all, +2 - dia, +4 - sq, +8 - neibs, +16 - hor + 32 - vert
clt_parameters.tileX, // final int debug_tileX,
clt_parameters.tileY, // final int debug_tileY,
threadsMax, // final int threadsMax, // maximal number of threads to launch
debugLevel - 2); // final int globalDebugLevel)
} else {// GPU
// First - measure and get fcorr_td, fdisp_dist, fpxpy
float [][][][] fcorr_td = new float[tilesY][tilesX][][];
......
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