Commit 28f7044c authored by Andrey Filippov's avatar Andrey Filippov
Browse files

Ground truth from EO to LWIR

parent e2478b97
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1544,8 +1544,8 @@ public class CLTParameters {
		if (properties.getProperty(prefix+"max_corr_radius")!=null)               this.max_corr_radius=Double.parseDouble(properties.getProperty(prefix+"max_corr_radius"));
		if (properties.getProperty(prefix+"max_corr_radius")!=null)               this.max_corr_radius=Double.parseDouble(properties.getProperty(prefix+"max_corr_radius"));


		// for compatibility with old settings
		// for compatibility with old settings
		if (properties.getProperty(prefix+"enhortho_width")!=null)                this.img_dtt.enhortho_width=Integer.parseInt(properties.getProperty(prefix+"enhortho_width"));
		if (properties.getProperty(prefix+"enhortho_width")!=null)                this.img_dtt.setEnhOrthoWidth(Integer.parseInt(properties.getProperty(prefix+"enhortho_width")));
		if (properties.getProperty(prefix+"enhortho_scale")!=null)                this.img_dtt.enhortho_scale=Double.parseDouble(properties.getProperty(prefix+"enhortho_scale"));
		if (properties.getProperty(prefix+"enhortho_scale")!=null)                this.img_dtt.setEnhOrthoScale(Double.parseDouble(properties.getProperty(prefix+"enhortho_scale")));
		// for compatibility with old settings
		// for compatibility with old settings


		if (properties.getProperty(prefix+"max_corr_double")!=null)               this.max_corr_double=Boolean.parseBoolean(properties.getProperty(prefix+"max_corr_double"));
		if (properties.getProperty(prefix+"max_corr_double")!=null)               this.max_corr_double=Boolean.parseBoolean(properties.getProperty(prefix+"max_corr_double"));
+17 −0
Original line number Original line Diff line number Diff line
@@ -124,6 +124,18 @@ public class EyesisCorrections {
				false,
				false,
				false);
				false);
	}
	}

	public void initPixelMapping(
			int debugLevel) {
		String [] sensorPaths=correctionsParameters.selectSensorFiles(this.debugLevel);
		this.pixelMapping=new PixelMapping(
				sensorPaths,
				correctionsParameters.firstSubCameraConfig, // 	int first_channel, // 0 - old way
				correctionsParameters.numSubCameras,        // int num_channels,  // 0 - any
				true, // boolean update_channel, // false (replace file channel with effective channel (subtract first_channel)
				debugLevel);
	}

	public void initSensorFiles(
	public void initSensorFiles(
			int debugLevel,
			int debugLevel,
			boolean missing_ok,
			boolean missing_ok,
@@ -132,6 +144,10 @@ public class EyesisCorrections {
			){
			){
		this.sharpKernelPaths=null;
		this.sharpKernelPaths=null;
		this.smoothKernelPaths=null;
		this.smoothKernelPaths=null;
		if (this.pixelMapping == null) { // NOTE: will not notice switching sensor files !
			initPixelMapping(debugLevel);
		}
		/*
		String [] sensorPaths=correctionsParameters.selectSensorFiles(this.debugLevel);
		String [] sensorPaths=correctionsParameters.selectSensorFiles(this.debugLevel);
		this.pixelMapping=new PixelMapping(
		this.pixelMapping=new PixelMapping(
				sensorPaths,
				sensorPaths,
@@ -139,6 +155,7 @@ public class EyesisCorrections {
				correctionsParameters.numSubCameras,        // int num_channels,  // 0 - any
				correctionsParameters.numSubCameras,        // int num_channels,  // 0 - any
				true, // boolean update_channel, // false (replace file channel with effective channel (subtract first_channel)
				true, // boolean update_channel, // false (replace file channel with effective channel (subtract first_channel)
				debugLevel);
				debugLevel);
        */
		if (all_sensors) {
		if (all_sensors) {
			this.usedChannels = new boolean [this.pixelMapping.sensors.length];
			this.usedChannels = new boolean [this.pixelMapping.sensors.length];
			for (int i = 0; i < this.usedChannels.length; i++) {
			for (int i = 0; i < this.usedChannels.length; i++) {
+304 −4
Original line number Original line Diff line number Diff line
@@ -88,6 +88,7 @@ import com.elphel.imagej.lwir.LwirReader;
import com.elphel.imagej.readers.EyesisTiff;
import com.elphel.imagej.readers.EyesisTiff;
import com.elphel.imagej.tensorflow.TensorflowInferModel;
import com.elphel.imagej.tensorflow.TensorflowInferModel;
import com.elphel.imagej.tileprocessor.DttRad2;
import com.elphel.imagej.tileprocessor.DttRad2;
import com.elphel.imagej.tileprocessor.GeometryCorrection;
import com.elphel.imagej.tileprocessor.ImageDtt;
import com.elphel.imagej.tileprocessor.ImageDtt;
import com.elphel.imagej.tileprocessor.MLStats;
import com.elphel.imagej.tileprocessor.MLStats;
import com.elphel.imagej.tileprocessor.QuadCLT;
import com.elphel.imagej.tileprocessor.QuadCLT;
@@ -728,6 +729,7 @@ private Panel panel1,
			addButton("AUX planes",                 panelLWIR, color_conf_process_aux);
			addButton("AUX planes",                 panelLWIR, color_conf_process_aux);
			addButton("AUX ASSIGN",                 panelLWIR, color_process_aux);
			addButton("AUX ASSIGN",                 panelLWIR, color_process_aux);
			addButton("AUX OUT 3D",                 panelLWIR, color_process_aux);
			addButton("AUX OUT 3D",                 panelLWIR, color_process_aux);
			addButton("Main to AUX",                panelLWIR, color_process_aux);


			addButton("LWIR_TEST",                  panelLWIR, color_conf_process);
			addButton("LWIR_TEST",                  panelLWIR, color_conf_process);
			addButton("LWIR_ACQUIRE",               panelLWIR, color_conf_process);
			addButton("LWIR_ACQUIRE",               panelLWIR, color_conf_process);
@@ -3958,12 +3960,12 @@ private Panel panel1,
			IJ.showMessage("Warning",msg);
			IJ.showMessage("Warning",msg);
			return;
			return;
    	}
    	}

/*
        EYESIS_CORRECTIONS.initSensorFiles(DEBUG_LEVEL,
        EYESIS_CORRECTIONS.initSensorFiles(DEBUG_LEVEL,
        		true, // true - ignore missing files
        		true, // true - ignore missing files
    			true, // boolean all_sensors,
    			true, // boolean all_sensors,
    			COLOR_PROC_PARAMETERS.correct_vignetting); //boolean correct_vignetting
    			COLOR_PROC_PARAMETERS.correct_vignetting); //boolean correct_vignetting

*/
        QUAD_CLT.resetGeometryCorrection();
        QUAD_CLT.resetGeometryCorrection();
        QUAD_CLT.initGeometryCorrection(DEBUG_LEVEL+2);
        QUAD_CLT.initGeometryCorrection(DEBUG_LEVEL+2);


@@ -4450,6 +4452,10 @@ private Panel panel1,
        		return;
        		return;
        	}
        	}
        }
        }
        @SuppressWarnings("unused")
		QuadCLT dbg_qc_main =  QUAD_CLT;
        @SuppressWarnings("unused")
		QuadCLT dbg_qc_aux =   QUAD_CLT_AUX;


///========================================
///========================================
        int num_infinity_corr = infinity_corr? CLT_PARAMETERS.inf_repeat : 1;
        int num_infinity_corr = infinity_corr? CLT_PARAMETERS.inf_repeat : 1;
@@ -4684,7 +4690,12 @@ private Panel panel1,
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	clt3d_aux(adjust_extrinsics, adjust_poly);
    	clt3d_aux(adjust_extrinsics, adjust_poly);
        return;
        return;

    } else if (label.equals("Main to AUX")) {
    	DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	mainToAux();
        return;
//
    } else if (label.equals("CLT planes")) {
    } else if (label.equals("CLT planes")) {
    	DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
    	EYESIS_CORRECTIONS.setDebug(DEBUG_LEVEL);
@@ -5106,6 +5117,295 @@ private Panel panel1,
// End of buttons code
// End of buttons code
    }
    }
  }
  }
