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
67228555
Commit
67228555
authored
Jun 12, 2017
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tweaking
parent
d059a2ac
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
248 additions
and
28 deletions
+248
-28
LinkPlanes.java
src/main/java/LinkPlanes.java
+175
-20
TilePlanes.java
src/main/java/TilePlanes.java
+26
-3
TileProcessor.java
src/main/java/TileProcessor.java
+47
-5
No files found.
src/main/java/LinkPlanes.java
View file @
67228555
This diff is collapsed.
Click to expand it.
src/main/java/TilePlanes.java
View file @
67228555
...
@@ -237,7 +237,7 @@ public class TilePlanes {
...
@@ -237,7 +237,7 @@ public class TilePlanes {
double
[]
px_py
=
getCenterPxPy
();
double
[]
px_py
=
getCenterPxPy
();
if
(
zxy
!=
null
)
s
+=
String
.
format
(
"\nzxy = [%8.3f, %8.3f, %8.3f] (pix)"
,
zxy
[
0
],
zxy
[
1
]+
px_py
[
0
],
zxy
[
2
]+
px_py
[
1
]);
if
(
zxy
!=
null
)
s
+=
String
.
format
(
"\nzxy = [%8.3f, %8.3f, %8.3f] (pix)"
,
zxy
[
0
],
zxy
[
1
]+
px_py
[
0
],
zxy
[
2
]+
px_py
[
1
]);
else
s
+=
"\nzxy = null"
;
else
s
+=
"\nzxy = null"
;
if
(
values
!=
null
)
s
+=
String
.
format
(
", values = [%8.
3f, %8.3
f, %8.3f] pix^2"
,
values
[
0
],
values
[
1
],
values
[
2
]);
if
(
values
!=
null
)
s
+=
String
.
format
(
", values = [%8.
5f, %8.4
f, %8.3f] pix^2"
,
values
[
0
],
values
[
1
],
values
[
2
]);
else
s
+=
" values = null"
;
else
s
+=
" values = null"
;
if
(
vectors
!=
null
)
s
+=
String
.
format
(
"\nvectors = [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f]"
,
if
(
vectors
!=
null
)
s
+=
String
.
format
(
"\nvectors = [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f]"
,
vectors
[
0
][
0
],
vectors
[
0
][
1
],
vectors
[
0
][
2
],
vectors
[
1
][
0
],
vectors
[
1
][
1
],
vectors
[
1
][
2
],
vectors
[
2
][
0
],
vectors
[
2
][
1
],
vectors
[
2
][
2
]);
vectors
[
0
][
0
],
vectors
[
0
][
1
],
vectors
[
0
][
2
],
vectors
[
1
][
0
],
vectors
[
1
][
1
],
vectors
[
1
][
2
],
vectors
[
2
][
0
],
vectors
[
2
][
1
],
vectors
[
2
][
2
]);
...
@@ -247,7 +247,7 @@ public class TilePlanes {
...
@@ -247,7 +247,7 @@ public class TilePlanes {
else
s
+=
" normal = null"
;
else
s
+=
" normal = null"
;
if
(
wxyz
!=
null
)
s
+=
String
.
format
(
"\nwxyz = [%8.2f, %8.2f, %8.2f] (m)"
,
wxyz
[
0
],
wxyz
[
1
],
wxyz
[
2
]);
if
(
wxyz
!=
null
)
s
+=
String
.
format
(
"\nwxyz = [%8.2f, %8.2f, %8.2f] (m)"
,
wxyz
[
0
],
wxyz
[
1
],
wxyz
[
2
]);
else
s
+=
"\nwxyz = null"
;
else
s
+=
"\nwxyz = null"
;
if
(
wvalues
!=
null
)
s
+=
String
.
format
(
" wvals = [%8.
2f, %8.2
f, %8.2f] (m^2)"
,
wvalues
[
0
],
wvalues
[
1
],
wvalues
[
2
]);
if
(
wvalues
!=
null
)
s
+=
String
.
format
(
" wvals = [%8.
4f, %8.3
f, %8.2f] (m^2)"
,
wvalues
[
0
],
wvalues
[
1
],
wvalues
[
2
]);
else
s
+=
" wvals = null"
;
else
s
+=
" wvals = null"
;
if
(
wvectors
!=
null
)
s
+=
String
.
format
(
"\nwvect = [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f]"
,
if
(
wvectors
!=
null
)
s
+=
String
.
format
(
"\nwvect = [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f]"
,
wvectors
[
0
][
0
],
wvectors
[
0
][
1
],
wvectors
[
0
][
2
],
wvectors
[
1
][
0
],
wvectors
[
1
][
1
],
wvectors
[
1
][
2
],
wvectors
[
2
][
0
],
wvectors
[
2
][
1
],
wvectors
[
2
][
2
]);
wvectors
[
0
][
0
],
wvectors
[
0
][
1
],
wvectors
[
0
][
2
],
wvectors
[
1
][
0
],
wvectors
[
1
][
1
],
wvectors
[
1
][
2
],
wvectors
[
2
][
0
],
wvectors
[
2
][
1
],
wvectors
[
2
][
2
]);
...
@@ -287,7 +287,30 @@ public class TilePlanes {
...
@@ -287,7 +287,30 @@ public class TilePlanes {
nonexclusiveStarEq
.
world_xyz
[
0
],
nonexclusiveStarEq
.
world_xyz
[
1
],
nonexclusiveStarEq
.
world_xyz
[
2
]);
nonexclusiveStarEq
.
world_xyz
[
0
],
nonexclusiveStarEq
.
world_xyz
[
1
],
nonexclusiveStarEq
.
world_xyz
[
2
]);
else
s
+=
" normal = null"
;
else
s
+=
" normal = null"
;
}
}
s
+=
"\n\n"
;
s
+=
"\n"
;
if
(
link_costs
!=
null
){
for
(
int
dir
=
0
;
dir
<
link_costs
.
length
;
dir
++){
s
+=
String
.
format
(
"dir=%d: "
,
dir
);
if
(
link_costs
[
dir
]
!=
null
)
{
int
best_np
=
-
1
;
for
(
int
np
=
0
;
np
<
link_costs
[
dir
].
length
;
np
++){
if
(!
Double
.
isNaN
(
link_costs
[
dir
][
np
])
&&
((
best_np
<
0
)
||
(
link_costs
[
dir
][
np
]
<
link_costs
[
dir
][
best_np
]))){
best_np
=
np
;
}
}
for
(
int
np
=
0
;
np
<
link_costs
[
dir
].
length
;
np
++){
if
(
np
==
best_np
){
s
+=
String
.
format
(
"%7.3f[%d] "
,
link_costs
[
dir
][
np
],
np
);
}
else
{
s
+=
String
.
format
(
"%7.3f "
,
link_costs
[
dir
][
np
]);
}
}
}
s
+=
"\n"
;
}
}
s
+=
"\n"
;
return
s
;
return
s
;
}
}
...
...
src/main/java/TileProcessor.java
View file @
67228555
...
@@ -3317,19 +3317,33 @@ public class TileProcessor {
...
@@ -3317,19 +3317,33 @@ public class TileProcessor {
clt_parameters
.
tileX
,
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
clt_parameters
.
tileY
);
// * Possible problem is that "normalizing" merge quality for low weights is not applicable for "star" plane that include neighhbors
// * Switch to a single "cost" function (costSameTileConnectionsAlt())
// Still - how to merge stray tiles that do not have neighbors/star? Still merge them "old way" (costSameTileConnections()) if at least 1 does not
// have a "star"
// double [][][][][][] merge_cost_data =
// double [][][][][][] merge_cost_data =
lp
.
costSameTileConnections
(
lp
.
costSameTileConnections
(
false
,
// final boolean ignore_weights,
st
.
planes
,
// final TilePlanes.PlaneData [][] planes,
1000.0
,
// final double threshold_worst,
1000.0
,
//final double threshold_world_worst,
st
.
planes
,
// ffinal TilePlanes.PlaneData [][] planes,
merge_candidates
,
// final int [][][] merge_candidates,
merge_candidates
,
// final int [][][] merge_candidates,
plane_nooverlaps
,
// final boolean [][][] valid_candidates, // will be updated
plane_nooverlaps
,
// final boolean [][][] valid_candidates, // will be updated
2
,
// -1, // debugLevel, // final int debugLevel)
2
,
// -1, // debugLevel, // final int debugLevel)
clt_parameters
.
tileX
,
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
clt_parameters
.
tileY
);
// System.out.println("merge_cost_data.length = " + merge_cost_data.length);
// System.out.println("merge_cost_data.length = " + merge_cost_data.length);
lp
.
costSameTileConnectionsAlt
(
5.0
,
// final double threshold,
10.0
,
// final double threshold_nostar,
st
.
planes
,
// final TilePlanes.PlaneData [][] planes,
merge_candidates
,
// final int [][][] merge_candidates,
plane_nooverlaps
,
// final boolean [][][] valid_candidates, // will be updated
2
,
// -1, // debugLevel, // final int debugLevel)
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
int
[][][]
merge_groups
=
lp
.
extractMergeSameTileGroups
(
int
[][][]
merge_groups
=
lp
.
extractMergeSameTileGroups
(
st
.
planes
,
// final TilePlanes.PlaneData [][] planes,
st
.
planes
,
// final TilePlanes.PlaneData [][] planes,
merge_candidates
,
// final int [][][] merge_candidates,
merge_candidates
,
// final int [][][] merge_candidates,
...
@@ -3805,6 +3819,12 @@ public class TileProcessor {
...
@@ -3805,6 +3819,12 @@ public class TileProcessor {
0
,
// 1,// 0, // final int debugLevel)
0
,
// 1,// 0, // final int debugLevel)
clt_parameters
.
tileX
,
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
clt_parameters
.
tileY
);
lp
.
interPlaneCosts
(
st
.
planes_mod
,
// final TilePlanes.PlaneData [][] planes,
2
,
// -1, // debugLevel, // final int debugLevel)
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
// recalculate links? more smooth?
}
else
{
}
else
{
st
.
planes_mod
=
st
.
planes
;
// just use the measured ones
st
.
planes_mod
=
st
.
planes
;
// just use the measured ones
...
@@ -3824,6 +3844,22 @@ public class TileProcessor {
...
@@ -3824,6 +3844,22 @@ public class TileProcessor {
clt_parameters
.
tileY
);
clt_parameters
.
tileY
);
int
[]
wh
=
st
.
getShowPlanesWidthHeight
();
int
[]
wh
=
st
.
getShowPlanesWidthHeight
();
double
[][]
plane_data_nonan_meas
=
st
.
getShowPlanes
(
st
.
getPlanes
(),
clt_parameters
.
plMinStrength
,
// minWeight,
clt_parameters
.
plMaxEigen
,
// maxEigen,
clt_parameters
.
plDispNorm
,
false
,
//boolean use_NaN)
0.0
,
10.0
);
double
[][]
plane_data_nan_meas
=
st
.
getShowPlanes
(
st
.
getPlanes
(),
clt_parameters
.
plMinStrength
,
// minWeight,
clt_parameters
.
plMaxEigen
,
// maxEigen,
clt_parameters
.
plDispNorm
,
true
,
//boolean use_NaN)
0.0
,
10.0
);
double
[][]
plane_data_nonan
=
st
.
getShowPlanes
(
double
[][]
plane_data_nonan
=
st
.
getShowPlanes
(
(
planes_mod
!=
null
)
?
st
.
getPlanesMod
():
st
.
getPlanes
(),
(
planes_mod
!=
null
)
?
st
.
getPlanesMod
():
st
.
getPlanes
(),
clt_parameters
.
plMinStrength
,
// minWeight,
clt_parameters
.
plMinStrength
,
// minWeight,
...
@@ -3840,8 +3876,14 @@ public class TileProcessor {
...
@@ -3840,8 +3876,14 @@ public class TileProcessor {
true
,
//boolean use_NaN)
true
,
//boolean use_NaN)
0.0
,
0.0
,
10.0
);
10.0
);
double
[][]
plane_data
=
new
double
[
plane_data_nonan
.
length
+
plane_data_nan
.
length
+
3
][];
double
[][]
plane_data
=
new
double
[
plane_data_nonan
_meas
.
length
+
plane_data_nan_meas
.
length
+
plane_data_nonan
.
length
+
plane_data_nan
.
length
+
3
][];
int
indx
=
0
;
int
indx
=
0
;
for
(
int
i
=
0
;
i
<
plane_data_nonan_meas
.
length
;
i
++){
plane_data
[
indx
++]
=
plane_data_nonan_meas
[
i
];
}
for
(
int
i
=
0
;
i
<
plane_data_nan_meas
.
length
;
i
++){
plane_data
[
indx
++]
=
plane_data_nan_meas
[
i
];
}
for
(
int
i
=
0
;
i
<
plane_data_nonan
.
length
;
i
++){
for
(
int
i
=
0
;
i
<
plane_data_nonan
.
length
;
i
++){
plane_data
[
indx
++]
=
plane_data_nonan
[
i
];
plane_data
[
indx
++]
=
plane_data_nonan
[
i
];
}
}
...
...
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