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
f3d147e9
Commit
f3d147e9
authored
Aug 10, 2018
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Creating test data from main camera only, not relying on GT
parent
66f3b726
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
12 deletions
+70
-12
TileProcessor.java
src/main/java/TileProcessor.java
+3
-2
TwoQuadCLT.java
src/main/java/TwoQuadCLT.java
+67
-10
No files found.
src/main/java/TileProcessor.java
View file @
f3d147e9
...
...
@@ -66,6 +66,7 @@ public class TileProcessor {
public
double
[][]
rig_post_poles_ds
=
null
;
// Rig disparity and strength after processing poles
public
boolean
[]
rig_pre_poles_sel
=
null
;
// Rig tile selection before processing poles
public
boolean
[]
rig_post_poles_sel
=
null
;
// Rig tile selection after processing poles
public
double
[][]
main_ds_ml
=
null
;
// main camera DSI restored from the COMBO-DSI file to generate ML test files
public
int
clt_3d_passes_size
=
0
;
//clt_3d_passes size after initial processing
public
int
clt_3d_passes_rig_size
=
0
;
//clt_3d_passes size after initial processing and rig processing
...
...
src/main/java/TwoQuadCLT.java
View file @
f3d147e9
...
...
@@ -2068,7 +2068,6 @@ if (debugLevel > -100) return true; // temporarily !
final
boolean
updateStatus
,
final
int
debugLevel
)
// throws Exception
{
if
((
quadCLT_main
.
tp
==
null
)
||
(
quadCLT_main
.
tp
.
rig_pre_poles_ds
==
null
))
{
String
msg
=
"DSI data not available. Please run \"Ground truth\" first"
;
IJ
.
showMessage
(
"Error"
,
msg
);
...
...
@@ -2077,6 +2076,7 @@ if (debugLevel > -100) return true; // temporarily !
}
boolean
post_poles
=
clt_parameters
.
rig
.
ml_poles
;
double
[][]
rig_disparity_strength
=
clt_parameters
.
rig
.
ml_poles
?
quadCLT_main
.
tp
.
rig_post_poles_ds
:
quadCLT_main
.
tp
.
rig_pre_poles_ds
;
double
[][]
main_disparity_strength
=
quadCLT_main
.
tp
.
main_ds_ml
;
if
(
rig_disparity_strength
==
null
)
{
System
.
out
.
println
(
"DSI data for the scene after poles extraction is not available. You may enable it and re-run \"Ground truth\" command or run \"Poles GT\""
);
rig_disparity_strength
=
quadCLT_main
.
tp
.
rig_pre_poles_ds
;
...
...
@@ -2100,6 +2100,47 @@ if (debugLevel > -100) return true; // temporarily !
2.0
,
// double wndx_scale, // (wndy scale is always 1.0)
(
debugLevel
>
-
1
));
// boolean debug)
// Create test data that does not rely on the rig measurements
String
img_name_main
=
quadCLT_main
.
image_name
+
"-ML_DATA_MAIN-"
;
double
[][]
ml_data_main
=
remeasureRigML
(
0.0
,
// double disparity_offset_low,
0.0
,
// double disparity_offset_high,
quadCLT_main
,
// QuadCLT quadCLT_main, // tiles should be set
quadCLT_aux
,
// QuadCLT quadCLT_aux,
// disparity_bimap, // double [][] src_bimap,
main_disparity_strength
[
0
],
// double [] disparity_main, // main camera disparity to use - if null, calculate from the rig one
rig_disparity_strength
[
0
],
// double [] disparity,
rig_disparity_strength
[
1
],
// double [] strength,
clt_parameters
,
// EyesisCorrectionParameters.CLTParameters clt_parameters,
clt_parameters
.
rig
.
ml_hwidth
,
// int ml_hwidth
clt_parameters
.
rig
.
ml_fatzero
,
// double fatzero,
//change if needed?
0
,
// int lt_rad, // low texture mode - inter-correlation is averaged between the neighbors before argmax-ing, using (2*notch_mode+1)^2 square
threadsMax
,
// final int threadsMax, // maximal number of threads to launch
updateStatus
,
// final boolean updateStatus,
debugLevel
);
// final int debugLevel);
saveMlFile
(
img_name_main
,
// String ml_title,
ml_directory
,
// String ml_directory,
Double
.
NaN
,
// double disp_offset_low,
Double
.
NaN
,
// double disp_offset_high,
quadCLT_main
,
// QuadCLT quadCLT_main,
quadCLT_aux
,
// QuadCLT quadCLT_aux,
corr2d
,
//Correlation2d corr2d, // to access "other" layer
clt_parameters
.
rig
.
ml_8bit
,
// boolean use8bpp,
clt_parameters
.
rig
.
ml_limit_extrim
,
// double limit_extrim,
clt_parameters
.
rig
.
ml_keep_aux
,
// boolean keep_aux,
clt_parameters
.
rig
.
ml_keep_inter
,
// boolean keep_inter,
clt_parameters
.
rig
.
ml_keep_hor_vert
,
// boolean keep_hor_vert,
clt_parameters
.
rig
.
ml_keep_tbrl
,
// boolean ml_keep_tbrl,
clt_parameters
.
rig
.
ml_keep_debug
,
// boolean keep_debug,
clt_parameters
.
rig
.
ml_fatzero
,
// double ml_fatzero,
clt_parameters
.
rig
.
ml_hwidth
,
// int ml_hwidth,
ml_data_main
,
// double [][] ml_data,
clt_parameters
.
rig
.
ml_show_ml
,
// boolean show,
debugLevel
);
// int debugLevel
for
(
int
sweep_step
=
0
;
sweep_step
<
clt_parameters
.
rig
.
ml_sweep_steps
;
sweep_step
++){
double
disparity_offset_low
=
0
;
double
disparity_offset_high
=
Double
.
NaN
;
...
...
@@ -2109,6 +2150,7 @@ if (debugLevel > -100) return true; // temporarily !
disparity_offset_high
=
clt_parameters
.
rig
.
ml_disparity_sweep
*
(
2.0
*
(
sweep_step
+
1
)/(
clt_parameters
.
rig
.
ml_sweep_steps
-
1.0
)
-
1.0
);
}
}
String
img_name
=
clt_parameters
.
rig
.
ml_randomize
?
quadCLT_main
.
image_name
+
"-ML_DATARND-"
:
quadCLT_main
.
image_name
+
"-ML_DATA-"
;
double
[][]
ml_data
=
remeasureRigML
(
disparity_offset_low
,
// double disparity_offset_low,
...
...
@@ -2116,6 +2158,7 @@ if (debugLevel > -100) return true; // temporarily !
quadCLT_main
,
// QuadCLT quadCLT_main, // tiles should be set
quadCLT_aux
,
// QuadCLT quadCLT_aux,
// disparity_bimap, // double [][] src_bimap,
null
,
// double [] disparity_main, // main camera disparity to use - if null, calculate from the rig one
rig_disparity_strength
[
0
],
// double [] disparity,
rig_disparity_strength
[
1
],
// double [] strength,
...
...
@@ -4516,11 +4559,14 @@ if (debugLevel > -100) return true; // temporarily !
int
width
=
tilesX
*
ml_width
;
int
height
=
tilesY
*
ml_width
;
String
title
=
ml_title
+
(
use8bpp
?
"08"
:
"32"
)+
"B-"
+(
keep_aux
?
"A"
:
""
)+(
keep_inter
?
"I"
:
""
)+(
keep_hor_vert
?
"O"
:
""
)+(
ml_keep_tbrl
?
"T"
:
""
)+
(
keep_debug
?
"D"
:
""
)+
"-FZ"
+
ml_fatzero
+
"-OFFS"
+
String
.
format
(
"%8.5f"
,
disp_offset_low
).
trim
();
(
keep_debug
?
"D"
:
""
)+
"-FZ"
+
ml_fatzero
+
"-OFFS"
;
if
(!
Double
.
isNaN
(
disp_offset_low
))
{
title
+=
String
.
format
(
"%8.5f"
,
disp_offset_low
).
trim
();
if
(
disp_offset_high
>
disp_offset_low
)
{
title
+=
"_"
;
title
+=
String
.
format
(
"%8.5f"
,
disp_offset_high
).
trim
();
}
}
int
[]
aux_indices
=
{
ImageDtt
.
ML_TOP_AUX_INDEX
,
// 8 - top pair 2d correlation center area (auxiliary camera)
ImageDtt
.
ML_BOTTOM_AUX_INDEX
,
// 9 - bottom pair 2d correlation center area (auxiliary camera)
...
...
@@ -5591,6 +5637,7 @@ if (debugLevel > -100) return true; // temporarily !
double
disparity_offset_high
,
QuadCLT
quadCLT_main
,
// tiles should be set
QuadCLT
quadCLT_aux
,
double
[]
disparity_main
,
// main camera disparity to use - if null, calculate from the rig one
double
[]
disparity
,
double
[]
strength
,
EyesisCorrectionParameters
.
CLTParameters
clt_parameters
,
...
...
@@ -5638,6 +5685,11 @@ if (debugLevel > -100) return true; // temporarily !
if
(
disparity_offset_high
>
disparity_offset
)
{
// will not happen if disparity_offset_high is NaN
disparity_offset
=
disparity_offset_low
+
(
disparity_offset_high
-
disparity_offset_low
)*
rnd
.
nextDouble
();
}
if
((
disparity_main
!=
null
)
&&
!
Double
.
isNaN
(
disparity_main
[
nTile
]))
{
// Use actuall disparity from the main camera
disparity_offset
=
disparity_main
[
nTile
]
-
disparity
[
nTile
];
}
disparity_array
[
tileY
][
tileX
]
=
disparity
[
nTile
]+
disparity_offset
;
corr2d
.
saveMlTilePixel
(
tileX
,
// int tileX,
...
...
@@ -6319,9 +6371,12 @@ if (debugLevel > -100) return true; // temporarily !
}
public
double
[][]
getRigDSI
(
String
path_DSI
)
// Combo DSI path
String
path_DSI
,
// Combo DSI path
boolean
main
)
// false - rig
{
int
[]
slices
=
{
TwoQuadCLT
.
DSI_DISPARITY_RIG
,
TwoQuadCLT
.
DSI_STRENGTH_RIG
};
int
[]
slices_rig
=
{
TwoQuadCLT
.
DSI_DISPARITY_RIG
,
TwoQuadCLT
.
DSI_STRENGTH_RIG
};
int
[]
slices_main
=
{
TwoQuadCLT
.
DSI_DISPARITY_MAIN
,
TwoQuadCLT
.
DSI_STRENGTH_MAIN
};
int
[]
slices
=
main
?
slices_main:
slices_rig
;
double
[][]
dsi
=
new
double
[
slices
.
length
][];
ImagePlus
imp_dsi
=
new
ImagePlus
(
path_DSI
);
ImageStack
dsi_stack
=
imp_dsi
.
getStack
();
...
...
@@ -6338,8 +6393,8 @@ if (debugLevel > -100) return true; // temporarily !
}
}
return
dsi
;
}
public
void
regenerateML
(
String
path_DSI
,
// Combo DSI path
String
model_dir
,
// model/version directory
...
...
@@ -6356,7 +6411,8 @@ if (debugLevel > -100) return true; // temporarily !
{
this
.
startTime
=
System
.
nanoTime
();
double
[][]
rig_dsi
=
getRigDSI
(
path_DSI
);
double
[][]
rig_dsi
=
getRigDSI
(
path_DSI
,
false
);
double
[][]
main_dsi
=
getRigDSI
(
path_DSI
,
true
);
String
[]
sourceFiles
=
quadCLT_main
.
correctionsParameters
.
getSourcePaths
();
QuadCLT
.
SetChannels
[]
set_channels_main
=
quadCLT_main
.
setChannels
(
debugLevel
);
QuadCLT
.
SetChannels
[]
set_channels_aux
=
quadCLT_aux
.
setChannels
(
debugLevel
);
...
...
@@ -6416,6 +6472,7 @@ if (debugLevel > -100) return true; // temporarily !
debugLevel
);
// final int debugLevel);
// now tp is defined
quadCLT_main
.
tp
.
rig_pre_poles_ds
=
rig_dsi
;
// use rig data from the COMBO-DSI file
quadCLT_main
.
tp
.
main_ds_ml
=
main_dsi
;
// use rig data from the COMBO-DSI file
// quadCLT_main.tp.resetCLTPasses();
// quadCLT_aux.tp.resetCLTPasses();
...
...
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