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
3b27965b
Commit
3b27965b
authored
Apr 23, 2017
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial extraction of predefined planes
parent
5fc78264
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
181 deletions
+105
-181
CLTPass3d.java
src/main/java/CLTPass3d.java
+6
-44
SuperTiles.java
src/main/java/SuperTiles.java
+82
-109
TilePlanes.java
src/main/java/TilePlanes.java
+0
-11
TileProcessor.java
src/main/java/TileProcessor.java
+17
-17
No files found.
src/main/java/CLTPass3d.java
View file @
3b27965b
...
@@ -69,7 +69,6 @@ public class CLTPass3d{
...
@@ -69,7 +69,6 @@ public class CLTPass3d{
{
{
return
this
.
tileProcessor
;
return
this
.
tileProcessor
;
}
}
public
void
updateSelection
(){
// add updating border tiles?
public
void
updateSelection
(){
// add updating border tiles?
int
tilesX
=
tileProcessor
.
getTilesX
();
int
tilesX
=
tileProcessor
.
getTilesX
();
int
tilesY
=
tileProcessor
.
getTilesY
();
int
tilesY
=
tileProcessor
.
getTilesY
();
...
@@ -558,6 +557,9 @@ public class CLTPass3d{
...
@@ -558,6 +557,9 @@ public class CLTPass3d{
return
this
.
superTiles
;
return
this
.
superTiles
;
}
}
public
double
[]
showDisparityHistogram
(
public
double
[]
showDisparityHistogram
(
double
[][][][]
disparity_strength
,
// pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or null
boolean
[][]
tile_sel
,
// null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
boolean
smplMode
,
// = true; // Use sample mode (false - regular tile mode)
boolean
smplMode
,
// = true; // Use sample mode (false - regular tile mode)
int
smplSide
,
// = 2; // Sample size (side of a square)
int
smplSide
,
// = 2; // Sample size (side of a square)
int
smplNum
,
// = 3; // Number after removing worst
int
smplNum
,
// = 3; // Number after removing worst
...
@@ -568,6 +570,9 @@ public class CLTPass3d{
...
@@ -568,6 +570,9 @@ public class CLTPass3d{
return
null
;
return
null
;
}
}
return
this
.
superTiles
.
showDisparityHistogram
(
return
this
.
superTiles
.
showDisparityHistogram
(
disparity_strength
,
// pre-calculated disparity/strength [per super-tile][per-measurement layer][2][tiles] or null
tile_sel
,
// null or per-measurement layer, per-tile selection. For each layer null - do not use, {} - use all
smplMode
,
// = true; // Use sample mode (false - regular tile mode)
smplMode
,
// = true; // Use sample mode (false - regular tile mode)
smplSide
,
// = 2; // Sample size (side of a square)
smplSide
,
// = 2; // Sample size (side of a square)
smplNum
,
// = 3; // Number after removing worst
smplNum
,
// = 3; // Number after removing worst
...
@@ -575,49 +580,6 @@ public class CLTPass3d{
...
@@ -575,49 +580,6 @@ public class CLTPass3d{
measSel
);
measSel
);
}
}
public
double
[]
showDisparityHistogram
()
{
if
(
this
.
superTiles
==
null
){
return
null
;
}
return
this
.
superTiles
.
showDisparityHistogram
();
}
public
double
[]
showDisparityHistogram
(
double
[][]
dispHist
)
{
if
(
this
.
superTiles
==
null
){
return
null
;
}
return
this
.
superTiles
.
showDisparityHistogram
(
dispHist
);
}
public
int
showDisparityHistogramWidth
()
{
return
this
.
superTiles
.
showDisparityHistogramWidth
();
}
public
double
[][][]
getMaxMinMax
(){
if
(
this
.
superTiles
==
null
){
return
null
;
}
return
superTiles
.
getMaxMinMax
();
}
public
double
[]
showMaxMinMax
(){
if
(
this
.
superTiles
==
null
){
return
null
;
}
return
this
.
superTiles
.
showMaxMinMax
();
}
public
int
getNumBins
(){
if
(
this
.
superTiles
==
null
){
return
0
;
}
return
superTiles
.
numBins
;
}
public
double
[]
getSuperTileStrength
()
public
double
[]
getSuperTileStrength
()
{
{
if
(
this
.
superTiles
==
null
){
if
(
this
.
superTiles
==
null
){
...
...
src/main/java/SuperTiles.java
View file @
3b27965b
This diff is collapsed.
Click to expand it.
src/main/java/TilePlanes.java
View file @
3b27965b
...
@@ -684,7 +684,6 @@ public class TilePlanes {
...
@@ -684,7 +684,6 @@ public class TilePlanes {
// make a plane and find the worst (largest disparity difference) tile
// make a plane and find the worst (largest disparity difference) tile
// z = -(x*Vx + y*Vy)/Vz
// z = -(x*Vx + y*Vy)/Vz
// double [][][] disp_str = new double [measuredSelection.length][][];
double
worst_d2
=
0.0
;
double
worst_d2
=
0.0
;
int
[]
worst_layer_index
=
{-
1
,-
1
};
int
[]
worst_layer_index
=
{-
1
,-
1
};
double
[]
v
=
getVector
();
double
[]
v
=
getVector
();
...
@@ -692,16 +691,6 @@ public class TilePlanes {
...
@@ -692,16 +691,6 @@ public class TilePlanes {
for
(
int
nl
=
0
;
nl
<
measuredSelection
.
length
;
nl
++){
for
(
int
nl
=
0
;
nl
<
measuredSelection
.
length
;
nl
++){
if
(
measuredSelection
[
nl
]
!=
null
){
if
(
measuredSelection
[
nl
]
!=
null
){
// already calculated, but not masked by selection!
// already calculated, but not masked by selection!
/*
disp_str[nl] = measuredLayers.getDisparityStrength(
nl, // int num_layer,
sTileXY[0], // int stX,
sTileXY[1], // int stY,
measuredSelection[nl], // boolean [] sel_in,
strength_floor, //
measured_strength_pow, //
true); // boolean null_if_none)
*/
if
(
disp_str
[
nl
]
!=
null
)
{
if
(
disp_str
[
nl
]
!=
null
)
{
for
(
int
indx
=
0
;
indx
<
disp_str
[
nl
][
0
].
length
;
indx
++){
for
(
int
indx
=
0
;
indx
<
disp_str
[
nl
][
0
].
length
;
indx
++){
double
w
=
disp_str
[
nl
][
1
][
indx
];
double
w
=
disp_str
[
nl
][
1
][
indx
];
...
...
src/main/java/TileProcessor.java
View file @
3b27965b
...
@@ -2759,7 +2759,7 @@ public class TileProcessor {
...
@@ -2759,7 +2759,7 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
0
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
0
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
scan_prev
.
setSuperTiles
(
scan_prev
.
setSuperTiles
(
clt_parameters
.
stStepNear
,
// double step_disparity,
clt_parameters
.
stStepNear
,
// double step_disparity,
...
@@ -2775,11 +2775,11 @@ public class TileProcessor {
...
@@ -2775,11 +2775,11 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
1
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
1
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
dbg_hist
[
2
]
=
scan_prev
.
showMaxMinMax
();
dbg_hist
[
2
]
=
scan_prev
.
getSuperTiles
().
showMaxMinMax
();
int
hist_width0
=
scan_prev
.
showDisparityHistogramWidth
();
int
hist_width0
=
scan_prev
.
getSuperTiles
().
showDisparityHistogramWidth
();
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
if
(
show_st
){
if
(
show_st
){
sdfa_instance
.
showArrays
(
dbg_hist
,
hist_width0
,
hist_height0
,
true
,
"disparity_supertiles_histograms"
,
dbg_st_titles
);
sdfa_instance
.
showArrays
(
dbg_hist
,
hist_width0
,
hist_height0
,
true
,
"disparity_supertiles_histograms"
,
dbg_st_titles
);
...
@@ -2973,7 +2973,7 @@ public class TileProcessor {
...
@@ -2973,7 +2973,7 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
0
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
0
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
scan_prev
.
setSuperTiles
(
scan_prev
.
setSuperTiles
(
clt_parameters
.
stStepNear
,
// double step_disparity,
clt_parameters
.
stStepNear
,
// double step_disparity,
clt_parameters
.
stStepFar
,
// double step_near,
clt_parameters
.
stStepFar
,
// double step_near,
...
@@ -2988,7 +2988,7 @@ public class TileProcessor {
...
@@ -2988,7 +2988,7 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
1
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
1
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
}
}
// SuperTiles st =
// SuperTiles st =
...
@@ -3007,13 +3007,13 @@ public class TileProcessor {
...
@@ -3007,13 +3007,13 @@ public class TileProcessor {
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
if
(
show_st
)
{
// otherwise only blured version is needed
if
(
show_st
)
{
// otherwise only blured version is needed
dbg_hist
[
2
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
2
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
dbg_hist
[
3
]
=
scan_prev
.
showMaxMinMax
();
dbg_hist
[
3
]
=
scan_prev
.
getSuperTiles
().
showMaxMinMax
();
}
}
if
(
show_st
){
if
(
show_st
){
int
hist_width0
=
scan_prev
.
showDisparityHistogramWidth
();
int
hist_width0
=
scan_prev
.
getSuperTiles
().
showDisparityHistogramWidth
();
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
showDoubleFloatArrays
sdfa_instance
=
new
showDoubleFloatArrays
();
// just for debugging?
showDoubleFloatArrays
sdfa_instance
=
new
showDoubleFloatArrays
();
// just for debugging?
sdfa_instance
.
showArrays
(
dbg_hist
,
hist_width0
,
hist_height0
,
true
,
"disparity_supertiles_histograms"
,
dbg_st_titles
);
sdfa_instance
.
showArrays
(
dbg_hist
,
hist_width0
,
hist_height0
,
true
,
"disparity_supertiles_histograms"
,
dbg_st_titles
);
...
@@ -3614,7 +3614,7 @@ public class TileProcessor {
...
@@ -3614,7 +3614,7 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
0
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
0
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
SuperTiles
st
=
scan_prev
.
setSuperTiles
(
SuperTiles
st
=
scan_prev
.
setSuperTiles
(
clt_parameters
.
stStepNear
,
// double step_disparity,
clt_parameters
.
stStepNear
,
// double step_disparity,
...
@@ -3630,11 +3630,11 @@ public class TileProcessor {
...
@@ -3630,11 +3630,11 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
1
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
1
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
dbg_hist
[
2
]
=
scan_prev
.
showMaxMinMax
();
dbg_hist
[
2
]
=
scan_prev
.
getSuperTiles
().
showMaxMinMax
();
int
hist_width0
=
scan_prev
.
showDisparityHistogramWidth
();
int
hist_width0
=
scan_prev
.
getSuperTiles
().
showDisparityHistogramWidth
();
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
if
(
show_st
){
if
(
show_st
){
...
@@ -4431,7 +4431,7 @@ public class TileProcessor {
...
@@ -4431,7 +4431,7 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
0
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
0
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
scan_prev
.
setSuperTiles
(
scan_prev
.
setSuperTiles
(
clt_parameters
.
stStepNear
,
// double step_disparity,
clt_parameters
.
stStepNear
,
// double step_disparity,
...
@@ -4447,12 +4447,12 @@ public class TileProcessor {
...
@@ -4447,12 +4447,12 @@ public class TileProcessor {
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplNum
,
// Number after removing worst
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stSmplRms
,
// Maximal RMS of the remaining tiles in a sample
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
clt_parameters
.
stMeasSel
);
// bitmask of the selected measurements for supertiles : +1 - combo, +2 - quad +4 - hor +8 - vert
dbg_hist
[
1
]
=
scan_prev
.
showDisparityHistogram
();
dbg_hist
[
1
]
=
scan_prev
.
getSuperTiles
().
showDisparityHistogram
();
dbg_hist
[
2
]
=
scan_prev
.
showMaxMinMax
();
dbg_hist
[
2
]
=
scan_prev
.
getSuperTiles
().
showMaxMinMax
();
if
(
clt_parameters
.
stShow
){
if
(
clt_parameters
.
stShow
){
int
hist_width0
=
scan_prev
.
showDisparityHistogramWidth
();
int
hist_width0
=
scan_prev
.
getSuperTiles
().
showDisparityHistogramWidth
();
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
int
hist_height0
=
dbg_hist
[
0
].
length
/
hist_width0
;
sdfa_instance
.
showArrays
(
dbg_hist
,
hist_width0
,
hist_height0
,
true
,
"disparity_supertiles_histograms"
,
dbg_st_titles
);
sdfa_instance
.
showArrays
(
dbg_hist
,
hist_width0
,
hist_height0
,
true
,
"disparity_supertiles_histograms"
,
dbg_st_titles
);
}
}
...
...
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