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
6c7e3422
Commit
6c7e3422
authored
Sep 25, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working snapshot for VegetationLMA, some debug tools
parent
8aa4bef7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
356 additions
and
65 deletions
+356
-65
VegetationLMA.java
...main/java/com/elphel/imagej/vegetation/VegetationLMA.java
+303
-32
VegetationModel.java
...in/java/com/elphel/imagej/vegetation/VegetationModel.java
+53
-33
No files found.
src/main/java/com/elphel/imagej/vegetation/VegetationLMA.java
View file @
6c7e3422
This diff is collapsed.
Click to expand it.
src/main/java/com/elphel/imagej/vegetation/VegetationModel.java
View file @
6c7e3422
...
...
@@ -697,41 +697,61 @@ public class VegetationModel {
Rectangle
woi50
=
new
Rectangle
(
143
,
317
,
35
,
35
);
int
min_scenes
=
10
;
double
default_alpha
=
0.8
;
double
[]
scene_weights
=
null
;
double
reg_weights
=
0.25
;
// fraction of the total weight used for regularization
double
alpha_loss
=
1.0
;
// quadratic loss when alpha reaches -1.0 or 2.0
double
alpha_loss
=
1
000.0
;
// 100.; // 10
.0; // quadratic loss when alpha reaches -1.0 or 2.0
double
alpha_offset
=
0.0
;
// if >0, start losses above 0.0 and below 1.0;
int
num_samples
=
vegetationLMA
.
prepareLMA
(
woi50
,
// final Rectangle woi,
min_scenes
,
// final int min_scenes, // minimal number of scenes (inside woi) vegetation pixel must influence
default_alpha
,
// final double default_alpha,
scene_weights
,
// final double [] scene_weights, // null or per-scene weights (higher for larger offsets)?
reg_weights
,
// final double reg_weights, // fraction of the total weight used for regularization
alpha_loss
,
// final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0
alpha_offset
,
// final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0
debugLevel
);
// final int debugLevel);
double
lambda
=
0.1
;
double
lambda_scale_good
=
0.5
;
double
lambda_scale_bad
=
8.0
;
double
lambda_max
=
1000
;
boolean
last_run
=
false
;
double
rms_diff
=
0.0001
;
int
num_iter
=
100
;
vegetationLMA
.
debug_index
=
0
;
vegetationLMA
.
debug_image
=
new
double
[
num_iter
][];
int
lma_rslt
=
vegetationLMA
.
runLma
(
// <0 - failed, >=0 iteration number (1 - immediately)
lambda
,
// double lambda, // 0.1
lambda_scale_good
,
// double lambda_scale_good,// 0.5
lambda_scale_bad
,
// double lambda_scale_bad, // 8.0
lambda_max
,
// double lambda_max, // 100
rms_diff
,
// double rms_diff, // 0.001
num_iter
,
//int num_iter, // 20
last_run
,
// boolean last_run,
null
,
// String dbg_prefix,
debugLevel
);
// int debug_level)
double
alpha_lpf
=
2.0
;
// 1.5; // 5.0; // 0.5; // pull to average of 4 neighbors
double
boost_parallax
=
5
;
boolean
exit_loop
=
debugLevel
<
1000
;
boolean
next_run
=
false
;
boolean
read_pars
=
true
;
String
parameters_path
=
"/media/elphel/SSD3-4GB/lwir16-proc/berdich3/debug/vegetation/lma/parameters_vector_data.tiff"
;
do
{
String
par_path
=
(
read_pars
&&
!
next_run
)?
parameters_path
:
null
;
int
num_samples
=
vegetationLMA
.
prepareLMA
(
next_run
,
// final boolean keep_parameters,
woi50
,
// final Rectangle woi,
min_scenes
,
// final int min_scenes, // minimal number of scenes (inside woi) vegetation pixel must influence
default_alpha
,
// final double default_alpha,
reg_weights
,
// final double reg_weights, // fraction of the total weight used for regularization
alpha_loss
,
// final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0
alpha_offset
,
// final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0
alpha_lpf
,
// final double alpha_lpf, // pull to average of 4 neighbors
boost_parallax
,
// final double boost_parallax, // increase weight of scene with maximal parallax relative to the reference scene
par_path
,
// final String parameters_read_path,
debugLevel
);
// final int debugLevel);
if
(
debugLevel
>-
2
)
{
vegetationLMA
.
showYfX
(
null
,
// double [] vector,
"reconstructed_model"
);
// String title)
}
next_run
=
true
;
double
lambda
=
5.0
;
// 0.1;
double
lambda_scale_good
=
0.5
;
double
lambda_scale_bad
=
8.0
;
double
lambda_max
=
1000
;
boolean
last_run
=
false
;
double
rms_diff
=
1
e
-
8
;
// 0.0001; virtually forever
int
num_iter
=
100
;
vegetationLMA
.
debug_index
=
0
;
vegetationLMA
.
debug_image
=
new
double
[
num_iter
][];
int
lma_rslt
=
vegetationLMA
.
runLma
(
// <0 - failed, >=0 iteration number (1 - immediately)
lambda
,
// double lambda, // 0.1
lambda_scale_good
,
// double lambda_scale_good,// 0.5
lambda_scale_bad
,
// double lambda_scale_bad, // 8.0
lambda_max
,
// double lambda_max, // 100
rms_diff
,
// double rms_diff, // 0.001
num_iter
,
//int num_iter, // 20
last_run
,
// boolean last_run,
null
,
// String dbg_prefix,
debugLevel
);
// int debug_level)
}
while
(!
exit_loop
);
if
(
debugLevel
>-
2
)
{
vegetationLMA
.
showYfX
(
null
,
// double [] vector,
"reconstructed_model_adjusted"
);
// String title)
}
return
;
//
}
...
...
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