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
ca22efc3
Commit
ca22efc3
authored
Oct 05, 2020
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementing OpticalFlow
parent
b1c9139f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1102 additions
and
29 deletions
+1102
-29
OpticalFlow.java
...ain/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
+1056
-0
QuadCLT.java
src/main/java/com/elphel/imagej/tileprocessor/QuadCLT.java
+7
-3
QuadCLTCPU.java
...main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
+6
-0
TwoQuadCLT.java
...main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
+33
-26
No files found.
src/main/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
0 → 100644
View file @
ca22efc3
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/tileprocessor/QuadCLT.java
View file @
ca22efc3
...
...
@@ -214,7 +214,7 @@ public class QuadCLT extends QuadCLTCPU {
@Deprecated
public
double
[][]
getOpticalFlow
(
double
disparity_min
,
double
disparity_max
,
...
...
@@ -282,7 +282,8 @@ public class QuadCLT extends QuadCLTCPU {
return
null
;
}
@Deprecated
public
double
[]
fillNaNGapsOld
(
double
[]
data
,
int
n
,
...
...
@@ -305,6 +306,7 @@ public class QuadCLT extends QuadCLTCPU {
}
return
d
;
}
@Deprecated
public
double
[]
fillNaNGaps
(
double
[]
data
,
int
n
,
...
...
@@ -322,6 +324,7 @@ public class QuadCLT extends QuadCLTCPU {
threadsMax
);
// final int threadsMax) // maximal number of threads to launch
}
@Deprecated
public
double
[][][]
get_pair
(
double
k_prev
,
QuadCLT
qprev
,
...
...
@@ -408,7 +411,8 @@ public class QuadCLT extends QuadCLTCPU {
}
return
pair
;
}
@Deprecated
public
double
[][]
transformCameraVew
(
QuadCLT
camera_QuadClt
,
double
[]
camera_xyz
,
// camera center in world coordinates
...
...
src/main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
View file @
ca22efc3
...
...
@@ -141,6 +141,9 @@ public class QuadCLTCPU {
public
double
[][]
ds_from_main
=
null
;
public
double
[][]
dsrbg
=
null
;
// D, S, R,B,G
public
TileProcessor
getTileProcessor
()
{
return
tp
;
}
public
QuadCLTCPU
(
QuadCLTCPU
qParent
,
...
...
@@ -225,6 +228,9 @@ public class QuadCLTCPU {
public
double
getTimeStamp
()
{
return
Double
.
parseDouble
(
image_name
.
replace
(
"_"
,
"."
));
}
public
String
getImageName
()
{
return
image_name
;
}
public
int
restoreDSI
(
String
suffix
)
// "-DSI_COMBO", "-DSI_MAIN" (DSI_COMBO_SUFFIX, DSI_MAIN_SUFFIX)
{
...
...
src/main/java/com/elphel/imagej/tileprocessor/TwoQuadCLT.java
View file @
ca22efc3
...
...
@@ -8259,39 +8259,46 @@ if (debugLevel > -100) return true; // temporarily !
double
corr_scale
=
0.75
;
/// for (int i = 0; i < quadCLTs.length; i++) {
OpticalFlow
opticalFlow
=
new
OpticalFlow
(
threadsMax
,
// int threadsMax, // maximal number of threads to launch
updateStatus
);
// boolean updateStatus);
int
margin
=
4
;
// extra margins over 16x16 tiles to accommodate distorted destination tiles
double
tolerance_absolute
=
0.25
;
// absolute disparity half-range in each tile
double
tolerance_relative
=
0.2
;
// relative disparity half-range in each tile
double
center_occupancy
=
0.25
;
// fraction of remaining tiles in the center 8x8 area (<1.0)
int
num_passes
=
100
;
double
max_change
=
0.005
;
for
(
int
i
=
1
;
i
<
quadCLTs
.
length
;
i
++)
{
QuadCLT
qPrev
=
(
i
>
0
)
?
quadCLTs
[
i
-
1
]
:
null
;
double
[][][]
source_tiles
=
opticalFlow
.
prepareReferenceTiles
(
quadCLTs
[
i
],
// final QuadCLT qthis,
// margin, // final int margin, // extra margins over 16x16 tiles to accommodate distorted destination tiles
tolerance_absolute
,
// final double tolerance_absolute, // absolute disparity half-range in each tile
tolerance_relative
,
// final double tolerance_relative, // relative disparity half-range in each tile
center_occupancy
,
// final double center_occupancy, // fraction of remaining tiles in the center 8x8 area (<1.0)
2
);
// final int debug_level)
opticalFlow
.
fillTilesNans
(
source_tiles
,
// final double [][][] nan_tiles,
quadCLTs
[
i
],
// final QuadCLT qthis,
// margin, // final int margin, // extra margins over 16x16 tiles to accommodate distorted destination tiles
// 0.5 * Math.sqrt(2.0), // double diagonal_weight, // relative to ortho
num_passes
,
// final int num_passes,
max_change
,
// final double max_change,
2
);
// final int debug_level)
double
[][][]
pair_sets
=
quadCLTs
[
i
].
get_pair
(
k_prev
,
qPrev
,
corr_scale
,
1
);
// -1); // int debug_level);
// old code
/*
double [][] dbg_img = quadCLTs[i].test_back_forth_debug(
double
[][][]
pair_sets
=
opticalFlow
.
get_pair
(
k_prev
,
quadCLTs
[
i
],
qPrev
,
corr_scale
,
1
);
// -1); // int debug_level);
double [][] ds0 = {dbg_img[6],dbg_img[2]};
double [][] ds1 = {dbg_img[7],dbg_img[3]};
double [] disparity = quadCLTs[i].dsi[TwoQuadCLT.DSI_DISPARITY_MAIN];
double [] strength = quadCLTs[i].dsi[TwoQuadCLT.DSI_STRENGTH_MAIN];
double disparity_min = -1.0;
double disparity_max = 1.0;
quadCLTs[i].getOpticalFlow(
disparity_min,
disparity_max,
ds0,
ds1,
1); // int debugLevel)
*/
}
/*
...
...
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