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 {
System.out.println("ERROR: getSubChannel("+channel+"): channel out of range");
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());
return this.sensors[channel].getSubChannel();
}
......@@ -164,6 +171,14 @@ public class PixelMapping {
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)
// 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!
......
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;
import java.util.Iterator;
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.ShowDoubleFloatArrays;
......@@ -41,7 +41,7 @@ public class BlueLeak {
private int width;
private int height;
private int length;
EyesisCorrectionParameters.ColorProcParameters colorProcParameters;
ColorProcParameters colorProcParameters;
private ShowDoubleFloatArrays SDFA_INSTANCE;
private int [] dirs20;
private double [] weights20;
......@@ -53,7 +53,7 @@ public class BlueLeak {
private int xMax,yMax;
public BlueLeak(
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
double [][] rgb,
int width,
ShowDoubleFloatArrays SDFA_INSTANCE,
......@@ -419,7 +419,7 @@ public class BlueLeak {
private double [] overexposed(
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
double [] dpixels,
int width
){
......@@ -454,7 +454,7 @@ public class BlueLeak {
private double [] overexposed(
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
double [] dpixels,
int width,
int shftX,
......
......@@ -29,7 +29,7 @@ package com.elphel.imagej.correction;
import java.util.Properties;
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.GenericJTabbedDialog;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
......@@ -56,7 +56,7 @@ public class CorrectionColorProc {
public void processColorsWeights(ImageStack stack, // does not like NaN (in GaussianBlur
double scale, // initial maximal pixel value (16))
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters,
int channel,
double [] denoiseMask,
......@@ -290,7 +290,7 @@ public class CorrectionColorProc {
// old versiion
public void processColorsWeightsOld(ImageStack stack,
double scale, // initial maximal pixel value (16))
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters,
int channel,
double [] denoiseMask,
......@@ -548,6 +548,21 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
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){
properties.setProperty(prefix+"channels",this.gain.length+"");
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
return true;
}
public boolean showDialog(ColorGainsParameters aux) {
GenericJTabbedDialog gd = new GenericJTabbedDialog("Individual channels colors/gains", 600,1000);
......
......@@ -26,6 +26,7 @@ package com.elphel.imagej.correction;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.ColorProcParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
......@@ -941,7 +942,7 @@ public class EyesisDCT {
EyesisCorrectionParameters.DCTParameters dct_parameters,
EyesisCorrectionParameters.DebayerParameters debayerParameters,
EyesisCorrectionParameters.NonlinParameters nonlinParameters,
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters,
EyesisCorrectionParameters.RGBParameters rgbParameters,
EyesisCorrectionParameters.EquirectangularParameters equirectangularParameters,
......@@ -1078,7 +1079,7 @@ public class EyesisDCT {
EyesisCorrectionParameters.DCTParameters dct_parameters,
EyesisCorrectionParameters.DebayerParameters debayerParameters,
EyesisCorrectionParameters.NonlinParameters nonlinParameters,
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
CorrectionColorProc.ColorGainsParameters channelGainParameters,
EyesisCorrectionParameters.RGBParameters rgbParameters,
int convolveFFTSize, // 128 - fft size, kernel size should be size/2
......@@ -1219,7 +1220,7 @@ public class EyesisDCT {
}
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(
stack,
channel,
......
......@@ -24,7 +24,7 @@ package com.elphel.imagej.tileprocessor;
*/
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.PolynomialApproximation;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
......@@ -286,7 +286,7 @@ public class AlignmentCorrection {
final int hist_min_samples,
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,
int tilesX,
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 {
final int max_iterations,
final double max_coeff_diff,
final double far_pull, // = 0.2; // 1; // 0.5;
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double [][] disp_strength,
int tilesX,
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 {
// final double max_coeff_diff0,
// final double far_pull0, // = 0.2; // 1; // 0.5;
final boolean use_vertical,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double [][] disp_strength,
ArrayList<Sample> samples_list,
int tilesX,
......@@ -882,7 +882,7 @@ public class AlignmentCorrection {
final boolean use_vertical,
final boolean use_disparity, // for infinity // now disabled?
final boolean allow_dispatity,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double [][] disp_strength,
ArrayList<Sample> samples_list,
int tilesX,
......@@ -1775,7 +1775,7 @@ B = |+dy0 -dy1 -2*dy3 |
final int hist_min_samples,
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
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double [][] scans_14,
double [][] target_disparity, // null or programmed disparity (1 per each 14 entries of scans_14)
int tilesX,
......@@ -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 double inf_fraction, // fraction of the weight for the infinity tiles
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 [][][] gt_disparity_strength, // 1 pair for each 14 entries of scans_14 (normally - just 1 scan
final boolean filter_ds, //
......@@ -2802,7 +2802,7 @@ B = |+dy0 -dy1 -2*dy3 |
public double [][] combineCltMismatches(
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double [][][] clt_mismatches,
double [][][] disparity_maps,
int disparity_index,
......@@ -2826,7 +2826,7 @@ B = |+dy0 -dy1 -2*dy3 |
public void showCltMismatches(
String title,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double [][] combo_data,
int tilesX,
int tilesY)
......@@ -2853,7 +2853,7 @@ B = |+dy0 -dy1 -2*dy3 |
public void showCltMismatch(
String title,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double [][] clt_mismatch,
int tilesX,
int tilesY)
......
......@@ -26,7 +26,7 @@ package com.elphel.imagej.tileprocessor;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
public class DisparityProcessor {
......@@ -272,7 +272,7 @@ public class DisparityProcessor {
final double [] hor_strength, // not yet used
final boolean [] selected,
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 debugLevel)
{
......@@ -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 double k_same,
final double k_turn,
final EyesisCorrectionParameters.CLTParameters clt_parameters,
final CLTParameters clt_parameters,
final double [][] dbgDeriv, //double [2][len] or null;
final int threadsMax, // maximal number of threads to launch
final int debugLevel)
......
......@@ -29,7 +29,7 @@ import java.util.Comparator;
import java.util.HashSet;
import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
public class LinkPlanes {
......@@ -122,7 +122,7 @@ public class LinkPlanes {
public LinkPlanes (
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
SuperTiles st)
{
plWorstWorsening = clt_parameters.plWorstWorsening;
......
......@@ -40,6 +40,8 @@ import java.util.EnumSet;
import java.util.List;
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.common.DoubleGaussianBlur;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
......@@ -430,9 +432,9 @@ public class MLStats {
}
public static boolean mlRecalc(String dir,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
EyesisCorrectionParameters.DebayerParameters debayerParameters,
EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
ColorProcParameters colorProcParameters,
EyesisCorrectionParameters.RGBParameters rgbParameters,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
......
......@@ -29,7 +29,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.concurrent.atomic.AtomicInteger;
import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
......@@ -62,6 +62,7 @@ public class MacroCorrelation {
mTilesY, // int tilesY,
tileSize, // int tileSize,
tp.superTileSize, // int superTileSize,
tp.isMonochrome(),
tp.getMagicScale(), // double scale,
trusted_correlation, // double trustedCorrelation,
0.0, // double maxOverexposure,
......@@ -70,7 +71,7 @@ public class MacroCorrelation {
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 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,
final double macro_disparity_low,
final double macro_disparity_high,
......@@ -222,7 +223,7 @@ public class MacroCorrelation {
public CLTPass3d CLTMacroSetMeasure( // perform single pass according to prepared tiles operations and disparity
final CLTPass3d macro_scan, // new, will be filled out
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
GeometryCorrection geometryCorrection,
final double macro_disparity,
final boolean show_corr_partial,
......@@ -256,7 +257,7 @@ public class MacroCorrelation {
public CLTPass3d CLTMacroMeasure( // perform single pass according to prepared tiles operations and disparity
final CLTPass3d macro_scan, //
final double [][][] input_data,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
GeometryCorrection geometryCorrection,
final String suffix,
final boolean show_corr_partial,
......@@ -304,7 +305,7 @@ public class MacroCorrelation {
// 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(
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
......@@ -430,7 +431,7 @@ public class MacroCorrelation {
public CLTPass3d refineMacro(
final double [][][] input_data,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
GeometryCorrection geometryCorrection,
final double trustedCorrelation,
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;
import java.util.Comparator;
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.ShowDoubleFloatArrays;
......@@ -1811,7 +1811,7 @@ public class PoleProcessor {
// BiScan biScan,
double [][] src_ds, // source disparity, strength pair
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 boolean updateStatus,
final int globalDebugLevel)
......@@ -2423,7 +2423,7 @@ public class PoleProcessor {
public void measurePoles(
QuadCLT quadCLT_main, // tiles should be set
QuadCLT quadCLT_aux,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
ArrayList<PoleProcessor.PoleCluster> pole_clusters,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
......@@ -2692,7 +2692,7 @@ public class PoleProcessor {
QuadCLT quadCLT_main, // tiles should be set
QuadCLT quadCLT_aux,
double [][] poles_ds,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
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
final int threadsMax, // maximal number of threads to launch
......
......@@ -27,7 +27,7 @@ import java.util.HashMap;
import java.util.concurrent.atomic.AtomicBoolean;
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.ShowDoubleFloatArrays;
......@@ -37,7 +37,7 @@ import com.elphel.imagej.common.ShowDoubleFloatArrays;
public class TileAssignment {
private TileSurface ts;
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 boolean [] valid_ml;
private double [][] tile_tones;
......@@ -112,7 +112,7 @@ public class TileAssignment {
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
*/
public TACosts (EyesisCorrectionParameters.CLTParameters clt_parameters)
public TACosts (CLTParameters clt_parameters)
{
this.empty = clt_parameters.taEnEmpty? clt_parameters.taCostEmpty : 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
* @param fatZero
*/
public TileAssignment (
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
TileSurface ts,
CLTPass3d p3d,
double [][][] dispStrength,
......@@ -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;
this.minFgBg = clt_parameters.taMinFgBg;
......
......@@ -31,7 +31,7 @@ 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.DoubleGaussianBlur;
import com.elphel.imagej.common.PolynomialApproximation;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
......@@ -74,6 +74,7 @@ public class TileProcessor {
public boolean [] rig_post_poles_sel = null; // Rig tile selection after processing poles
public double [][] main_ds_ml = null; // main camera DSI restored from the COMBO-DSI file to generate ML test files
public boolean monochrome = false; // these are monochrome images
public int clt_3d_passes_size = 0; //clt_3d_passes size after initial processing
public int clt_3d_passes_rig_size = 0; //clt_3d_passes size after initial processing and rig processing
private int tilesX;
......@@ -102,6 +103,7 @@ public class TileProcessor {
int tilesY,
int tileSize,
int superTileSize,
boolean monochrome,
double scale,
double trustedCorrelation,
double maxOverexposure,
......@@ -111,15 +113,17 @@ public class TileProcessor {
this.tilesY = tilesY;
this.tileSize = tileSize;
this.superTileSize = superTileSize;
this.monochrome = monochrome;
this.corr_magic_scale = scale;
this.trustedCorrelation = trustedCorrelation;
this.maxOverexposure = maxOverexposure;
this.threadsMax = threadsMax;
}
public int getTilesX() {return tilesX;};
public int getTilesY() {return tilesY;};
public int getTileSize() {return tileSize;};
public int getSuperTileSize() {return superTileSize;};
public boolean isMonochrome() {return monochrome;}
public int getTilesX() {return tilesX;}
public int getTilesY() {return tilesY;}
public int getTileSize() {return tileSize;}
public int getSuperTileSize() {return superTileSize;}
public void setTrustedCorrelation(double trustedCorrelation)
{
this.trustedCorrelation = trustedCorrelation;
......@@ -1836,6 +1840,7 @@ public class TileProcessor {
}
}
int removed = 0, total = 0;
@SuppressWarnings("unused")
int dbg_remain = 0;
for (int ty = 0; ty < tilesY; ty ++) {
for (int tx = 0; tx < tilesX; tx ++){
......@@ -2180,6 +2185,7 @@ public class TileProcessor {
boolean [] dbg_last_selected = last_scan.selected.clone();
boolean [] dbg_last_border = last_scan.border_tiles.clone();
@SuppressWarnings("unused")
boolean [] dbg_no_border = these_no_border.clone();
boolean [] known_tiles = these_no_border.clone();
......@@ -2356,7 +2362,7 @@ public class TileProcessor {
final boolean grow_pedantic, // Scan full range between max_tried_disparity of the background and known foreground
final boolean grow_retry_inf, // Retry border tiles that were identified as infinity earlier
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
GeometryCorrection geometryCorrection,
final boolean show_debug,
final int threadsMax, // maximal number of threads to launch
......@@ -2412,8 +2418,11 @@ public class TileProcessor {
debugLevel); // final int debugLevel)
}
if (!grow_retry_inf && (bg_scan == null)){
for (int i = 0; i < untested_bgnd.length; i++) if (bg_scan.selected[i]) untested_bgnd[i] = false;
/// if (!grow_retry_inf && (bg_scan == null)){ // FIXME: BUG bg_scan == null here!
if (!grow_retry_inf && (bg_scan != null)){ // FIXME: BUG bg_scan == null here!
for (int i = 0; i < untested_bgnd.length; i++) {
if (bg_scan.selected[i]) untested_bgnd[i] = false;
}
}
// turn these tiles as if they are not known (really known or belong to bgnd)
for (int i = 0; i < known_tiles.length; i++) known_tiles[i] &= !untested_bgnd[i];
......@@ -4055,7 +4064,7 @@ public class TileProcessor {
public int [][] setSameTileOp(
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
int op,
int debugLevel
)
......@@ -4509,7 +4518,7 @@ public class TileProcessor {
final double this_sure, // minimal strength to be considered definitely background
final double this_maybe, // maximal strength to ignore as non-background
final double sure_smth, // if 2-nd worst image difference (noise-normalized) exceeds this - do not propagate bgnd
final EyesisCorrectionParameters.CLTParameters clt_parameters,
final CLTParameters clt_parameters,
// final int threadsMax, // maximal number of threads to launch
// final boolean updateStatus,
final int debugLevel
......@@ -4792,7 +4801,7 @@ public class TileProcessor {
public CLTPass3d refinePassSetup( // prepare tile tasks for the second pass based on the previous one(s)
// final double [][][] image_data, // first index - number of image in a quad
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
// disparity range - differences from
boolean use_supertiles, // false (2018)
int bg_scan_index, // 0
......@@ -5156,7 +5165,7 @@ public class TileProcessor {
public double [][] assignTilesToSurfaces(
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
GeometryCorrection geometryCorrection,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
......@@ -5176,7 +5185,7 @@ public class TileProcessor {
// show testure_tiles
double [][][][] texture_tiles = scan_prev.getTextureTiles();
ImageDtt image_dtt = new ImageDtt();
ImageDtt image_dtt = new ImageDtt(isMonochrome());
double [][][] dispStrength = st.getDisparityStrengths(
clt_parameters.stMeasSel); // int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
......@@ -5294,6 +5303,7 @@ public class TileProcessor {
// Reset/initialize assignments - if not done so yet or specifically requested
@SuppressWarnings("unused")
boolean first_run = !tileSurface.isInit() || clt_parameters.tsReset;
tileSurface.InitTilesAssignment(
clt_parameters.tsReset,
......@@ -5729,7 +5739,7 @@ public class TileProcessor {
//======================
public void showPlanes(
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
GeometryCorrection geometryCorrection,
final int threadsMax, // maximal number of threads to launch
final boolean updateStatus,
......@@ -6279,7 +6289,7 @@ public class TileProcessor {
public void showPlaneData(
String suffix,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
SuperTiles st,
TilePlanes.PlaneData[][][] split_planes
)
......@@ -6384,7 +6394,7 @@ public class TileProcessor {
public void createShells_old (
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
SuperTiles st,
boolean [][] selected_planes,
GeometryCorrection geometryCorrection,
......@@ -6599,7 +6609,7 @@ public class TileProcessor {
public void secondPassSetup( // prepare tile tasks for the second pass based on the previous one(s)
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
boolean use_supertiles,
int bg_scan_index,
// disparity range - differences from
......@@ -6740,8 +6750,11 @@ public class TileProcessor {
//************************************************
// try renovated supertiles. Do twice to show both original and blurred histograms
@SuppressWarnings("unused")
double [] dbg_orig_disparity = null;
@SuppressWarnings("unused")
double [] dbg_with_super_disp = null;
@SuppressWarnings("unused")
double [] dbg_outliers = null;
// boolean [] grown = these_tiles.clone();
......@@ -6762,6 +6775,7 @@ public class TileProcessor {
clt_parameters.stMeasSel); // bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist[0] = scan_prev.getSuperTiles().showDisparityHistogram();
@SuppressWarnings("unused")
SuperTiles st = scan_prev.setSuperTiles(
clt_parameters.stStepNear, // double step_disparity,
clt_parameters.stStepFar, // double step_near,
......@@ -6788,7 +6802,7 @@ public class TileProcessor {
//==================
public void thirdPassSetup_old( // prepare tile tasks for the second pass based on the previous one(s)
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double disparity_far, //
double disparity_near, //
GeometryCorrection geometryCorrection,
......@@ -6916,7 +6930,7 @@ public class TileProcessor {
public void thirdPassSetupSurf( // prepare tile tasks for the second pass based on the previous one(s)
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
double disparity_far, //
double disparity_near, //
GeometryCorrection geometryCorrection,
......@@ -7040,7 +7054,7 @@ public class TileProcessor {
public int bridgeFgndOrthoGap(
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
boolean vert, // verical pairs, horizontal features
boolean disp_interpolate, // fill interpolated disparity for bridged over tiles, false - copy from ortho_disparity (if not null)
boolean closer_only, // only update disparity if laregr than was
......
......@@ -30,8 +30,8 @@ import java.util.ArrayList;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters.CLTParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters.CorrectionParameters;
import com.elphel.imagej.tileprocessor.CLTPass3d;
import com.elphel.imagej.tileprocessor.GeometryCorrection;
......@@ -43,7 +43,7 @@ public class WavefrontExport {
static final String OBJ_EXT=".obj";
GeometryCorrection geometry_correction;
public ArrayList <CLTPass3d> clt_3d_passes;
public EyesisCorrectionParameters.CLTParameters clt_parameters;
public CLTParameters clt_parameters;
public EyesisCorrectionParameters.CorrectionParameters correctionsParameters;
public int debugLevel = 1;
FileWriter obj_writer; // f0 = new FileWriter("output.txt");
......@@ -62,7 +62,7 @@ public class WavefrontExport {
public WavefrontExport(
String out_dir,
String project_name,
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
EyesisCorrectionParameters.CorrectionParameters correctionsParameters,
GeometryCorrection geometry_correction,
ArrayList <CLTPass3d> clt_3d_passes) throws IOException{
......
......@@ -44,8 +44,8 @@ import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import com.elphel.imagej.cameras.CLTParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters.CLTParameters;
import com.elphel.imagej.cameras.EyesisCorrectionParameters.CorrectionParameters;
import com.elphel.imagej.tileprocessor.CLTPass3d;
import com.elphel.imagej.tileprocessor.GeometryCorrection;
......@@ -55,7 +55,7 @@ import com.elphel.imagej.tileprocessor.GeometryCorrection;
public class X3dOutput {
GeometryCorrection geometry_correction;
public ArrayList <CLTPass3d> clt_3d_passes;
public EyesisCorrectionParameters.CLTParameters clt_parameters;
public CLTParameters clt_parameters;
public EyesisCorrectionParameters.CorrectionParameters correctionsParameters;
public int debugLevel = 1;
Document x3dDoc;
......@@ -67,7 +67,7 @@ public class X3dOutput {
public X3dOutput() {}
public X3dOutput(
EyesisCorrectionParameters.CLTParameters clt_parameters,
CLTParameters clt_parameters,
EyesisCorrectionParameters.CorrectionParameters correctionsParameters,
GeometryCorrection geometry_correction,
ArrayList <CLTPass3d> clt_3d_passes){
......
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