Commit a45f56ef authored by Andrey Filippov's avatar Andrey Filippov

working, refactoring for multi scene set vegetation

parent 4fefd6d1
......@@ -6235,7 +6235,7 @@ if (MORE_BUTTONS) {
return;
}
if ((images[0].getProperty("timestamp")==null) || (((String) images[0].getProperty("timestamp")).length()==0)) {
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(images[0]);
JP46_Reader_camera.decodeProperiesFromInfo(images[0]);
}
if (GONIOMETER==null) {
......@@ -10880,7 +10880,7 @@ if (MORE_BUTTONS) {
}
}
imp_sel=new ImagePlus(sourceFilesList[numFile]); // read source file
JP4_INSTANCE.decodeProperiesFromInfo(imp_sel);
JP46_Reader_camera.decodeProperiesFromInfo(imp_sel);
// matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.FFTSize); // TODO: is it needed each time?
int sensor_type = 0; // EO
matchSimulatedPattern= new MatchSimulatedPattern(DISTORTION.getFFTSize(sensor_type));
......@@ -12204,7 +12204,7 @@ if (MORE_BUTTONS) {
imp.setProperty("motor1", ""+focusMeasurementParameters.motorPos[0]);
imp.setProperty("motor2", ""+focusMeasurementParameters.motorPos[1]);
imp.setProperty("motor3", ""+focusMeasurementParameters.motorPos[2]);
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
if (alwaysShow || focusMeasurementParameters.showResults) imp.show();
if (alwaysSave || focusMeasurementParameters.saveResults) {
String dir=getResultsPath(focusMeasurementParameters);
......@@ -14137,7 +14137,7 @@ if (MORE_BUTTONS) {
}
}
}
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp_psf);
JP46_Reader_camera.encodeProperiesToInfo(imp_psf);
if (showPSF) imp_psf.show();
if (focusMeasurementParameters.saveResults) {
String dir=getResultsPath(focusMeasurementParameters);
......@@ -3435,16 +3435,16 @@ import ij.text.TextWindow;
return null;
}
public double getImageTimestamp(ImagePlus image){
public static double getImageTimestamp(ImagePlus image){
if ((image.getProperty("timestamp")==null) || (((String) image.getProperty("timestamp")).length()==0)) {
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(image);
JP46_Reader_camera.decodeProperiesFromInfo(image);
}
return Double.parseDouble((String) image.getProperty("timestamp"));
}
public int getImageChannel(ImagePlus image){
if ((image.getProperty("channel")==null) || (((String) image.getProperty("channel")).length()==0)) {
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(image);
JP46_Reader_camera.decodeProperiesFromInfo(image);
}
String channelSuffix=(String) image.getProperty("channel");
......@@ -4462,7 +4462,7 @@ import ij.text.TextWindow;
// read image info to properties (if it was not done yet - should it?
if ((imp.getProperty("timestamp")==null) || (((String) imp.getProperty("timestamp")).length()==0)) {
JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
}
int [] motorPos=new int [numMotors];
int numMotorsDetected=0;
......@@ -4481,7 +4481,7 @@ import ij.text.TextWindow;
// read image info to properties (if it was not done yet - should it?
if ((imp.getProperty("timestamp")==null) || (((String) imp.getProperty("timestamp")).length()==0)) {
JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
}
if (imp.getProperty("USED_POINTERS")!=null) {
return Integer.parseInt((String) imp.getProperty("USED_POINTERS"));
......@@ -4984,7 +4984,7 @@ import ij.text.TextWindow;
IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg);
}
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
if (imp.getProperty("shrinkGridForMask")!=null)
eyesisCameraParameters.shrinkGridForMask=Integer.parseInt((String) imp.getProperty("shrinkGridForMask"));
if (imp.getProperty("maskBlurSigma")!=null)
......@@ -5116,7 +5116,7 @@ import ij.text.TextWindow;
imp.setProperty("maskBlurSigma", ""+eyesisCameraParameters.maskBlurSigma);
imp.setProperty("decimateMasks", ""+eyesisCameraParameters.getDecimateMasks());
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
imp.getProcessor().resetMinAndMax();
return imp;
}
......
......@@ -3784,7 +3784,7 @@ For each point in the image
if (grid_path != null) {
ImagePlus imp = new ImagePlus(grid_path);
JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
MatchSimulatedPattern.setPointersXYUV(imp, xyuv);
updateGridToPointer(imp, xyuv);
jp4_instance.encodeProperiesToInfo(imp);
......@@ -7237,7 +7237,7 @@ List calibration
}
//camerasInterface, numSensor
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
imp.getProcessor().resetMinAndMax();
return imp;
}
......@@ -7291,7 +7291,7 @@ List calibration
throw new IllegalArgumentException (msg);
}
if (this.debugLevel>0) System.out.println("Read "+path+" as a sensor calibration data");
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
setDistortionFromImageStack(distortionCalibrationData,
imp,
numSensor,
......
......@@ -130,7 +130,7 @@ public class EyesisAberrations {
ImagePlus impInvertedPSF = new ImagePlus("interpolated kernel stack", stack);
JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(impSpsf);
JP46_Reader_camera.decodeProperiesFromInfo(impSpsf);
// copy properties from the source image
jp4_instance.copyProperties (impSpsf,impInvertedPSF);
inverseParameters.setProperties("INVERSE.", impInvertedPSF);
......@@ -731,7 +731,7 @@ public class EyesisAberrations {
ImagePlus impInterpolatedPSF = new ImagePlus("interpolated kernel stack", stack);
JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(impSpsf);
JP46_Reader_camera.decodeProperiesFromInfo(impSpsf);
// copy properties from the source image
jp4_instance.copyProperties (impSpsf,impInterpolatedPSF);
interpolateParameters.setProperties("INTERPOLATE.", impInterpolatedPSF);
......@@ -1249,7 +1249,7 @@ public class EyesisAberrations {
for (int imgNum=0;imgNum<files.length;imgNum++){ // add stopRequested
if (debugLevel>0) System.out.println("Processing file #"+(imgNum+1)+ " ( of "+files.length+") :"+files[imgNum][0]);
ImagePlus imp=new ImagePlus(files[imgNum][0]); // read source file
JP4_INSTANCE.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
// boolean is_lwir = lwirReaderParameters.is_LWIR(imp);
int sensor_type = LwirReaderParameters.sensorType(imp);
// int fft_size = is_lwir ? distortionParameters.FFTSize_lwir : distortionParameters.FFTSize;
......@@ -1502,7 +1502,7 @@ public class EyesisAberrations {
// see if it has any usable properties and impProto is not set yet
if (impProtoIndex<0){
if ((imp_sel.getProperty("timestamp")==null) || (((String) imp_sel.getProperty("timestamp")).length()==0)) {
jp4_instance.decodeProperiesFromInfo(imp_sel);
JP46_Reader_camera.decodeProperiesFromInfo(imp_sel);
if ((imp_sel.getProperty("timestamp")!=null) && (((String) imp_sel.getProperty("timestamp")).length()>0)) {
impProtoIndex=nFile;
}
......@@ -1867,7 +1867,7 @@ public class EyesisAberrations {
if (impProtoIndex>=0){
imp_sel=opener.openImage("", filenames[impProtoIndex]);
jp4_instance.decodeProperiesFromInfo(imp_sel);
JP46_Reader_camera.decodeProperiesFromInfo(imp_sel);
// copy properties from the source image
jp4_instance.copyProperties (imp_sel,imp_psf);
}
......@@ -2167,7 +2167,7 @@ public class EyesisAberrations {
JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
if ((impSrc.getProperty("timestamp")==null) || (((String) impSrc.getProperty("timestamp")).length()==0)) {
jp4_instance.decodeProperiesFromInfo(impSrc);
JP46_Reader_camera.decodeProperiesFromInfo(impSrc);
}
// copy properies from the source image
jp4_instance.copyProperties (impSrc,impPsf);
......
......@@ -633,7 +633,7 @@ horizontal axis:
// int stationNumber= distortionCalibrationData.getImageStation(numGridImage), // station number
double timeStamp= distortionCalibrationData.getImageTimestamp(images[nImg]);
double timeStamp= DistortionCalibrationData.getImageTimestamp(images[nImg]);
int numPointers=pointersArray[nImg];
double [] goniometerTiltAxial=distortionCalibrationData.getImagesetTiltAxial(timeStamp);
......
......@@ -7450,7 +7450,7 @@ public class MatchSimulatedPattern {
// read image info to properties (if it was not done yet - should it?
if ((imp.getProperty("timestamp") == null) || (((String) imp.getProperty("timestamp")).length() == 0)) {
JP46_Reader_camera jp4_instance = new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
}
double[][] pointersXY = new double[numPointers][];
int numPointerDetected = 0;
......@@ -7477,7 +7477,7 @@ public class MatchSimulatedPattern {
// read image info to properties (if it was not done yet - should it?
if ((imp.getProperty("timestamp") == null) || (((String) imp.getProperty("timestamp")).length() == 0)) {
JP46_Reader_camera jp4_instance = new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
}
double[][] pointersXY = new double[numPointers][];
int numPointerDetected = 0;
......@@ -7512,7 +7512,7 @@ public class MatchSimulatedPattern {
public static void setPointersXYUV(ImagePlus imp, double[][] pointersXYUV) {
// JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
// jp4_instance.decodeProperiesFromInfo(imp);
// JP46_Reader_camera.decodeProperiesFromInfo(imp);
String prefix = "POINTER_";
Properties prop = imp.getProperties();
// Delete all properties starting with "POINTER_"
......@@ -7547,7 +7547,7 @@ public class MatchSimulatedPattern {
// read image info to properties (if it was not done yet - should it?
if ((imp.getProperty("timestamp") == null) || (((String) imp.getProperty("timestamp")).length() == 0)) {
JP46_Reader_camera jp4_instance = new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
}
if (imp.getProperty("channel") == null)
return null;
......
......@@ -327,7 +327,7 @@ import ij.io.Opener;
IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg);
}
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
setGridFromImageStack(imp);
this.pathName=path;
if (this.debugLevel>0) System.out.println("Opened "+path+" as a stack of the pattern grid geometry");
......@@ -524,7 +524,7 @@ import ij.io.Opener;
imp.setProperty("AverageGreen", ""+this.averageRGB[1]);
imp.setProperty("AverageBlue", ""+this.averageRGB[2]);
if (numZCorr>0) imp.setProperty("numZCorr", ""+numZCorr);
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
imp.getProcessor().resetMinAndMax();
return imp;
}
......
......@@ -463,7 +463,7 @@ public class PixelMapping {
IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg);
}
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
return resampleToEquirectangular(
imp,
channel,
......@@ -666,7 +666,7 @@ public class PixelMapping {
impOut.setProperty("YPosition", ""+erm.mapWOI.y); // real XPosition as tiff tag 0x11f is rational (5)
impOut.setProperty("ImageFullWidth", "" +erm.pixelsHorizontal);// real ImageFullWidth as tiff tag 0x8214 is rational (5)
impOut.setProperty("ImageFullLength", ""+erm.pixelsVertical); // real ImageFullLength as tiff tag 0x8215 is rational (5)
(new JP46_Reader_camera(false)).encodeProperiesToInfo(impOut);
JP46_Reader_camera.encodeProperiesToInfo(impOut);
impOut.getProcessor().resetMinAndMax();
return impOut;
}
......@@ -768,7 +768,7 @@ public class PixelMapping {
impOut.setProperty("YPosition", ""+erm.mapWOI.y); // real XPosition as tiff tag 0x11f is rational (5)
impOut.setProperty("ImageFullWidth", "" +erm.pixelsHorizontal);// real ImageFullWidth as tiff tag 0x8214 is rational (5)
impOut.setProperty("ImageFullLength", ""+erm.pixelsVertical); // real ImageFullLength as tiff tag 0x8215 is rational (5)
(new JP46_Reader_camera(false)).encodeProperiesToInfo(impOut);
JP46_Reader_camera.encodeProperiesToInfo(impOut);
impOut.getProcessor().resetMinAndMax();
return impOut;
}
......@@ -1176,7 +1176,7 @@ public class PixelMapping {
throw new IllegalArgumentException (msg);
}
if (debugLevel>0) System.out.println("Read "+path+" as an inter-sensor overlap map");
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(impMap);
JP46_Reader_camera.decodeProperiesFromInfo(impMap);
InterSensor interSensor=new InterSensor(impMap,debugLevel);
this.lastUsedInterSensor=interSensor;
double [][] aYCbCr=convertToDouble?(new double [8][]):null;
......@@ -1263,7 +1263,7 @@ public class PixelMapping {
throw new IllegalArgumentException (msg);
}
if (debugLevel>0) System.out.println("Read "+path+" as a plane-to-sensor map");
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(impMap);
JP46_Reader_camera.decodeProperiesFromInfo(impMap);
InterSensor interSensor=new InterSensor(impMap,debugLevel);
this.lastUsedInterSensor=interSensor;
for (int iChn=0;iChn<interSensor.channel.length;iChn++){
......@@ -1684,7 +1684,7 @@ public class PixelMapping {
var dispScales_2_y = -0.2898449402;
*/
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
return imp;
}
......@@ -2046,7 +2046,7 @@ public class PixelMapping {
imp.setProperty("interVectorY", ""+vectors[1][1]);
imp.setProperty("interVectorZ", ""+vectors[1][2]);
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
return imp;
}
......@@ -2424,7 +2424,7 @@ public class PixelMapping {
String [] requiredProperties=generateRequiredProperties(this.numOverlapChannels);
// try to decode info if required properties are not set
if (imp.getProperty(requiredProperties[0])==null) (new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
if (imp.getProperty(requiredProperties[0])==null) JP46_Reader_camera.decodeProperiesFromInfo(imp);
for (int i=0; i<requiredProperties.length;i++) if (imp.getProperty(requiredProperties[i])==null){
String msg="Required property "+requiredProperties[i]+" is not defined in "+imp.getTitle();
......@@ -5196,7 +5196,7 @@ public class PixelMapping {
imp_stack.setProperty("disparityScalesY_"+i, this.disparityScales[i][1]+"");
}
}
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp_stack);
JP46_Reader_camera.encodeProperiesToInfo(imp_stack);
imp_stack.getProcessor().resetMinAndMax();
if (show) imp_stack.show();
return imp_stack;
......@@ -5211,7 +5211,7 @@ public class PixelMapping {
"tilesY",
"tilesX",
"numPairs"};
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
for (int i=0; i<requiredProperties.length;i++) if (imp.getProperty(requiredProperties[i])==null){
String msg="Required property "+requiredProperties[i]+" is not defined in "+imp.getTitle();
IJ.showMessage("Error",msg);
......@@ -15675,7 +15675,7 @@ public class PixelMapping {
ImagePlus impOut=new ImagePlus(imageTitle,cp);
impOut.setProperty("channel", ""+channel); // image channel
for (int i=0;i<this.channel.length;i++) impOut.setProperty("channel"+(i+1), ""+this.channel[i]); // image channel
(new JP46_Reader_camera(false)).encodeProperiesToInfo(impOut);
JP46_Reader_camera.encodeProperiesToInfo(impOut);
impOut.getProcessor().resetMinAndMax();
return impOut;
}
......@@ -16175,7 +16175,7 @@ public class PixelMapping {
imp.setProperty("latitudeTop", ""+this.latitudeTop);
imp.setProperty("latitudeBottom", ""+this.latitudeBottom);
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
imp.getProcessor().resetMinAndMax();
return imp;
}
......@@ -16188,7 +16188,7 @@ public class PixelMapping {
IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg);
}
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
this.mapWOI=new Rectangle();
this.mapWOI.width=imp.getWidth();
this.mapWOI.height=imp.getHeight();
......@@ -16292,7 +16292,7 @@ public class PixelMapping {
return;
}
if (this.debugLevel>1) System.out.println("Read "+path+" as a sensor calibration data");
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
setSensorDataFromImageStack(imp);
}
public SensorData (){} // just to get parameter names
......
......@@ -1565,7 +1565,7 @@ public class CamerasInterface{
if (debugLevel>2) jp4_Instance.encodeProperiesToInfo(images[imageIndex]);
if (debugLevel>2) {
jp4_Instance.listImageProperties(images[imageIndex]);
jp4_Instance.decodeProperiesFromInfo(images[imageIndex]);
JP46_Reader_camera.decodeProperiesFromInfo(images[imageIndex]);
jp4_Instance.listImageProperties(images[imageIndex]);
}
String title=IJ.d2s(timestamps[iIP],6).replace('.','_')+String.format("-%02d.tiff", imageIndex); // sensor number
......
......@@ -741,7 +741,7 @@ public class SFEPhases {
// read image info to properties (if it was not done yet - should it?
if ((imp.getProperty("timestamp")==null) || (((String) imp.getProperty("timestamp")).length()==0)) {
JP46_Reader_camera jp4_instance= new JP46_Reader_camera(false);
jp4_instance.decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
}
if (imp.getProperty("channel")==null) return null;
return (String) imp.getProperty("channel");
......@@ -1106,7 +1106,7 @@ public class SFEPhases {
throw new IllegalArgumentException (msg);
}
if (this.debugLevel>0) System.out.println("Read "+path+" as a sensor calibration data");
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp);
JP46_Reader_camera.decodeProperiesFromInfo(imp);
setDistortionFromImageStack(imp, numSensor, overwriteExtrinsic);
*
D5917: public void setDistortionFromImageStack(String path, boolean overwriteExtrinsic){
......
......@@ -1614,7 +1614,7 @@ if (PROCESS_PARAMETERS.saveSettings) saveProperties(FILE_PARAMETERS.resultsDirec
IJ.showMessage("Error",msg);
throw new IllegalArgumentException (msg);
}
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp_composite);
JP46_Reader_camera.decodeProperiesFromInfo(imp_composite);
imp_composite.setProperty("isTiff", true);
} else {
imp_composite=JP4_instance.open(
......
......@@ -334,8 +334,8 @@ public class EyesisCorrections {
false); // do not show
} else {
imp=new ImagePlus(paths[nFile]);
// (new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp_src); // decode existent properties from info
JP4_INSTANCE.decodeProperiesFromInfo(imp); // decode existent properties from info
// JP46_Reader_camera.decodeProperiesFromInfo(imp_src); // decode existent properties from info
JP46_Reader_camera.decodeProperiesFromInfo(imp); // decode existent properties from info
}
*/
if ((imp != null) &&(imp.getProperty("EXPOSURE")!=null)){
......@@ -883,8 +883,8 @@ public class EyesisCorrections {
// do we need to add any properties?
} else {
imp_src=new ImagePlus(sourceFiles[nFile]);
// (new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp_src); // decode existent properties from info
JP4_INSTANCE.decodeProperiesFromInfo(imp_src); // decode existent properties from info
// JP46_Reader_camera.decodeProperiesFromInfo(imp_src); // decode existent properties from info
JP46_Reader_camera.decodeProperiesFromInfo(imp_src); // decode existent properties from info
if (debugLevel>0) System.out.println("Processing "+sourceFiles[nFile]);
}
double scaleExposure=1.0;
......@@ -1005,7 +1005,7 @@ public class EyesisCorrections {
}
(new JP46_Reader_camera(false)).copyProperties (imp, imp_croped);
if (right) imp_croped.setProperty("XPosition", "0");
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp_croped);
JP46_Reader_camera.encodeProperiesToInfo(imp_croped);
return imp_croped;
}
......
......@@ -31,6 +31,7 @@ import com.elphel.imagej.cameras.EyesisCorrectionParameters;
import com.elphel.imagej.common.DoubleGaussianBlur;
import com.elphel.imagej.common.ShowDoubleFloatArrays;
import com.elphel.imagej.dct.FactorConvKernel;
import com.elphel.imagej.jp4.JP46_Reader_camera;
import com.elphel.imagej.tileprocessor.DttRad2;
import com.elphel.imagej.tileprocessor.ImageDtt;
......@@ -1016,8 +1017,8 @@ public class EyesisDCT {
// do we need to add any properties?
} else {
imp_src=new ImagePlus(sourceFiles[nFile]);
// (new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp_src); // decode existent properties from info
eyesisCorrections.JP4_INSTANCE.decodeProperiesFromInfo(imp_src); // decode existent properties from info
// JP46_Reader_camera.decodeProperiesFromInfo(imp_src); // decode existent properties from info
JP46_Reader_camera.decodeProperiesFromInfo(imp_src); // decode existent properties from info
if (debugLevel>0) System.out.println("Processing "+sourceFiles[nFile]);
}
double scaleExposure=1.0;
......
......@@ -868,6 +868,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton("Test Orange", panelOrange, color_process);
addButton("Process Merged", panelOrange, color_process);
addButton("Vegetation LMA", panelOrange, color_process);
addButton("Combine LMA Segments", panelOrange, color_process);
plugInFrame.add(panelOrange);
}
plugInFrame.pack();
......@@ -5604,7 +5605,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
IJ.showMessage("Error", "There are no images open\nProcess canceled");
return;
}
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp_sel);
JP46_Reader_camera.decodeProperiesFromInfo(imp_sel);
ArrayList<String> prop_kv = new ArrayList<String>();
Set<Object> jp4_set;
Properties jp4_prop;
......@@ -5660,7 +5661,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
imp_sel.setProperty(name, val);
}
}
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp_sel);
JP46_Reader_camera.encodeProperiesToInfo(imp_sel);
return;
} else if (label.equals("Build World")) {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
......@@ -5801,7 +5802,9 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
} else if (label.equals("Process Merged")) {
OrangeTest.processMerged();
} else if (label.equals("Vegetation LMA")) {
VegetationModel.testVegetationLMA();
VegetationModel.testVegetationLMA(false); //boolean combine_segments);
} else if (label.equals("Combine LMA Segments")) {
VegetationModel.testVegetationLMA(true); //boolean combine_segments);
}
//
}
......@@ -10279,7 +10282,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
IJ.showMessage("Error", msg);
throw new IllegalArgumentException(msg);
}
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(imp_composite);
JP46_Reader_camera.decodeProperiesFromInfo(imp_composite);
imp_composite.setProperty("isTiff", true);
} else {
imp_composite = JP4_instance.open(directories[nFile], // path,
......
......@@ -96,7 +96,7 @@ public class PostProcessing {
throw new IllegalArgumentException (msg);
}
if (debugLevel>0) System.out.println("Read "+mapsPath+" as an inter-sensor overlap map");
(new JP46_Reader_camera(false)).decodeProperiesFromInfo(impMap);
JP46_Reader_camera.decodeProperiesFromInfo(impMap);
this.interSensor=pixelMapping.new InterSensor(impMap,debugLevel);
System.out.println("Converting source files");
this.debugLevel= debugLevel;
......
......@@ -1451,7 +1451,7 @@ Exception in thread "Thread-3564" java.lang.ArrayIndexOutOfBoundsException: 8970
}
public ImagePlus encodeProperiesToInfo(ImagePlus imp){
public static ImagePlus encodeProperiesToInfo(ImagePlus imp){
String info="<?xml version=\"1.0\" encoding=\"UTF-8\"?><properties>";
Set<Object> jp4_set;
Properties jp4_prop;
......@@ -1471,7 +1471,7 @@ Exception in thread "Thread-3564" java.lang.ArrayIndexOutOfBoundsException: 8970
imp.setProperty("Info", info);
return imp;
}
public boolean decodeProperiesFromInfo(ImagePlus imp){
public static boolean decodeProperiesFromInfo(ImagePlus imp){
if (imp.getProperty("Info")==null) return false;
String xml= (String) imp.getProperty("Info");
......
......@@ -427,7 +427,7 @@ public class MLStats {
imp.setProperty("disparity_outlier", disparity_outlier+"");
imp.setProperty("comment_disparity_outlier", "Ignore tiles with disparity difference higher");
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp);
JP46_Reader_camera.encodeProperiesToInfo(imp);
imp.show();
return true;
......
......@@ -10329,7 +10329,7 @@ public class OpticalFlow {
imp_ml.setProperty("metaFGDisparity", ""+10); //=="metaGTDisparity"
imp_ml.setProperty("metaBGDisparityAll", ""+11);
imp_ml.setProperty("metaBlueSky", ""+12);
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp_ml);
JP46_Reader_camera.encodeProperiesToInfo(imp_ml);
FileSaver fs=new FileSaver(imp_ml);
fs.saveAsTiff(file_path);
System.out.println("intersceneExport(): saved "+file_path);
......@@ -10474,7 +10474,7 @@ public class OpticalFlow {
imp_ml.setProperty("metaFGDisparity", ""+10); //=="metaGTDisparity"
imp_ml.setProperty("metaBGDisparityAll", ""+11);
imp_ml.setProperty("metaBlueSky", ""+12);
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp_ml);
JP46_Reader_camera.encodeProperiesToInfo(imp_ml);
FileSaver fs=new FileSaver(imp_ml);
fs.saveAsTiff(file_path);
System.out.println("intersceneExport(): saved "+file_path);
......
......@@ -6220,7 +6220,7 @@ if (debugLevel > -100) return true; // temporarily !
}
imp_ml.setProperty("comment_disparityRadiusAux", "Side of the square where 4 main camera subcameras are located (mm). Disparity is specified for the main camera");
(new JP46_Reader_camera(false)).encodeProperiesToInfo(imp_ml);
JP46_Reader_camera.encodeProperiesToInfo(imp_ml);
imp_ml.getProcessor().resetMinAndMax();
if (show ) {
imp_ml.show();
......
package com.elphel.imagej.vegetation;
import java.awt.Rectangle;
public class VegetationSegment {
public Rectangle woi;
public double [] scene_offsets;
public double [][] tva;
public VegetationSegment(
Rectangle woi,
double [] scene_offsets,
double [][] tva) {
this.woi = woi;
this.scene_offsets = scene_offsets;
this.tva = tva;
}
}
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