Commit e54061b3 authored by Andrey Filippov's avatar Andrey Filippov

using 'interAxisAngle' to compensate for non-axial 'rotation' of the camera

parent adea6f41
......@@ -8,19 +8,19 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>1.135</version>
<relativePath />
<version>3.1</version>
<relativePath/>
</parent>
<!--
<properties>
<imagej.app.directory>/data/ImageJ/ImageJ</imagej.app.directory>
<imagej.app.directory>/home/foxel/Desktop/Fiji.app</imagej.app.directory>
</properties>
-->
<groupId>com.elphel</groupId>
<artifactId>imagej-elphel</artifactId>
<!-- <artifactId>Aberration_Calibration</artifactId> -->
<version>1.0.0</version>
<version>1.0.0-SNAPSHOT</version>
<name>plugins/imagej_elphel.jar</name>
<!-- <name>plugins/Aberration_Calibration.jar</name> -->
......@@ -31,8 +31,9 @@
<dependency>
<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
<version>${imagej1.version}</version>
<version>1.49m</version>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
......@@ -94,8 +95,10 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
......@@ -106,7 +109,28 @@
<mainClass>Eyesis_Correction</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>true</doUpdate>
<format>Build {0,date,yyyy-MM-dd} {0,time,HH:MM:SS} on host {1}</format>
<items>
<item>timestamp</item>
<item>foxel-MRHM7AP</item>
</items>
</configuration>
</plugin>
</plugins>
</build>
......@@ -142,10 +166,22 @@
<scm>
<connection>scm:git:git://github.com/Elphel/imagej-elphel</connection>
<developerConnection>sscm:git:https://github.com/Elphel/imagej-elphel</developerConnection>
<developerConnection>scm:git:https://github.com/Elphel/imagej-elphel</developerConnection>
<tag>HEAD</tag>
<url>https://github.com/Elphel/imagej-elphel</url>
</scm>
<packaging>maven-plugin</packaging>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.14</version>
<configuration>
<configLocation>config/sun_checks.xml</configLocation>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
......@@ -6662,8 +6662,9 @@ if (MORE_BUTTONS) {
gd.addNumericField("Station number (0.."+(LENS_DISTORTIONS.fittingStrategy.distortionCalibrationData.eyesisCameraParameters.numStations-1), stationNumber, 0);
}
gd.addNumericField("Number of sub-camera (starting with 0)", 0, 0);
gd.addNumericField("Camera tilt (0 - vertical, >0 looking above horizon on the target", 0.0, 1,6,"degrees");
gd.addNumericField("Camera axial (0 - subcamera 0 looking to the target, >0 - rotated clockwise", 0.0, 1,6,"degrees");
gd.addNumericField("Camera tilt (0 - vertical, >0 looking above horizon on the target)", 0.0, 1,6,"degrees");
gd.addNumericField("Camera axial (0 - subcamera 0 looking to the target, >0 - rotated clockwise)", 0.0, 1,6,"degrees");
gd.addNumericField("Inter-axis angle (from 90)", 0.0, 1,6,"degrees");
gd.showDialog();
if (gd.wasCanceled()) return;
if (LENS_DISTORTIONS.fittingStrategy.distortionCalibrationData.eyesisCameraParameters.numStations>1){
......@@ -6672,11 +6673,13 @@ if (MORE_BUTTONS) {
int channelNumber= (int) gd.getNextNumber();
double tilt= gd.getNextNumber();
double axial= gd.getNextNumber();
double inter= gd.getNextNumber();
ImagePlus imp_simulatePatternOnSensor=LENS_DISTORTIONS.simulatePatternOnSensor(
stationNumber,
channelNumber,
tilt,
axial,
inter,
SIMUL,
THREADS_MAX, //int threadsMax,
UPDATE_STATUS, // boolean updateStatus,
......@@ -716,10 +716,11 @@ public class Distortions {
if (this.debugLevel>2){
System.out.println("listImageSets() 1: ");
for (int is=0;is<this.fittingStrategy.distortionCalibrationData.gIS.length;is++){
System.out.println("listImageSets() 1: "+is+": tilt="+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+" axial="+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+" estimated="+
this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated);
System.out.println("listImageSets() 1: "+is+
": tilt="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+
" axial="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+
" interAxis="+this.fittingStrategy.distortionCalibrationData.gIS[is].interAxisAngle+
" estimated="+this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated);
}
}
}
......@@ -731,10 +732,11 @@ public class Distortions {
if (this.debugLevel>2){
System.out.println("listImageSets() 2: ");
for (int is=0;is<this.fittingStrategy.distortionCalibrationData.gIS.length;is++){
System.out.println("listImageSets() 2: "+is+": tilt="+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+" axial="+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+" estimated="+
this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated);
System.out.println("listImageSets() 2: "+is+
": tilt="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+
" axial="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+
" interAxis="+this.fittingStrategy.distortionCalibrationData.gIS[is].interAxisAngle+
" estimated="+this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated);
}
}
}
......@@ -2462,6 +2464,7 @@ For each point in the image
int subCam,
double goniometerTilt,
double goniometerAxial,
double goniometerInterAxis,
SimulationPattern.SimulParameters simulParametersDefault,
int threadsMax,
boolean updateStatus,
......@@ -2481,6 +2484,7 @@ For each point in the image
subCam,
goniometerTilt, // Tilt, goniometerHorizontal
goniometerAxial, // Axial,goniometerAxial
goniometerInterAxis, // inter-axis angle
-1, // use camera parameters, not imageSet
true // filter border
);
......@@ -2662,6 +2666,7 @@ For each point in the image
dcd.gIP[numGridImage].channel,
goniometerTiltAxial[0], // Tilt, goniometerHorizontal
goniometerTiltAxial[1], // Axial,goniometerAxial
goniometerTiltAxial[2], // inter-axis angle
setNumber, // -1 or specific image set
true // filter border
);
......@@ -2902,19 +2907,22 @@ For each point in the image
GenericDialog gd=new GenericDialog("Specify camera orientation (channel"+fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel+")");
gd.addMessage("No goniometer orientation is available for image # "+numGridImage+" - "+fittingStrategy.distortionCalibrationData.gIP[numGridImage].path+
", please specify orientation manually");
gd.addNumericField("Camera tilt (0 - vertical, >0 looking above horizon on the target", 0.0, 1,6,"degrees");
gd.addNumericField("Camera axial (0 - subcamera 0 looking to the target, >0 - rotated clockwise", 0.0, 1,6,"degrees");
gd.addNumericField("Camera tilt (0 - vertical, >0 looking above horizon on the target)", 0.0, 1,6,"degrees");
gd.addNumericField("Camera axial (0 - subcamera 0 looking to the target, >0 - rotated clockwise)", 0.0, 1,6,"degrees");
gd.addNumericField("Camera inter-axis angle (from 90) ", 0.0, 1,6,"degrees");
gd.showDialog();
if (gd.wasCanceled()) return;
goniometerTiltAxial=new double[2];
goniometerTiltAxial=new double[3];
goniometerTiltAxial[0]= gd.getNextNumber();
goniometerTiltAxial[1]= gd.getNextNumber();
goniometerTiltAxial[2]= gd.getNextNumber();
}
double [][][] hintGrid=estimateGridOnSensor(
fittingStrategy.distortionCalibrationData.getImageStation(numGridImage), // station number
fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel,
goniometerTiltAxial[0], // Tilt, goniometerHorizontal
goniometerTiltAxial[1], // Axial,goniometerAxial
goniometerTiltAxial[2], // inter-axis angle
(useSetData?fittingStrategy.distortionCalibrationData.gIP[numGridImage].getSetNumber():-1),
true // filter border
);
......@@ -3107,6 +3115,7 @@ For each point in the image
int subCamera,
double goniometerHorizontal, // Tilt
double goniometerAxial, // Axial
double goniometerInterAxis, // interAxisAngle
int imageSet,
boolean filterBorder){
double maxRelativeRadius=this.hintedMaxRelativeRadius; // make adjustable
......@@ -3126,6 +3135,11 @@ For each point in the image
int goniometerAxialIndex=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getGoniometerAxialIndex();
parVector[goniometerAxialIndex]= goniometerAxial;
}
if (!Double.isNaN(goniometerInterAxis)) {
int goniometerInterAxisAngleIndex=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getInterAxisAngleIndex();
parVector[goniometerInterAxisAngleIndex]= goniometerInterAxis;
}
// /interAxis
int sensorWidth=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getSensorWidth(subCamera);
int sensorHeight=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getSensorHeight(subCamera);
System.out.println("estimateGridOnSensor(): subCamera="+subCamera+", goniometerHorizontal="+goniometerHorizontal+", goniometerAxial="+goniometerAxial);
......@@ -9842,7 +9856,7 @@ M * V = B
distortionCalibrationData.gIS[numSet].goniometerAxial=Double.NaN;
distortionCalibrationData.gIS[numSet].goniometerTilt= Double.NaN;
// re-estimate orientation
double [] ta=distortionCalibrationData.getImagesetTiltAxial(distortionCalibrationData.gIS[numSet].timeStamp); // updates tilt/axial
double [] ta=distortionCalibrationData.getImagesetTiltAxial(distortionCalibrationData.gIS[numSet].timeStamp); // updates tilt/axial (now interAxis too!)
if ((ta==null) || Double.isNaN(ta[0]) || Double.isNaN(ta[1])) return false;
return true;
}
......
......@@ -1254,6 +1254,7 @@ public class EyesisAberrations {
distortions.fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel, // subCamera,
Double.NaN, // goniometerHorizontal, - not used
Double.NaN, // goniometerAxial, - not used
Double.NaN, // inter-axis angle, - not used ?
distortions.fittingStrategy.distortionCalibrationData.gIP[numGridImage].getSetNumber(), //imageSet,
true); //filterBorder)
hintTolerance=5.0; // TODO:set from configurable parameter
......
......@@ -1136,6 +1136,7 @@ import org.apache.commons.configuration.XMLConfiguration;
// public int getNumSubCameras (){return (this.eyesisSubCameras==null)?0:this.eyesisSubCameras.length;}
public int getGoniometerHorizontalIndex(){return 6;}
public int getGoniometerAxialIndex(){return 7;}
public int getInterAxisAngleIndex(){return 9;}
public int getSensorWidth() { return this.sensorWidth;}
public int getSensorHeight() { return this.sensorHeight;}
public int getSensorWidth(int subCam) { return this.sensorWidth;} // for the future? different sensors
......
......@@ -598,6 +598,7 @@ horizontal axis:
subCam,
goniometerTiltAxial[0], // Tilt, goniometerHorizontal
goniometerTiltAxial[1], // Axial,goniometerAxial
goniometerTiltAxial[2], // inter-axis angle
-1, // use camera parameters, not imageSet
true // filter border
);
......
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