Commit 6ad9d157 authored by Andrey Filippov's avatar Andrey Filippov

caught up with branch dct

parents b7a74a73 24fb19fa
This diff is collapsed.
......@@ -5,7 +5,7 @@
** Parameter classes for aberration correction for Eyesis4pi
**
**
** Copyright (C) 2012 Elphel, Inc.
** Copyright (C) 2012-2018 Elphel, Inc.
**
** -----------------------------------------------------------------------------**
**
......
......@@ -111,6 +111,9 @@ public class EyesisCorrections {
if ((this.debugLevel>101) && (correctionsParameters.sourcePaths!=null) && (correctionsParameters.sourcePaths.length>0)) {
testFF(correctionsParameters.sourcePaths[0]);
}
if (debugLevel > -2) {
System.out.println();
}
}
public void initSensorFilesAux(int debugLevel){
......
......@@ -2684,7 +2684,22 @@ public class ImageDtt {
}
// IDCT-IV should be in reversed order: CC->CC, SC->CS, CS->SC, SS->SS
int idct_mode = ((dct_mode << 1) & 2) | ((dct_mode >> 1) & 1);
if ((globalDebugLevel > 0) && debugTile) {
double [] clt_tile_dbg = clt_tile.clone();
double [] clt_tile_dbg1 = clt_tile.clone();
clt_tile_dbg = dtt.dttt_ivn (clt_tile_dbg, idct_mode, transform_size, false);
clt_tile_dbg1 = dtt.dttt_ivn (clt_tile_dbg1, idct_mode, transform_size, true);
clt_tile = dtt.dttt_iv (clt_tile, idct_mode, transform_size);
System.out.println("\n-------- tileX="+tileX+", tileY="+tileY+", idct_mode="+idct_mode+" ---#, standard, good, bad, diff---");
for (int nt = 0; nt < clt_tile_dbg.length; nt++) {
System.out.println(String.format("%2d: %8f %8f %8f %8f %8f",
clt_tile[nt],clt_tile_dbg[nt],clt_tile_dbg1[nt],clt_tile_dbg[nt] - clt_tile_dbg[nt],clt_tile_dbg1[nt] - clt_tile_dbg[nt]));
}
} else {
clt_tile = dtt.dttt_iv (clt_tile, idct_mode, transform_size);
}
// iclt_tile[i][chn] = dtt.dttt_iv (clt_data[i][chn][tileY][tileX][dct_mode], idct_mode, transform_size);
double [] tile_mdct = dtt.unfold_tile(clt_tile, transform_size, dct_mode); // mode=0 - DCCT 16x16
// accumulate partial mdct results
......@@ -4989,8 +5004,26 @@ public class ImageDtt {
} else {
clt_tile[dct_mode] = dtt.fold_tile (tile_in, transform_size, dct_mode); // DCCT, DSCT, DCST, DSST
}
// clt_tile[dct_mode] = dtt.dttt_iv (clt_tile[dct_mode], dct_mode, transform_size);
if (bdebug) {
double [] clt_tile_dbg = clt_tile[dct_mode].clone();
double [] clt_tile_dbg1 = clt_tile[dct_mode].clone();
clt_tile_dbg1 = dtt.dttt_ivn (clt_tile_dbg1, dct_mode, transform_size,true);
clt_tile_dbg = dtt.dttt_ivn (clt_tile_dbg, dct_mode, transform_size,false);
clt_tile[dct_mode] = dtt.dttt_iv (clt_tile[dct_mode], dct_mode, transform_size);
System.out.println("\n-------- 2: dct_mode="+dct_mode+" ---#, standard, good, bad, diff---");
for (int nt = 0; nt < clt_tile_dbg.length; nt++) {
System.out.println(String.format("%2d: %8f %8f %8f %8f %8f",
nt, clt_tile[dct_mode][nt],clt_tile_dbg[nt], clt_tile_dbg1[nt],clt_tile_dbg[nt] - clt_tile_dbg[nt], clt_tile_dbg1[nt] - clt_tile_dbg[nt]));
}
System.out.println("done debug");
} else {
clt_tile[dct_mode] = dtt.dttt_iv (clt_tile[dct_mode], dct_mode, transform_size);
}
}
}
if (debug_fpga){
......@@ -7887,7 +7920,7 @@ public class ImageDtt {
chn,
centersXY_main[i][0], // centerX, // center of aberration-corrected (common model) tile, X
centersXY_main[i][1], // centerY, //
0, // external tile compare
(globalDebugLevel > -2) && (tileX == debug_tileX) && (tileY == debug_tileY)? 2:0, // external tile compare
false,// no_deconvolution,
false, // ); // transpose);
((saturation_main != null) ? saturation_main[i] : null), //final boolean [][] saturation_imp, // (near) saturated pixels or null
......
......@@ -150,6 +150,9 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
pack();
GUI.center(this);
setVisible(showGUI);
if (!showGUI) {
this.ABSOLUTELY_SILENT = true;
}
}
void addButton(String label, Panel panel) {
......@@ -648,14 +651,14 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
min_gain=2.0*gains[0];
for (i=0;i<4;i++) {
if (min_gain > gains[i]*(1.0-blacks[i])) min_gain = gains[i]*(1.0-blacks[i]);
System.out.println("gains["+i+"]="+gains[i]+" min_gain="+min_gain);
if (!this.ABSOLUTELY_SILENT) System.out.println("gains["+i+"]="+gains[i]+" min_gain="+min_gain);
}
imp.setProperty("GAIN",String.format("%f",min_gain)); // common gain
for (i=0;i<4;i++) gains[i]/=min_gain;
for (i=0;i<4;i++) blacks256[i]=256.0*blacks[i];
for (i=0;i<4;i++) {
System.out.println("scaled gains["+i+"]="+gains[i]);
if (!this.ABSOLUTELY_SILENT) System.out.println("scaled gains["+i+"]="+gains[i]);
}
......@@ -665,7 +668,7 @@ public class JP46_Reader_camera extends PlugInFrame implements ActionListener {
else satValue[i]=((rgammas[i][255])-blacks256[i]);
} else satValue[i]=255.0;
imp.setProperty("saturation_"+i,String.format("%f",satValue[i]));
System.out.println("scaled gains["+i+"]="+gains[i]+" satValue["+i+"]="+satValue[i]);
if (!this.ABSOLUTELY_SILENT) System.out.println("scaled gains["+i+"]="+gains[i]+" satValue["+i+"]="+satValue[i]);
}
// swap satValue to match FLIPH,FLIPV again
......
......@@ -157,7 +157,12 @@ public class PixelMapping {
if (subCamera < 0) {
return null;
}
System.out.println("channelsForSubCamera("+subCamera+"),this.sensors.length="+this.sensors.length);
if (this.debugLevel>1) {
System.out.print("channelsForSubCamera("+subCamera+"),this.sensors.length="+this.sensors.length+": ");
// } else if (this.debugLevel > -2) {
// System.out.print(".");
}
// ArrayList<ArrayList<ArrayList<Integer>>> camera_IPs = new ArrayList<ArrayList<ArrayList<Integer>>>();
ArrayList<Point> cam_port = new ArrayList<Point>();
for (int i=0;i<this.sensors.length;i++) if (this.sensors[i]!=null) {
......@@ -176,10 +181,16 @@ public class PixelMapping {
});
// debugging:
if (subCamera >= cam_port_arr.length) {
if (this.debugLevel>1) {
System.out.println("Error: Subcamera "+subCamera+" > that total number of sensor ports in the system = "+cam_port_arr.length);
}
return null;
}
if (this.debugLevel>1) {
System.out.println("----- This filename subcamera "+subCamera+": physical camera "+cam_port_arr[subCamera].x+", sensor_port "+cam_port_arr[subCamera].y);
} else if (this.debugLevel > -2) {
System.out.print(".");
}
if (this.sensors == null) return null;
int numChannels=0;
for (int i=0;i<this.sensors.length;i++) if (this.sensors[i]!=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