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

Implementing targets analysis

parent a4ec6dc5
package com.elphel.imagej.common;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import com.elphel.imagej.tileprocessor.QuadCLTCPU;
import ij.IJ;
import ij.ImagePlus;
import ij.ImageStack;
......@@ -1116,7 +1120,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
System.out.println("readDoubleHyperstack(): reading "+path);
ImagePlus imp = new ImagePlus(path);
if (imp.getWidth() == 0) {
System.out.println("testSynthetic(): Failed reading Vector field from: " + path);
System.out.println("readDoubleHyperstack(): Failed reading [][][] from: " + path);
return null;
}
int num_slices = imp.getStackSize();
......@@ -1161,5 +1165,7 @@ G= Y +Pr*(- 2*Kr*(1-Kr))/Kg + Pb*(-2*Kb*(1-Kb))/Kg
}
return out_data;
}
}
}
\ No newline at end of file
......@@ -940,6 +940,7 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
addJButton("UAS log", jpanelOrange, color_process);
addJButton("DJI SRT", jpanelOrange, color_process);
addJButton("SRT to KML", jpanelOrange, color_process);
addJButton("Target Analyze", jpanelOrange, color_process);
// addJButton("Motion_CUAS", jpanelOrange, color_stop);
// addJButton("Motion_scan", jpanelOrange, color_stop);
//
......@@ -6142,33 +6143,15 @@ public class Eyesis_Correction implements PlugIn, ActionListener {
}
}
testUasLog();
return;
} else if (label.equals("DJI SRT")) {
testDjiSrt();
} else if (label.equals("SRT to KML")) {
djiSrtToKml();
/*
} else if (label.equals("Motion_CUAS")) {
DEBUG_LEVEL = MASTER_DEBUG_LEVEL;
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");
}
*/
return;
} else if (label.equals("Target Analyze")) {
CuasMotion.targetsAnalyze();
return;
}
} finally {
MCP_COMMAND_CONTEXT = false;
......
......@@ -57,6 +57,7 @@ public class CuasRanging {
boolean batch_mode){
boolean save_linear_cuas = true;
boolean save_um_cuas = true;
boolean save_noise_map = true;
double um_sigma = clt_parameters.imp.um_sigma;
double um_weight = clt_parameters.imp.um_weight;
boolean mono_fixed = clt_parameters.imp.mono_fixed;
......@@ -207,6 +208,9 @@ public class CuasRanging {
}
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;
if (skip_targets) {
return null;
......@@ -218,8 +222,20 @@ public class CuasRanging {
clt_parameters, // CLTParameters clt_parameters,
scene_titles, // String [] scene_titles,
center_CLT, // QuadCLT parentCLT,
fpixels_avg, // float [] fpixels_avg,
uasLogReader, // UasLogReader uasLogReader,
debugLevel); // int debugLevel)
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;
/*
......@@ -251,6 +267,7 @@ public class CuasRanging {
cuasMotion.processMovingTargetsMulti( // will remove rendering
batch_mode, // final boolean batch_mode,
fpixels, // final float [][] fpixels,
fpixels_avg, // final float [] fpixels_avg,
debugLevel); // final int debugLevel) {
// double[][][]
targets = cuasMotion.getTargets();
......@@ -470,7 +487,6 @@ public class CuasRanging {
}
public double [][][] renderKeyFrames(
final double [][][] targets, // centers
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