Commit 4648e870 authored by Andrey Filippov's avatar Andrey Filippov
Browse files

working with color

parent 56b7ed16
Loading
Loading
Loading
Loading
+219 −219
Original line number Original line Diff line number Diff line
@@ -271,7 +271,7 @@ public class CorrectionColorProc {
    	stack.addSlice("Pr", fpixels_pr);
    	stack.addSlice("Pr", fpixels_pr);
    	stack.addSlice("Pb", fpixels_pb);
    	stack.addSlice("Pb", fpixels_pb);
    	stack.addSlice("Y",  fpixels_y);
    	stack.addSlice("Y",  fpixels_y);
        stack.addSlice("Y0", fpixels_y0); // not filtered by low-pass, preliminary (for comaprison only)
    	stack.addSlice("Y0", fpixels_y0); // not filtered by low-pass, preliminary (for comparison only)
    	if (debugLevel>2) {
    	if (debugLevel>2) {
    		stack.addSlice("Yr",fpixels_yR);
    		stack.addSlice("Yr",fpixels_yR);
    		stack.addSlice("Yg",fpixels_yG);
    		stack.addSlice("Yg",fpixels_yG);
+34 −4
Original line number Original line Diff line number Diff line
@@ -1802,7 +1802,13 @@ public class EyesisCorrectionParameters {
  		public boolean convolve_direct = false; // do not apply symmetrical correction
  		public boolean convolve_direct = false; // do not apply symmetrical correction
  		
  		
  		public double vignetting_max    = 0.4; // value in vignetting data to correspond to 1x in the kernel
  		public double vignetting_max    = 0.4; // value in vignetting data to correspond to 1x in the kernel
  		public double vignetting_range  = 3.0; // do not try to correct vignetting less than vignetting_max/vignetting_range
  		public double vignetting_range  = 5.0; // do not try to correct vignetting less than vignetting_max/vignetting_range
  		
  		public boolean color_DCT        = true; // false - use old color processing mode
  		public double  sigma_rb =         0.5; // additional (to G) blur for R and B
  		public double  sigma_y =          0.5; // blur for G contribution to Y
  		public double  sigma_color =      1.0; // blur for Pb and Pr in addition to that of Y
  		public double  line_thershold =   1.0; // line detection amplitude to apply line enhancement


  		public DCTParameters(
  		public DCTParameters(
  				int dct_size,
  				int dct_size,
@@ -1858,6 +1864,12 @@ public class EyesisCorrectionParameters {
  			properties.setProperty(prefix+"vignetting_max",   this.vignetting_max+"");
  			properties.setProperty(prefix+"vignetting_max",   this.vignetting_max+"");
  			properties.setProperty(prefix+"vignetting_range",   this.vignetting_range+"");
  			properties.setProperty(prefix+"vignetting_range",   this.vignetting_range+"");


  			properties.setProperty(prefix+"color_DCT",          this.color_DCT+"");
  			properties.setProperty(prefix+"sigma_rb",           this.sigma_rb+"");
  			properties.setProperty(prefix+"sigma_y",            this.sigma_y+"");
  			properties.setProperty(prefix+"sigma_color",        this.sigma_color+"");
  			properties.setProperty(prefix+"line_thershold",     this.line_thershold+"");
  			
  		}
  		}
  		public void getProperties(String prefix,Properties properties){
  		public void getProperties(String prefix,Properties properties){
  			if (properties.getProperty(prefix+"dct_size")!=null) this.dct_size=Integer.parseInt(properties.getProperty(prefix+"dct_size"));
  			if (properties.getProperty(prefix+"dct_size")!=null) this.dct_size=Integer.parseInt(properties.getProperty(prefix+"dct_size"));
@@ -1894,6 +1906,11 @@ public class EyesisCorrectionParameters {
  			if (properties.getProperty(prefix+"convolve_direct")!=null) this.convolve_direct=Boolean.parseBoolean(properties.getProperty(prefix+"convolve_direct"));
  			if (properties.getProperty(prefix+"convolve_direct")!=null) this.convolve_direct=Boolean.parseBoolean(properties.getProperty(prefix+"convolve_direct"));
  			if (properties.getProperty(prefix+"vignetting_max")!=null) this.vignetting_max=Double.parseDouble(properties.getProperty(prefix+"vignetting_max"));
  			if (properties.getProperty(prefix+"vignetting_max")!=null) this.vignetting_max=Double.parseDouble(properties.getProperty(prefix+"vignetting_max"));
  			if (properties.getProperty(prefix+"vignetting_range")!=null) this.vignetting_range=Double.parseDouble(properties.getProperty(prefix+"vignetting_range"));
  			if (properties.getProperty(prefix+"vignetting_range")!=null) this.vignetting_range=Double.parseDouble(properties.getProperty(prefix+"vignetting_range"));
  			if (properties.getProperty(prefix+"color_DCT")!=null)      this.color_DCT=Boolean.parseBoolean(properties.getProperty(prefix+"color_DCT"));
  			if (properties.getProperty(prefix+"sigma_rb")!=null)       this.sigma_rb=Double.parseDouble(properties.getProperty(prefix+"sigma_rb"));
  			if (properties.getProperty(prefix+"sigma_y")!=null)        this.sigma_y=Double.parseDouble(properties.getProperty(prefix+"sigma_y"));
  			if (properties.getProperty(prefix+"sigma_color")!=null)    this.sigma_color=Double.parseDouble(properties.getProperty(prefix+"sigma_color"));
  			if (properties.getProperty(prefix+"line_thershold")!=null) this.line_thershold=Double.parseDouble(properties.getProperty(prefix+"line_thershold"));


  		}
  		}
  		public boolean showDialog() {
  		public boolean showDialog() {
@@ -1933,6 +1950,12 @@ public class EyesisCorrectionParameters {
  			gd.addNumericField("Value (max) in vignetting data to correspond to 1x in the kernel",this.vignetting_max,      3);
  			gd.addNumericField("Value (max) in vignetting data to correspond to 1x in the kernel",this.vignetting_max,      3);
  			gd.addNumericField("Do not try to correct vignetting smaller than this fraction of max",this.vignetting_range,  3);
  			gd.addNumericField("Do not try to correct vignetting smaller than this fraction of max",this.vignetting_range,  3);
  			
  			
  			gd.addCheckbox    ("Use DCT-base color conversion",                                   this.color_DCT             );
  			gd.addNumericField("Gaussian sigma to apply to R and B (in addition to G), pix",      this.sigma_rb,            3);
  			gd.addNumericField("Gaussian sigma to apply to Y in the MDCT domain, pix",            this.sigma_y,             3);
  			gd.addNumericField("Gaussian sigma to apply to Pr and Pb in the MDCT domain, pix",    this.sigma_color,         3);
  			gd.addNumericField("Threshold for line detection",                                    this.line_thershold,      3);

  			WindowTools.addScrollBars(gd);
  			WindowTools.addScrollBars(gd);
  			gd.showDialog();
  			gd.showDialog();
  			
  			
@@ -1971,6 +1994,13 @@ public class EyesisCorrectionParameters {
  			this.convolve_direct=       gd.getNextBoolean();
  			this.convolve_direct=       gd.getNextBoolean();
  			this.vignetting_max=        gd.getNextNumber();
  			this.vignetting_max=        gd.getNextNumber();
  			this.vignetting_range=      gd.getNextNumber();
  			this.vignetting_range=      gd.getNextNumber();

  			this.color_DCT=             gd.getNextBoolean();
  			this.sigma_rb=              gd.getNextNumber();
  			this.sigma_y=               gd.getNextNumber();
  			this.sigma_color=           gd.getNextNumber();
  			this.line_thershold=        gd.getNextNumber();
  			
  			//  	    MASTER_DEBUG_LEVEL= (int) gd.getNextNumber();
  			//  	    MASTER_DEBUG_LEVEL= (int) gd.getNextNumber();
  			return true;
  			return true;
  		}  
  		}  
+4 −3
Original line number Original line Diff line number Diff line
@@ -1390,7 +1390,8 @@ public class EyesisCorrections {
	 /* ======================================================================== */
	 /* ======================================================================== */
	  
	  
	  
	  
	  private boolean fixSliceSequence (
//	  private boolean fixSliceSequence (
	public boolean fixSliceSequence ( // for EyesisDCT
			  ImageStack stack,
			  ImageStack stack,
			  int debugLevel){
			  int debugLevel){
		  int i,j;
		  int i,j;
@@ -2254,7 +2255,7 @@ public class EyesisCorrections {
	 			correctionsParameters.JPEG_quality);
	 			correctionsParameters.JPEG_quality);
	   }
	   }


	   private void saveAndShow(
	   void saveAndShow(
//	   public void saveAndShow(
//	   public void saveAndShow(
			   ImagePlus             imp,
			   ImagePlus             imp,
			   EyesisCorrectionParameters.CorrectionParameters  correctionsParameters,
			   EyesisCorrectionParameters.CorrectionParameters  correctionsParameters,
@@ -2263,7 +2264,7 @@ public class EyesisCorrections {
		   saveAndShow(imp, correctionsParameters,  save,  show, -1);
		   saveAndShow(imp, correctionsParameters,  save,  show, -1);
	   } 
	   } 
	   
	   
	   private void saveAndShow(
	   void saveAndShow(
	 		  ImagePlus             imp,
	 		  ImagePlus             imp,
	 		 EyesisCorrectionParameters.CorrectionParameters  correctionsParameters,
	 		 EyesisCorrectionParameters.CorrectionParameters  correctionsParameters,
	 		  boolean               save,
	 		  boolean               save,
Loading