Commit 72b6bdce authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Got 4 images converted, corrected, and converted back with JCUDA!

parent 184a23d0
Loading
Loading
Loading
Loading
+56 −1
Original line number Diff line number Diff line
@@ -640,6 +640,7 @@ private Panel panel1,
			panelClt_GPU.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap
			addButton("JCUDA TEST",                 panelClt_GPU);
			addButton("TF TEST",                    panelClt_GPU);
			addButton("GPU files",                  panelClt_GPU, color_conf_process);
			addButton("Rig8 gpu",                   panelClt_GPU, color_conf_process);
			addButton("ShowGPU",                    panelClt_GPU, color_conf_process);
			add(panelClt_GPU);
@@ -4579,12 +4580,19 @@ private Panel panel1,
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	getPairImages2();
    	return;
/* ======================================================================== */
    } else if (label.equals("GPU files")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	generateGPUDebugFiles();
    	return;
/* ======================================================================== */
    } else if (label.equals("Rig8 gpu")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	getPairImages2Gpu();
    	return;

/* ======================================================================== */
    } else if (label.equals("ShowGPU")) {
        DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
@@ -5143,6 +5151,52 @@ private Panel panel1,
		return true;
	}

	public boolean generateGPUDebugFiles() {
		if (!prepareRigImages()) return false;
		String configPath=getSaveCongigPath();
		if (configPath.equals("ABORT")) return false;

		if (DEBUG_LEVEL > -2){
			System.out.println("++++++++++++++ Calculating combined correlations ++++++++++++++");
		}
		// reset if ran after 3d model to save memory
		if (QUAD_CLT.tp != null) {
			QUAD_CLT.tp.clt_3d_passes = null; // resetCLTPasses();
		}
		if (QUAD_CLT_AUX.tp != null) {
			QUAD_CLT_AUX.tp.clt_3d_passes = null; // resetCLTPasses();
		}

		try {
			TWO_QUAD_CLT.prepareFilesForGPUDebug(
					QUAD_CLT, // QuadCLT quadCLT_main,
					QUAD_CLT_AUX, // QuadCLT quadCLT_aux,
					CLT_PARAMETERS,  // EyesisCorrectionParameters.DCTParameters           dct_parameters,
					DEBAYER_PARAMETERS, //EyesisCorrectionParameters.DebayerParameters     debayerParameters,
					COLOR_PROC_PARAMETERS, //EyesisCorrectionParameters.ColorProcParameters colorProcParameters,
					//        				CHANNEL_GAINS_PARAMETERS, //CorrectionColorProc.ColorGainsParameters     channelGainParameters,
					//        				CHANNEL_GAINS_PARAMETERS_AUX, //CorrectionColorProc.ColorGainsParameters       channelGainParameters_aux,
					RGB_PARAMETERS, //EyesisCorrectionParameters.RGBParameters             rgbParameters,
					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);
		QUAD_CLT.tp.clt_3d_passes = null; // resetCLTPasses(); // so running "Ground truth" after would be OK
		QUAD_CLT_AUX.tp.clt_3d_passes = null; //.resetCLTPasses();

		if (configPath!=null) {
			saveTimestampedProperties( // save config again
					configPath,      // full path or null
					null, // use as default directory if path==null
					true,
					PROPERTIES);
		}
		return true;
	}

	public boolean getPairImages2Gpu() {
		if (!prepareRigImages()) return false;
		String configPath=getSaveCongigPath();
@@ -5165,6 +5219,7 @@ private Panel panel1,
				System.out.println("Failed to initialize GPU class");
				// TODO Auto-generated catch block
				e.printStackTrace();
				return false;
			} //final int        debugLevel);

		}
@@ -5186,6 +5241,7 @@ private Panel panel1,
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return false;
		} //final int        debugLevel);
		QUAD_CLT.tp.clt_3d_passes = null; // resetCLTPasses(); // so running "Ground truth" after would be OK
		QUAD_CLT_AUX.tp.clt_3d_passes = null; //.resetCLTPasses();
@@ -5203,7 +5259,6 @@ private Panel panel1,




	public boolean rigPlanes() {
		if ((QUAD_CLT == null) || (QUAD_CLT.tp == null) || (QUAD_CLT.tp.clt_3d_passes == null)  || (QUAD_CLT.tp.clt_3d_passes.size() == 0)) {
			String msg = "DSI data is not available. Please run \"CLT 3D\" first";
Loading