double photo_min_strength = clt_parameters.photo_min_strength; // 0.0; // maybe add to filter out weak tiles
double photo_min_strength = clt_parameters.photo_min_strength; // 0.0; // maybe add to filter out weak tiles
double photo_max_diff = clt_parameters.photo_max_diff; // 40.0; // To filter mismatches. Normal (adjusted) have RMSE ~9
double photo_max_diff = clt_parameters.photo_max_diff; // 40.0; // To filter mismatches. Normal (adjusted) have RMSE ~9
int photo_order = clt_parameters.photo_order;
int photo_order = clt_parameters.photo_order;
double photo_std_1 = clt_parameters.photo_std_1; // 50.0; // Minimal standard deviation of the filtered values for poly order 1
double photo_std_2 = clt_parameters.photo_std_2; // 200.0; // Minimal standard deviation of the filtered values for poly order 2
int photo_offs_set = clt_parameters.photo_offs_set; // 0; // 0 - keep weighted offset average, 1 - balance result image, 2 - set weighted average to specific value
double photo_offs = clt_parameters.photo_offs; // 21946; // weighted average offset target value, if photo_offs_set (and not photo_offs_balance)
boolean photo_debug = clt_parameters.photo_debug; // false; // Generate images and text
boolean photo_debug = clt_parameters.photo_debug; // false; // Generate images and text
for (int nrecalib = 0; nrecalib < photo_num_full; nrecalib++) { // maybe need to correct just offsets?
for (int nrecalib = 0; nrecalib < photo_num_full; nrecalib++) { // maybe need to correct just offsets?
int poly_order = photo_order;
int poly_order = photo_order;
if ((poly_order > 1) && (nrecalib == 0)) {
if ((poly_order > 1) && (nrecalib == 0)) {
poly_order = 1;
poly_order = 1;
}
}
boolean ok = QuadCLT.calibratePhotometric2(
QuadCLT.calibratePhotometric2(
clt_parameters, // CLTParameters clt_parameters,
clt_parameters, // CLTParameters clt_parameters,
quadCLTs[ref_index], // final QuadCLT ref_scene, will set photometric calibration to this scene
quadCLTs[ref_index], // final QuadCLT ref_scene, will set photometric calibration to this scene
photo_min_strength, // final double min_strength,
photo_min_strength, // final double min_strength,
photo_max_diff, // final double max_diff, // 30.0
photo_max_diff, // final double max_diff, // 30.0
poly_order, // final int photo_order, // 0 - offset only, 1 - linear, 2 - quadratic
poly_order, // final int photo_order, // 0 - offset only, 1 - linear, 2 - quadratic
photo_std_1, // final double photo_std_1, // 50.0; // Minimal standard deviation of the filtered values for poly order 1
photo_std_2, // final double photo_std_2, // 200.0; // Minimal standard deviation of the filtered values for poly order 2
photo_offs_set, // final int photo_offs_set,// 0; // 0 - keep weighted offset average, 1 - balance result image, 2 - set weighted average to specific value
photo_offs, // final double photo_offs, // 21946; // weighted average offset target value, if photo_offs_set (and not photo_offs_balance)
quadCLTs[ref_index], // final QuadCLT ref_scene, will set photometric calibration to this scene
photo_min_strength, // final double min_strength,
photo_max_diff, // final double max_diff, // 30.0
1, // poly_order, // final int photo_order, // 0 - offset only, 1 - linear, 2 - quadratic
photo_std_1, // final double photo_std_1, // 50.0; // Minimal standard deviation of the filtered values for poly order 1
photo_std_2, // final double photo_std_2, // 200.0; // Minimal standard deviation of the filtered values for poly order 2
photo_offs_set, // final int photo_offs_set,// 0; // 0 - keep weighted offset average, 1 - balance result image, 2 - set weighted average to specific value
photo_offs, // final double photo_offs, // 21946; // weighted average offset target value, if photo_offs_set (and not photo_offs_balance)
// Re-read reference and other scenes using new offsets
// Re-read reference and other scenes using new offsets
// quadCLTs[ref_index].saveQuadClt(); // to re-load new set of Bayer images to the GPU (do nothing for CPU) and Geometry
quadCLTs[ref_index].setQuadClt(); // should work even when the data is new for the same scene
quadCLTs[ref_index].setQuadClt(); // should work even when the data is new for the same scene
quadCLTs[ref_index] = (QuadCLT) quadCLT_main.spawnQuadCLT( // restores dsi from "DSI-MAIN"
quadCLTs[ref_index] = (QuadCLT) quadCLT_main.spawnQuadCLT( // restores dsi from "DSI-MAIN"
set_channels[ref_index].set_name,
set_channels[ref_index].set_name,
@@ -4826,6 +4850,10 @@ public class OpticalFlow {
photo_min_strength, // final double min_strength,
photo_min_strength, // final double min_strength,
photo_max_diff, // final double max_diff, // 30.0
photo_max_diff, // final double max_diff, // 30.0
poly_order, // final int photo_order, // 0 - offset only, 1 - linear, 2 - quadratic
poly_order, // final int photo_order, // 0 - offset only, 1 - linear, 2 - quadratic
photo_std_1, // final double photo_std_1, // 50.0; // Minimal standard deviation of the filtered values for poly order 1
photo_std_2, // final double photo_std_2, // 200.0; // Minimal standard deviation of the filtered values for poly order 2
photo_offs_set, // final int photo_offs_set,// 0; // 0 - keep weighted offset average, 1 - balance result image, 2 - set weighted average to specific value
photo_offs, // final double photo_offs, // 21946; // weighted average offset target value, if photo_offs_set (and not photo_offs_balance)