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
514057c6
Commit
514057c6
authored
Apr 13, 2020
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented/tested per-tile geometric distortions setup
parent
50630abc
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
434 additions
and
34 deletions
+434
-34
GPUTileProcessor.java
src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java
+132
-21
GeometryCorrection.java
...a/com/elphel/imagej/tileprocessor/GeometryCorrection.java
+250
-1
ImageDtt.java
src/main/java/com/elphel/imagej/tileprocessor/ImageDtt.java
+17
-0
TwoQuadCLT.java
...main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
+35
-12
No files found.
src/main/java/com/elphel/imagej/gpu/GPUTileProcessor.java
View file @
514057c6
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/GeometryCorrection.java
View file @
514057c6
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/ImageDtt.java
View file @
514057c6
...
...
@@ -9705,6 +9705,23 @@ public class ImageDtt {
centerX
,
centerY
,
disparity_aux
);
// + disparity_corr);
if
((
tileX
==
debug_tileX
)
&&
(
tileY
==
debug_tileY
))
{
// will just print debug data
geometryCorrection_main
.
getPortsCoordinatesAndDerivativesDbg
(
geometryCorrection_main
,
// GeometryCorrection gc_main,
false
,
// boolean use_rig_offsets,
corr_rots_main
,
// Matrix [] rots,
null
,
// Matrix [][] deriv_rots,
null
,
// double [][] pXYderiv, // if not null, should be double[8][]
disp_dist_main
,
// used to correct 3D correlations
centerX
,
centerY
,
disparity_main
);
// + disparity_corr);
}
// acquisition time of the tiles centers in scanline times
if
(
ers_delay
!=
null
)
{
for
(
int
i
=
0
;
i
<
quad_main
;
i
++)
ers_delay
[
0
][
i
][
nTile
]
=
centersXY_main
[
i
][
1
]-
geometryCorrection_main
.
woi_tops
[
i
];
...
...
src/main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
View file @
514057c6
...
...
@@ -2018,6 +2018,7 @@ public class TwoQuadCLT {
clt_parameters
.
gpu_woi_twidth
,
clt_parameters
.
gpu_woi_theight
);
GPUTileProcessor
.
TpTask
[]
tp_tasks
=
gPUTileProcessor
.
setFullFrameImages
(
false
,
// boolean calc_offsets, // old way, now not needed with GPU calculation
twoi
,
// Rectangle woi,
clt_parameters
.
gpu_woi_round
,
// boolean round_woi,
(
float
)
clt_parameters
.
disparity
,
// float target_disparity, // apply same disparity to all tiles
...
...
@@ -2031,7 +2032,6 @@ public class TwoQuadCLT {
threadsMax
,
// final int threadsMax, // maximal number of threads to launch
debugLevel
);
// final int debugLevel)
// Optionally save offsets here?
// EyesisCorrectionParameters.CorrectionParameters ecp,
boolean
save_ports_xy
=
false
;
// true; Same files as saved with the kernels
...
...
@@ -2087,6 +2087,8 @@ public class TwoQuadCLT {
tp_tasks
);
gPUTileProcessor
.
setTextureIndices
(
texture_indices
);
gPUTileProcessor
.
setGeometryCorrection
(
quadCLT_main
.
getGeometryCorrection
());
// once
gPUTileProcessor
.
setExtrinsicsVector
(
quadCLT_main
.
getGeometryCorrection
().
getCorrVector
());
// for each new image
// TODO: calculate from the camera geometry?
double
[][]
port_offsets
=
{
// used only in textures to scale differences
...
...
@@ -2099,7 +2101,20 @@ public class TwoQuadCLT {
int
NREPEAT
=
1
;
// 00;
System
.
out
.
println
(
"\n------------ Running GPU "
+
NREPEAT
+
" times ----------------"
);
long
startGPU
=
System
.
nanoTime
();
for
(
int
i
=
0
;
i
<
NREPEAT
;
i
++
)
gPUTileProcessor
.
execConverCorrectTiles
();
for
(
int
i
=
0
;
i
<
NREPEAT
;
i
++
)
{
gPUTileProcessor
.
execRotDerivs
();
}
long
startTasksSetup
=
System
.
nanoTime
();
for
(
int
i
=
0
;
i
<
NREPEAT
;
i
++
)
{
gPUTileProcessor
.
execSetTilesOffsets
();
}
long
startDirectConvert
=
System
.
nanoTime
();
for
(
int
i
=
0
;
i
<
NREPEAT
;
i
++
)
{
gPUTileProcessor
.
execConverCorrectTiles
();
}
// run imclt;
long
startIMCLT
=
System
.
nanoTime
();
...
...
@@ -2145,18 +2160,26 @@ public class TwoQuadCLT {
long
endTexturesRBGA
=
System
.
nanoTime
();
long
endGPUTime
=
System
.
nanoTime
();
long
firstGPUTime
=
(
startIMCLT
-
startGPU
)
/
NREPEAT
;
long
rotDerivsTime
=
(
startTasksSetup
-
startGPU
)
/
NREPEAT
;
long
tasksSetupTime
=
(
startDirectConvert
-
startTasksSetup
)
/
NREPEAT
;
long
firstGPUTime
=
(
startIMCLT
-
startDirectConvert
)
/
NREPEAT
;
long
runImcltTime
=
(
endImcltTime
-
startIMCLT
)
/
NREPEAT
;
long
runCorr2DTime
=
(
endCorr2d
-
startCorr2d
)
/
NREPEAT
;
long
runTexturesTime
=
(
endTextures
-
startTextures
)
/
NREPEAT
;
long
runTexturesRBGATime
=
(
endTexturesRBGA
-
startTexturesRBGA
)
/
NREPEAT
;
long
runTexturesRBGATime
=
(
endTexturesRBGA
-
startTexturesRBGA
)
/
NREPEAT
;
long
runGPUTime
=
(
endGPUTime
-
startGPU
)
/
NREPEAT
;
// run corr2d
System
.
out
.
println
(
"\n------------ End of running GPU "
+
NREPEAT
+
" times ----------------"
);
System
.
out
.
println
(
"GPU run time ="
+(
runGPUTime
*
1.0
e
-
6
)+
"ms, (direct conversion: "
+(
firstGPUTime
*
1.0
e
-
6
)+
"ms, imclt: "
+
(
runImcltTime
*
1.0
e
-
6
)+
"ms), corr2D: "
+(
runCorr2DTime
*
1.0
e
-
6
)+
"ms), textures: "
+(
runTexturesTime
*
1.0
e
-
6
)+
"ms, RGBA: "
+
(
runTexturesRBGATime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
"GPU run time ="
+
(
runGPUTime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
" - rot/derivs: "
+(
rotDerivsTime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
" - tasks setup: "
+(
tasksSetupTime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
" - direct conversion: "
+(
firstGPUTime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
" - imclt: "
+(
runImcltTime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
" - corr2D: "
+(
runCorr2DTime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
" - textures: "
+(
runTexturesTime
*
1.0
e
-
6
)+
"ms"
);
System
.
out
.
println
(
" - RGBA: "
+(
runTexturesRBGATime
*
1.0
e
-
6
)+
"ms"
);
// get data back from GPU
float
[][][]
iclt_fimg
=
new
float
[
GPUTileProcessor
.
NUM_CAMS
][][];
for
(
int
ncam
=
0
;
ncam
<
iclt_fimg
.
length
;
ncam
++)
{
...
...
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