Commit 8e12622f authored by Andrey Filippov's avatar Andrey Filippov

Working on FOPEN

parent 273e58c7
......@@ -1672,7 +1672,7 @@ public class OrangeTest {
for (int ipix=0; ipix < num_pixels; ipix++) {
mask[nframe][ipix] = !(weights_in[nframe][ipix] > 0);
}
tn. growSelection(
tn.growSelection(
shrink, // int grow, // grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
mask[nframe], // final boolean [] tiles,
null); // final boolean [] prohibit)
......
......@@ -60,6 +60,7 @@ import com.elphel.imagej.ims.Did_ins_2;
import com.elphel.imagej.ims.Did_pimu;
import com.elphel.imagej.ims.Imx5;
import com.elphel.imagej.jp4.JP46_Reader_camera;
import com.elphel.imagej.orthomosaic.VegetationModel;
import com.elphel.imagej.tileprocessor.sfm.StructureFromMotion;
import Jama.Matrix;
......@@ -5685,6 +5686,23 @@ public class OpticalFlow {
// generates 3-d modes, colors, stereos, tiffs/videos
// Testing vegetation, for debugging supposing that terrain layer is already set in *-INTER-INTRA-LMA.tiff - normally it is only set during 3d model generation
boolean test_vegetation = true;
if (test_vegetation) { // limit start of the quadCLTs by reading start/end from the reference scene
VegetationModel.test_vegetation(
clt_parameters, // CLTParameters clt_parameters,
quadCLTs, // QuadCLT [] quadCLTs,
ref_index, // int ref_index,
debugLevel); // int debugLevel)
if (videos != null) {
videos[0] = new String[0];
}
// temporarily - exiting now
return quadCLTs[ref_index].getX3dTopDirectory();
}
if (generate_mapped || reuse_video) { // modifies combo_dsn_final ?
int tilesX = quadCLTs[ref_index].getTileProcessor().getTilesX();
int tilesY = quadCLTs[ref_index].getTileProcessor().getTilesY();
......
......@@ -3044,96 +3044,6 @@ public class TexturedModel {
}
/*
if ((smooth_ground != null) && !ct_mode) { // no sense to use with CT? or compare with the common only?
if (has_sfm && gsmth_sfm_deviate) {
mixed_flat = true;
// Change!
// Use FG for FG, and ground plane as BG?
TileNeibs tn = new TileNeibs(tilesX, smooth_ground.length/tilesX);
for (int ntile = 0; ntile < smooth_ground.length; ntile++) {
double disp = (ss_fg_bg[1][ntile] > ss_fg_bg[0][ntile]) ? ds_fg_bg[1][ntile] : ds_fg_bg[1][ntile]; // strongest
if (disp > lim_disparity) {
disp = lim_disparity;
}
double str = Math.max(ss_fg_bg[1][ntile], ss_fg_bg[0][ntile]);
boolean strong = false;
if (disp > smooth_ground[ntile]) {
strong = str >= gsmth_str_bump;
} else {
strong = str >= gsmth_str_dip;
}
if (strong) {
check_neibs:
{
for (int dy = -gsmth_sfm_rad; dy <= gsmth_sfm_rad; dy++) {
for (int dx = -gsmth_sfm_rad; dx <= gsmth_sfm_rad; dx++) {
int ntile1 = tn.getNeibIndex(ntile, dx, dy);
if ((ntile1 < 0) || (sfm_gain[ntile1] < gsmth_sfm_gain)) {
strong = false;
break check_neibs;
}
}
}
if (disp > smooth_ground[ntile]) {
ds_fg_bg[0][ntile] = disp;
ss_fg_bg[0][ntile] = str;
ds_fg_bg[1][ntile] = smooth_ground[ntile];
ss_fg_bg[1][ntile] = small_strength;
} else {
ds_fg_bg[0][ntile] = Double.NaN;
ss_fg_bg[0][ntile] = 0.0;
smooth_ground[ntile] = disp;
ds_fg_bg[1][ntile] = smooth_ground[ntile];
ss_fg_bg[1][ntile] = str;
}
}
}
if (!strong) { // either was weak or broke check_neibs
// if (ct_mode) {
// ds_fg_bg[0][ntile] = lim_disparity;
// ss_fg_bg[0][ntile] = str;
// ds_fg_bg[1][ntile] = smooth_ground[ntile];
// ss_fg_bg[1][ntile] = small_strength;
// } else {
ds_fg_bg[0][ntile] = Double.NaN;
ds_fg_bg[1][ntile] = smooth_ground[ntile];
ss_fg_bg[0][ntile] = 0.0;
ss_fg_bg[1][ntile] = str;
// }
}
}
} else { // smooth surface only: nothing in FG, surface - in BG
if (!ct_mode) { // no sense to use smooth_ground in CT scan mode
for (int i = 0; i < smooth_ground.length; i++) {
ds_fg_bg[1][i] = smooth_ground[i];
ss_fg_bg[1][i] = Math.max(ss_fg_bg[1][i],ss_fg_bg[0][i]);
ss_fg_bg[1][i] = Math.max(ss_fg_bg[1][i],small_strength);
ds_fg_bg[0][i] = Double.NaN;
ss_fg_bg[0][i] = 0.0;
}
}
}
if (show_bs_debug && (debugLevel>1)) {
String [] dbg_titles = {"FGC","BGC","FG", "BG", "GND", "FS", "BS"};
double [][] dbg_img = {ds_fg_bg_common[0], ds_fg_bg_common[1], ds_fg_bg[0], ds_fg_bg[1], smooth_ground, ss_fg_bg_common[0], ss_fg_bg_common[1]}; // here BG==FG
ShowDoubleFloatArrays.showArrays(
dbg_img,
tilesX,
dbg_img[0].length/tilesX,
true,
ref_scene.getImageName()+"-fgc-bgc-fg-bg-disparity_strength-LMA-GND",
dbg_titles);
}
}
*/
if (show_bs_debug) {
String [] dbg_titles = {"FGC","BGC","FG", "BG", "GND", "FS", "BS"};
double [][] dbg_img = {ds_fg_bg_common[0], ds_fg_bg_common[1], ds_fg_bg[0], ds_fg_bg[1], smooth_ground, ss_fg_bg_common[0], ss_fg_bg_common[1]}; // here BG==FG
......@@ -3248,10 +3158,9 @@ public class TexturedModel {
min_trim_disparity, // final double min_trim_disparity, // 2.0; // do not try to trim texture outlines with lower disparities
lin_text0, // final double [][][][] lin_textures, // null or [1][][][] to return non-normalized textures
(ct_scans != null), // ct_mode, // final boolean ct_mode,
terrain_mode, // final boolean terrain_mode, Just for file name
terrain_mode, // final boolean terrain_mode, just for file name
debugLevel); // final int debug_level)
if (ct_scans != null) {
// ct_scans[nscan] = new double [][] {faded_textures[0][0].clone(),faded_textures[1][0].clone()}; // both slices, channel 0
ct_scans[nscan] = new double [faded_textures.length][];
for (int i = 0; i < ct_scans[nscan].length; i++) {
ct_scans[nscan][i] = faded_textures[i][0].clone(); // channel 0 from each slice
......@@ -3266,15 +3175,6 @@ public class TexturedModel {
titles[nscan] = String.format("D=%.3f", ct_min+ct_step*nscan);
}
titles[titles.length-1]="full";
/*
ShowDoubleFloatArrays.showArrays(
ct_disparity,
tilesX,
ct_disparity[0].length/tilesX,
true,
ref_scene.getImageName()+"-CT_scan_disparities",
titles);
*/
double ct_max = ct_min+ct_step* (ct_scans.length-1);
String suffix = String.format("-CT_SCAN_%.3f_%.3f_%.3f",ct_min,ct_max,ct_step);
scenes[ref_index].saveDoubleArrayInModelDirectory(
......
......@@ -8660,6 +8660,9 @@ if (debugLevel > -100) return true; // temporarily !
}
first_in_series = false; // at least once success in this series
System.out.println("adding to video_sets_list start="+start_ref_pointers[0]+", end="+ref_index); // start_ref_pointers[1]);
// if ((video_list != null) && (video_list.length>0) && (video_list[0] == null)) {
// video_list[0]= new String[0];
// }
for (int i= 0; i < video_list[0].length; i++) {
System.out.println(i+": "+video_list[0][i]+", "+widths_list[0][i]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment