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
8e595c63
Commit
8e595c63
authored
May 31, 2025
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compare to template
parent
62655772
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
177 additions
and
517 deletions
+177
-517
CalibrationFileManagement.java
.../elphel/imagej/calibration/CalibrationFileManagement.java
+3
-0
Cuas.java
src/main/java/com/elphel/imagej/cuas/Cuas.java
+104
-482
Interscene.java
...main/java/com/elphel/imagej/tileprocessor/Interscene.java
+1
-1
IntersceneMatchParameters.java
...lphel/imagej/tileprocessor/IntersceneMatchParameters.java
+16
-0
OpticalFlow.java
...ain/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
+33
-23
QuadCLT.java
src/main/java/com/elphel/imagej/tileprocessor/QuadCLT.java
+1
-1
QuadCLTCPU.java
...main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
+19
-10
No files found.
src/main/java/com/elphel/imagej/calibration/CalibrationFileManagement.java
View file @
8e595c63
...
...
@@ -168,6 +168,9 @@ public class CalibrationFileManagement {
if
((
dir
!=
null
)
&&
(!
dir
.
isDirectory
())){
dir
=
dir
.
getParentFile
();
}
if
((
dir
!=
null
)
&&
(
dir
.
exists
())
&&
(
dir
.
isDirectory
()
==
directory
))
{
// 05.30.2025
return
dir
.
getPath
();
}
if
(!
smart
)
{
// 05.29.2025
return
null
;
...
...
src/main/java/com/elphel/imagej/cuas/Cuas.java
View file @
8e595c63
...
...
@@ -18,421 +18,7 @@ import com.elphel.imagej.tileprocessor.TileProcessor;
import
ij.ImagePlus
;
public
class
Cuas
{
/*
@Deprecated
public static QuadCLT createCenterClt( // assuming cuas_rotation is true
CLTParameters clt_parameters,
QuadCLT [] quadCLTs,
int ref_index, // where combo_dsi is
int [] range, // or null
double [][] ref_combo_dsi, // DSI data for the reference scene (or null to read it from file)
boolean condition_dsi,
int sensor_mask, // -1 - all;
int debugLevel) {
QuadCLT ref_clt = quadCLTs[ref_index];
QuadCLT last_clt = quadCLTs[quadCLTs.length-1]; // save center with the latest timestamp
if (range == null) {
range = new int [] {0, quadCLTs.length-1};
}
if (ref_index <0) {
ref_index = quadCLTs.length-1;
}
double [][] center_ATR = CuasCenterLma.getCenterATR(
quadCLTs, // QuadCLT [] quadCLTs,
ref_index, //int ref_index,
range, //int [] range,
debugLevel); // int debugLevel);
double [] cuas_atr = new double [] { center_ATR[0][0], center_ATR[0][1], center_ATR[0][2]};
if (ref_combo_dsi == null) {
ref_combo_dsi =quadCLTs[ref_index].restoreComboDSI(true); // also sets quadCLTs[ref_index].dsi and blue sky
}
double [][] dls = {
ref_combo_dsi[OpticalFlow.COMBO_DSN_INDX_DISP],
ref_combo_dsi[OpticalFlow.COMBO_DSN_INDX_LMA],
ref_combo_dsi[OpticalFlow.COMBO_DSN_INDX_STRENGTH]
};
double [][] ds = new double [][] {dls[0],dls[2]}; // {disparity, strength}
if (condition_dsi) {
ds = OpticalFlow.conditionInitialDS( // only
true, // boolean use_conf, // use configuration parameters, false - use following
clt_parameters, // CLTParameters clt_parameters,
dls, // double [][] dls
quadCLTs[ref_index], // QuadCLT scene,
debugLevel);
}
// getRefPxPyD: pX, pY reference image X,Y correspomnding to the uniform grid of the center view
final double [][] ref_pXpYD = getRefPxPyD( // Use to interpolate disparity layers
clt_parameters, // CLTParameters clt_parameters,
true, // boolean mode_cuas,
null, // Rectangle fov_tiles,
OpticalFlow.ZERO3, // double [] stereo_xyz, // offset reference camera {x,y,z}
cuas_atr, // double [] stereo_atr_in, // offset reference orientation (cuas)
ds[0], // double [] ref_disparity,
ref_clt, // QuadCLT refCLT, // should be the same instance if one of quadCLTs
debugLevel); // int debugLevel)
boolean save_weights = true; // always
float [][] center_clt_w = getTDComboSceneSequence(
clt_parameters, // CLTParameters clt_parameters,
ref_pXpYD, // double [][] ref_pXpYD,
save_weights, // boolean save_weights, // output corresponding weights for each data
true, // boolean merge_all,
sensor_mask, // int sensor_mask,
null, // Rectangle fov_tiles,
OpticalFlow.ZERO3, // double [] stereo_xyz, // offset reference camera {x,y,z}
cuas_atr, // double [] stereo_atr_in, // offset reference orientation (cuas)
null, // ds[0], // double [] ref_disparity, // may be null if ref_pXpYD != null
quadCLTs, // QuadCLT [] quadCLTs,
ref_clt, // QuadCLT refCLT, // should be the same instance if one of quadCLTs
debugLevel); // int debugLevel)
// remove weights
float [][] center_clt = save_weights? new float [center_clt_w.length/2][]: center_clt_w;
int [][] center_clt_num = save_weights? new int [center_clt_w.length/2][]: null;
if (save_weights) { // remove second half (weights as integer numbers)
for (int i = 0; i< center_clt.length; i++) {
center_clt[i] = center_clt_w[i];
center_clt_num[i] = new int [center_clt_w[i + center_clt.length].length];
for (int j = 0; j < center_clt_num[i].length; j++) {
center_clt_num[i][j] = (int) Math.round(center_clt_w[i + center_clt.length][j]);
}
}
}
int [] wh_c = ref_clt.getWHC(false);
//final int tile_size_td = 4 * GPUTileProcessor.DTT_SIZE * GPUTileProcessor.DTT_SIZE;
final int width_clt = wh_c[0] * 2; // to make image dimensions similar
String center_name = QuadCLT.getCenterDirName(last_clt.getImageName()); // make name from last timestamp, not reference
String ref_dir_path = ref_clt.getX3dDirectory(center_name);
File cdir = new File(ref_dir_path);
QuadCLT center_CLT = new QuadCLT(ref_clt, center_name); //null
cdir.mkdirs();
center_CLT.setImagePath(cdir.getPath());
center_CLT.setCenterClt(
center_clt[0], // float [] clt,
center_clt_num[0], // int [] clt_num,
width_clt); // int clt_width);
TileProcessor tp = quadCLTs[quadCLTs.length - 1].getTileProcessor();
final int transform_size = tp.getTileSize();
final int tilesX = tp.getTilesX();
final int tilesY = tp.getTilesY();
final double [][] center_combo_dsi = interpolateDSI(
ref_pXpYD, // final double [][] ref_pXpYD,
ref_combo_dsi, // combo_dsi_cli, // final double [][] dsi_in,
transform_size, // final int transform_size,
tilesX, // final int tilesX,
tilesY); //final int tilesY);
center_CLT.setDSIFromCombo(center_combo_dsi); // reformat
// center_CLT.setDSI(center_combo_dsi); // WRONG!
String rslt_suffix = "-INTER-INTRA";
rslt_suffix += (clt_parameters.correlate_lma?"-LMA":"-NOLMA");
// fixing NaN in strengths. It is uses to return RMS in Not needed - NaN was from Arrays.fill(combo_dsn_final[i], Double.NaN);
// OpticalFlow:10348
for (int slice: OpticalFlow.COMBO_DSN_NONNAN) { // new int[] {COMBO_DSN_INDX_STRENGTH,COMBO_DSN_INDX_STRENGTH_BG}) {
if (center_combo_dsi[slice] != null) {
for (int i = 0; i <center_combo_dsi[slice].length; i++) {
if (Double.isNaN(center_combo_dsi[slice][i])) {
center_combo_dsi[slice][i] = 0.0;
}
}
}
}
center_CLT.saveDoubleArrayInModelDirectory( // error
rslt_suffix, // String suffix,
OpticalFlow.COMBO_DSN_TITLES, // combo_dsn_titles_full, // null, // String [] labels, // or null
center_combo_dsi, // dbg_data, // double [][] data,
tilesX, // int width,
tilesY); // int height)
// center_CLT.saveDSI();
center_CLT.saveCenterClt();
boolean save_clt = true;
boolean save_dsi = true;
boolean save_in_ref = true;
boolean save_in_last = true;
if (save_clt) {
final int height_clt = combo_seq_clt[0].length/width_clt;
String [] clt_titles = new String [combo_seq_clt_w.length];
for (int i = 0; i < combo_seq_clt.length; i++) {
clt_titles[i] = "chn-"+i;
if (save_weights) {
clt_titles[i+combo_seq_clt.length] = "weight-"+i;
}
}
String suffix_clt = "-clt_combo";
if (save_weights) {
suffix_clt+="_weights";
}
if (save_in_ref) {
ref_clt.saveFloatArrayInModelDirectory( // error
suffix_clt, // String suffix,
clt_titles, // combo_dsn_titles_full, // null, // String [] labels, // or null
combo_seq_clt_w, // dbg_data, // float [][] data,
width_clt, // int width,
height_clt); // int height)
}
if (save_in_last) {
quadCLTs[quadCLTs.length - 1].saveFloatArrayInModelDirectory( // error
suffix_clt, // String suffix,
clt_titles, // combo_dsn_titles_full, // null, // String [] labels, // or null
combo_seq_clt_w, // dbg_data, // float [][] data,
width_clt, // int width,
height_clt); // int height)
}
}
if (save_dsi) {
// final double [][] combo_dsi_cli = ref_clt.restoreComboDSI (true);
TileProcessor tp = quadCLTs[quadCLTs.length - 1].getTileProcessor();
final int transform_size = tp.getTileSize();
final int tilesX = tp.getTilesX();
final int tilesY = tp.getTilesY();
final double [][] center_dsi = interpolateDSI(
ref_pXpYD, // final double [][] ref_pXpYD,
ref_dsi, // combo_dsi_cli, // final double [][] dsi_in,
transform_size, // final int transform_size,
tilesX, // final int tilesX,
tilesY); //final int tilesY);
String rslt_suffix = "-CENTER-INTER-INTRA";
// use quadCLTs[quadCLTs.length - 1].restoreComboDSI ("-CENTER",true); to restore
rslt_suffix += (clt_parameters.correlate_lma?"-LMA":"-NOLMA");
if (save_in_ref) {
ref_clt.saveDoubleArrayInModelDirectory( // error
rslt_suffix, // String suffix,
OpticalFlow.COMBO_DSN_TITLES, // combo_dsn_titles_full, // null, // String [] labels, // or null
center_dsi, // dbg_data, // double [][] data,
tilesX, // int width,
tilesY); // int height)
}
if (save_in_last) {
quadCLTs[quadCLTs.length - 1].saveDoubleArrayInModelDirectory( // error
rslt_suffix, // String suffix,
OpticalFlow.COMBO_DSN_TITLES, // combo_dsn_titles_full, // null, // String [] labels, // or null
center_dsi, // dbg_data, // double [][] data,
tilesX, // int width,
tilesY); // int height)
}
}
return center_CLT;
}
*/
@Deprecated
public
static
QuadCLT
createCenterClt_old
(
// assuming cuas_rotation is true
CLTParameters
clt_parameters
,
QuadCLT
[]
quadCLTs
,
QuadCLT
ref_scene
,
// where combo_dsi is
int
[]
range
,
// or null
double
[][]
ref_combo_dsi
,
// DSI data for the reference scene (or null to read it from file)
boolean
condition_dsi
,
int
sensor_mask
,
// -1 - all;
int
debugLevel
)
{
QuadCLT
last_clt
=
quadCLTs
[
quadCLTs
.
length
-
1
];
// save center with the latest timestamp
if
(
range
==
null
)
{
range
=
new
int
[]
{
0
,
quadCLTs
.
length
-
1
};
}
double
[][]
center_ATR
=
CuasCenterLma
.
getCenterATR
(
// relative to ref_scene
quadCLTs
,
// QuadCLT [] quadCLTs,
ref_scene
,
// QuadCLT ref_scene, //
range
,
//int [] range,
debugLevel
);
// int debugLevel);
double
[]
cuas_xyz
=
new
double
[
3
];
//maybe use later
double
[]
cuas_atr
=
new
double
[]
{
center_ATR
[
0
][
0
],
center_ATR
[
0
][
1
],
center_ATR
[
0
][
2
]};
double
[][]
cuas_xyzatr
=
{
cuas_xyz
,
cuas_atr
};
if
(
ref_combo_dsi
==
null
)
{
ref_combo_dsi
=
ref_scene
.
restoreComboDSI
(
true
);
// also sets quadCLTs[ref_index].dsi and blue sky
}
double
[][]
dls
=
{
ref_combo_dsi
[
OpticalFlow
.
COMBO_DSN_INDX_DISP
],
ref_combo_dsi
[
OpticalFlow
.
COMBO_DSN_INDX_LMA
],
ref_combo_dsi
[
OpticalFlow
.
COMBO_DSN_INDX_STRENGTH
]
};
double
[][]
ds
=
new
double
[][]
{
dls
[
0
],
dls
[
2
]};
// {disparity, strength}
if
(
condition_dsi
)
{
ds
=
OpticalFlow
.
conditionInitialDS
(
// only
true
,
// boolean use_conf, // use configuration parameters, false - use following
clt_parameters
,
// CLTParameters clt_parameters,
dls
,
// double [][] dls
ref_scene
,
// QuadCLT scene,
debugLevel
);
}
// getRefPxPyD: pX, pY reference image X,Y corresponding to the uniform grid of the center view
final
double
[][]
ref_pXpYD
=
getRefPxPyD
(
// Use to interpolate disparity layers
clt_parameters
,
// CLTParameters clt_parameters,
true
,
// boolean mode_cuas,
null
,
// Rectangle fov_tiles,
OpticalFlow
.
ZERO3
,
// double [] stereo_xyz, // offset reference camera {x,y,z}
cuas_atr
,
// double [] stereo_atr_in, // offset reference orientation (cuas)
ds
[
0
],
// double [] ref_disparity,
ref_scene
,
// QuadCLT refCLT, // should be the same instance if one of quadCLTs
debugLevel
);
// int debugLevel)
boolean
save_weights
=
true
;
// always
float
[][][]
center_clt_w
=
getTDComboSceneSequence
(
clt_parameters
,
// CLTParameters clt_parameters,
ref_pXpYD
,
// double [][] ref_pXpYD,
save_weights
,
// boolean save_weights, // output corresponding weights for each data
true
,
// boolean merge_all,
sensor_mask
,
// int sensor_mask,
null
,
// Rectangle fov_tiles,
OpticalFlow
.
ZERO3
,
// double [] stereo_xyz, // offset reference camera {x,y,z}
cuas_atr
,
// double [] stereo_atr_in, // offset reference orientation (cuas)
null
,
// ds[0], // double [] ref_disparity, // may be null if ref_pXpYD != null
quadCLTs
,
// QuadCLT [] quadCLTs,
ref_scene
,
// QuadCLT refCLT, // should be the same instance if one of quadCLTs
debugLevel
);
// int debugLevel)
// remove weights
//// float [][] center_clt = save_weights? new float [center_clt_w.length/2][]: center_clt_w;
//// int [][] center_clt_num = save_weights? new int [center_clt_w.length/2][]: null;
/*
int [][] center_clt_num = save_weights? new int [center_clt_w.length/2][]: null;
if (save_weights) { // remove second half (weights as integer numbers)
for (int i = 0; i< center_clt.length; i++) {
center_clt[i] = center_clt_w[i];
center_clt_num[i] = new int [center_clt_w[i + center_clt.length].length];
for (int j = 0; j < center_clt_num[i].length; j++) {
center_clt_num[i][j] = (int) Math.round(center_clt_w[i + center_clt.length][j]);
}
}
}
int [] wh_c = ref_scene.getWHC(false);
//final int tile_size_td = 4 * GPUTileProcessor.DTT_SIZE * GPUTileProcessor.DTT_SIZE;
final int width_clt = wh_c[0] * 2; // to make image dimensions similar
*/
String
center_name
=
QuadCLT
.
getCenterDirName
(
last_clt
.
getImageName
());
// make name from last timestamp, not reference
String
ref_dir_path
=
ref_scene
.
getX3dDirectory
(
center_name
);
File
cdir
=
new
File
(
ref_dir_path
);
QuadCLT
center_CLT
=
new
QuadCLT
(
ref_scene
,
center_name
);
//null
cdir
.
mkdirs
();
center_CLT
.
setImagePath
(
cdir
.
getPath
());
/*
center_CLT.setCenterClt(
center_clt[0], // float [] clt,
center_clt_num[0], // int [] clt_num,
width_clt); // int clt_width);
*/
center_CLT
.
setCenterClt
(
// only for merged sensors
center_clt_w
[
0
][
0
],
// float [] clt,
center_clt_w
[
1
][
0
]);
// int [] clt_num, // Index 1 out of bounds for length 1
// TileProcessor tp = quadCLTs[quadCLTs.length - 1].getTileProcessor();
final
int
transform_size
=
ref_scene
.
getTileSize
();
final
int
tilesX
=
ref_scene
.
getTilesX
();
final
int
tilesY
=
ref_scene
.
getTilesY
();
final
double
[][]
center_combo_dsi
=
interpolateDSI
(
ref_pXpYD
,
// final double [][] ref_pXpYD,
ref_combo_dsi
,
// combo_dsi_cli, // final double [][] dsi_in,
transform_size
,
// final int transform_size,
tilesX
,
// final int tilesX,
tilesY
);
//final int tilesY);
center_CLT
.
setDSIFromCombo
(
center_combo_dsi
);
// reformat
// center_CLT.setDSI(center_combo_dsi); // WRONG!
String
rslt_suffix
=
"-INTER-INTRA"
;
rslt_suffix
+=
(
clt_parameters
.
correlate_lma
?
"-LMA"
:
"-NOLMA"
);
/*
// fixing NaN in strengths. It is uses to return RMS in Not needed - NaN was from Arrays.fill(combo_dsn_final[i], Double.NaN);
// OpticalFlow:10348
for (int slice: OpticalFlow.COMBO_DSN_NONNAN) { // new int[] {COMBO_DSN_INDX_STRENGTH,COMBO_DSN_INDX_STRENGTH_BG}) {
if (center_combo_dsi[slice] != null) {
for (int i = 0; i <center_combo_dsi[slice].length; i++) {
if (Double.isNaN(center_combo_dsi[slice][i])) {
center_combo_dsi[slice][i] = 0.0;
}
}
}
}
*/
center_CLT
.
saveDoubleArrayInModelDirectory
(
// error
rslt_suffix
,
// String suffix,
OpticalFlow
.
COMBO_DSN_TITLES
,
// combo_dsn_titles_full, // null, // String [] labels, // or null
center_combo_dsi
,
// dbg_data, // double [][] data,
tilesX
,
// int width,
tilesY
);
// int height)
// center_CLT.saveDSI();
center_CLT
.
saveCenterClt
();
/*
boolean save_clt = true;
boolean save_dsi = true;
boolean save_in_ref = true;
boolean save_in_last = true;
if (save_clt) {
final int height_clt = combo_seq_clt[0].length/width_clt;
String [] clt_titles = new String [combo_seq_clt_w.length];
for (int i = 0; i < combo_seq_clt.length; i++) {
clt_titles[i] = "chn-"+i;
if (save_weights) {
clt_titles[i+combo_seq_clt.length] = "weight-"+i;
}
}
String suffix_clt = "-clt_combo";
if (save_weights) {
suffix_clt+="_weights";
}
if (save_in_ref) {
ref_clt.saveFloatArrayInModelDirectory( // error
suffix_clt, // String suffix,
clt_titles, // combo_dsn_titles_full, // null, // String [] labels, // or null
combo_seq_clt_w, // dbg_data, // float [][] data,
width_clt, // int width,
height_clt); // int height)
}
if (save_in_last) {
quadCLTs[quadCLTs.length - 1].saveFloatArrayInModelDirectory( // error
suffix_clt, // String suffix,
clt_titles, // combo_dsn_titles_full, // null, // String [] labels, // or null
combo_seq_clt_w, // dbg_data, // float [][] data,
width_clt, // int width,
height_clt); // int height)
}
}
if (save_dsi) {
// final double [][] combo_dsi_cli = ref_clt.restoreComboDSI (true);
TileProcessor tp = quadCLTs[quadCLTs.length - 1].getTileProcessor();
final int transform_size = tp.getTileSize();
final int tilesX = tp.getTilesX();
final int tilesY = tp.getTilesY();
final double [][] center_dsi = interpolateDSI(
ref_pXpYD, // final double [][] ref_pXpYD,
ref_dsi, // combo_dsi_cli, // final double [][] dsi_in,
transform_size, // final int transform_size,
tilesX, // final int tilesX,
tilesY); //final int tilesY);
String rslt_suffix = "-CENTER-INTER-INTRA";
// use quadCLTs[quadCLTs.length - 1].restoreComboDSI ("-CENTER",true); to restore
rslt_suffix += (clt_parameters.correlate_lma?"-LMA":"-NOLMA");
if (save_in_ref) {
ref_clt.saveDoubleArrayInModelDirectory( // error
rslt_suffix, // String suffix,
OpticalFlow.COMBO_DSN_TITLES, // combo_dsn_titles_full, // null, // String [] labels, // or null
center_dsi, // dbg_data, // double [][] data,
tilesX, // int width,
tilesY); // int height)
}
if (save_in_last) {
quadCLTs[quadCLTs.length - 1].saveDoubleArrayInModelDirectory( // error
rslt_suffix, // String suffix,
OpticalFlow.COMBO_DSN_TITLES, // combo_dsn_titles_full, // null, // String [] labels, // or null
center_dsi, // dbg_data, // double [][] data,
tilesX, // int width,
tilesY); // int height)
}
}
*/
return
center_CLT
;
}
public
static
QuadCLT
createCenterClt
(
// assuming cuas_rotation is true
CLTParameters
clt_parameters
,
QuadCLT
[]
quadCLTs
,
...
...
@@ -559,6 +145,8 @@ public class Cuas {
}
boolean
save_weights
=
true
;
// always
double
cuas_clt_threshold
=
clt_parameters
.
imp
.
cuas_clt_threshold
;
// 20;
double
cuas_clt_decrease
=
clt_parameters
.
imp
.
cuas_clt_decrease
;
// 0.01;
float
[][][]
center_clt_w
=
getTDComboSceneSequence
(
clt_parameters
,
// CLTParameters clt_parameters,
null
,
// ref_pXpYD, // double [][] ref_pXpYD,
...
...
@@ -571,7 +159,30 @@ public class Cuas {
disparity_center
,
// ds[0], // double [] ref_disparity, // may be null if ref_pXpYD != null
quadCLTs
,
// QuadCLT [] quadCLTs,
center_CLT
,
// ref_scene, // QuadCLT refCLT, // should be the same instance if one of quadCLTs
null
,
// float [][] ref_slices, // same dimensions, compare to current
cuas_clt_threshold
,
// final double clt_threshold, // will be ignored as ref_slices== null
cuas_clt_decrease
,
// final double clt_decrease, // will be ignored as ref_slices== null
debugLevel
);
// int debugLevel)
boolean
test_diff
=
true
;
// false;
if
(
test_diff
||
(
cuas_clt_threshold
>
0
))
{
center_clt_w
=
getTDComboSceneSequence
(
clt_parameters
,
// CLTParameters clt_parameters,
null
,
// ref_pXpYD, // double [][] ref_pXpYD,
save_weights
,
// boolean save_weights, // output corresponding weights for each data
true
,
// boolean merge_all,
sensor_mask
,
// int sensor_mask,
null
,
// Rectangle fov_tiles,
OpticalFlow
.
ZERO3
,
// double [] stereo_xyz, // offset reference camera {x,y,z}
OpticalFlow
.
ZERO3
,
// cuas_atr, // double [] stereo_atr_in, // offset reference orientation (cuas)
disparity_center
,
// ds[0], // double [] ref_disparity, // may be null if ref_pXpYD != null
quadCLTs
,
// QuadCLT [] quadCLTs,
center_CLT
,
// ref_scene, // QuadCLT refCLT, // should be the same instance if one of quadCLTs
center_clt_w
[
0
],
// float [][] ref_slices, // same dimensions, compare to current
cuas_clt_threshold
,
// final double clt_threshold,
cuas_clt_decrease
,
// final double clt_decrease,
debugLevel
);
// int debugLevel)
}
center_CLT
.
setCenterClt
(
// only for merged sensors
center_clt_w
[
0
][
0
],
// float [] clt, // per CLT sample (4x pixels)
center_clt_w
[
1
][
0
]);
// float [] clt_weights // per tile
...
...
@@ -588,10 +199,10 @@ public class Cuas {
int
[]
slices_to_fill
=
{
OpticalFlow
.
COMBO_DSN_INDX_DISP
,
OpticalFlow
.
COMBO_DSN_INDX_STRENGTH
OpticalFlow
.
COMBO_DSN_INDX_STRENGTH
,
// OpticalFlow.COMBO_DSN_INDX_LMA, // keep as is
// OpticalFlow.COMBO_DSN_INDX_CHANGE, // may just relace nan with 0
/// OpticalFlow.COMBO_DSN_INDX_DISP_FG,
OpticalFlow
.
COMBO_DSN_INDX_DISP_FG
,
// Needed in setDSIFromCombo() !!!
/// OpticalFlow.COMBO_DSN_INDX_DISP_BG_ALL
};
fillNanDsi
(
...
...
@@ -758,50 +369,7 @@ public class Cuas {
return
combo_dsi
;
}
/*
public static float [][] getTDComboSceneSequence( // never used
CLTParameters clt_parameters,
final boolean save_weights, // output corresponding weights for each data
final boolean merge_all,
final int sensor_mask,
Rectangle fov_tiles,
double [] stereo_xyz, // offset reference camera {x,y,z}
double [] stereo_atr, // offset reference orientation (cuas)
double [] ref_disparity,
QuadCLT [] quadCLTs,
QuadCLT refCLT, // should be the same instance if one of quadCLTs
// int ref_index,
int debugLevel) {
// double [] stereo_atr = (stereo_atr_in != null)? stereo_atr_in: ZERO3; // maybe later play with rotated camera
boolean mode_cuas = (stereo_atr!=null) && ((stereo_atr[0] != 0) || (stereo_atr[1] != 0) || (stereo_atr[2] != 0));
double [][] ref_pXpYD = getRefPxPyD(
clt_parameters, // CLTParameters clt_parameters,
mode_cuas, // boolean mode_cuas,
// save_weights, // final boolean save_weights, // output corresponding weights for each data
fov_tiles, // Rectangle fov_tiles,
stereo_xyz, // double [] stereo_xyz, // offset reference camera {x,y,z}
stereo_atr, // double [] stereo_atr_in, // offset reference orientation (cuas)
ref_disparity, // double [] ref_disparity,
refCLT, // QuadCLT refCLT, // should be the same instance if one of quadCLTs
debugLevel); // int debugLevel)
return getTDComboSceneSequence(
clt_parameters, // CLTParameters clt_parameters,
ref_pXpYD, // double [][] ref_pXpYD,
save_weights, // final boolean save_weights, // output corresponding weights for each data
merge_all, // final boolean merge_all,
sensor_mask, // final int sensor_mask,
fov_tiles, // Rectangle fov_tiles,
stereo_xyz, // double [] stereo_xyz, // offset reference camera {x,y,z}
stereo_atr, // double [] stereo_atr_in, // offset reference orientation (cuas)
ref_disparity, // double [] ref_disparity,
quadCLTs, // QuadCLT [] quadCLTs,
refCLT, // QuadCLT refCLT, // should be the same instance if one of quadCLTs
debugLevel); // int debugLevel);
}
*/
// TODO: Use only center disparity, ignore pX,pY
public
static
float
[][][]
getTDComboSceneSequence
(
CLTParameters
clt_parameters
,
double
[][]
ref_pXpYD
,
// TODO: Use disparity, ignore pXpYD?
...
...
@@ -813,10 +381,23 @@ public class Cuas {
double
[]
stereo_atr_in
,
// offset reference orientation (cuas)
double
[]
ref_disparity
,
// null
QuadCLT
[]
quadCLTs
,
QuadCLT
refCLT
,
// should be the same instance if one of quadCLTs?
QuadCLT
refCLT
,
// center_CLT
float
[][]
ref_slices
,
// same dimensions, compare to current
final
double
clt_threshold
,
final
double
clt_decrease
,
int
debugLevel
)
{
boolean
debug_pxpyd
=
false
;
boolean
debug_pxpyd
=
true
;
// false;
int
dbg_slices
=
3
;
final
int
tilesX
=
refCLT
.
getTilesX
();
final
int
tilesY
=
refCLT
.
getTilesX
();
double
[][]
tile_diffs
=
(
debug_pxpyd
&&
(
ref_slices
!=
null
))
?
new
double
[
quadCLTs
.
length
][
tilesX
*
tilesY
]:
null
;
if
(
tile_diffs
!=
null
)
{
for
(
int
i
=
0
;
i
<
tile_diffs
.
length
;
i
++)
{
Arrays
.
fill
(
tile_diffs
[
i
],
Double
.
NaN
);
}
}
double
[][][]
dbg_PxPyD
=
debug_pxpyd
?
(
new
double
[
dbg_slices
][
quadCLTs
.
length
][]):
null
;
double
[][][]
dbg_PxPyD_slice
=
debug_pxpyd
?
(
new
double
[
1
][][]):
null
;
...
...
@@ -866,6 +447,7 @@ public class Cuas {
final
Thread
[]
threads
=
ImageDtt
.
newThreadArray
(
ImageDtt
.
THREADS_MAX
);
final
AtomicInteger
ai
=
new
AtomicInteger
(
0
);
for
(
int
nscene
=
0
;
nscene
<
quadCLTs
.
length
;
nscene
++)
if
(
quadCLTs
[
nscene
]
!=
null
){
final
int
fnscene
=
nscene
;
if
(
nscene
==
dbg_scene
)
{
System
.
out
.
println
(
"renderSceneSequence(): nscene = "
+
nscene
);
}
...
...
@@ -983,31 +565,56 @@ public class Cuas {
threads
[
ithread
]
=
new
Thread
()
{
public
void
run
()
{
for
(
int
nTile
=
ai
.
getAndIncrement
();
nTile
<
num_tiles
;
nTile
=
ai
.
getAndIncrement
())
{
for
(
int
slice
=
0
;
slice
<
num_slices
;
slice
++)
{
// normally just one
int
fclt_offs
=
nTile
*
tile_length
;
float
[]
fclt_slice
=
ffclt
[
slice
];
float
[]
sumFclt_slice
=
sumFclt
[
slice
];
boolean
no_nans
=
true
;
int
indx
=
fclt_offs
;
for
(
int
i
=
0
;
i
<
tile_length
;
i
++)
{
if
(
Float
.
isNaN
(
fclt_slice
[
indx
++]))
{
no_nans
=
false
;
break
;
int
fclt_offs
=
nTile
*
tile_length
;
double
s2
=
0
;
int
ns
=
num_slices
*
tile_length
;
boolean
no_nans
=
true
;
check_nan:
{
for
(
int
slice
=
0
;
slice
<
num_slices
;
slice
++)
{
// normally just one
float
[]
fclt_slice
=
ffclt
[
slice
];
// float [] sumFclt_slice = sumFclt[slice];
int
indx
=
fclt_offs
;
for
(
int
i
=
0
;
i
<
tile_length
;
i
++)
{
if
(
Float
.
isNaN
(
fclt_slice
[
indx
++]))
{
no_nans
=
false
;
break
check_nan
;
}
}
}
}
if
(!
no_nans
)
{
continue
;
}
float
w
=
1.0f
;
// constant weight
if
((
ref_slices
!=
null
)
&&
((
clt_threshold
>
0
)
||
(
tile_diffs
!=
null
)))
{
for
(
int
slice
=
0
;
slice
<
num_slices
;
slice
++)
{
// normally just one
float
[]
fclt_slice
=
ffclt
[
slice
];
float
[]
fclt_ref
=
ref_slices
[
slice
];
int
indx
=
fclt_offs
;
for
(
int
i
=
0
;
i
<
tile_length
;
i
++)
{
double
diff
=
fclt_slice
[
indx
]
-
fclt_ref
[
indx
];
s2
+=
diff
*
diff
;
indx
++;
}
}
double
diff
=
Math
.
sqrt
(
s2
/
ns
);
if
(
diff
>
clt_threshold
)
{
w
=
(
float
)
clt_decrease
;
}
if
(
no_nans
)
{
indx
=
fclt_offs
;
float
w
=
1.0f
;
// constant weight
if
(
tile_diffs
!=
null
)
{
tile_diffs
[
fnscene
][
nTile
]
=
diff
;
}
}
for
(
int
slice
=
0
;
slice
<
num_slices
;
slice
++)
{
// normally just one
int
indx
=
fclt_offs
;
float
[]
fclt_slice
=
ffclt
[
slice
];
float
[]
sumFclt_slice
=
sumFclt
[
slice
];
for
(
int
i
=
0
;
i
<
tile_length
;
i
++)
{
if
(
Float
.
isNaN
(
fclt_slice
[
indx
]))
{
sumFclt_slice
[
indx
]
+=
0
;
}
else
{
sumFclt_slice
[
indx
]
+=
w
*
fclt_slice
[
indx
];
}
sumFclt_slice
[
indx
]
+=
w
*
fclt_slice
[
indx
];
indx
++;
}
sum_weights
[
slice
][
nTile
]
+=
w
;
}
}
}
}
...
...
@@ -1057,6 +664,21 @@ public class Cuas {
debug_frame_titles
,
// String [] frame_titles, // frame titles or null
true
);
// boolean show)
}
if
(
tile_diffs
!=
null
)
{
String
[]
diff_titles
=
new
String
[
quadCLTs
.
length
];
for
(
int
nscene
=
0
;
nscene
<
diff_titles
.
length
;
nscene
++)
{
diff_titles
[
nscene
]
=
quadCLTs
[
nscene
].
getImageName
();
}
String
diff_title
=
refCLT
.
getImageName
()
+
"-diffs"
;
ShowDoubleFloatArrays
.
showArrays
(
tile_diffs
,
tilesX
,
tilesY
,
true
,
diff_title
,
diff_titles
);
}
return
new
float
[][][]
{
sumFclt
,
sum_weights
};
}
...
...
src/main/java/com/elphel/imagej/tileprocessor/Interscene.java
View file @
8e595c63
...
...
@@ -1504,7 +1504,7 @@ public class Interscene {
// added 05.21.2024: skip if was spawn already
if
(
changed
||
(
quadCLTs
[
scene_index
]
==
null
))
{
// quadCLTs[scene_index] = quadCLTs[last_index].spawnNoModelQuadCLT(
quadCLTs
[
scene_index
]
=
center_CLT
.
spawnNoModelQuadCLT
(
quadCLTs
[
scene_index
]
=
center_CLT
.
spawnNoModelQuadCLT
(
// null
set_channels
[
scene_index
].
set_name
,
clt_parameters
,
colorProcParameters
,
//
...
...
src/main/java/com/elphel/imagej/tileprocessor/IntersceneMatchParameters.java
View file @
8e595c63
...
...
@@ -658,6 +658,9 @@ min_str_neib_fpn 0.35
public
int
cuas_discard_border
=
8
;
// Discard this number of pixels from each side when merging
public
double
cuas_max_fold
=
50
;
public
int
cuas_min_in_row_col
=
4
;
// Minimal number of defined tiles in a row/column
public
double
cuas_clt_threshold
=
20
;
// threshold for CLT tile difference from a template
public
double
cuas_clt_decrease
=
0.01
;
// Scale CLT outliers weight
// TODO: move next parameters elsewhere - they are not the motion blur ones.
public
int
mb_gain_index_pose
=
5
;
// pose readjust pass to switch to full mb_max_gain from mb_max_gain_inter
public
int
mb_gain_index_depth
=
5
;
// depth map refine pass (SfM) to switch to full mb_max_gain from mb_max_gain_inter
...
...
@@ -1972,6 +1975,11 @@ min_str_neib_fpn 0.35
"Maximal non-monotonic Px, Py in PxPyD (usually near image edges)."
);
gd
.
addNumericField
(
"Minimal tiles in a row/column"
,
this
.
cuas_min_in_row_col
,
0
,
3
,
"tiles"
,
"Discards rows then columns that have less defined tiles (noticed in a diagonal after folds removal)."
);
gd
.
addNumericField
(
"CLT tile diff thershold"
,
this
.
cuas_clt_threshold
,
5
,
7
,
"pix"
,
"Threshold to the CLT tile difference to a template (RMS)."
);
gd
.
addNumericField
(
"CLT outliers scale"
,
this
.
cuas_clt_decrease
,
5
,
7
,
"pix"
,
"Scale CLT outliers tiles weight when averaging."
);
gd
.
addTab
(
"LMA sequence"
,
"Interscene LMA sequence control"
);
gd
.
addMessage
(
"Parameters for control of the LMA pose adjustment sequence"
);
gd
.
addNumericField
(
"Pose readjust number for full mb_gain"
,
this
.
mb_gain_index_pose
,
0
,
3
,
""
,
...
...
@@ -2858,6 +2866,8 @@ min_str_neib_fpn 0.35
this
.
cuas_discard_border
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_max_fold
=
gd
.
getNextNumber
();
this
.
cuas_min_in_row_col
=
(
int
)
gd
.
getNextNumber
();
this
.
cuas_clt_threshold
=
gd
.
getNextNumber
();
this
.
cuas_clt_decrease
=
gd
.
getNextNumber
();
this
.
mb_gain_index_pose
=
(
int
)
gd
.
getNextNumber
();
this
.
mb_gain_index_depth
=(
int
)
gd
.
getNextNumber
();
...
...
@@ -3676,6 +3686,8 @@ min_str_neib_fpn 0.35
properties
.
setProperty
(
prefix
+
"cuas_discard_border"
,
this
.
cuas_discard_border
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_max_fold"
,
this
.
cuas_max_fold
+
""
);
// double
properties
.
setProperty
(
prefix
+
"cuas_min_in_row_col"
,
this
.
cuas_min_in_row_col
+
""
);
// int
properties
.
setProperty
(
prefix
+
"cuas_clt_threshold"
,
this
.
cuas_clt_threshold
+
""
);
// double
properties
.
setProperty
(
prefix
+
"cuas_clt_decrease"
,
this
.
cuas_clt_decrease
+
""
);
// double
properties
.
setProperty
(
prefix
+
"mb_gain_index_pose"
,
this
.
mb_gain_index_pose
+
""
);
// int
properties
.
setProperty
(
prefix
+
"mb_gain_index_depth"
,
this
.
mb_gain_index_depth
+
""
);
// int
...
...
@@ -4469,6 +4481,8 @@ min_str_neib_fpn 0.35
if
(
properties
.
getProperty
(
prefix
+
"cuas_discard_border"
)!=
null
)
this
.
cuas_discard_border
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_discard_border"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_max_fold"
)!=
null
)
this
.
cuas_max_fold
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"cuas_max_fold"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_min_in_row_col"
)!=
null
)
this
.
cuas_min_in_row_col
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"cuas_min_in_row_col"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_clt_threshold"
)!=
null
)
this
.
cuas_clt_threshold
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"cuas_clt_threshold"
));
if
(
properties
.
getProperty
(
prefix
+
"cuas_clt_decrease"
)!=
null
)
this
.
cuas_clt_decrease
=
Double
.
parseDouble
(
properties
.
getProperty
(
prefix
+
"cuas_clt_decrease"
));
if
(
properties
.
getProperty
(
prefix
+
"mb_gain_index_pose"
)!=
null
)
this
.
mb_gain_index_pose
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"mb_gain_index_pose"
));
if
(
properties
.
getProperty
(
prefix
+
"mb_gain_index_depth"
)!=
null
)
this
.
mb_gain_index_depth
=
Integer
.
parseInt
(
properties
.
getProperty
(
prefix
+
"mb_gain_index_depth"
));
...
...
@@ -5264,6 +5278,8 @@ min_str_neib_fpn 0.35
imp
.
cuas_discard_border
=
this
.
cuas_discard_border
;
imp
.
cuas_max_fold
=
this
.
cuas_max_fold
;
imp
.
cuas_min_in_row_col
=
this
.
cuas_min_in_row_col
;
imp
.
cuas_clt_threshold
=
this
.
cuas_clt_threshold
;
imp
.
cuas_clt_decrease
=
this
.
cuas_clt_decrease
;
imp
.
mb_gain_index_pose
=
this
.
mb_gain_index_pose
;
imp
.
mb_gain_index_depth
=
this
.
mb_gain_index_depth
;
...
...
src/main/java/com/elphel/imagej/tileprocessor/OpticalFlow.java
View file @
8e595c63
...
...
@@ -4896,10 +4896,12 @@ public class OpticalFlow {
}
if
((
center_CLT
!=
null
)
&&
center_CLT
.
hasCenterClt
())
{
center_CLT
.
restoreInterProperties
(
// restore properties for interscene processing (extrinsics, ers, ...) // get relative poses (98)
Properties
prop
=
center_CLT
.
restoreInterProperties
(
// restore properties for interscene processing (extrinsics, ers, ...) // get relative poses (98)
null
,
// String path, // full name with extension or null to use x3d directory
false
,
// boolean all_properties,// null, // Properties properties, // if null - will only save extrinsics)
debugLevel
);
// TODO:
// if (prop == null) - failed to restore. Maybe OK, will need minimum (later will provide center_CLT as input)
}
else
{
if
(
center_reference
&&
(
quadCLTs
[
last_index
]
!=
null
))
{
quadCLTs
[
last_index
].
restoreInterProperties
(
// restore properties for interscene processing (extrinsics, ers, ...) // get relative poses (98)
...
...
@@ -4961,7 +4963,7 @@ public class OpticalFlow {
}
if
(!
build_ref_dsi
&&
(
quadCLTs
[
last_index
]
!=
null
))
{
if
(!
build_ref_dsi
&&
(
quadCLTs
[
last_index
]
!=
null
))
{
// is it needed in CUAS mode?
quadCLTs
[
last_index
].
restoreInterProperties
(
null
,
false
,
debugLevel
);
//null
}
// 1. Reference scene DSI
...
...
@@ -4985,8 +4987,9 @@ public class OpticalFlow {
//************* move loading center DSI here before building reference DSI. Or after "blue sky
while
((
quadCLTs
[
last_index
]
==
null
)
||
!
quadCLTs
[
last_index
].
hasBlueSky
())
{
// null
QuadCLT
source_CLT
=
(
center_CLT
!=
null
)
?
center_CLT
:
quadCLTs
[
last_index
];
/// while ((quadCLTs[last_index] == null) || !quadCLTs[last_index].hasBlueSky()) { // null
while
((
quadCLTs
[
last_index
]
==
null
)
||
!
source_CLT
.
hasBlueSky
())
{
// null
if
(
build_ref_dsi
)
{
TwoQuadCLT
.
copyJP4src
(
// actually there is no sense to process multiple image sets. Combine with other
// processing?
...
...
@@ -5039,15 +5042,22 @@ public class OpticalFlow {
}
else
{
// if (build_ref_dsi) {
// need to read photometric from reference scene -INTERFRAME.corr-xml, and if it exists - set and propagate to main?
// try to run reuseRefDSI() even for center?
reuseRefDSI
(
// QuadCLT source_CLT = (center_CLT != null) ? center_CLT :quadCLTs[last_index];
reuseRefDSI
(
// if (dsi[TwoQuadCLT.DSI_SPREAD_AUX] == null) System.out.println("DSI_MAIN file has old format and does not have spread data, will recalculate.");
clt_parameters
,
// CLTParameters clt_parameters,
colorProcParameters
,
// ColorProcParameters colorProcParameters,
quadCLT_main
,
// QuadCLT quadCLT_main, // tiles should be set
quadCLTs
[
last_index
],
// QuadCLT quadCLT_ref, // tiles should be set
source_CLT
,
// QuadCLT quadCLT_ref, // tiles should be set
batch_mode
,
// final boolean batch_mode,
threadsMax
,
// final int threadsMax,
updateStatus
,
// final boolean updateStatus,
debugLevel
);
// int debugLevel)
if
(
center_CLT
!=
null
)
{
System
.
out
.
println
(
"In CUAS mode dsi[TwoQuadCLT.DSI_SPREAD_AUX] == null), breaking loop"
);
System
.
out
.
println
(
"In CUAS mode dsi[TwoQuadCLT.DSI_SPREAD_AUX] == null), breaking loop"
);
break
;
}
if
(
center_reference
)
{
// center_ts = getReferenceTimestamp(); //??
}
...
...
@@ -5055,23 +5065,23 @@ public class OpticalFlow {
}
// while (blue_sky == null)
// by now if it was center_reference the last ref_dsi is restored with optional blue sky.
ref_blue_sky
=
quadCLTs
[
last_index
].
getDoubleBlueSky
();
quadCLTs
[
last_index
]
=
(
QuadCLT
)
quadCLT_main
.
spawnQuadCLT
(
// restores dsi from "DSI-MAIN"
set_channels
[
last_index
].
set_name
,
clt_parameters
,
colorProcParameters
,
//
threadsMax
,
debugLevel
);
quadCLTs
[
last_index
].
setQuadClt
();
// just in case ?
quadCLTs
[
last_index
].
setBlueSky
(
ref_blue_sky
);
//quadCLTs[ref_index].dsi has it
quadCLTs
[
last_index
].
setDSRBG
(
clt_parameters
,
// CLTParameters clt_parameters,
threadsMax
,
// int threadsMax, // maximal number of threads to launch
updateStatus
,
// boolean updateStatus,
debugLevel
);
// int debugLevel)
if
(
center_CLT
==
null
)
{
// does not work in CUAS mode
ref_blue_sky
=
quadCLTs
[
last_index
].
getDoubleBlueSky
();
quadCLTs
[
last_index
]
=
(
QuadCLT
)
quadCLT_main
.
spawnQuadCLT
(
// restores dsi from "DSI-MAIN"
set_channels
[
last_index
].
set_name
,
clt_parameters
,
colorProcParameters
,
//
threadsMax
,
debugLevel
);
quadCLTs
[
last_index
].
setQuadClt
();
// just in case ?
quadCLTs
[
last_index
].
setBlueSky
(
ref_blue_sky
);
//quadCLTs[ref_index].dsi has it
quadCLTs
[
last_index
].
setDSRBG
(
// null
clt_parameters
,
// CLTParameters clt_parameters,
threadsMax
,
// int threadsMax, // maximal number of threads to launch
updateStatus
,
// boolean updateStatus,
debugLevel
);
// int debugLevel)
}
if
(!
force_initial_orientations
)
{
// use master_clt? - where to look for stage. in CUAS mode build directory name and look there
if
(
center_CLT
!=
null
)
{
...
...
src/main/java/com/elphel/imagej/tileprocessor/QuadCLT.java
View file @
8e595c63
...
...
@@ -138,7 +138,7 @@ public class QuadCLT extends QuadCLTCPU {
sensor_mask_clt
,
// final int sensor_mask, // only if merge_channels
whc
,
// final int [] whc, // if int[2], will return width, height
false
);
// final boolean use_reference);
String
suffix
=
"-virtual
"
;
String
suffix
=
"-virtual
_threshold"
+
clt_parameters
.
imp
.
cuas_clt_threshold
+
"_decrease"
+
clt_parameters
.
imp
.
cuas_clt_decrease
;
;
ImagePlus
imp_virtual
=
renderFromTD
(
// do we need to update gpuQuad ?
sensor_mask_clt
,
// final int sensor_mask,
true
,
// merge_clt, // boolean merge_channels,
...
...
src/main/java/com/elphel/imagej/tileprocessor/QuadCLTCPU.java
View file @
8e595c63
...
...
@@ -368,6 +368,9 @@ public class QuadCLTCPU {
center_CLT
.
setCenterClt
(
center_clt
,
// float [] clt,
center_clt_weights
);
// int clt_width);
}
else
{
System
.
out
.
println
(
"restoreCenterClt(): No FCLT data in "
+
center_CLT
.
getImagePath
());
return
null
;
}
center_CLT
.
restoreComboDSI
(
true
);
return
center_CLT
;
...
...
@@ -2925,12 +2928,13 @@ public class QuadCLTCPU {
// create from existing instance
this
.
properties
=
new
Properties
();
// properties will be different
// is it needed at all?
for
(
Enumeration
<?>
e
=
qParent
.
properties
.
propertyNames
();
e
.
hasMoreElements
();)
{
String
key
=
(
String
)
e
.
nextElement
();
this
.
properties
.
setProperty
(
key
,
qParent
.
properties
.
getProperty
(
key
));
if
(
qParent
.
properties
!=
null
)
{
// 05.30.2025
for
(
Enumeration
<?>
e
=
qParent
.
properties
.
propertyNames
();
e
.
hasMoreElements
();)
{
String
key
=
(
String
)
e
.
nextElement
();
this
.
properties
.
setProperty
(
key
,
qParent
.
properties
.
getProperty
(
key
));
}
this
.
properties
.
putAll
(
qParent
.
properties
);
}
this
.
properties
.
putAll
(
qParent
.
properties
);
this
.
eyesisCorrections
=
qParent
.
eyesisCorrections
;
this
.
correctionsParameters
=
qParent
.
correctionsParameters
;
this
.
clt_kernels
=
qParent
.
clt_kernels
;
...
...
@@ -4560,14 +4564,19 @@ public class QuadCLTCPU {
String
x3d_path
=
getX3dDirectory
();
path
=
x3d_path
+
Prefs
.
getFileSeparator
()+
path
;
}
properties
=
loadProperties
(
Properties
new_
properties
=
loadProperties
(
path
,
// String path,
properties
,
// Properties properties)
true
);
// false); // boolean silent)
if
(
properties
==
null
)
{
if
(
new_
properties
==
null
)
{
System
.
out
.
println
(
"Failed to restore interframe properties from :"
+
path
);
System
.
out
.
println
(
"Resetting properties"
);
properties
=
new
Properties
();
return
null
;
// System.out.println("Keeping old properies");
// return null;
}
properties
=
new_properties
;
String
prefix
=
is_aux
?
PREFIX_AUX:
PREFIX
;
getProperties
(
prefix
);
// will set Geometry correction non-null
if
(!(
geometryCorrection
instanceof
ErsCorrection
))
{
// should only be for the new GeometryCorrection created in getProperties
...
...
@@ -4684,7 +4693,7 @@ public class QuadCLTCPU {
}
return
;
}
setDSRBG
(
// will likely not be used at all. Use getDLS() instead
setDSRBG
(
// will likely not be used at all. Use getDLS() instead
// null
this
.
dsi
[
is_aux
?
TwoQuadCLT
.
DSI_DISPARITY_AUX
:
TwoQuadCLT
.
DSI_DISPARITY_MAIN
],
this
.
dsi
[
is_aux
?
TwoQuadCLT
.
DSI_STRENGTH_AUX
:
TwoQuadCLT
.
DSI_STRENGTH_MAIN
],
this
.
dsi
[
is_aux
?
TwoQuadCLT
.
DSI_DISPARITY_AUX_LMA
:
TwoQuadCLT
.
DSI_DISPARITY_MAIN_LMA
],
...
...
@@ -4714,7 +4723,7 @@ public class QuadCLTCPU {
}
double
[][]
rbg
=
getTileRBG
(
double
[][]
rbg
=
getTileRBG
(
// null
clt_parameters
,
disparity
,
strength
,
...
...
@@ -4774,7 +4783,7 @@ public class QuadCLTCPU {
}
else
{
scan
.
setLMA
(
disparity_lma
);
}
boolean
[]
selection
=
new
boolean
[
disparity
.
length
];
boolean
[]
selection
=
new
boolean
[
disparity
.
length
];
//null
for
(
int
i
=
0
;
i
<
disparity
.
length
;
i
++)
{
selection
[
i
]
=
(!
Double
.
isNaN
(
disparity
[
i
])
&&
((
strength
==
null
)
||
(
strength
[
i
]
>
0
)));
}
...
...
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