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
5defee61
Commit
5defee61
authored
May 08, 2026
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging
parent
aac34c6a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
CuasMotion.java
src/main/java/com/elphel/imagej/cuas/CuasMotion.java
+10
-8
IntersceneMatchParameters.java
...lphel/imagej/tileprocessor/IntersceneMatchParameters.java
+19
-3
No files found.
src/main/java/com/elphel/imagej/cuas/CuasMotion.java
View file @
5defee61
...
@@ -2242,7 +2242,7 @@ public class CuasMotion {
...
@@ -2242,7 +2242,7 @@ public class CuasMotion {
int
corr_offset
,
// inter-frame distance for correlation pairs
int
corr_offset
,
// inter-frame distance for correlation pairs
int
dbg_iter_index
,
// to generate different image names for different iteration to simplify "save as" images
int
dbg_iter_index
,
// to generate different image names for different iteration to simplify "save as" images
int
debugLevel
)
{
int
debugLevel
)
{
final
int
max_index_dbg
=
10
;
// show images for the first iterations only
final
int
tileSize
=
GPUTileProcessor
.
DTT_SIZE
;
// 8 pixels
final
int
tileSize
=
GPUTileProcessor
.
DTT_SIZE
;
// 8 pixels
final
int
tilesX
=
cuasMotion
.
tilesX
;
final
int
tilesX
=
cuasMotion
.
tilesX
;
final
int
width
=
cuasMotion
.
gpu_max_width
;
final
int
width
=
cuasMotion
.
gpu_max_width
;
...
@@ -2258,8 +2258,8 @@ public class CuasMotion {
...
@@ -2258,8 +2258,8 @@ public class CuasMotion {
final
int
corr_pairs_ref
=
(
int
)
Math
.
round
(
2
*
half_accum_range
*
recalc_mv_boost
);
final
int
corr_pairs_ref
=
(
int
)
Math
.
round
(
2
*
half_accum_range
*
recalc_mv_boost
);
// Hard-coded debug selectors: set >= 0 to enable per-scan/per-tile visualisation
// Hard-coded debug selectors: set >= 0 to enable per-scan/per-tile visualisation
final
int
dbg_nseq
=
157
;
// -(116); // 57; // 20; // -1;
final
int
dbg_nseq
=
41
;
//
157; // -(116); // 57; // 20; // -1;
final
int
dbg_tile
=
55
+
38
*
80
;
// -(17 + 33*80); // 48+32*80; // 50+38*80; // -1;
final
int
dbg_tile
=
5
0
+
38
*
80
;
// 5
5+38*80; // -(17 + 33*80); // 48+32*80; // 50+38*80; // -1;
// Pre-compute integer-pixel raised-cosine mask kernel once (shared across all nseq)
// Pre-compute integer-pixel raised-cosine mask kernel once (shared across all nseq)
final
int
r1i
=
(
int
)
Math
.
ceil
(
recalc_mv_r1
);
final
int
r1i
=
(
int
)
Math
.
ceil
(
recalc_mv_r1
);
...
@@ -2275,7 +2275,7 @@ public class CuasMotion {
...
@@ -2275,7 +2275,7 @@ public class CuasMotion {
mask_kernel
[(
dy
+
r1i
)
*
mside
+
(
dx
+
r1i
)]
=
w
;
mask_kernel
[(
dy
+
r1i
)
*
mside
+
(
dx
+
r1i
)]
=
w
;
}
}
}
}
if
((
dbg_nseq
>=
0
||
dbg_tile
>=
0
)
&&
debugLevel
>=
0
)
{
if
((
dbg_nseq
>=
0
||
dbg_tile
>=
0
)
&&
(
debugLevel
>=
0
)
&&
(
dbg_iter_index
<=
max_index_dbg
)
)
{
ShowDoubleFloatArrays
.
showArrays
(
mask_kernel
.
clone
(),
mside
,
mside
,
ShowDoubleFloatArrays
.
showArrays
(
mask_kernel
.
clone
(),
mside
,
mside
,
"refineMotionVectors-mask-r0_"
+
recalc_mv_r0
+
"-r1_"
+
recalc_mv_r1
+
"-niter"
+
dbg_iter_index
);
"refineMotionVectors-mask-r0_"
+
recalc_mv_r0
+
"-r1_"
+
recalc_mv_r1
+
"-niter"
+
dbg_iter_index
);
}
}
...
@@ -2370,7 +2370,7 @@ public class CuasMotion {
...
@@ -2370,7 +2370,7 @@ public class CuasMotion {
ImageDtt
.
startAndJoin
(
threads
);
ImageDtt
.
startAndJoin
(
threads
);
// Debug: show full fmin..fmax masked frame stack for dbg_nseq
// Debug: show full fmin..fmax masked frame stack for dbg_nseq
if
(
nseq
==
dbg_nseq
&&
debugLevel
>=
0
)
{
if
(
(
nseq
==
dbg_nseq
)
&&
(
debugLevel
>=
0
)
&&
(
dbg_iter_index
<=
max_index_dbg
)
)
{
int
fcount
=
fmax_alloc
-
fmin_alloc
+
1
;
int
fcount
=
fmax_alloc
-
fmin_alloc
+
1
;
float
[][]
stack_slices
=
new
float
[
fcount
][];
float
[][]
stack_slices
=
new
float
[
fcount
][];
String
[]
stack_titles
=
new
String
[
fcount
];
String
[]
stack_titles
=
new
String
[
fcount
];
...
@@ -2383,7 +2383,7 @@ public class CuasMotion {
...
@@ -2383,7 +2383,7 @@ public class CuasMotion {
ShowDoubleFloatArrays
.
showArrays
(
stack_slices
,
width
,
height
,
true
,
ShowDoubleFloatArrays
.
showArrays
(
stack_slices
,
width
,
height
,
true
,
"refineMotionVectors-masked-nseq"
+
nseq
+
"-niter"
+
dbg_iter_index
,
stack_titles
);
"refineMotionVectors-masked-nseq"
+
nseq
+
"-niter"
+
dbg_iter_index
,
stack_titles
);
}
}
if
(
nseq
==
dbg_nseq
&&
debugLevel
>=
0
)
{
if
(
(
nseq
==
dbg_nseq
)
&&
(
debugLevel
>=
0
)
&&
(
dbg_iter_index
<=
max_index_dbg
)
)
{
int
fcount
=
fmax_alloc
-
fmin_alloc
+
1
;
int
fcount
=
fmax_alloc
-
fmin_alloc
+
1
;
float
[][]
stack_slices
=
new
float
[
fcount
][];
float
[][]
stack_slices
=
new
float
[
fcount
][];
String
[]
stack_titles
=
new
String
[
fcount
];
String
[]
stack_titles
=
new
String
[
fcount
];
...
@@ -2436,10 +2436,12 @@ public class CuasMotion {
...
@@ -2436,10 +2436,12 @@ public class CuasMotion {
if
(
target
==
null
||
Double
.
isNaN
(
target
[
CuasMotionLMA
.
RSLT_X
]))
continue
;
if
(
target
==
null
||
Double
.
isNaN
(
target
[
CuasMotionLMA
.
RSLT_X
]))
continue
;
if
(
vector_field
[
ntile
]
==
null
)
continue
;
if
(
vector_field
[
ntile
]
==
null
)
continue
;
if
(
ntile
==
dbg_tile
&&
debugLevel
>=
0
)
{
if
(
ntile
==
dbg_tile
&&
debugLevel
>=
0
)
{
System
.
out
.
printf
(
"refineMotionVectors(): nseq=%
d ntile=%d before: VX=%.4f VY=%.4f delta: dVX=%.4f dVY=%.4f%n
"
,
System
.
out
.
printf
(
"refineMotionVectors(): nseq=%
3d ntile=%4d before: VX=%9.4f VY=%9.4f delta: dVX=%8.4f dVY=%8.4f% after: VX1=%9.4f VY1=%9.4f%
"
,
nseq
,
ntile
,
nseq
,
ntile
,
target
[
CuasMotionLMA
.
RSLT_VX
],
target
[
CuasMotionLMA
.
RSLT_VY
],
target
[
CuasMotionLMA
.
RSLT_VX
],
target
[
CuasMotionLMA
.
RSLT_VY
],
vector_field
[
ntile
][
INDX_VX
],
vector_field
[
ntile
][
INDX_VY
]);
vector_field
[
ntile
][
INDX_VX
],
vector_field
[
ntile
][
INDX_VY
],
target
[
CuasMotionLMA
.
RSLT_VX
]
+
vector_field
[
ntile
][
INDX_VX
],
target
[
CuasMotionLMA
.
RSLT_VY
]
+
vector_field
[
ntile
][
INDX_VY
]);
}
}
target
[
CuasMotionLMA
.
RSLT_VX
]
+=
vector_field
[
ntile
][
INDX_VX
];
target
[
CuasMotionLMA
.
RSLT_VX
]
+=
vector_field
[
ntile
][
INDX_VX
];
target
[
CuasMotionLMA
.
RSLT_VY
]
+=
vector_field
[
ntile
][
INDX_VY
];
target
[
CuasMotionLMA
.
RSLT_VY
]
+=
vector_field
[
ntile
][
INDX_VY
];
...
...
src/main/java/com/elphel/imagej/tileprocessor/IntersceneMatchParameters.java
View file @
5defee61
...
@@ -803,8 +803,10 @@ min_str_neib_fpn 0.35
...
@@ -803,8 +803,10 @@ min_str_neib_fpn 0.35
public
int
cuas_temporal_um
=
100
;
// temporal "unsharp mask" - subtract running
public
int
cuas_temporal_um
=
100
;
// temporal "unsharp mask" - subtract running
public
double
cuas_tum_threshold
=
5.0
;
// if >0, remove outliers from the running average and recalculate RA
public
double
cuas_tum_threshold
=
5.0
;
// if >0, remove outliers from the running average and recalculate RA
public
int
cuas_precorr_ra
=
10
;
// roll
ing average before correlation
public
int
cuas_precorr_ra
=
4
;
// runn
ing average before correlation
public
int
cuas_corr_step
=
2
;
// correlation step when using rolling average
public
int
cuas_corr_step
=
2
;
// correlation step when using rolling average
public
int
cuas_accum_ra
=
2
;
// running average before shifted target accumulation
public
int
cuas_accum_step
=
2
;
// accumulation step when using rolling average
public
boolean
cuas_half_step
=
true
;
// half step (=cuas_corr_offset/2) when scanning for motion
public
boolean
cuas_half_step
=
true
;
// half step (=cuas_corr_offset/2) when scanning for motion
public
int
cuas_max_range
=
2
;
// how far to extend local max: 1 3x3 neighbors, 2 - 5x5 neighbs
public
int
cuas_max_range
=
2
;
// how far to extend local max: 1 3x3 neighbors, 2 - 5x5 neighbs
...
@@ -2716,9 +2718,14 @@ min_str_neib_fpn 0.35
...
@@ -2716,9 +2718,14 @@ min_str_neib_fpn 0.35
"Remove outlier pixels that differ from the running average by more than this (to later re-calculate running average excluding those pixels."
);
"Remove outlier pixels that differ from the running average by more than this (to later re-calculate running average excluding those pixels."
);
gd
.
addNumericField
(
"Pre-correlation running average"
,
this
.
cuas_precorr_ra
,
0
,
3
,
"scenes"
,
gd
.
addNumericField
(
"Pre-correlation running average"
,
this
.
cuas_precorr_ra
,
0
,
3
,
"scenes"
,
"
Smoothing
input data by running average before correlation for motion vectors calculations. Target extraction wil still use individual scenes."
);
"
LPF
input data by running average before correlation for motion vectors calculations. Target extraction wil still use individual scenes."
);
gd
.
addNumericField
(
"Correlation step after RA"
,
this
.
cuas_corr_step
,
0
,
3
,
"scenes"
,
gd
.
addNumericField
(
"Correlation step after RA"
,
this
.
cuas_corr_step
,
0
,
3
,
"scenes"
,
"Decimate correlations after running average"
);
"Decimate correlations after running average"
);
gd
.
addNumericField
(
"Pre target accumulation running average"
,
this
.
cuas_accum_ra
,
0
,
3
,
"scenes"
,
"LPF input data by running average before target accumulation to avoid potential prsision loss for long series."
);
gd
.
addNumericField
(
"Averaging step after RA"
,
this
.
cuas_accum_step
,
0
,
3
,
"scenes"
,
"Step in averaging of the shifted targets when using input LPF"
);
gd
.
addCheckbox
(
"Half scan step"
,
this
.
cuas_half_step
,
gd
.
addCheckbox
(
"Half scan step"
,
this
.
cuas_half_step
,
"Reduce step for motion detection = offset/2, if false = offset."
);
"Reduce step for motion detection = offset/2, if false = offset."
);
gd
.
addNumericField
(
"Local max range"
,
this
.
cuas_max_range
,
0
,
3
,
""
,
gd
.
addNumericField
(
"Local max range"
,
this
.
cuas_max_range
,
0
,
3
,
""
,
...
@@ -4383,6 +4390,8 @@ min_str_neib_fpn 0.35
...
@@ -4383,6 +4390,8 @@ min_str_neib_fpn 0.35
this
.
cuas_precorr_ra
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_precorr_ra
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_corr_step
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_corr_step
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_accum_ra
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_accum_step
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_half_step
=
gd
.
getNextBoolean
();
this
.
cuas_half_step
=
gd
.
getNextBoolean
();
this
.
cuas_max_range
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_max_range
=
(
int
)
gd
.
getNextNumber
();
...
@@ -5690,6 +5699,8 @@ min_str_neib_fpn 0.35
...
@@ -5690,6 +5699,8 @@ min_str_neib_fpn 0.35
properties
.
setProperty
(
prefix
+
"cuas_precorr_ra"
,
this
.
cuas_precorr_ra
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_precorr_ra"
,
this
.
cuas_precorr_ra
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_corr_step"
,
this
.
cuas_corr_step
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_corr_step"
,
this
.
cuas_corr_step
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_accum_ra"
,
this
.
cuas_accum_ra
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_accum_step"
,
this
.
cuas_accum_step
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_half_step"
,
this
.
cuas_half_step
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"cuas_half_step"
,
this
.
cuas_half_step
+
""
);
// boolean
properties
.
setProperty
(
prefix
+
"cuas_max_range"
,
this
.
cuas_max_range
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_max_range"
,
this
.
cuas_max_range
+
""
);
// int
...
@@ -6932,6 +6943,8 @@ min_str_neib_fpn 0.35
...
@@ -6932,6 +6943,8 @@ min_str_neib_fpn 0.35
if
(
properties
.
getProperty
(
prefix
+
"cuas_precorr_ra"
)!=
null
)
this
.
cuas_precorr_ra
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_precorr_ra"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_precorr_ra"
)!=
null
)
this
.
cuas_precorr_ra
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_precorr_ra"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_corr_step"
)!=
null
)
this
.
cuas_corr_step
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_corr_step"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_corr_step"
)!=
null
)
this
.
cuas_corr_step
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_corr_step"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_accum_ra"
)!=
null
)
this
.
cuas_accum_ra
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_accum_ra"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_accum_step"
)!=
null
)
this
.
cuas_accum_step
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_accum_step"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_half_step"
)!=
null
)
this
.
cuas_half_step
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"cuas_half_step"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_half_step"
)!=
null
)
this
.
cuas_half_step
=
Boolean
.
parseBoolean
(
properties
.
getProperty
(
prefix
+
"cuas_half_step"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_max_range"
)!=
null
)
this
.
cuas_max_range
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_max_range"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_max_range"
)!=
null
)
this
.
cuas_max_range
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_max_range"
));
...
@@ -8191,6 +8204,9 @@ min_str_neib_fpn 0.35
...
@@ -8191,6 +8204,9 @@ min_str_neib_fpn 0.35
imp
.
cuas_precorr_ra
=
this
.
cuas_precorr_ra
;
imp
.
cuas_precorr_ra
=
this
.
cuas_precorr_ra
;
imp
.
cuas_corr_step
=
this
.
cuas_corr_step
;
imp
.
cuas_corr_step
=
this
.
cuas_corr_step
;
imp
.
cuas_accum_ra
=
this
.
cuas_accum_ra
;
imp
.
cuas_accum_step
=
this
.
cuas_accum_step
;
imp
.
cuas_half_step
=
this
.
cuas_half_step
;
imp
.
cuas_half_step
=
this
.
cuas_half_step
;
imp
.
cuas_max_range
=
this
.
cuas_max_range
;
imp
.
cuas_max_range
=
this
.
cuas_max_range
;
imp
.
cuas_fin_range
=
this
.
cuas_fin_range
;
imp
.
cuas_fin_range
=
this
.
cuas_fin_range
;
...
...
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