Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
848f691d
Commit
848f691d
authored
Jul 20, 2018
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved list of infinities
parent
b6d753cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
8 deletions
+49
-8
EyesisCorrectionParameters.java
src/main/java/EyesisCorrectionParameters.java
+43
-2
GeometryCorrection.java
src/main/java/GeometryCorrection.java
+6
-6
No files found.
src/main/java/EyesisCorrectionParameters.java
View file @
848f691d
...
...
@@ -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()){
...
...
src/main/java/GeometryCorrection.java
View file @
848f691d
...
...
@@ -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"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment