Commit 15babaaf authored by Andrey Filippov's avatar Andrey Filippov

Adding monochrome mode to CLT, snapshot tested with Bayer images

parent b106acf0
...@@ -150,6 +150,13 @@ public class PixelMapping { ...@@ -150,6 +150,13 @@ public class PixelMapping {
System.out.println("ERROR: getSubChannel("+channel+"): channel out of range"); System.out.println("ERROR: getSubChannel("+channel+"): channel out of range");
return -1; return -1;
} }
// System.out.println("getSubChannel("+channel+") => "+this.sensors[channel].getSubChannel());
return this.sensors[channel].getSubChannel();
}
public int getSubChannelSilent(int channel ){
if ((channel<0) || (channel>=this.sensors.length)) {
return -1;
}
// System.out.println("getSubChannel("+channel+") => "+this.sensors[channel].getSubChannel()); // System.out.println("getSubChannel("+channel+") => "+this.sensors[channel].getSubChannel());
return this.sensors[channel].getSubChannel(); return this.sensors[channel].getSubChannel();
} }
...@@ -164,6 +171,14 @@ public class PixelMapping { ...@@ -164,6 +171,14 @@ public class PixelMapping {
return (this.sensors != null) && (channel>=0) && (channel<this.sensors.length) && (this.sensors[channel]!=null); return (this.sensors != null) && (channel>=0) && (channel<this.sensors.length) && (this.sensors[channel]!=null);
} }
public boolean isChannelAvailable(int [] channels){
if (channels == null) return false;
for (int c:channels) {
if (isChannelAvailable(c)) return true;
}
return false;
}
// Updating for nc393. subCamera here is 0..9 for Eyesis4pi393 - 0-based index of the file, so it combines physical camera (separate IP) // Updating for nc393. subCamera here is 0..9 for Eyesis4pi393 - 0-based index of the file, so it combines physical camera (separate IP)
// as stored in "subcamera" field of the calibration file and "sensor_port". sensor_port may start from non-0, so we need to count all combinations // as stored in "subcamera" field of the calibration file and "sensor_port". sensor_port may start from non-0, so we need to count all combinations
//removeUnusedSensorData should be off! //removeUnusedSensorData should be off!
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -30,7 +30,7 @@ import java.util.ArrayList; ...@@ -30,7 +30,7 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.ColorProcParameters;
import com.elphel.imagej.common.DoubleGaussianBlur; import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -41,7 +41,7 @@ public class BlueLeak { ...@@ -41,7 +41,7 @@ public class BlueLeak {
private int width; private int width;
private int height; private int height;
private int length; private int length;
EyesisCorrectionParameters.ColorProcParameters colorProcParameters; ColorProcParameters colorProcParameters;
private ShowDoubleFloatArrays SDFA_INSTANCE; private ShowDoubleFloatArrays SDFA_INSTANCE;
private int [] dirs20; private int [] dirs20;
private double [] weights20; private double [] weights20;
...@@ -53,7 +53,7 @@ public class BlueLeak { ...@@ -53,7 +53,7 @@ public class BlueLeak {
private int xMax,yMax; private int xMax,yMax;
public BlueLeak( public BlueLeak(
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
double [][] rgb, double [][] rgb,
int width, int width,
ShowDoubleFloatArrays SDFA_INSTANCE, ShowDoubleFloatArrays SDFA_INSTANCE,
...@@ -419,7 +419,7 @@ public class BlueLeak { ...@@ -419,7 +419,7 @@ public class BlueLeak {
private double [] overexposed( private double [] overexposed(
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
double [] dpixels, double [] dpixels,
int width int width
){ ){
...@@ -454,7 +454,7 @@ public class BlueLeak { ...@@ -454,7 +454,7 @@ public class BlueLeak {
private double [] overexposed( private double [] overexposed(
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
double [] dpixels, double [] dpixels,
int width, int width,
int shftX, int shftX,
......
...@@ -29,7 +29,7 @@ package com.elphel.imagej.correction; ...@@ -29,7 +29,7 @@ package com.elphel.imagej.correction;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.ColorProcParameters;
import com.elphel.imagej.common.DoubleGaussianBlur; import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.GenericJTabbedDialog; import com.elphel.imagej.common.GenericJTabbedDialog;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -56,7 +56,7 @@ public class CorrectionColorProc { ...@@ -56,7 +56,7 @@ public class CorrectionColorProc {
public void processColorsWeights(ImageStack stack, // does not like NaN (in GaussianBlur public void processColorsWeights(ImageStack stack, // does not like NaN (in GaussianBlur
double scale, // initial maximal pixel value (16)) double scale, // initial maximal pixel value (16))
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters, CorrectionColorProc.ColorGainsParameters channelGainParameters,
int channel, int channel,
double [] denoiseMask, double [] denoiseMask,
...@@ -290,7 +290,7 @@ public class CorrectionColorProc { ...@@ -290,7 +290,7 @@ public class CorrectionColorProc {
// old versiion // old versiion
public void processColorsWeightsOld(ImageStack stack, public void processColorsWeightsOld(ImageStack stack,
double scale, // initial maximal pixel value (16)) double scale, // initial maximal pixel value (16))
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters, CorrectionColorProc.ColorGainsParameters channelGainParameters,
int channel, int channel,
double [] denoiseMask, double [] denoiseMask,
...@@ -548,6 +548,21 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg ...@@ -548,6 +548,21 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
public ColorGainsParameters(){ public ColorGainsParameters(){
} }
@Override
public ColorGainsParameters clone() {
ColorGainsParameters cgp = new ColorGainsParameters();
cgp.gain = this.gain.clone();
cgp.balanceRed = this.balanceRed.clone();
cgp.balanceBlue = this.balanceBlue.clone();
return cgp;
}
public void copyFrom(ColorGainsParameters cgp) {
this.gain = cgp.gain.clone();
this.balanceRed = cgp.balanceRed.clone();
this.balanceBlue = cgp.balanceBlue.clone();
}
public void setProperties(String prefix,Properties properties){ public void setProperties(String prefix,Properties properties){
properties.setProperty(prefix+"channels",this.gain.length+""); properties.setProperty(prefix+"channels",this.gain.length+"");
for (int i=0; i<this.gain.length;i++) { for (int i=0; i<this.gain.length;i++) {
...@@ -609,6 +624,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg ...@@ -609,6 +624,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
return true; return true;
} }
public boolean showDialog(ColorGainsParameters aux) { public boolean showDialog(ColorGainsParameters aux) {
GenericJTabbedDialog gd = new GenericJTabbedDialog("Individual channels colors/gains", 600,1000); GenericJTabbedDialog gd = new GenericJTabbedDialog("Individual channels colors/gains", 600,1000);
......
...@@ -26,6 +26,7 @@ package com.elphel.imagej.correction; ...@@ -26,6 +26,7 @@ package com.elphel.imagej.correction;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.ColorProcParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.common.DoubleGaussianBlur; import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -941,7 +942,7 @@ public class EyesisDCT { ...@@ -941,7 +942,7 @@ public class EyesisDCT {
EyesisCorrectionParameters.DCTParameters dct_parameters, EyesisCorrectionParameters.DCTParameters dct_parameters,
EyesisCorrectionParameters.DebayerParameters debayerParameters, EyesisCorrectionParameters.DebayerParameters debayerParameters,
EyesisCorrectionParameters.NonlinParameters nonlinParameters, EyesisCorrectionParameters.NonlinParameters nonlinParameters,
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters, CorrectionColorProc.ColorGainsParameters channelGainParameters,
EyesisCorrectionParameters.RGBParameters rgbParameters, EyesisCorrectionParameters.RGBParameters rgbParameters,
EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters, EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
...@@ -1078,7 +1079,7 @@ public class EyesisDCT { ...@@ -1078,7 +1079,7 @@ public class EyesisDCT {
EyesisCorrectionParameters.DCTParameters dct_parameters, EyesisCorrectionParameters.DCTParameters dct_parameters,
EyesisCorrectionParameters.DebayerParameters debayerParameters, EyesisCorrectionParameters.DebayerParameters debayerParameters,
EyesisCorrectionParameters.NonlinParameters nonlinParameters, EyesisCorrectionParameters.NonlinParameters nonlinParameters,
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters, CorrectionColorProc.ColorGainsParameters channelGainParameters,
EyesisCorrectionParameters.RGBParameters rgbParameters, EyesisCorrectionParameters.RGBParameters rgbParameters,
int convolveFFTSize, // 128 - fft size, kernel size should be size/2 int convolveFFTSize, // 128 - fft size, kernel size should be size/2
...@@ -1219,7 +1220,7 @@ public class EyesisDCT { ...@@ -1219,7 +1220,7 @@ public class EyesisDCT {
} }
if (this.correctionsParameters.deconvolve) { // process with DCT, otherwise use simple debayer if (this.correctionsParameters.deconvolve) { // process with DCT, otherwise use simple debayer
ImageDtt image_dtt = new ImageDtt(); ImageDtt image_dtt = new ImageDtt(false); // Bayer, not monochrome
double [][][][] dct_data = image_dtt.mdctStack( double [][][][] dct_data = image_dtt.mdctStack(
stack, stack,
channel, channel,
......
...@@ -24,7 +24,7 @@ package com.elphel.imagej.tileprocessor; ...@@ -24,7 +24,7 @@ package com.elphel.imagej.tileprocessor;
*/ */
import java.util.ArrayList; import java.util.ArrayList;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.DoubleGaussianBlur; import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.PolynomialApproximation; import com.elphel.imagej.common.PolynomialApproximation;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -286,7 +286,7 @@ public class AlignmentCorrection { ...@@ -286,7 +286,7 @@ public class AlignmentCorrection {
final int hist_min_samples, final int hist_min_samples,
final boolean hist_norm_center, // if there are more tiles that fit than min_samples, replace with final boolean hist_norm_center, // if there are more tiles that fit than min_samples, replace with
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] disp_strength_in, double [][] disp_strength_in,
int tilesX, int tilesX,
double magic_coeff, // still not understood coefficient that reduces reported disparity value. Seems to be around 8.5 double magic_coeff, // still not understood coefficient that reduces reported disparity value. Seems to be around 8.5
...@@ -484,7 +484,7 @@ public class AlignmentCorrection { ...@@ -484,7 +484,7 @@ public class AlignmentCorrection {
final int max_iterations, final int max_iterations,
final double max_coeff_diff, final double max_coeff_diff,
final double far_pull, // = 0.2; // 1; // 0.5; final double far_pull, // = 0.2; // 1; // 0.5;
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] disp_strength, double [][] disp_strength,
int tilesX, int tilesX,
double magic_coeff, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85 double magic_coeff, // still not understood coefficient that reduces reported disparity value. Seems to be around 0.85
...@@ -706,7 +706,7 @@ public class AlignmentCorrection { ...@@ -706,7 +706,7 @@ public class AlignmentCorrection {
// final double max_coeff_diff0, // final double max_coeff_diff0,
// final double far_pull0, // = 0.2; // 1; // 0.5; // final double far_pull0, // = 0.2; // 1; // 0.5;
final boolean use_vertical, final boolean use_vertical,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] disp_strength, double [][] disp_strength,
ArrayList<Sample> samples_list, ArrayList<Sample> samples_list,
int tilesX, int tilesX,
...@@ -882,7 +882,7 @@ public class AlignmentCorrection { ...@@ -882,7 +882,7 @@ public class AlignmentCorrection {
final boolean use_vertical, final boolean use_vertical,
final boolean use_disparity, // for infinity // now disabled? final boolean use_disparity, // for infinity // now disabled?
final boolean allow_dispatity, final boolean allow_dispatity,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] disp_strength, double [][] disp_strength,
ArrayList<Sample> samples_list, ArrayList<Sample> samples_list,
int tilesX, int tilesX,
...@@ -1775,7 +1775,7 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -1775,7 +1775,7 @@ B = |+dy0 -dy1 -2*dy3 |
final int hist_min_samples, final int hist_min_samples,
final boolean hist_norm_center, // if there are more tiles that fit than min_samples, replace with final boolean hist_norm_center, // if there are more tiles that fit than min_samples, replace with
final double inf_fraction, // fraction of the weight for the infinity tiles final double inf_fraction, // fraction of the weight for the infinity tiles
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] scans_14, double [][] scans_14,
double [][] target_disparity, // null or programmed disparity (1 per each 14 entries of scans_14) double [][] target_disparity, // null or programmed disparity (1 per each 14 entries of scans_14)
int tilesX, int tilesX,
...@@ -2362,7 +2362,7 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -2362,7 +2362,7 @@ B = |+dy0 -dy1 -2*dy3 |
final boolean hist_norm_center, // if there are more tiles that fit than min_samples, replace with final boolean hist_norm_center, // if there are more tiles that fit than min_samples, replace with
final double inf_fraction, // fraction of the weight for the infinity tiles final double inf_fraction, // fraction of the weight for the infinity tiles
final double inf_max_disparity, // use all smaller disparities as inf_fraction final double inf_max_disparity, // use all smaller disparities as inf_fraction
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] scans_14, // here - always 14 - infinity and non-infinity double [][] scans_14, // here - always 14 - infinity and non-infinity
double [][][] gt_disparity_strength, // 1 pair for each 14 entries of scans_14 (normally - just 1 scan double [][][] gt_disparity_strength, // 1 pair for each 14 entries of scans_14 (normally - just 1 scan
final boolean filter_ds, // final boolean filter_ds, //
...@@ -2802,7 +2802,7 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -2802,7 +2802,7 @@ B = |+dy0 -dy1 -2*dy3 |
public double [][] combineCltMismatches( public double [][] combineCltMismatches(
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][][] clt_mismatches, double [][][] clt_mismatches,
double [][][] disparity_maps, double [][][] disparity_maps,
int disparity_index, int disparity_index,
...@@ -2826,7 +2826,7 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -2826,7 +2826,7 @@ B = |+dy0 -dy1 -2*dy3 |
public void showCltMismatches( public void showCltMismatches(
String title, String title,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] combo_data, double [][] combo_data,
int tilesX, int tilesX,
int tilesY) int tilesY)
...@@ -2853,7 +2853,7 @@ B = |+dy0 -dy1 -2*dy3 | ...@@ -2853,7 +2853,7 @@ B = |+dy0 -dy1 -2*dy3 |
public void showCltMismatch( public void showCltMismatch(
String title, String title,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
double [][] clt_mismatch, double [][] clt_mismatch,
int tilesX, int tilesX,
int tilesY) int tilesY)
......
...@@ -26,7 +26,7 @@ package com.elphel.imagej.tileprocessor; ...@@ -26,7 +26,7 @@ package com.elphel.imagej.tileprocessor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
public class DisparityProcessor { public class DisparityProcessor {
...@@ -272,7 +272,7 @@ public class DisparityProcessor { ...@@ -272,7 +272,7 @@ public class DisparityProcessor {
final double [] hor_strength, // not yet used final double [] hor_strength, // not yet used
final boolean [] selected, final boolean [] selected,
final boolean [] border, // may be null final boolean [] border, // may be null
final EyesisCorrectionParameters.CLTParameters clt_parameters, final CLTParameters clt_parameters,
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
final int debugLevel) final int debugLevel)
{ {
...@@ -480,7 +480,7 @@ public class DisparityProcessor { ...@@ -480,7 +480,7 @@ public class DisparityProcessor {
final boolean extend_flat, // if the tile is on the hor/vert edge, assume same disparity on the other side final boolean extend_flat, // if the tile is on the hor/vert edge, assume same disparity on the other side
final double k_same, final double k_same,
final double k_turn, final double k_turn,
final EyesisCorrectionParameters.CLTParameters clt_parameters, final CLTParameters clt_parameters,
final double [][] dbgDeriv, //double [2][len] or null; final double [][] dbgDeriv, //double [2][len] or null;
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
final int debugLevel) final int debugLevel)
......
...@@ -29,7 +29,7 @@ import java.util.Comparator; ...@@ -29,7 +29,7 @@ import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
public class LinkPlanes { public class LinkPlanes {
...@@ -122,7 +122,7 @@ public class LinkPlanes { ...@@ -122,7 +122,7 @@ public class LinkPlanes {
public LinkPlanes ( public LinkPlanes (
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
SuperTiles st) SuperTiles st)
{ {
plWorstWorsening = clt_parameters.plWorstWorsening; plWorstWorsening = clt_parameters.plWorstWorsening;
......
...@@ -40,6 +40,8 @@ import java.util.EnumSet; ...@@ -40,6 +40,8 @@ import java.util.EnumSet;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.cameras.ColorProcParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.common.DoubleGaussianBlur; import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -430,9 +432,9 @@ public class MLStats { ...@@ -430,9 +432,9 @@ public class MLStats {
} }
public static boolean mlRecalc(String dir, public static boolean mlRecalc(String dir,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
EyesisCorrectionParameters.DebayerParameters debayerParameters, EyesisCorrectionParameters.DebayerParameters debayerParameters,
EyesisCorrectionParameters.ColorProcParameters colorProcParameters, ColorProcParameters colorProcParameters,
EyesisCorrectionParameters.RGBParameters rgbParameters, EyesisCorrectionParameters.RGBParameters rgbParameters,
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
final boolean updateStatus, final boolean updateStatus,
......
...@@ -29,7 +29,7 @@ import java.util.Collections; ...@@ -29,7 +29,7 @@ import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -62,6 +62,7 @@ public class MacroCorrelation { ...@@ -62,6 +62,7 @@ public class MacroCorrelation {
mTilesY, // int tilesY, mTilesY, // int tilesY,
tileSize, // int tileSize, tileSize, // int tileSize,
tp.superTileSize, // int superTileSize, tp.superTileSize, // int superTileSize,
tp.isMonochrome(),
tp.getMagicScale(), // double scale, tp.getMagicScale(), // double scale,
trusted_correlation, // double trustedCorrelation, trusted_correlation, // double trustedCorrelation,
0.0, // double maxOverexposure, 0.0, // double maxOverexposure,
...@@ -70,7 +71,7 @@ public class MacroCorrelation { ...@@ -70,7 +71,7 @@ public class MacroCorrelation {
public TileProcessor CLTMacroScan( // perform single pass according to prepared tiles operations and disparity public TileProcessor CLTMacroScan( // perform single pass according to prepared tiles operations and disparity
final CLTPass3d src_scan, // results of the normal correlations (now expecting infinity) final CLTPass3d src_scan, // results of the normal correlations (now expecting infinity)
// final double [][][] other_channels, // other channels to correlate, such as average RGB (first index - subcamera, 2-nd - channel, 3-rd - pixel) // final double [][][] other_channels, // other channels to correlate, such as average RGB (first index - subcamera, 2-nd - channel, 3-rd - pixel)
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
GeometryCorrection geometryCorrection, GeometryCorrection geometryCorrection,
final double macro_disparity_low, final double macro_disparity_low,
final double macro_disparity_high, final double macro_disparity_high,
...@@ -222,7 +223,7 @@ public class MacroCorrelation { ...@@ -222,7 +223,7 @@ public class MacroCorrelation {
public CLTPass3d CLTMacroSetMeasure( // perform single pass according to prepared tiles operations and disparity public CLTPass3d CLTMacroSetMeasure( // perform single pass according to prepared tiles operations and disparity
final CLTPass3d macro_scan, // new, will be filled out final CLTPass3d macro_scan, // new, will be filled out
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
GeometryCorrection geometryCorrection, GeometryCorrection geometryCorrection,
final double macro_disparity, final double macro_disparity,
final boolean show_corr_partial, final boolean show_corr_partial,
...@@ -256,7 +257,7 @@ public class MacroCorrelation { ...@@ -256,7 +257,7 @@ public class MacroCorrelation {
public CLTPass3d CLTMacroMeasure( // perform single pass according to prepared tiles operations and disparity public CLTPass3d CLTMacroMeasure( // perform single pass according to prepared tiles operations and disparity
final CLTPass3d macro_scan, // final CLTPass3d macro_scan, //
final double [][][] input_data, final double [][][] input_data,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
GeometryCorrection geometryCorrection, GeometryCorrection geometryCorrection,
final String suffix, final String suffix,
final boolean show_corr_partial, final boolean show_corr_partial,
...@@ -304,7 +305,7 @@ public class MacroCorrelation { ...@@ -304,7 +305,7 @@ public class MacroCorrelation {
// double [][][][] texture_tiles = save_textures ? new double [tilesY][tilesX][][] : null; // ["RGBA".length()][]; // double [][][][] texture_tiles = save_textures ? new double [tilesY][tilesX][][] : null; // ["RGBA".length()][];
ImageDtt image_dtt = new ImageDtt(); ImageDtt image_dtt = new ImageDtt(this.mtp.isMonochrome());
image_dtt.clt_aberrations_quad_corr( image_dtt.clt_aberrations_quad_corr(
clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others clt_parameters.img_dtt, // final ImageDttParameters imgdtt_params, // Now just extra correlation parameters, later will include, most others
8, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles 8, // final int macro_scale, // to correlate tile data instead of the pixel data: 1 - pixels, 8 - tiles
...@@ -430,7 +431,7 @@ public class MacroCorrelation { ...@@ -430,7 +431,7 @@ public class MacroCorrelation {
public CLTPass3d refineMacro( public CLTPass3d refineMacro(
final double [][][] input_data, final double [][][] input_data,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
GeometryCorrection geometryCorrection, GeometryCorrection geometryCorrection,
final double trustedCorrelation, final double trustedCorrelation,
final double disp_far, // limit results to the disparity range, far - start with 1 step above 0 (was valid for all) final double disp_far, // limit results to the disparity range, far - start with 1 step above 0 (was valid for all)
......
...@@ -29,7 +29,7 @@ import java.util.Collections; ...@@ -29,7 +29,7 @@ import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.PolynomialApproximation; import com.elphel.imagej.common.PolynomialApproximation;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -1811,7 +1811,7 @@ public class PoleProcessor { ...@@ -1811,7 +1811,7 @@ public class PoleProcessor {
// BiScan biScan, // BiScan biScan,
double [][] src_ds, // source disparity, strength pair double [][] src_ds, // source disparity, strength pair
boolean [] selection, // source tile selection, will be modified boolean [] selection, // source tile selection, will be modified
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
final boolean updateStatus, final boolean updateStatus,
final int globalDebugLevel) final int globalDebugLevel)
...@@ -2423,7 +2423,7 @@ public class PoleProcessor { ...@@ -2423,7 +2423,7 @@ public class PoleProcessor {
public void measurePoles( public void measurePoles(
QuadCLT quadCLT_main, // tiles should be set QuadCLT quadCLT_main, // tiles should be set
QuadCLT quadCLT_aux, QuadCLT quadCLT_aux,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
ArrayList<PoleProcessor.PoleCluster> pole_clusters, ArrayList<PoleProcessor.PoleCluster> pole_clusters,
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
final boolean updateStatus, final boolean updateStatus,
...@@ -2692,7 +2692,7 @@ public class PoleProcessor { ...@@ -2692,7 +2692,7 @@ public class PoleProcessor {
QuadCLT quadCLT_main, // tiles should be set QuadCLT quadCLT_main, // tiles should be set
QuadCLT quadCLT_aux, QuadCLT quadCLT_aux,
double [][] poles_ds, double [][] poles_ds,
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
boolean notch_mode, // use pole-detection mode for inter-camera correlation boolean notch_mode, // use pole-detection mode for inter-camera correlation
int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
final int threadsMax, // maximal number of threads to launch final int threadsMax, // maximal number of threads to launch
......
...@@ -27,7 +27,7 @@ import java.util.HashMap; ...@@ -27,7 +27,7 @@ import java.util.HashMap;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters; import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.DoubleGaussianBlur; import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.ShowDoubleFloatArrays; import com.elphel.imagej.common.ShowDoubleFloatArrays;
...@@ -37,7 +37,7 @@ import com.elphel.imagej.common.ShowDoubleFloatArrays; ...@@ -37,7 +37,7 @@ import com.elphel.imagej.common.ShowDoubleFloatArrays;
public class TileAssignment { public class TileAssignment {
private TileSurface ts; private TileSurface ts;
private CLTPass3d p3d; // last/ combined FPGA data private CLTPass3d p3d; // last/ combined FPGA data
private EyesisCorrectionParameters.CLTParameters clt_parameters; private CLTParameters clt_parameters;
private double [][][] dispStrength; // indexed as a surface (full supertiles), not as image private double [][][] dispStrength; // indexed as a surface (full supertiles), not as image
private boolean [] valid_ml; private boolean [] valid_ml;
private double [][] tile_tones; private double [][] tile_tones;
...@@ -112,7 +112,7 @@ public class TileAssignment { ...@@ -112,7 +112,7 @@ public class TileAssignment {
empty= 0.00000 nolink= 1.50705 swtch= 0.59474 color= 2.25763 diff= 1.94213 empty= 0.00000 nolink= 1.50705 swtch= 0.59474 color= 2.25763 diff= 1.94213
diff_best= 0.06731 diff9= 1.09087 weak_fgnd= 0.22250 flaps= 0.07229 ml_mismatch= 0.00000 diff_best= 0.06731 diff9= 1.09087 weak_fgnd= 0.22250 flaps= 0.07229 ml_mismatch= 0.00000
*/ */
public TACosts (EyesisCorrectionParameters.CLTParameters clt_parameters) public TACosts (CLTParameters clt_parameters)
{ {
this.empty = clt_parameters.taEnEmpty? clt_parameters.taCostEmpty : 0.0; this.empty = clt_parameters.taEnEmpty? clt_parameters.taCostEmpty : 0.0;
this.nolink = clt_parameters.taEnNoLink? clt_parameters.taCostNoLink : 0.0; this.nolink = clt_parameters.taEnNoLink? clt_parameters.taCostNoLink : 0.0;
...@@ -247,7 +247,7 @@ diff_best= 0.06731 diff9= 1.09087 weak_fgnd= 0.22250 flaps= 0.07229 ml_mismatch ...@@ -247,7 +247,7 @@ diff_best= 0.06731 diff9= 1.09087 weak_fgnd= 0.22250 flaps= 0.07229 ml_mismatch
* @param fatZero * @param fatZero
*/ */
public TileAssignment ( public TileAssignment (
EyesisCorrectionParameters.CLTParameters clt_parameters, CLTParameters clt_parameters,
TileSurface ts, TileSurface ts,
CLTPass3d p3d, CLTPass3d p3d,
double [][][] dispStrength, double [][][] dispStrength,
...@@ -277,7 +277,7 @@ diff_best= 0.06731 diff9= 1.09087 weak_fgnd= 0.22250 flaps= 0.07229 ml_mismatch ...@@ -277,7 +277,7 @@ diff_best= 0.06731 diff9= 1.09087 weak_fgnd= 0.22250 flaps= 0.07229 ml_mismatch
} }
public void copyParams(EyesisCorrectionParameters.CLTParameters clt_parameters) public void copyParams(CLTParameters clt_parameters)
{ {
this.dispNorm = clt_parameters.plDispNorm;