/* ======================================================================== */

	public boolean mainToAux() {
        if (QUAD_CLT == null){
        	QUAD_CLT = new  QuadCLT (
        			QuadCLT.PREFIX,
        			PROPERTIES,
        			EYESIS_CORRECTIONS,
        			CORRECTION_PARAMETERS);
        	if (DEBUG_LEVEL > 0){
        		System.out.println("Created new QuadCLT instance, will need to read CLT kernels");
        	}
        }
        if (QUAD_CLT_AUX == null){
        	if (EYESIS_CORRECTIONS_AUX == null) {
        		EYESIS_CORRECTIONS_AUX = new EyesisCorrections(SYNC_COMMAND.stopRequested,CORRECTION_PARAMETERS.getAux());
        	}
        	QUAD_CLT_AUX = new  QuadCLT (
        			QuadCLT.PREFIX_AUX,
        			PROPERTIES,
        			EYESIS_CORRECTIONS_AUX,
        			CORRECTION_PARAMETERS.getAux());
        	if (DEBUG_LEVEL > 0){
        		System.out.println("Created new QuadCLT instance, will need to read CLT kernels for aux camera");
        	}
        }
        @SuppressWarnings("unused")
		QuadCLT dbg_QUAD_CLT = QUAD_CLT;
        @SuppressWarnings("unused")
		QuadCLT dbg_QUAD_CLT_AUX = QUAD_CLT_AUX;

		ImagePlus imp_sel = WindowManager.getCurrentImage();
		if (imp_sel==null){
			IJ.showMessage("Error","There are no images open\nProcess canceled");
			return false;
		}
	    ImageStack stack_sel = imp_sel.getStack();
	    String [] labels = stack_sel.getSliceLabels();
		int indx = 0;
		for (int i = 0; i < labels.length; i++) {
			if (labels[i] !=null) indx++;
		}
	    boolean just2 = (indx == 2) && (labels[0] != null) && (labels[1] != null);


	    String [] choices = {"---", "disparity","strength"};
		double min_strength =  0.18; // use some configurable parameters
		boolean use_wnd =      true;
		boolean split_fg_bg =  true;
		double split_fbg_rms = 0.2; // split small source samples tp FG/BG if all aux tile RMS exceeds this value

		GenericDialog gd = new GenericDialog("Select disparity and strength slices");
		indx = 0;
		for (int i = 0; i < labels.length; i++) {
			if (labels[i] !=null) {
				gd.addChoice(((indx++) + 1)+": " +labels[i], choices, choices[just2 ? (i + 1) : 0]);
			}
		}
		gd.addMessage("--- main-to-aux depth map parameters ---");
		gd.addNumericField("Minimal EO correlation strength",                                          min_strength, 3, 6, "");
		gd.addCheckbox("Use window for AUX tiles to reduce weight of the hi-res tiles near low-res tile boundaries" , use_wnd);
		gd.addCheckbox("Split FG and BG if hi-res disparity varies for the same low-res tile",                    split_fg_bg);
		gd.addNumericField("Aux disparity thershold to split FG and BG",                              split_fbg_rms, 3, 6, "");
		WindowTools.addScrollBars(gd);
		gd.showDialog();
		if (gd.wasCanceled()) return false;

		int [] selections = new int[indx];
		indx = 0;
		for (int i = 0; i < selections.length; i++) {
				selections[i] = gd.getNextChoiceIndex();
		}
		min_strength =  gd.getNextNumber();
		use_wnd =       gd.getNextBoolean();
		split_fg_bg =   gd.getNextBoolean();
		split_fbg_rms = gd.getNextNumber();

		int index_disparity = -1, index_strength=-1;
		indx = 0;
		for (int i = 0; i < labels.length; i++) if (labels[i] != null) {
			if ((index_disparity < 0) && (selections[indx] == 1)) {
				index_disparity = i;
			}
			if ((index_strength < 0) && (selections[indx] == 2)) {
				index_strength = i;
			}
			if ((index_disparity >= 0 ) &&(index_strength >= 0 )) {
				break;
			}
			indx++;
		}

		int width = imp_sel.getWidth();
		int height = imp_sel.getHeight();
		String title = imp_sel.getTitle()+"-DS";
		float [][] f_ds = new float [2][];
		f_ds[0] = (float[]) stack_sel.getPixels(index_disparity+1);
		f_ds[1] = (float[]) stack_sel.getPixels(index_strength+1);
		double [][] ds = new double [2][width*height];
		for (int l = 0; l < ds.length; l++) {
			for (int i = 0; i < ds[l].length; i++) {
				ds[l][i] = f_ds[l][i];
			}
		}
		String [] titles = {"disparity","strength"};
		(new ShowDoubleFloatArrays()) .showArrays(ds,  width, height, true, title, titles);
		int tile_size =  CLT_PARAMETERS.transform_size;
		int [] wh_aux =  QUAD_CLT_AUX.getGeometryCorrection().getSensorWH();
		int tilesX_aux = wh_aux[0] / tile_size;
		int tilesY_aux = wh_aux[1] / tile_size;

//		int num_slices = split_fg_bg? 7:2;
		String [] fgbg_titles = {"disparity","strength", "rms","rms-split","fg-disp","fg-str","bg-disp","bg-str"};
		String [] rslt_titles = split_fg_bg ? fgbg_titles  :titles;

		double [][] ds_aux = DepthMapMainToAux(
				ds, // double [][] ds,
				QUAD_CLT.getGeometryCorrection(), //  GeometryCorrection geometryCorrection_main,
				QUAD_CLT_AUX.getGeometryCorrection(), //  GeometryCorrection geometryCorrection_aux,
				CLT_PARAMETERS,
				min_strength, // double min_strength,
				use_wnd,
				split_fg_bg,
				split_fbg_rms,
				DEBUG_LEVEL); // int debug_level
		(new ShowDoubleFloatArrays()).showArrays(ds_aux,  tilesX_aux, tilesY_aux, true, title+"_TOAUX", rslt_titles);
		return true;

	}
	public double [][] DepthMapMainToAux(
			double [][]        ds,
			GeometryCorrection geometryCorrection_main,
			GeometryCorrection geometryCorrection_aux,
			CLTParameters      clt_Parameters,
			double             min_strength,
			boolean            use_wnd,
			boolean            split_fg_bg,
			double             split_fbg_rms,
			int                debug_level
			){
		class DS{
			double disparity;  // gt disparity
			double strength;   // gt strength
			int tx;            // gt tile x
			int ty;            // gt tile x
			double fx;         // fractional aux tile X (0.0..1.0) for optional window
			double fy;         // fractional aux tile Y (0.0..1.0) for optional window
//			DS (double disparity, double strength){
//				this.disparity = disparity;
//				this.strength = strength;
//			}
			DS (double disparity, double strength, int tx, int ty, double fx, double fy){
				this.disparity = disparity;
				this.strength =  strength;
				this.tx =        tx;
				this.ty =        ty;
				this.fx =        fx;
				this.fy =        fy;

			}
			@Override
			public String toString() {
				return String.format("Disparity (str) = % 6f (%5f), tx=%d ty=%d fx=%5f fy=%5f\n", disparity, strength,tx,ty,fx,fy);
			}
		}
		int tile_size =  clt_Parameters.transform_size;
		int [] wh_main = geometryCorrection_main.getSensorWH();
		int [] wh_aux =  geometryCorrection_aux.getSensorWH();
		int tilesX_main = wh_main[0] / tile_size;
		int tilesY_main = wh_main[1] / tile_size;
		int tilesX_aux = wh_aux[0] / tile_size;
		int tilesY_aux = wh_aux[1] / tile_size;

		ArrayList<ArrayList<DS>> ds_list = new ArrayList<ArrayList<DS>>();
		for (int nt = 0; nt < tilesX_aux * tilesY_aux; nt++) {
			ds_list.add(new ArrayList<DS>());
		}
		for (int ty = 0; ty < tilesY_main; ty++) {
			double centerY = ty * tile_size + tile_size/2;
			for (int tx = 0; tx < tilesX_main; tx++) {
				int nt = ty*tilesX_main + tx;
				double centerX = tx * tile_size + tile_size/2;
				double disparity = ds[0][nt];
				double strength =  ds[1][nt];
				if ((strength >= min_strength) && !Double.isNaN(disparity)) {
					double [] dpxpy_aux =  geometryCorrection_aux.getFromOther(
							geometryCorrection_main, // GeometryCorrection other_gc,
							centerX,                 // double other_px,
							centerY,                 // double other_py,
							disparity);              // double other_disparity)
					double fx = dpxpy_aux[1]/tile_size;
					double fy = dpxpy_aux[2]/tile_size;
					int tx_aux = (int) Math.floor(fx);
					int ty_aux = (int) Math.floor(fy);
					fx -= tx_aux;
					fy -= ty_aux;
					if ((ty_aux >= 0) && (ty_aux < tilesY_aux) && (tx_aux >= 0) && (tx_aux < tilesX_aux)) {
						int nt_aux = ty_aux * tilesX_aux + tx_aux;
						ds_list.get(nt_aux).add(new DS(dpxpy_aux[0], strength, tx, ty, fx, fy));
					}
				}
			}
		}

		// simple average (ignoring below minimal)
		int num_slices = split_fg_bg? 8:2;
		double [][] ds_aux_avg = new double [num_slices][tilesX_aux * tilesY_aux];
		for (int ty = 0; ty < tilesY_aux; ty++) {
			for (int tx = 0; tx < tilesX_aux; tx++) {
				if ((ty == 4) && (tx == 12)) {
					System.out.println("tx = "+tx+", ty = "+ty);
				}
				int nt = ty * tilesX_aux + tx;
				ds_aux_avg[0][nt] = Double.NaN;
				ds_aux_avg[1][nt] = 0.0;
				if(ds_list.get(nt).isEmpty()) continue;
	    		Collections.sort(ds_list.get(nt), new Comparator<DS>() {
	    		    @Override
	    		    public int compare(DS lhs, DS rhs) {
	    		        return rhs.disparity > lhs.disparity  ? -1 : (rhs.disparity  < lhs.disparity ) ? 1 : 0;
	    		    }
	    		});

				double sw = 0.0, swd = 0.0, swd2 = 0.0;
	    		for (DS dsi: ds_list.get(nt)) {
	    			double w = dsi.strength;
	    			if (use_wnd) {
	    				w *= Math.sin(Math.PI * (dsi.fx + 0.5/tile_size)) * Math.sin(Math.PI * (dsi.fy + 0.5/tile_size));
	    			}
	    			sw +=  w;
	    			double wd = w * dsi.disparity;
	    			swd += wd;
	    			swd2 += wd * dsi.disparity;

	    		}
	    		ds_aux_avg[0][nt] = swd/sw;
	    		ds_aux_avg[1][nt] = sw/ds_list.get(nt).size();
	    		if (split_fg_bg) {

	    			ds_aux_avg[2][nt] = Math.sqrt( (swd2 * sw - swd * swd) / (sw * sw));
	    			ds_aux_avg[3][nt] = ds_aux_avg[2][nt]; // rms
	    			ds_aux_avg[4][nt] = ds_aux_avg[0][nt]; // fg disp
	    			ds_aux_avg[5][nt] = ds_aux_avg[1][nt]; // fg strength
	    			ds_aux_avg[6][nt] = ds_aux_avg[0][nt]; // bg disp
	    			ds_aux_avg[7][nt] = ds_aux_avg[1][nt]; // bg strength
	    			if (ds_aux_avg[2][nt] >= split_fbg_rms) {
	    				// splitting while minimizing sum of 2 squared errors
	    	    		double [][] swfb =  new double [2][ds_list.get(nt).size() -1];
	    	    		double [][] swdfb = new double [2][ds_list.get(nt).size() -1];
	    	    		double []   s2fb =  new double [ds_list.get(nt).size() -1];
	    	    		for (int n = 0; n < s2fb.length; n++) { // split position
	    	    			double [] s2 = new double[2];
	    	    			for (int i = 0; i <= s2fb.length; i++) {
	    	    				int fg = (i > n)? 1 : 0; // 0 - bg, 1 - fg
	    	    				DS dsi = ds_list.get(nt).get(i);
	    		    			double w = dsi.strength;
	    		    			if (use_wnd) {
	    		    				w *= Math.sin(Math.PI * dsi.fx) * Math.sin(Math.PI * dsi.fy);
	    		    			}
	    		    			swfb[fg][n] +=  w;
	    		    			double wd =      w * dsi.disparity;
	    		    			swdfb[fg][n] += wd;
	    		    			s2[fg] +=        wd * dsi.disparity;
	    	    			}
	    	    			s2fb[n] =  ((s2[0] * swfb[0][n] - swdfb[0][n] * swdfb[0][n]) / swfb[0][n] +
	    	    					(s2[1] * swfb[1][n] - swdfb[1][n] * swdfb[1][n]) / swfb[1][n]) / (swfb[0][n] + swfb[1][n]);
	    	    		}
		    			// now find the n with lowest s2fb and use it to split fg/bg. Could be done in a single pass, but with saved arrays
		    			// it is easier to verify
		    			int nsplit = 0;
		    			for (int i = 1; i < s2fb.length; i++) if (s2fb[i] < s2fb[nsplit]) {
		    				nsplit = i;
		    			}
		    			ds_aux_avg[3][nt] = s2fb[nsplit]; // rms split
		    			ds_aux_avg[4][nt] = swdfb[1][nsplit] / swfb[1][nsplit] ;      // fg disp
		    			ds_aux_avg[5][nt] = swfb[1][nsplit]/ (s2fb.length - nsplit) ; // fg strength

		    			ds_aux_avg[6][nt] = swdfb[0][nsplit] / swfb[0][nsplit] ;      // bg disp
		    			ds_aux_avg[7][nt] = swfb[0][nsplit]/ (nsplit + 1) ;           // bg strength
	    			}
	    		}
			}
		}
		return ds_aux_avg;

	}
