Commit 2ea2b2c9 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

More work on low-textured areas with bi-quad camera

parent b3cf8b8a
Loading
Loading
Loading
Loading
+44 −5
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 **
 ** -----------------------------------------------------------------------------**
 **
 **  TwoQuadCLT.java is free software: you can redistribute it and/or modify
 **  BiCamDSI.java is free software: you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License as published by
 **  the Free Software Foundation, either version 3 of the License, or
 **  (at your option) any later version.
@@ -25,13 +25,52 @@ import java.util.ArrayList;


public class BiCamDSI {
//	public int tilesX;
//	public int tilesY;
	TileNeibs         tnImage; //  = new TileNeibs(tilesX, tilesY)
	int               threadsMax;
	ArrayList<BiScan> biScans;



	public int addBiScan(
			double [] disparity,
			double [] strength,
			boolean [] trusted,
			boolean [] disabled) {

		if (biScans == null) biScans = new ArrayList<BiScan>();
		biScans.add(new BiScan(this, biScans.size(), disparity, strength, trusted, disabled));
		return biScans.size()-1;

	}

	public int addBiScan(
			double [][] disparity_bimap) {
		return addBiScan(
				disparity_bimap[ImageDtt.BI_TARGET_INDEX], // double [] disparity,
				disparity_bimap[ImageDtt.BI_STR_CROSS_INDEX], // double [] strength,
				null, // boolean [] trusted,
				null); // boolean [] disabled)
	}

	public BiScan getLastBiScan() {
		return getBiScan(-1);
	}
	public BiScan getBiScan(int indx) {
		if (biScans.isEmpty()) return null;
		return biScans.get((indx>=0)? indx: (biScans.size() - 1));
	}

	public double [] getTargetDisparity(int indx) {
		BiScan biScan = getBiScan(indx);
		if (biScan == null) return null;
		return biScan.target_disparity;
	}

	public BiCamDSI(
			int tilesX,
			int tilesY) {
			int tilesY,
			int threadsMax) {
		this.threadsMax = threadsMax;
		tnImage  = new TileNeibs(tilesX, tilesY);
	}

+274 −3

File changed.

Preview size limit exceeded, changes collapsed.

+1431 −0

File added.

Preview size limit exceeded, changes collapsed.

+30 −14
Original line number Diff line number Diff line
@@ -588,6 +588,9 @@ private Panel panel1,
			addButton("AUX Extrinsics",             panelClt4, color_process);
			addButton("AUX show fine",              panelClt4, color_configure);
//			addButton("Rig enhance",                panelClt4, color_conf_process);
//			/"Reset GT"
			addButton("Reset GT",                   panelClt4, color_stop);
			addButton("Ground truth 0",             panelClt4, color_configure);
			addButton("Ground truth",               panelClt4, color_conf_process);
			addButton("ML export",                  panelClt4, color_conf_process);
			addButton("Rig planes",                 panelClt4, color_conf_process);
@@ -4594,10 +4597,24 @@ private Panel panel1,

        return;
/* ======================================================================== */
    } else if (label.equals("Reset GT")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	resetGroundTruth();

    	return;
/* ======================================================================== */
    } else if (label.equals("Ground truth 0")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	enhanceByRig(false);

    	return;
/* ======================================================================== */
    } else if (label.equals("Ground truth")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	enhanceByRig();
    	enhanceByRig(true);

    	return;
/* ======================================================================== */
@@ -5052,10 +5069,14 @@ private Panel panel1,
		return true;

	}

	public boolean enhanceByRig() {
//resetGroundTruthByRig()
	public boolean resetGroundTruth() {
		if ((QUAD_CLT == null) || (QUAD_CLT.tp == null)) return false;
		QUAD_CLT.resetGroundTruthByRig();
		return true;
	}
	public boolean enhanceByRig( boolean use_planes) {
		long startTime=System.nanoTime();

		if ((QUAD_CLT == null) || (QUAD_CLT.tp == null) || (QUAD_CLT.tp.clt_3d_passes == null)) {
			String msg = "DSI data is not available. Please run \"CLT 3D\" first";
			IJ.showMessage("Error",msg);
@@ -5067,21 +5088,16 @@ private Panel panel1,
    	if (configPath.equals("ABORT")) return false;

        	if (DEBUG_LEVEL > -2){
    		System.out.println("++++++++++++++ Enhancing single-camera DSI by the dual-camera rig++++++++++++++");
        		System.out.println("++++++++++++++ Enhancing single-camera DSI by the dual-camera rig using planes ++++++++++++++");
        	}
    	try {
    		TWO_QUAD_CLT.enhanceByRig( // actually there is no sense to process multiple image sets. Combine with other processing?
    				QUAD_CLT, // QuadCLT quadCLT_main,
    				QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
    				CLT_PARAMETERS,  // EyesisCorrectionParameters.DCTParameters           dct_parameters,
    				use_planes, //   final boolean                                  use_planes,
    				THREADS_MAX, //final int          threadsMax,  // maximal number of threads to launch
    				UPDATE_STATUS, //final boolean    updateStatus,
    				DEBUG_LEVEL);
    	} catch (Exception e) {
    		// TODO Auto-generated catch block
    		e.printStackTrace();
    	} //final int        debugLevel);

    	if (configPath!=null) {
    		saveTimestampedProperties( // save config again
    				configPath,      // full path or null
+4 −4
Original line number Diff line number Diff line
@@ -2711,7 +2711,7 @@ public class ImageDtt {
								for (int chn = 0; chn < numcol; chn++){

									tiles_debayered[i][chn] =  tile_debayer_shot_corr(
											(chn != 2), // red or blue (flase - green)
											(chn != 2), // red or blue (false - green)
											iclt_tile[i][chn],
											2 * transform_size,
											lt_window2, // squared lapping window
@@ -7098,12 +7098,12 @@ public class ImageDtt {
							for (int i =0; i<quad; i++){
								for (int chn = 0; chn < numcol; chn++){
									//								tiles_debayered[i][chn] =  tile_debayer(
									//										(chn != 2), // red or blue (flase - green)
									//										(chn != 2), // red or blue (false - green)
									//										iclt_tile[i][chn],
									//										2 * transform_size);

									tiles_debayered[i][chn] =  tile_debayer_shot_corr(
											(chn != 2), // red or blue (flase - green)
											(chn != 2), // red or blue (false - green)
											iclt_tile[i][chn],
											2 * transform_size,
											lt_window2, // squared lapping window
@@ -7642,7 +7642,7 @@ public class ImageDtt {
			for (int chn = 0; chn < numcol; chn++){

				tiles_debayered[i][chn] =  tile_debayer_shot_corr(
						(chn != 2),                 // red or blue (flase - green)
						(chn != 2),                 // red or blue (false - green)
						iclt_tile[i][chn],
						2 * clt_parameters.transform_size,
						lt_window2,                 // squared lapping window
Loading