Commit ada7257a authored by Andrey Filippov's avatar Andrey Filippov

Added full image model rendering

parent 8facfc7c
......@@ -137,6 +137,7 @@ import com.elphel.imagej.tileprocessor.TwoQuadCLT;
import com.elphel.imagej.tileprocessor.lwoc.LwirWorld;
import com.elphel.imagej.vegetation.VegetationModel;
//import com.elphel.imagej.vegetation.VegetationSegment;
import com.elphel.imagej.vegetation.VegetationSynthesis;
import ij.CompositeImage;
import ij.IJ;
......@@ -871,6 +872,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addButton("Process Merged", panelOrange, color_process);
addButton("Vegetation LMA", panelOrange, color_process);
addButton("Combine LMA Segments", panelOrange, color_process);
addButton("Render synthetic", panelOrange, color_process);
addButton("Generate LWIR target", panelOrange, color_process);
// addButton("Test LDLT Cholesky", panelOrange, color_process);
addButton("Test LLT Cholesky", panelOrange, color_process);
......@@ -5820,6 +5822,11 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
SYNC_COMMAND, // // SyncCommand SYNC_COMMAND,
CLT_PARAMETERS, //CLTParameters clt_parameters,
true); //boolean combine_segments);
} else if (label.equals("Render synthetic")) {
VegetationSynthesis.testSynthetic(
SYNC_COMMAND, // // SyncCommand SYNC_COMMAND,
CLT_PARAMETERS, // CLTParameters clt_parameters,
DEBUG_LEVEL); // final int debugLevel
/*
} else if (label.equals("Test LDLT Cholesky")) {
ImagePlus imp_sel = WindowManager.getCurrentImage();
......
......@@ -256,13 +256,13 @@ public class CorrectionFPN {
for (int nsens = ai.getAndIncrement(); nsens < num_sens; nsens = ai.getAndIncrement()) {
for (int nscene = 0; nscene < num_scenes; nscene++) {
System.arraycopy(
rowcol_data2[2 * nsens + 0],
rowcol_data2[nsens + 0],
nscene*img_width,
rows[nscene][nsens], // data[0][nsens],
0,
width);
System.arraycopy(
rowcol_data2[2 * nsens + 1],
rowcol_data2[nsens + num_sens],
nscene*img_width,
cols[nscene][nsens], // data[1][nsens],
0,
......
......@@ -805,6 +805,7 @@ public class QuadCLTCPU {
* Read (try to read) this first, maybe parent is not needed (yet)
* @param clt_parameters
* @param ignore_this do not merge this sequence CLT data, only use parent's cumulative
* @param use_parent_dsi - use parent DSI even if this exists
* @param ref_clt
* @param full_path
* @param single_first true: read single first, cumulative second, false - read cumulative first
......@@ -814,6 +815,7 @@ public class QuadCLTCPU {
public static QuadCLT restoreCenterClt(
CLTParameters clt_parameters,
boolean ignore_this,
boolean use_parent_dsi,
QuadCLT ref_clt , // latest
String full_path, // if non-null, use it instead of ref_clt
boolean single_first, // true: read single first, cumulative second
......@@ -915,11 +917,14 @@ public class QuadCLTCPU {
System.out.println("restoreCenterClt(): parent directory is not provided, and this model data does not exist - bailing out.");
return null;
}
if (center_CLT == null) { // so parent parentCuasData and parent_dsi both exist
if (use_parent_dsi || (center_CLT == null)) { // so parent parentCuasData and parent_dsi both exist
// Create new center_CLT
if (center_CLT == null) {
center_CLT = new QuadCLT(ref_clt, center_name);
center_CLT.setImagePath(cdir.getPath()); // *********************
cdir.mkdirs();
cuasData = parentCuasData; // will be collapsed in one place
}
center_CLT.setDSIFromCombo(parent_dsi); // set center DSI from parent
String rslt_suffix = "-INTER-INTRA";
if (!clt_parameters.correlate_lma){
......@@ -934,7 +939,7 @@ public class QuadCLTCPU {
center_CLT.getTilesX(), // int width,
center_CLT.getTilesY()); // int height)
center_CLT.setDSIFromCombo(parent_dsi);
cuasData = parentCuasData; // will be collapsed in one place
// cuasData = parentCuasData; // will be collapsed in one place
} else { // if (center_CLT == null) {
if (parentCuasData != null) { // both exist - combine
boolean en_create = true;
......@@ -4645,13 +4650,13 @@ public class QuadCLTCPU {
DSI_SUFFIXES[INDEX_INTER_LMA], // String suffix, // "-DSI_COMBO", "-DSI_MAIN" (DSI_COMBO_SUFFIX, DSI_MAIN_SUFFIX)
null, // double [][] dsi, // if null - just check file exists
true); // boolean silent);
if (num_slices >= 0) {
/* if (num_slices >= 0) {
return true;
}
num_slices = restoreDSI(
DSI_SUFFIXES[INDEX_INTER], // String suffix, // "-DSI_COMBO", "-DSI_MAIN" (DSI_COMBO_SUFFIX, DSI_MAIN_SUFFIX)
null, // double [][] dsi, // if null - just check file exists
true); // boolean silent);
true); // boolean silent); */
return num_slices >= 0;
}
......
......@@ -43,8 +43,8 @@ public class VegetationLMA {
public static final int TVAO_VEGETATION = 1;
public static final int TVAO_ALPHA = 2;
public static final int TVAO_ELEVATION = 3;
public static final int TVAO_TERR_ELEV = 4;
public static final int TVAO_TERR_ELEV_PIX = 5;
public static final int TVAO_TERR_ELEV = 4; // common for all the tile
public static final int TVAO_TERR_ELEV_PIX = 5; // per-pixel terrain elevation
public static final int TVAO_SCENE_OFFSET = 6;
public static final int TVAO_TYPES = TVAO_SCENE_OFFSET + 1;
......@@ -439,7 +439,7 @@ public class VegetationLMA {
return;
}
private static double [][][] getScalesXY(
public static double [][][] getScalesXY(
final double [][][] scales_mag_dir) {
final int num_scenes = scales_mag_dir.length;
final int num_pixels = scales_mag_dir[0].length;
......
......@@ -92,6 +92,14 @@ public class VegetationModel {
public String src_dir = null;
public String src_title = null;
public String [] getSceneNames() {
return scene_names;
}
public double [][] getTerrainScenesRendered(){
return terrain_scenes_render;
}
public double [][] tva;
int step_restore;
......@@ -1481,7 +1489,7 @@ public class VegetationModel {
// boolean
tile_woi = clt_parameters.imp.terr_tile_woi; // scan woi_enclosing, false - run a single woi_last
tile_woi = clt_parameters.imp.terr_tile_woi || combine_segments; // scan woi_enclosing, false - run a single woi_last
Rectangle woi_enclosing = clt_parameters.imp.terr_woi_enclos; // new Rectangle(0, 0, 200, 160); // will be tiled, using width/height from woi_step;
Rectangle woi_step = clt_parameters.imp.terr_woi_step; // new Rectangle(10,10,20,20);
Rectangle woi_last = clt_parameters.imp.terr_woi_last; // new Rectangle(160,310,20,20); // 170
......
......@@ -98,7 +98,7 @@ public class VegetationSegment {
int out_length = out_woi.width*out_woi.height;
int accum_indx = segments.length;
String [] top_titles = {"terrain","vegetation","alpha","elevation","terrain_elevation","confidence"};
double [][][] preview_data = new double [top_titles.length][accum_indx+1][out_length];
double [][][] preview_data = new double [top_titles.length][accum_indx+1][out_length]; // Java heap space
String [] titles = new String[accum_indx+1];
for (int ns = 0; ns < segments.length; ns++) {
Rectangle woi = segments[ns].woi; // for confidence and limits for terrain
......
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