for (int imgIndex=0;imgIndex<numImages;imgIndex++){
int imgNum=imgIndices[imgIndex]; // image number
// sb.append("\t"+IJ.d2s(fittingStrategy.distortionCalibrationData.pars[imgNum][parNumber],3+extraDecimals)); // TODO: make an array of decimals per parameter
@@ -5334,7 +5334,7 @@ List calibration
int iState=(state[0]?1:0)+(state[1]?2:0);
GenericDialog gd = new GenericDialog("Levenberg-Marquardt algorithm step");
imp.setProperty("comment_arrays", "Array corrections from acquired image to radially distorted, in pixels");
@@ -5984,17 +5988,28 @@ List calibration
imp.setProperty("px0", ""+subCam.px0);
imp.setProperty("py0", ""+subCam.py0);
imp.setProperty("comment_azimuth", "lens center azimuth, CW from top, degrees");
imp.setProperty("height", ""+subCam.height);
imp.setProperty("comment_elevation", "lens elevation from horizontal, positive - above horizon, degrees");
imp.setProperty("elevation", ""+subCam.theta);
imp.setProperty("comment_roll", "lens rotation around the lens axis. Positive - CW looking to the target, degrees");
imp.setProperty("roll", ""+subCam.psi);
imp.setProperty("comment_cartesian", "Use cartesian coordinates for the sensor in the camera CS (forward, right,aheading), instead of (radius, azimuth, heading)");
// public double azimuth; // azimuth of the lens entrance pupil center, degrees, clockwise looking from top
// public double radius; // mm, distance from the rotation axis
// public double height; // mm, up - from the origin point
// public double phi; // degrees, optical axis from azimuth/r vector, clockwise heading
// public double theta; // degrees, optical axis from the eyesis horizon, positive - up elevation
// public double psi; // degrees, rotation (of the sensor) around the optical axis. Positive if camera is rotated clockwise looking to the target roll
publicdoublefocalLength=4.5;
publicdoublepixelSize=2.2;//um
publicdoubledistortionRadius=2.8512;// mm - half width of the sensor
publicdoubledistortionA8=0.0;//r^8 (normalized to focal length or to sensor half width?)
publicdoubledistortionA7=0.0;//r^7 (normalized to focal length or to sensor half width?)
publicdoubledistortionA6=0.0;//r^6 (normalized to focal length or to sensor half width?)
publicdoubledistortionA5=0.0;//r^5 (normalized to focal length or to sensor half width?)
publicdoubledistortionA=0.0;// r^4 (normalized to focal length or to sensor half width?)
publicdoubledistortionB=0.0;// r^3
publicdoubledistortionC=0.0;// r^2
publicdoublepx0=1296.0;// center of the lens on the sensor, pixels
publicdoublepy0=968.0;// center of the lens on the sensor, pixels
privatedouble[]rByRDist=null;
privatedoublestepR=0.001;
privatedoublemaxR=2.0;// calculate up to this*distortionRadius
publicvoidsetDistortion(){
// imp.setProperty("distortion_formula", "(normalized by distortionRadius in mm) Rdist/R=A8*R^7+A7*R^6+A6*R^5+A5*R^4+A*R^3+B*R^2+C*R+(1-A6-A7-A6-A5-A-B-C)");