Commit 869ec232 authored by Andrey Filippov's avatar Andrey Filippov

Implementing targets analysis

parent a4ec6dc5
package com.elphel.imagej.common; package com.elphel.imagej.common;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import com.elphel.imagej.tileprocessor.QuadCLTCPU;
import ij.IJ; import ij.IJ;
import ij.ImagePlus; import ij.ImagePlus;
import ij.ImageStack; import ij.ImageStack;
...@@ -1116,7 +1120,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg ...@@ -1116,7 +1120,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
System.out.println("readDoubleHyperstack(): reading "+path); System.out.println("readDoubleHyperstack(): reading "+path);
ImagePlus imp = new ImagePlus(path); ImagePlus imp = new ImagePlus(path);
if (imp.getWidth() == 0) { if (imp.getWidth() == 0) {
System.out.println("testSynthetic(): Failed reading Vector field from: " + path); System.out.println("readDoubleHyperstack(): Failed reading [][][] from: " + path);
return null; return null;
} }
int num_slices = imp.getStackSize(); int num_slices = imp.getStackSize();
...@@ -1161,5 +1165,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg ...@@ -1161,5 +1165,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
} }
return out_data; return out_data;
} }
}
}
\ No newline at end of file
...@@ -939,7 +939,8 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -939,7 +939,8 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addJButton("Test LLT Cholesky", jpanelOrange, color_process); addJButton("Test LLT Cholesky", jpanelOrange, color_process);
addJButton("UAS log", jpanelOrange, color_process); addJButton("UAS log", jpanelOrange, color_process);
addJButton("DJI SRT", jpanelOrange, color_process); addJButton("DJI SRT", jpanelOrange, color_process);
addJButton("SRT to KML", jpanelOrange, color_process); addJButton("SRT to KML", jpanelOrange, color_process);
addJButton("Target Analyze", jpanelOrange, color_process);
// addJButton("Motion_CUAS", jpanelOrange, color_stop); // addJButton("Motion_CUAS", jpanelOrange, color_stop);
// addJButton("Motion_scan", jpanelOrange, color_stop); // addJButton("Motion_scan", jpanelOrange, color_stop);
// //
...@@ -6142,33 +6143,15 @@ public class Eyesis_Correction implements PlugIn, ActionListener { ...@@ -6142,33 +6143,15 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
} }
} }
testUasLog(); testUasLog();
return;
} else if (label.equals("DJI SRT")) { } else if (label.equals("DJI SRT")) {
testDjiSrt(); testDjiSrt();
} else if (label.equals("SRT to KML")) { } else if (label.equals("SRT to KML")) {
djiSrtToKml(); djiSrtToKml();
return;
/* } else if (label.equals("Target Analyze")) {
} else if (label.equals("Motion_CUAS")) { CuasMotion.targetsAnalyze();
DEBUG_LEVEL = MASTER_DEBUG_LEVEL; return;
ImagePlus imp_sel = WindowManager.getCurrentImage();
if (imp_sel != null) {
motion_cuas(
imp_sel,
0); // int mode));
} else {
System.out.println("No image selected");
}
} else if (label.equals("Motion_scan")) {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
ImagePlus imp_sel = WindowManager.getCurrentImage();
if (imp_sel != null) {
motion_cuas(
imp_sel,
1); // int mode));
} else {
System.out.println("No image selected");
}
*/
} }
} finally { } finally {
MCP_COMMAND_CONTEXT = false; MCP_COMMAND_CONTEXT = false;
......
...@@ -57,6 +57,7 @@ public class CuasRanging { ...@@ -57,6 +57,7 @@ public class CuasRanging {
boolean batch_mode){ boolean batch_mode){
boolean save_linear_cuas = true; boolean save_linear_cuas = true;
boolean save_um_cuas = true; boolean save_um_cuas = true;
boolean save_noise_map = true;
double um_sigma = clt_parameters.imp.um_sigma; double um_sigma = clt_parameters.imp.um_sigma;
double um_weight = clt_parameters.imp.um_weight; double um_weight = clt_parameters.imp.um_weight;
boolean mono_fixed = clt_parameters.imp.mono_fixed; boolean mono_fixed = clt_parameters.imp.mono_fixed;
...@@ -207,6 +208,9 @@ public class CuasRanging { ...@@ -207,6 +208,9 @@ public class CuasRanging {
} }
scene_titles[nscene] = s;// imp_targets.getStack().getSliceLabel(nscene+first_corr+1); scene_titles[nscene] = s;// imp_targets.getStack().getSliceLabel(nscene+first_corr+1);
} }
// get tile variations
float [] fpixels_avg = (float[]) imp_targets.getStack().getPixels(1); // here assuming first slice is average
boolean skip_targets = false;// true; boolean skip_targets = false;// true;
if (skip_targets) { if (skip_targets) {
return null; return null;
...@@ -218,9 +222,21 @@ public class CuasRanging { ...@@ -218,9 +222,21 @@ public class CuasRanging {
clt_parameters, // CLTParameters clt_parameters, clt_parameters, // CLTParameters clt_parameters,
scene_titles, // String [] scene_titles, scene_titles, // String [] scene_titles,
center_CLT, // QuadCLT parentCLT, center_CLT, // QuadCLT parentCLT,
fpixels_avg, // float [] fpixels_avg,
uasLogReader, // UasLogReader uasLogReader, uasLogReader, // UasLogReader uasLogReader,
debugLevel); // int debugLevel) debugLevel); // int debugLevel)
double[][][] targets; // = null; if (save_noise_map) {
ImagePlus imp_noise_map = ShowDoubleFloatArrays.makeArrays(
cuasMotion.getNoiseMap(), // float[][] pixels,
cuasMotion.getTilesX(), // int width,
cuasMotion.getTilesY(), // int height,
center_CLT.getImageName()+"-NOISE-MAP"); //String [] titles)
center_CLT.saveImagePlusInModelDirectory(imp_noise_map); // ImagePlus imp)
}
double[][][] targets; // = null;
/* /*
cuasMotion.processMovingTargetsMulti( // will remove rendering cuasMotion.processMovingTargetsMulti( // will remove rendering
...@@ -251,6 +267,7 @@ public class CuasRanging { ...@@ -251,6 +267,7 @@ public class CuasRanging {
cuasMotion.processMovingTargetsMulti( // will remove rendering cuasMotion.processMovingTargetsMulti( // will remove rendering
batch_mode, // final boolean batch_mode, batch_mode, // final boolean batch_mode,
fpixels, // final float [][] fpixels, fpixels, // final float [][] fpixels,
fpixels_avg, // final float [] fpixels_avg,
debugLevel); // final int debugLevel) { debugLevel); // final int debugLevel) {
// double[][][] // double[][][]
targets = cuasMotion.getTargets(); targets = cuasMotion.getTargets();
...@@ -470,7 +487,6 @@ public class CuasRanging { ...@@ -470,7 +487,6 @@ public class CuasRanging {
} }
public double [][][] renderKeyFrames( public double [][][] renderKeyFrames(
final double [][][] targets, // centers final double [][][] targets, // centers
final double [][][] targets5x5, final double [][][] targets5x5,
......
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