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
71aa98de
Commit
71aa98de
authored
Aug 02, 2017
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction scale
parent
6bc620fb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
45 deletions
+59
-45
AlignmentCorrection.java
src/main/java/AlignmentCorrection.java
+48
-40
EyesisCorrectionParameters.java
src/main/java/EyesisCorrectionParameters.java
+6
-1
GeometryCorrection.java
src/main/java/GeometryCorrection.java
+5
-4
No files found.
src/main/java/AlignmentCorrection.java
View file @
71aa98de
...
@@ -1876,7 +1876,10 @@ B = |+dy0 -dy1 -2*dy3 |
...
@@ -1876,7 +1876,10 @@ B = |+dy0 -dy1 -2*dy3 |
}
}
// create list for infinity data
// create list for infinity data
ArrayList
<
Sample
>
inf_samples_list
=
selectInfinityTiles
(
// /clt_parameters.ly_inf_en,
ArrayList
<
Sample
>
inf_samples_list
;
if
(
clt_parameters
.
ly_inf_en
)
{
inf_samples_list
=
selectInfinityTiles
(
clt_parameters
.
fcorr_radius
,
// final double fcorr_radius,
clt_parameters
.
fcorr_radius
,
// final double fcorr_radius,
clt_parameters
.
fcorr_inf_vert
,
// final boolean use_vertical,
clt_parameters
.
fcorr_inf_vert
,
// final boolean use_vertical,
0.0
,
// any > 0.0
0.0
,
// any > 0.0
...
@@ -1922,6 +1925,11 @@ B = |+dy0 -dy1 -2*dy3 |
...
@@ -1922,6 +1925,11 @@ B = |+dy0 -dy1 -2*dy3 |
for
(
Sample
s:
inf_samples_list
)
{
for
(
Sample
s:
inf_samples_list
)
{
s
.
weight
*=
weights
[
0
];
s
.
weight
*=
weights
[
0
];
}
}
}
else
{
inf_samples_list
=
new
ArrayList
<
Sample
>();
// do not use infinity at all
}
///-----
// Supplement list with the lazy eye scans data - use all tiles
// Supplement list with the lazy eye scans data - use all tiles
for
(
int
nTile
=
0
;
nTile
<
num_tiles
;
nTile
++)
if
(
center_mask
[
nTile
])
{
for
(
int
nTile
=
0
;
nTile
<
num_tiles
;
nTile
++)
if
(
center_mask
[
nTile
])
{
...
@@ -1995,7 +2003,7 @@ B = |+dy0 -dy1 -2*dy3 |
...
@@ -1995,7 +2003,7 @@ B = |+dy0 -dy1 -2*dy3 |
System
.
out
.
println
(
corr_vector
.
toString
());
System
.
out
.
println
(
corr_vector
.
toString
());
}
}
if
(
apply_extrinsic
){
if
(
apply_extrinsic
){
qc
.
geometryCorrection
.
getCorrVector
().
incrementVector
(
corr_vector
);
qc
.
geometryCorrection
.
getCorrVector
().
incrementVector
(
corr_vector
,
clt_parameters
.
ly_corr_scale
);
if
(
debugLevel
>
-
1
){
if
(
debugLevel
>
-
1
){
System
.
out
.
println
(
"New extrinsic corrections:"
);
System
.
out
.
println
(
"New extrinsic corrections:"
);
System
.
out
.
println
(
qc
.
geometryCorrection
.
getCorrVector
().
toString
());
System
.
out
.
println
(
qc
.
geometryCorrection
.
getCorrVector
().
toString
());
...
...
src/main/java/EyesisCorrectionParameters.java
View file @
71aa98de
...
@@ -2050,7 +2050,7 @@ public class EyesisCorrectionParameters {
...
@@ -2050,7 +2050,7 @@ public class EyesisCorrectionParameters {
public
double
ly_disp_var
=
0.5
;
// 2; // Maximal full disparity difference to 8 neighbors
public
double
ly_disp_var
=
0.5
;
// 2; // Maximal full disparity difference to 8 neighbors
public
double
ly_inf_frac
=
0.5
;
// Relative weight of infinity calibration data
public
double
ly_inf_frac
=
0.5
;
// Relative weight of infinity calibration data
public
boolean
ly_on_scan
=
true
;
// Calculate and apply lazy eye correction after disparity scan (poly or extrinsic)
public
boolean
ly_on_scan
=
true
;
// Calculate and apply lazy eye correction after disparity scan (poly or extrinsic)
public
boolean
ly_inf_en
=
true
;
// Simultaneously correct disparity at infinity (both poly and extrinsic)
public
boolean
ly_inf_en
=
false
;
//
true; // Simultaneously correct disparity at infinity (both poly and extrinsic)
public
boolean
ly_inf_force
=
false
;
// Force convergence correction during extrinsic, even with no infinity data
public
boolean
ly_inf_force
=
false
;
// Force convergence correction during extrinsic, even with no infinity data
public
boolean
ly_poly
=
false
;
// Use polynomial correction, false - correct tilt/azimuth/roll of each sensor
public
boolean
ly_poly
=
false
;
// Use polynomial correction, false - correct tilt/azimuth/roll of each sensor
...
@@ -2060,6 +2060,7 @@ public class EyesisCorrectionParameters {
...
@@ -2060,6 +2060,7 @@ public class EyesisCorrectionParameters {
public
double
lyf_frac_keep
=
0.5
;
// Keep best fit samples, discard worst
public
double
lyf_frac_keep
=
0.5
;
// Keep best fit samples, discard worst
public
int
lyf_min_samples
=
5
;
// Minimal number of tiles remaining in the sample
public
int
lyf_min_samples
=
5
;
// Minimal number of tiles remaining in the sample
public
boolean
lyf_norm_center
=
true
;
// Replace samples with a single average with equal weight
public
boolean
lyf_norm_center
=
true
;
// Replace samples with a single average with equal weight
public
double
ly_corr_scale
=
1.0
;
// Scale calculated correction vector
// old fcorr parameters, reuse?
// old fcorr parameters, reuse?
// public int fcorr_sample_size = 32; // Use square this size side to detect outliers
// public int fcorr_sample_size = 32; // Use square this size side to detect outliers
...
@@ -2695,6 +2696,7 @@ public class EyesisCorrectionParameters {
...
@@ -2695,6 +2696,7 @@ public class EyesisCorrectionParameters {
properties
.
setProperty
(
prefix
+
"lyf_frac_keep"
,
this
.
lyf_frac_keep
+
""
);
properties
.
setProperty
(
prefix
+
"lyf_frac_keep"
,
this
.
lyf_frac_keep
+
""
);
properties
.
setProperty
(
prefix
+
"lyf_min_samples"
,
this
.
lyf_min_samples
+
""
);
properties
.
setProperty
(
prefix
+
"lyf_min_samples"
,
this
.
lyf_min_samples
+
""
);
properties
.
setProperty
(
prefix
+
"lyf_norm_center"
,
this
.
lyf_norm_center
+
""
);
properties
.
setProperty
(
prefix
+
"lyf_norm_center"
,
this
.
lyf_norm_center
+
""
);
properties
.
setProperty
(
prefix
+
"ly_corr_scale"
,
this
.
ly_corr_scale
+
""
);
properties
.
setProperty
(
prefix
+
"corr_magic_scale"
,
this
.
corr_magic_scale
+
""
);
properties
.
setProperty
(
prefix
+
"corr_magic_scale"
,
this
.
corr_magic_scale
+
""
);
...
@@ -3282,6 +3284,7 @@ public class EyesisCorrectionParameters {
...
@@ -3282,6 +3284,7 @@ public class EyesisCorrectionParameters {
if
(
properties
.
getProperty
(
prefix
+
"lyf_frac_keep"
)!=
null
)
this
.
lyf_frac_keep
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"lyf_frac_keep"
));
if
(
properties
.
getProperty
(
prefix
+
"lyf_frac_keep"
)!=
null
)
this
.
lyf_frac_keep
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"lyf_frac_keep"
));
if
(
properties
.
getProperty
(
prefix
+
"lyf_min_samples"
)!=
null
)
this
.
lyf_min_samples
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"lyf_min_samples"
));
if
(
properties
.
getProperty
(
prefix
+
"lyf_min_samples"
)!=
null
)
this
.
lyf_min_samples
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"lyf_min_samples"
));
if
(
properties
.
getProperty
(
prefix
+
"lyf_norm_center"
)!=
null
)
this
.
lyf_norm_center
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"lyf_norm_center"
));
if
(
properties
.
getProperty
(
prefix
+
"lyf_norm_center"
)!=
null
)
this
.
lyf_norm_center
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"lyf_norm_center"
));
if
(
properties
.
getProperty
(
prefix
+
"ly_corr_scale"
)!=
null
)
this
.
ly_corr_scale
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"ly_corr_scale"
));
if
(
properties
.
getProperty
(
prefix
+
"corr_magic_scale"
)!=
null
)
this
.
corr_magic_scale
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"corr_magic_scale"
));
if
(
properties
.
getProperty
(
prefix
+
"corr_magic_scale"
)!=
null
)
this
.
corr_magic_scale
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"corr_magic_scale"
));
...
@@ -3886,6 +3889,7 @@ public class EyesisCorrectionParameters {
...
@@ -3886,6 +3889,7 @@ public class EyesisCorrectionParameters {
gd
.
addNumericField
(
"Keep best fit samples, discard worst"
,
this
.
lyf_frac_keep
,
3
);
gd
.
addNumericField
(
"Keep best fit samples, discard worst"
,
this
.
lyf_frac_keep
,
3
);
gd
.
addNumericField
(
"Minimal number of tiles remaining in the sample"
,
this
.
lyf_min_samples
,
0
);
gd
.
addNumericField
(
"Minimal number of tiles remaining in the sample"
,
this
.
lyf_min_samples
,
0
);
gd
.
addCheckbox
(
"Replace samples with a single average with equal weight"
,
this
.
lyf_norm_center
);
gd
.
addCheckbox
(
"Replace samples with a single average with equal weight"
,
this
.
lyf_norm_center
);
gd
.
addNumericField
(
"Scale calculated correction vector"
,
this
.
ly_corr_scale
,
3
);
gd
.
addMessage
(
"---"
);
gd
.
addMessage
(
"---"
);
// gd.addNumericField("Use square this size side to detect outliers", this.fcorr_sample_size, 0);
// gd.addNumericField("Use square this size side to detect outliers", this.fcorr_sample_size, 0);
// gd.addNumericField("Keep tiles only if there are more in each square", this.fcorr_mintiles, 0);
// gd.addNumericField("Keep tiles only if there are more in each square", this.fcorr_mintiles, 0);
...
@@ -4510,6 +4514,7 @@ public class EyesisCorrectionParameters {
...
@@ -4510,6 +4514,7 @@ public class EyesisCorrectionParameters {
this
.
lyf_frac_keep
=
gd
.
getNextNumber
();
this
.
lyf_frac_keep
=
gd
.
getNextNumber
();
this
.
lyf_min_samples
=
(
int
)
gd
.
getNextNumber
();
this
.
lyf_min_samples
=
(
int
)
gd
.
getNextNumber
();
this
.
lyf_norm_center
=
gd
.
getNextBoolean
();
this
.
lyf_norm_center
=
gd
.
getNextBoolean
();
this
.
ly_corr_scale
=
gd
.
getNextNumber
();
// this.fcorr_sample_size= (int)gd.getNextNumber();
// this.fcorr_sample_size= (int)gd.getNextNumber();
// this.fcorr_mintiles= (int) gd.getNextNumber();
// this.fcorr_mintiles= (int) gd.getNextNumber();
// this.fcorr_reloutliers= gd.getNextNumber();
// this.fcorr_reloutliers= gd.getNextNumber();
...
...
src/main/java/GeometryCorrection.java
View file @
71aa98de
...
@@ -215,16 +215,17 @@ public class GeometryCorrection {
...
@@ -215,16 +215,17 @@ public class GeometryCorrection {
return
s
;
return
s
;
}
}
public
void
incrementVector
(
double
[]
incr
)
public
void
incrementVector
(
double
[]
incr
,
double
scale
)
{
{
for
(
int
i
=
0
;
i
<
incr
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
incr
.
length
;
i
++){
vector
[
i
]+=
incr
[
i
]
;
vector
[
i
]+=
incr
[
i
]
*
scale
;
}
}
}
}
public
void
incrementVector
(
CorrVector
incr
)
public
void
incrementVector
(
CorrVector
incr
,
double
scale
)
{
{
incrementVector
(
incr
.
toArray
());
incrementVector
(
incr
.
toArray
()
,
scale
);
}
}
...
...
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