//getGeometryCorrection
///data_ssd/lwir3d/results/saved/1562390490_233403/v11/
/* ======================================================================== */


	public String getSaveCongigPath() {
	public String getSaveCongigPath() {
    	String configPath=null;
    	String configPath=null;
@@ -9879,8 +10179,8 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
	  gd.addNumericField("JPEG scale   (%)",                         100* processParameters.JPEG_scale,0);
	  gd.addNumericField("JPEG scale   (%)",                         100* processParameters.JPEG_scale,0);
      gd.addCheckbox ("Save current settings with results",               processParameters.saveSettings);
      gd.addCheckbox ("Save current settings with results",               processParameters.saveSettings);
      gd.addCheckbox ("Update ImageJ status",                             UPDATE_STATUS);
      gd.addCheckbox ("Update ImageJ status",                             UPDATE_STATUS);
      WindowTools.addScrollBars(gd);
	  gd.addNumericField("Debug Level:",                          MASTER_DEBUG_LEVEL,      0);
	  gd.addNumericField("Debug Level:",                          MASTER_DEBUG_LEVEL,      0);
      WindowTools.addScrollBars(gd);
	  gd.showDialog();
	  gd.showDialog();
	  if (gd.wasCanceled()) return false;
	  if (gd.wasCanceled()) return false;
	  processParameters.eyesisMode=        gd.getNextBoolean();
	  processParameters.eyesisMode=        gd.getNextBoolean();
+154 −42

File changed.

Preview size limit exceeded, changes collapsed.

+16 −11
Original line number Original line Diff line number Diff line
@@ -224,6 +224,11 @@ public class ImageDtt {
	public boolean isMonochrome() {
	public boolean isMonochrome() {
		return monochrome;
		return monochrome;
	}
	}
	// maybe change in the future
	public boolean isAux() {
		return monochrome;
	}



	public double [][][][] mdctStack(
	public double [][][][] mdctStack(
			final ImageStack                                 imageStack,
			final ImageStack                                 imageStack,
@@ -1615,16 +1620,16 @@ public class ImageDtt {


		final double [] enh_ortho_scale = new double [corr_size];
		final double [] enh_ortho_scale = new double [corr_size];
		for (int i = 0; i < corr_size; i++){
		for (int i = 0; i < corr_size; i++){
			if ((i < (transform_size - imgdtt_params.enhortho_width)) || (i > (transform_size - 2 + imgdtt_params.enhortho_width))) {
			if ((i < (transform_size - imgdtt_params.getEnhOrthoWidth(isAux()))) || (i > (transform_size - 2 + imgdtt_params.getEnhOrthoWidth(isAux())))) {
				enh_ortho_scale[i] = 1.0;
				enh_ortho_scale[i] = 1.0;
			} else {
			} else {
				enh_ortho_scale[i] = imgdtt_params.enhortho_scale;
				enh_ortho_scale[i] = imgdtt_params.getEnhOrthoScale(isAux());
			}
			}
			if (i == (transform_size-1)) enh_ortho_scale[i] = 0.0 ; // hardwired 0 in the center
			if (i == (transform_size-1)) enh_ortho_scale[i] = 0.0 ; // hardwired 0 in the center
			enh_ortho_scale[i] *= Math.sin(Math.PI*(i+1.0)/(2*transform_size));
			enh_ortho_scale[i] *= Math.sin(Math.PI*(i+1.0)/(2*transform_size));
		}
		}
		if (globalDebugLevel > 1){
		if (globalDebugLevel > 1){
			System.out.println("enhortho_width="+ imgdtt_params.enhortho_width+" enhortho_scale="+ imgdtt_params.enhortho_scale);
			System.out.println("getEnhOrthoWidth(isAux())="+ imgdtt_params.getEnhOrthoWidth(isAux())+" getEnhOrthoScale(isAux())="+ imgdtt_params.getEnhOrthoScale(isAux()));
			for (int i = 0; i < corr_size; i++){
			for (int i = 0; i < corr_size; i++){
				System.out.println(" enh_ortho_scale["+i+"]="+ enh_ortho_scale[i]);
				System.out.println(" enh_ortho_scale["+i+"]="+ enh_ortho_scale[i]);


@@ -1782,8 +1787,8 @@ public class ImageDtt {
							isMonochrome(), // boolean monochrome,
							isMonochrome(), // boolean monochrome,
							(globalDebugLevel > -1));   //   boolean debug)
							(globalDebugLevel > -1));   //   boolean debug)
					corr2d.createOrtoNotch(
					corr2d.createOrtoNotch(
							imgdtt_params.enhortho_width, // double enhortho_width,
							imgdtt_params.getEnhOrthoWidth(isAux()), // double getEnhOrthoWidth(isAux()),
							imgdtt_params.enhortho_scale, //double enhortho_scale,
							imgdtt_params.getEnhOrthoScale(isAux()), //double getEnhOrthoScale(isAux()),
							(imgdtt_params.lma_debug_level > 1)); // boolean debug);
							(imgdtt_params.lma_debug_level > 1)); // boolean debug);


					for (int nTile = ai.getAndIncrement(); nTile < nTilesInChn; nTile = ai.getAndIncrement()) {
					for (int nTile = ai.getAndIncrement(); nTile < nTilesInChn; nTile = ai.getAndIncrement()) {
@@ -6192,20 +6197,20 @@ public class ImageDtt {
		}
		}


		// reducing weight of on-axis correlation values to enhance detection of vertical/horizontal lines
		// reducing weight of on-axis correlation values to enhance detection of vertical/horizontal lines
		// multiply correlation results inside the horizontal center strip  2*enhortho_width - 1 wide by enhortho_scale
		// multiply correlation results inside the horizontal center strip  2*getEnhOrthoWidth(isAux()) - 1 wide by getEnhOrthoScale(isAux())


		final double [] enh_ortho_scale = new double [corr_size];
		final double [] enh_ortho_scale = new double [corr_size];
		for (int i = 0; i < corr_size; i++){
		for (int i = 0; i < corr_size; i++){
			if ((i < (transform_size - imgdtt_params.enhortho_width)) || (i > (transform_size - 2 + imgdtt_params.enhortho_width))) {
			if ((i < (transform_size - imgdtt_params.getEnhOrthoWidth(isAux()))) || (i > (transform_size - 2 + imgdtt_params.getEnhOrthoWidth(isAux())))) {
				enh_ortho_scale[i] = 1.0;
				enh_ortho_scale[i] = 1.0;
			} else {
			} else {
				enh_ortho_scale[i] = imgdtt_params.enhortho_scale;
				enh_ortho_scale[i] = imgdtt_params.getEnhOrthoScale(isAux());
			}
			}
			if (i == (transform_size-1)) enh_ortho_scale[i] = 0.0 ; // hardwired 0 in the center
			if (i == (transform_size-1)) enh_ortho_scale[i] = 0.0 ; // hardwired 0 in the center
			enh_ortho_scale[i] *= Math.sin(Math.PI*(i+1.0)/(2*transform_size));
			enh_ortho_scale[i] *= Math.sin(Math.PI*(i+1.0)/(2*transform_size));
		}
		}
		if (globalDebugLevel > 1){
		if (globalDebugLevel > 1){
			System.out.println("enhortho_width="+ imgdtt_params.enhortho_width+" enhortho_scale="+ imgdtt_params.enhortho_scale);
			System.out.println("getEnhOrthoWidth(isAux())="+ imgdtt_params.getEnhOrthoWidth(isAux())+" getEnhOrthoScale(isAux())="+ imgdtt_params.getEnhOrthoScale(isAux()));
			for (int i = 0; i < corr_size; i++){
			for (int i = 0; i < corr_size; i++){
				System.out.println(" enh_ortho_scale["+i+"]="+ enh_ortho_scale[i]);
				System.out.println(" enh_ortho_scale["+i+"]="+ enh_ortho_scale[i]);


@@ -6383,8 +6388,8 @@ public class ImageDtt {
							(globalDebugLevel > -1));   //   boolean debug)
							(globalDebugLevel > -1));   //   boolean debug)


					corr2d.createOrtoNotch(
					corr2d.createOrtoNotch(
							imgdtt_params.enhortho_width, // double enhortho_width,
							imgdtt_params.getEnhOrthoWidth(isAux()), // double enhortho_width,
							imgdtt_params.enhortho_scale, //double enhortho_scale,
							imgdtt_params.getEnhOrthoScale(isAux()), //double enhortho_scale,
							false); // true); // boolean debug);
							false); // true); // boolean debug);
//					public int     enhortho_width =         2;   // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
//					public int     enhortho_width =         2;   // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
//					public double  enhortho_scale =         0.0; // 0.2;  // multiply center correlation pixels (inside enhortho_width)
//					public double  enhortho_scale =         0.0; // 0.2;  // multiply center correlation pixels (inside enhortho_width)
Loading