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 @@ ...@@ -8,19 +8,19 @@
<parent> <parent>
<groupId>org.scijava</groupId> <groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId> <artifactId>pom-scijava</artifactId>
<version>1.135</version> <version>3.1</version>
<relativePath /> <relativePath/>
</parent> </parent>
<!--
<properties> <properties>
<imagej.app.directory>/data/ImageJ/ImageJ</imagej.app.directory> <imagej.app.directory>/home/foxel/Desktop/Fiji.app</imagej.app.directory>
</properties> </properties>
-->
<groupId>com.elphel</groupId> <groupId>com.elphel</groupId>
<artifactId>imagej-elphel</artifactId> <artifactId>imagej-elphel</artifactId>
<!-- <artifactId>Aberration_Calibration</artifactId> --> <!-- <artifactId>Aberration_Calibration</artifactId> -->
<version>1.0.0</version> <version>1.0.0-SNAPSHOT</version>
<name>plugins/imagej_elphel.jar</name> <name>plugins/imagej_elphel.jar</name>
<!-- <name>plugins/Aberration_Calibration.jar</name> --> <!-- <name>plugins/Aberration_Calibration.jar</name> -->
...@@ -29,10 +29,11 @@ ...@@ -29,10 +29,11 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>net.imagej</groupId> <groupId>net.imagej</groupId>
<artifactId>ij</artifactId> <artifactId>ij</artifactId>
<version>${imagej1.version}</version> <version>1.49m</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-configuration</groupId> <groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId> <artifactId>commons-configuration</artifactId>
...@@ -73,29 +74,31 @@ ...@@ -73,29 +74,31 @@
</testResource> </testResource>
</testResources> </testResources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId> <artifactId>maven-plugin-plugin</artifactId>
<configuration> <configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 --> <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound> <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>mojo-descriptor</id> <id>mojo-descriptor</id>
<goals> <goals>
<goal>descriptor</goal> <goal>descriptor</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase>
<goals> <goals>
<goal>java</goal> <goal>java</goal>
</goals> </goals>
...@@ -106,7 +109,28 @@ ...@@ -106,7 +109,28 @@
<mainClass>Eyesis_Correction</mainClass> <mainClass>Eyesis_Correction</mainClass>
</configuration> </configuration>
</plugin> </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> </plugins>
</build> </build>
...@@ -142,10 +166,22 @@ ...@@ -142,10 +166,22 @@
<scm> <scm>
<connection>scm:git:git://github.com/Elphel/imagej-elphel</connection> <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> <tag>HEAD</tag>
<url>https://github.com/Elphel/imagej-elphel</url> <url>https://github.com/Elphel/imagej-elphel</url>
</scm> </scm>
<packaging>maven-plugin</packaging> <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> </project>
...@@ -6662,8 +6662,9 @@ if (MORE_BUTTONS) { ...@@ -6662,8 +6662,9 @@ if (MORE_BUTTONS) {
gd.addNumericField("Station number (0.."+(LENS_DISTORTIONS.fittingStrategy.distortionCalibrationData.eyesisCameraParameters.numStations-1), stationNumber, 0); 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("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 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 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(); gd.showDialog();
if (gd.wasCanceled()) return; if (gd.wasCanceled()) return;
if (LENS_DISTORTIONS.fittingStrategy.distortionCalibrationData.eyesisCameraParameters.numStations>1){ if (LENS_DISTORTIONS.fittingStrategy.distortionCalibrationData.eyesisCameraParameters.numStations>1){
...@@ -6672,11 +6673,13 @@ if (MORE_BUTTONS) { ...@@ -6672,11 +6673,13 @@ if (MORE_BUTTONS) {
int channelNumber= (int) gd.getNextNumber(); int channelNumber= (int) gd.getNextNumber();
double tilt= gd.getNextNumber(); double tilt= gd.getNextNumber();
double axial= gd.getNextNumber(); double axial= gd.getNextNumber();
double inter= gd.getNextNumber();
ImagePlus imp_simulatePatternOnSensor=LENS_DISTORTIONS.simulatePatternOnSensor( ImagePlus imp_simulatePatternOnSensor=LENS_DISTORTIONS.simulatePatternOnSensor(
stationNumber, stationNumber,
channelNumber, channelNumber,
tilt, tilt,
axial, axial,
inter,
SIMUL, SIMUL,
THREADS_MAX, //int threadsMax, THREADS_MAX, //int threadsMax,
UPDATE_STATUS, // boolean updateStatus, UPDATE_STATUS, // boolean updateStatus,
...@@ -716,10 +716,11 @@ public class Distortions { ...@@ -716,10 +716,11 @@ public class Distortions {
if (this.debugLevel>2){ if (this.debugLevel>2){
System.out.println("listImageSets() 1: "); System.out.println("listImageSets() 1: ");
for (int is=0;is<this.fittingStrategy.distortionCalibrationData.gIS.length;is++){ for (int is=0;is<this.fittingStrategy.distortionCalibrationData.gIS.length;is++){
System.out.println("listImageSets() 1: "+is+": tilt="+ System.out.println("listImageSets() 1: "+is+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+" axial="+ ": tilt="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+" estimated="+ " axial="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+
this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated); " interAxis="+this.fittingStrategy.distortionCalibrationData.gIS[is].interAxisAngle+
" estimated="+this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated);
} }
} }
} }
...@@ -731,10 +732,11 @@ public class Distortions { ...@@ -731,10 +732,11 @@ public class Distortions {
if (this.debugLevel>2){ if (this.debugLevel>2){
System.out.println("listImageSets() 2: "); System.out.println("listImageSets() 2: ");
for (int is=0;is<this.fittingStrategy.distortionCalibrationData.gIS.length;is++){ for (int is=0;is<this.fittingStrategy.distortionCalibrationData.gIS.length;is++){
System.out.println("listImageSets() 2: "+is+": tilt="+ System.out.println("listImageSets() 2: "+is+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+" axial="+ ": tilt="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerTilt+
this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+" estimated="+ " axial="+ this.fittingStrategy.distortionCalibrationData.gIS[is].goniometerAxial+
this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated); " interAxis="+this.fittingStrategy.distortionCalibrationData.gIS[is].interAxisAngle+
" estimated="+this.fittingStrategy.distortionCalibrationData.gIS[is].orientationEstimated);
} }
} }
} }
...@@ -2462,6 +2464,7 @@ For each point in the image ...@@ -2462,6 +2464,7 @@ For each point in the image
int subCam, int subCam,
double goniometerTilt, double goniometerTilt,
double goniometerAxial, double goniometerAxial,
double goniometerInterAxis,
SimulationPattern.SimulParameters simulParametersDefault, SimulationPattern.SimulParameters simulParametersDefault,
int threadsMax, int threadsMax,
boolean updateStatus, boolean updateStatus,
...@@ -2481,6 +2484,7 @@ For each point in the image ...@@ -2481,6 +2484,7 @@ For each point in the image
subCam, subCam,
goniometerTilt, // Tilt, goniometerHorizontal goniometerTilt, // Tilt, goniometerHorizontal
goniometerAxial, // Axial,goniometerAxial goniometerAxial, // Axial,goniometerAxial
goniometerInterAxis, // inter-axis angle
-1, // use camera parameters, not imageSet -1, // use camera parameters, not imageSet
true // filter border true // filter border
); );
...@@ -2662,6 +2666,7 @@ For each point in the image ...@@ -2662,6 +2666,7 @@ For each point in the image
dcd.gIP[numGridImage].channel, dcd.gIP[numGridImage].channel,
goniometerTiltAxial[0], // Tilt, goniometerHorizontal goniometerTiltAxial[0], // Tilt, goniometerHorizontal
goniometerTiltAxial[1], // Axial,goniometerAxial goniometerTiltAxial[1], // Axial,goniometerAxial
goniometerTiltAxial[2], // inter-axis angle
setNumber, // -1 or specific image set setNumber, // -1 or specific image set
true // filter border true // filter border
); );
...@@ -2902,19 +2907,22 @@ For each point in the image ...@@ -2902,19 +2907,22 @@ For each point in the image
GenericDialog gd=new GenericDialog("Specify camera orientation (channel"+fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel+")"); 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+ gd.addMessage("No goniometer orientation is available for image # "+numGridImage+" - "+fittingStrategy.distortionCalibrationData.gIP[numGridImage].path+
", please specify orientation manually"); ", 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 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 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(); gd.showDialog();
if (gd.wasCanceled()) return; if (gd.wasCanceled()) return;
goniometerTiltAxial=new double[2]; goniometerTiltAxial=new double[3];
goniometerTiltAxial[0]= gd.getNextNumber(); goniometerTiltAxial[0]= gd.getNextNumber();
goniometerTiltAxial[1]= gd.getNextNumber(); goniometerTiltAxial[1]= gd.getNextNumber();
goniometerTiltAxial[2]= gd.getNextNumber();
} }
double [][][] hintGrid=estimateGridOnSensor( double [][][] hintGrid=estimateGridOnSensor(
fittingStrategy.distortionCalibrationData.getImageStation(numGridImage), // station number fittingStrategy.distortionCalibrationData.getImageStation(numGridImage), // station number
fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel, fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel,
goniometerTiltAxial[0], // Tilt, goniometerHorizontal goniometerTiltAxial[0], // Tilt, goniometerHorizontal
goniometerTiltAxial[1], // Axial,goniometerAxial goniometerTiltAxial[1], // Axial,goniometerAxial
goniometerTiltAxial[2], // inter-axis angle
(useSetData?fittingStrategy.distortionCalibrationData.gIP[numGridImage].getSetNumber():-1), (useSetData?fittingStrategy.distortionCalibrationData.gIP[numGridImage].getSetNumber():-1),
true // filter border true // filter border
); );
...@@ -3107,6 +3115,7 @@ For each point in the image ...@@ -3107,6 +3115,7 @@ For each point in the image
int subCamera, int subCamera,
double goniometerHorizontal, // Tilt double goniometerHorizontal, // Tilt
double goniometerAxial, // Axial double goniometerAxial, // Axial
double goniometerInterAxis, // interAxisAngle
int imageSet, int imageSet,
boolean filterBorder){ boolean filterBorder){
double maxRelativeRadius=this.hintedMaxRelativeRadius; // make adjustable double maxRelativeRadius=this.hintedMaxRelativeRadius; // make adjustable
...@@ -3126,6 +3135,11 @@ For each point in the image ...@@ -3126,6 +3135,11 @@ For each point in the image
int goniometerAxialIndex=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getGoniometerAxialIndex(); int goniometerAxialIndex=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getGoniometerAxialIndex();
parVector[goniometerAxialIndex]= goniometerAxial; 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 sensorWidth=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getSensorWidth(subCamera);
int sensorHeight=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getSensorHeight(subCamera); int sensorHeight=fittingStrategy.distortionCalibrationData.eyesisCameraParameters.getSensorHeight(subCamera);
System.out.println("estimateGridOnSensor(): subCamera="+subCamera+", goniometerHorizontal="+goniometerHorizontal+", goniometerAxial="+goniometerAxial); System.out.println("estimateGridOnSensor(): subCamera="+subCamera+", goniometerHorizontal="+goniometerHorizontal+", goniometerAxial="+goniometerAxial);
...@@ -9842,7 +9856,7 @@ M * V = B ...@@ -9842,7 +9856,7 @@ M * V = B
distortionCalibrationData.gIS[numSet].goniometerAxial=Double.NaN; distortionCalibrationData.gIS[numSet].goniometerAxial=Double.NaN;
distortionCalibrationData.gIS[numSet].goniometerTilt= Double.NaN; distortionCalibrationData.gIS[numSet].goniometerTilt= Double.NaN;
// re-estimate orientation // 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; if ((ta==null) || Double.isNaN(ta[0]) || Double.isNaN(ta[1])) return false;
return true; return true;
} }
......
...@@ -1254,6 +1254,7 @@ public class EyesisAberrations { ...@@ -1254,6 +1254,7 @@ public class EyesisAberrations {
distortions.fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel, // subCamera, distortions.fittingStrategy.distortionCalibrationData.gIP[numGridImage].channel, // subCamera,
Double.NaN, // goniometerHorizontal, - not used Double.NaN, // goniometerHorizontal, - not used
Double.NaN, // goniometerAxial, - not used Double.NaN, // goniometerAxial, - not used
Double.NaN, // inter-axis angle, - not used ?
distortions.fittingStrategy.distortionCalibrationData.gIP[numGridImage].getSetNumber(), //imageSet, distortions.fittingStrategy.distortionCalibrationData.gIP[numGridImage].getSetNumber(), //imageSet,
true); //filterBorder) true); //filterBorder)
hintTolerance=5.0; // TODO:set from configurable parameter hintTolerance=5.0; // TODO:set from configurable parameter
......
...@@ -1136,6 +1136,7 @@ import org.apache.commons.configuration.XMLConfiguration; ...@@ -1136,6 +1136,7 @@ import org.apache.commons.configuration.XMLConfiguration;
// public int getNumSubCameras (){return (this.eyesisSubCameras==null)?0:this.eyesisSubCameras.length;} // public int getNumSubCameras (){return (this.eyesisSubCameras==null)?0:this.eyesisSubCameras.length;}
public int getGoniometerHorizontalIndex(){return 6;} public int getGoniometerHorizontalIndex(){return 6;}
public int getGoniometerAxialIndex(){return 7;} public int getGoniometerAxialIndex(){return 7;}
public int getInterAxisAngleIndex(){return 9;}
public int getSensorWidth() { return this.sensorWidth;} public int getSensorWidth() { return this.sensorWidth;}
public int getSensorHeight() { return this.sensorHeight;} public int getSensorHeight() { return this.sensorHeight;}
public int getSensorWidth(int subCam) { return this.sensorWidth;} // for the future? different sensors public int getSensorWidth(int subCam) { return this.sensorWidth;} // for the future? different sensors
......
...@@ -598,6 +598,7 @@ horizontal axis: ...@@ -598,6 +598,7 @@ horizontal axis:
subCam, subCam,
goniometerTiltAxial[0], // Tilt, goniometerHorizontal goniometerTiltAxial[0], // Tilt, goniometerHorizontal
goniometerTiltAxial[1], // Axial,goniometerAxial goniometerTiltAxial[1], // Axial,goniometerAxial
goniometerTiltAxial[2], // inter-axis angle
-1, // use camera parameters, not imageSet -1, // use camera parameters, not imageSet
true // filter border 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