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
076baece
Commit
076baece
authored
Jun 23, 2017
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on tiles assignment to planes
parent
9cfff83b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
827 additions
and
38 deletions
+827
-38
EyesisCorrectionParameters.java
src/main/java/EyesisCorrectionParameters.java
+89
-4
SurfaceData.java
src/main/java/SurfaceData.java
+1
-1
TilePlanes.java
src/main/java/TilePlanes.java
+6
-2
TileProcessor.java
src/main/java/TileProcessor.java
+114
-2
TileSurface.java
src/main/java/TileSurface.java
+617
-29
No files found.
src/main/java/EyesisCorrectionParameters.java
View file @
076baece
This diff is collapsed.
Click to expand it.
src/main/java/SurfaceData.java
View file @
076baece
/**
/**
**
**
** SurfaceData - represents rectangu
a
lar area with per-tile disparity
** SurfaceData - represents rectangular area with per-tile disparity
**
**
** Copyright (C) 2017 Elphel, Inc.
** Copyright (C) 2017 Elphel, Inc.
**
**
...
...
src/main/java/TilePlanes.java
View file @
076baece
...
@@ -104,7 +104,7 @@ public class TilePlanes {
...
@@ -104,7 +104,7 @@ public class TilePlanes {
boolean
preferDisparity
=
false
;
boolean
preferDisparity
=
false
;
// alternative "plane" calcu
al
tions in the world coordinates
// alternative "plane" calcu
la
tions in the world coordinates
double
[]
wxyz
=
null
;
// [3] - plane center point when calculated in world coordinates (x, y , z)
double
[]
wxyz
=
null
;
// [3] - plane center point when calculated in world coordinates (x, y , z)
double
[][]
wvectors
=
null
;
// [3][3] - eigenvectors calculated in the real world
double
[][]
wvectors
=
null
;
// [3][3] - eigenvectors calculated in the real world
double
[]
wvalues
=
null
;
// [3] -eigenvalues calculated in the real world
double
[]
wvalues
=
null
;
// [3] -eigenvalues calculated in the real world
...
@@ -3607,7 +3607,11 @@ public class TilePlanes {
...
@@ -3607,7 +3607,11 @@ public class TilePlanes {
}
}
copyNeib
(
this
,
pd
);
copyNeib
(
this
,
pd
);
pd
.
num_points
=
otherPd
.
num_points
;
// restore, maybe remove from copy_neib?
pd
.
num_points
=
otherPd
.
num_points
;
// restore, maybe remove from copy_neib?
// copy other data from this tile
pd
.
setMeasSelection
(
this
.
measuredSelection
);
if
(
this
.
measuredLayers
!=
null
)
pd
.
measuredLayers
=
this
.
measuredLayers
;
if
(
this
.
sel_mask
!=
null
)
pd
.
sel_mask
=
this
.
sel_mask
.
clone
();
copyStar
(
this
,
pd
);
return
pd
;
// make sure pd are updated // "this" is not used. Should it be used instead of pd?
return
pd
;
// make sure pd are updated // "this" is not used. Should it be used instead of pd?
}
}
...
...
src/main/java/TileProcessor.java
View file @
076baece
...
@@ -3128,7 +3128,7 @@ public class TileProcessor {
...
@@ -3128,7 +3128,7 @@ public class TileProcessor {
final
boolean
updateStatus
,
final
boolean
updateStatus
,
final
int
debugLevel
)
final
int
debugLevel
)
{
{
trimCLTPasses
();
// make possible to run this method multiple time - remove extra passes added by it last time
trimCLTPasses
();
// make possible to run this method multiple time
s
- remove extra passes added by it last time
CLTPass3d
scan_prev
=
clt_3d_passes
.
get
(
clt_3d_passes
.
size
()
-
1
);
// get last one
CLTPass3d
scan_prev
=
clt_3d_passes
.
get
(
clt_3d_passes
.
size
()
-
1
);
// get last one
// boolean show_st = clt_parameters.stShow || (debugLevel > 1);
// boolean show_st = clt_parameters.stShow || (debugLevel > 1);
SuperTiles
st
=
scan_prev
.
getSuperTiles
();
SuperTiles
st
=
scan_prev
.
getSuperTiles
();
...
@@ -3136,10 +3136,11 @@ public class TileProcessor {
...
@@ -3136,10 +3136,11 @@ public class TileProcessor {
if
(
tileSurface
==
null
){
if
(
tileSurface
==
null
){
return
false
;
return
false
;
}
}
/*
tileSurface.testSimpleConnected(
tileSurface.testSimpleConnected(
230, // clt_parameters.tileX,
230, // clt_parameters.tileX,
131);//clt_parameters.tileY);
131);//clt_parameters.tileY);
*/
double
[][][]
dispStrength
=
st
.
getDisparityStrengths
(
double
[][][]
dispStrength
=
st
.
getDisparityStrengths
(
clt_parameters
.
stMeasSel
);
// int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
clt_parameters
.
stMeasSel
);
// int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
...
@@ -3148,14 +3149,88 @@ public class TileProcessor {
...
@@ -3148,14 +3149,88 @@ public class TileProcessor {
clt_parameters
.
stMeasSel
);
// int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
clt_parameters
.
stMeasSel
);
// int stMeasSel) // = 1; // Select measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert)
// Reset/initialize assignments - if not done so yet or specifically requested
// Reset/initialize assignments - if not done so yet or specifically requested
boolean
first_run
=
!
tileSurface
.
isInit
()
||
clt_parameters
.
tsReset
;
tileSurface
.
InitTilesAssignment
(
tileSurface
.
InitTilesAssignment
(
clt_parameters
.
tsReset
,
clt_parameters
.
tsReset
,
dispStrength
,
// final double [][][] dispStrength,
dispStrength
,
// final double [][][] dispStrength,
tileSel
,
// final boolean [][] tileSel,
tileSel
,
// final boolean [][] tileSel,
debugLevel
);
// final int debugLevel,
debugLevel
);
// final int debugLevel,
// assign tiles that do not depend on other assigned tiles - single pass
// assign tiles that do not depend on other assigned tiles - single pass
int
[][]
tile_layers
=
tileSurface
.
getTileLayersCopy
();
int
[][]
tile_layers_single_surf
=
tileSurface
.
newTileLayers
(
tileSel
);
// final boolean [][] tileSel,)
int
[][]
tile_layers_planes
=
tileSurface
.
newTileLayers
(
tileSel
);
// final boolean [][] tileSel,)
int
[]
stats_single_surf
=
tileSurface
.
assignTilesToSingleSurface
(
tile_layers_single_surf
,
//final int [][] tileLayers,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
0
,
// -1, // debugLevel, // final int debugLevel)
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
System
.
out
.
print
(
"Assign the only surface :"
);
tileSurface
.
printStats
(
stats_single_surf
);
// grow the only surface assignments
if
(
clt_parameters
.
tsEnGrow
){
double
[]
growStrengths
=
new
double
[
tile_layers_single_surf
.
length
];
double
[]
contMinStrengths
=
new
double
[
tile_layers_single_surf
.
length
];
double
[]
growMaxDiffFar
=
new
double
[
tile_layers_single_surf
.
length
];
double
[]
growMaxDiffNear
=
new
double
[
tile_layers_single_surf
.
length
];
int
[][]
assign_conflicts
=
null
;
for
(
int
i
=
0
;
i
<
growStrengths
.
length
;
i
++){
growStrengths
[
i
]
=
clt_parameters
.
tsGrowStrength
;
// save all the same, later can use different for different types of correlation
contMinStrengths
[
i
]
=
clt_parameters
.
tsContStrength
;
growMaxDiffFar
[
i
]=
clt_parameters
.
tsContDiff
;
growMaxDiffNear
[
i
]=
clt_parameters
.
tsContDiff
;
if
((
tile_layers_single_surf
[
i
]
!=
null
)
&&
(
assign_conflicts
==
null
)){
assign_conflicts
=
new
int
[
tile_layers_single_surf
[
i
].
length
][];
}
}
stats_single_surf
=
tileSurface
.
growWeakAssigned
(
tile_layers_single_surf
,
//final int [][] tileLayers,
assign_conflicts
,
// final int [][] conflicts,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
growStrengths
,
// final double [] maxStrength,
(
clt_parameters
.
tsGrowStrong
?
contMinStrengths:
null
),
//final double [] minStrengthContinue,
(
clt_parameters
.
tsEnGrow
?
growMaxDiffFar:
null
),
// final double [] maxDiffFar, // null
(
clt_parameters
.
tsEnGrow
?
growMaxDiffNear:
null
),
// final double [] maxDiffNear, // null
clt_parameters
.
plDispNorm
,
// final double dispNorm, // disparity normalize (proportionally scale down disparity difference if above
dispStrength
,
// final double [][][] dispStrength,
2
,
// -1, // debugLevel, // final int debugLevel)
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
System
.
out
.
print
(
"growWeakAssigned():"
);
tileSurface
.
printStats
(
stats_single_surf
);
}
int
[]
stats_planes
=
tileSurface
.
assignPlanesTiles
(
true
,
// final boolean force,
tile_layers_planes
,
//final int [][] tileLayers,
st
.
planes_mod
,
// final TilePlanes.PlaneData[][] planes,
2
,
// -1, // debugLevel, // final int debugLevel)
clt_parameters
.
tileX
,
clt_parameters
.
tileY
);
System
.
out
.
print
(
"assignPlanesTiles():"
);
tileSurface
.
printStats
(
stats_planes
);
if
(
clt_parameters
.
tsEnOnly
){
tileSurface
.
combineTileLayers
(
true
,
// final boolean overwrite,
tile_layers
,
// final int [][] dst,
tile_layers_single_surf
);
// final int [][] src);
}
if
(
clt_parameters
.
tsEnPlaneSeed
)
{
tileSurface
.
combineTileLayers
(
true
,
// final boolean overwrite,
tile_layers
,
// final int [][] dst,
tile_layers_planes
);
// final int [][] src);
}
if
(
clt_parameters
.
tsEnSingle
)
{
if
(
clt_parameters
.
tsEnSingle
)
{
int
[]
stats
=
tileSurface
.
assignTilesToSurfaces
(
int
[]
stats
=
tileSurface
.
assignTilesToSurfaces
(
tile_layers
,
//final int [][] tileLayers,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
clt_parameters
.
tsUseCenter
,
// final boolean useCenter,
clt_parameters
.
tsUseCenter
,
// final boolean useCenter,
clt_parameters
.
tsMaxDiff
,
//final double maxDiff,
clt_parameters
.
tsMaxDiff
,
//final double maxDiff,
...
@@ -3185,6 +3260,7 @@ public class TileProcessor {
...
@@ -3185,6 +3260,7 @@ public class TileProcessor {
if
(
clt_parameters
.
tsEnMulti
)
{
if
(
clt_parameters
.
tsEnMulti
)
{
for
(
int
nTry
=
0
;
nTry
<
100
;
nTry
++)
{
for
(
int
nTry
=
0
;
nTry
<
100
;
nTry
++)
{
int
[]
stats
=
tileSurface
.
assignTilesToSurfaces
(
int
[]
stats
=
tileSurface
.
assignTilesToSurfaces
(
tile_layers
,
//final int [][] tileLayers,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
clt_parameters
.
tsUseCenter
,
// final boolean useCenter,
clt_parameters
.
tsUseCenter
,
// final boolean useCenter,
clt_parameters
.
tsMaxDiff
,
//final double maxDiff,
clt_parameters
.
tsMaxDiff
,
//final double maxDiff,
...
@@ -3217,6 +3293,7 @@ public class TileProcessor {
...
@@ -3217,6 +3293,7 @@ public class TileProcessor {
// Single pass, before growing assigned tiles
// Single pass, before growing assigned tiles
if
(
clt_parameters
.
tsRemoveWeak1
)
{
if
(
clt_parameters
.
tsRemoveWeak1
)
{
int
[]
stats
=
tileSurface
.
removeSmallClusters
(
int
[]
stats
=
tileSurface
.
removeSmallClusters
(
tile_layers
,
//final int [][] tileLayers,
clt_parameters
.
tsClustSize
,
// final int minSize, // **
clt_parameters
.
tsClustSize
,
// final int minSize, // **
clt_parameters
.
tsClustWeight
,
// final double minStrength, // **
clt_parameters
.
tsClustWeight
,
// final double minStrength, // **
dispStrength
,
// final double [][][] dispStrength,
dispStrength
,
// final double [][][] dispStrength,
...
@@ -3232,6 +3309,7 @@ public class TileProcessor {
...
@@ -3232,6 +3309,7 @@ public class TileProcessor {
if
(
clt_parameters
.
tsGrowSurround
)
{
if
(
clt_parameters
.
tsGrowSurround
)
{
for
(
int
nTry
=
0
;
nTry
<
100
;
nTry
++)
{
for
(
int
nTry
=
0
;
nTry
<
100
;
nTry
++)
{
int
[]
stats
=
tileSurface
.
assignFromFarthest
(
int
[]
stats
=
tileSurface
.
assignFromFarthest
(
tile_layers
,
//final int [][] tileLayers,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
clt_parameters
.
tsNoEdge
,
// final boolean noEdge,
clt_parameters
.
tsMinNeib
,
// final int minNeib, // **
clt_parameters
.
tsMinNeib
,
// final int minNeib, // **
clt_parameters
.
tsMaxSurStrength
,
// final double maxStrength, // **
clt_parameters
.
tsMaxSurStrength
,
// final double maxStrength, // **
...
@@ -3255,6 +3333,7 @@ public class TileProcessor {
...
@@ -3255,6 +3333,7 @@ public class TileProcessor {
// Single pass, after growing assigned tiles
// Single pass, after growing assigned tiles
if
(
clt_parameters
.
tsRemoveWeak2
)
{
if
(
clt_parameters
.
tsRemoveWeak2
)
{
int
[]
stats
=
tileSurface
.
removeSmallClusters
(
int
[]
stats
=
tileSurface
.
removeSmallClusters
(
tile_layers
,
//final int [][] tileLayers,
clt_parameters
.
tsClustSize
,
// final int minSize, // **
clt_parameters
.
tsClustSize
,
// final int minSize, // **
clt_parameters
.
tsClustWeight
,
// final double minStrength, // **
clt_parameters
.
tsClustWeight
,
// final double minStrength, // **
dispStrength
,
// final double [][][] dispStrength,
dispStrength
,
// final double [][][] dispStrength,
...
@@ -3263,6 +3342,39 @@ public class TileProcessor {
...
@@ -3263,6 +3342,39 @@ public class TileProcessor {
clt_parameters
.
tileY
);
clt_parameters
.
tileY
);
tileSurface
.
printStats
(
stats
);
tileSurface
.
printStats
(
stats
);
}
}
// Just show current state
tileSurface
.
statTileLayers
(
tile_layers
,
// final int [][] tileLayers,
tileSel
,
// final boolean [][] tileSel,
1
);
// final int debugLevel)
// removed tile_layers from globals, so multiple parallel assignments can be generated and then combined
// int [][] tile_layers = tileSurface.getTileLayersCopy();
// int [][] tile_layers_single_surf = tileSurface.newTileLayers(tileSel); // final boolean [][] tileSel,)
// int [][] tile_layers_planes = tileSurface.newTileLayers(tileSel); // final boolean [][] tileSel,)
int
[][][]
tile_assignments
=
{
tile_layers
,
tile_layers_single_surf
,
tile_layers_planes
};
for
(
int
i
=
0
;
i
<
tile_assignments
.
length
;
i
++){
if
((
clt_parameters
.
tsConsensMode
&
(
1
<<
i
))
==
0
)
{
tile_assignments
[
i
]
=
null
;
}
}
tileSurface
.
compareAssignments
(
tile_assignments
);
// final int [][][] tileAssignments)
int
[][][]
opinions
=
new
int
[
tile_layers
.
length
][][];
tile_layers
=
tileSurface
.
getConsensusAssignment
(
clt_parameters
.
tsConsensAgree
,
// final int min_agree,
opinions
,
// int [][][] opinions_in,
tile_assignments
);
// final int [][][] tileAssignments)
tileSurface
.
setTileLayers
(
tile_layers
);
// Just show current state
// Just show current state
tileSurface
.
InitTilesAssignment
(
tileSurface
.
InitTilesAssignment
(
false
,
false
,
...
...
src/main/java/TileSurface.java
View file @
076baece
This diff is collapsed.
Click to expand it.
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