Commit 848f691d authored by Andrey Filippov's avatar Andrey Filippov

improved list of infinities

parent b6d753cb
......@@ -26,6 +26,9 @@
*/
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Properties;
import java.util.Set;
......@@ -6339,12 +6342,34 @@ public class EyesisCorrectionParameters {
if (infinity_distace_map == null){
infinity_distace_map = new HashMap<String,Double>();
}
class StringDouble{
String str;
double dbl;
StringDouble (String s, double d){
this.str = s;
this.dbl = d;
}
}
ArrayList<StringDouble> sd_list = new ArrayList<StringDouble>();
for (HashMap.Entry<String,Double> entry : infinity_distace_map.entrySet()){
sd_list.add(new StringDouble(entry.getKey(), entry.getValue()));
}
Collections.sort(sd_list, new Comparator<StringDouble>() {
@Override
public int compare(StringDouble lhs, StringDouble rhs) {
// -1 - less than, 1 - greater than, 0 - equal, not inverted for ascending disparity
return lhs.str.compareTo(rhs.str);
}
});
GenericDialog gd = new GenericDialog(title);
if (infinity_distace_map.size() > 0) {
gd.addMessage("Edit \"infinity\" (when mountains are too close) distance (in m), set == 0.0 to remove for the following");
gd.addMessage("Press \"Cancel\" to exit");
for (HashMap.Entry<String,Double> entry : infinity_distace_map.entrySet()){
gd.addNumericField(entry.getKey(), entry.getValue(), 1,6, "m");
// for (HashMap.Entry<String,Double> entry : infinity_distace_map.entrySet()){
for (StringDouble entry : sd_list){
gd.addNumericField(entry.str, entry.dbl, 1,6, "m");
}
}
gd.addMessage("Add new infinity correction");
......@@ -6355,12 +6380,28 @@ public class EyesisCorrectionParameters {
gd.showDialog();
if (gd.wasCanceled()) return false;
HashMap<String,Double> new_map = new HashMap<String,Double>();
/*
for (HashMap.Entry<String,Double> entry : infinity_distace_map.entrySet()){
double d = gd.getNextNumber();
if (d != 0.0) {
new_map.put(entry.getKey(),d);
}
}
for (StringDouble entry : sd_list){
gd.addNumericField(entry.str, entry.dbl, 1,6, "m");
}
*/
for (StringDouble entry : sd_list){
double d = gd.getNextNumber();
if (d != 0.0) {
new_map.put(entry.str,d);
}
}
String new_ts = gd.getNextString();
double d = gd.getNextNumber();
if (gd.getNextBoolean()){
......
......@@ -921,10 +921,10 @@ public class GeometryCorrection {
"Directly to the right - 0°, directly up - 90°, ...");
gd.addNumericField("Auxilliary camera forward from the plane of the main one (not used)", this.aux_z, 3,6,"mm",
"Distance from the plane perpendicualr to the main camera axis to the auxiliary camera (positive for aux moved forward)");
gd.addNumericField("Auxilliary camera azimuth (positive - to the right)", par_scales[AUX_AZIMUTH_INDEX] * this.aux_azimuth, 3,6,"pix",
"Relative to the main camera axis, shift of the center of the image in pixels");
gd.addNumericField("Auxilliary camera tilt (positive - looking up)", par_scales[AUX_TILT_INDEX] * this.aux_tilt, 3,6,"pix",
"Relative to the main camera, shift of the center of the image in pixels");
gd.addNumericField("Auxilliary camera azimuth (positive - image to the right)", par_scales[AUX_AZIMUTH_INDEX] * this.aux_azimuth, 3,6,"pix",
"Positive - converge more: aux (right) camera to the left, image - to the right");
gd.addNumericField("Auxilliary camera tilt (positive - move aux image up)", par_scales[AUX_TILT_INDEX] * this.aux_tilt, 3,6,"pix",
"Positive: aux looks down, image moves up");
gd.addNumericField("Auxilliary camera roll (positive - clockwise)", par_scales[AUX_ROLL_INDEX] * this.aux_roll, 3,6,"pix",
"Roll of a camera as a whole relative to the main camera, shift at the image half-width from the center");
gd.addNumericField("Relative zoom - difference from 1.0 in parts parts per 1/1000", par_scales[AUX_ZOOM_INDEX] * this.aux_zoom, 3,6,"pix",
......@@ -947,8 +947,8 @@ public class GeometryCorrection {
System.out.println(" Baseline "+ this.baseline +"mm");
System.out.println(" Angle to the aux camera from the main "+ (180.0/Math.PI*this.aux_angle)+"°");
System.out.println("Auxilliary camera forward from the plane of the main one (not used) "+ this.aux_z +"mm");
System.out.println(" Auxilliary camera azimuth (positive - to the right) "+ (par_scales[AUX_AZIMUTH_INDEX] * this.aux_azimuth) + "pix");
System.out.println(" Auxilliary camera tilt (positive - looking up) "+ (par_scales[AUX_TILT_INDEX] * this.aux_tilt)+"pix");
System.out.println("Auxilliary camera azimuth (positive: camera - left, image - right) "+ (par_scales[AUX_AZIMUTH_INDEX] * this.aux_azimuth) + "pix");
System.out.println(" Auxilliary camera tilt (positive: aux camera - down, image - up) "+ (par_scales[AUX_TILT_INDEX] * this.aux_tilt)+"pix");
System.out.println(" Auxilliary camera roll (positive - clockwise) "+ (par_scales[AUX_ROLL_INDEX] * this.aux_roll)+"pix");
System.out.println(" Relative zoom - difference from 1.0 in parts parts per 1/1000 "+ (par_scales[AUX_ZOOM_INDEX] * this.aux_zoom) +"pix");
}
......
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