Commit d76553f1 authored by Andrey Filippov's avatar Andrey Filippov

Developing symmetrical vectors for N>4 cameras

parent 3c2b0b49
...@@ -1074,6 +1074,7 @@ if (MORE_BUTTONS) { ...@@ -1074,6 +1074,7 @@ if (MORE_BUTTONS) {
addButton("Illustrations", panelIllustrations,color_bundle); addButton("Illustrations", panelIllustrations,color_bundle);
addButton("Illustrate Kernels", panelIllustrations,color_process); addButton("Illustrate Kernels", panelIllustrations,color_process);
addButton("Illustrate Footage", panelIllustrations,color_process); addButton("Illustrate Footage", panelIllustrations,color_process);
addButton("Link Missing", panelIllustrations,color_process); // add missing low-fps RGB images as links
add(panelIllustrations); add(panelIllustrations);
...@@ -9451,12 +9452,6 @@ if (MORE_BUTTONS) { ...@@ -9451,12 +9452,6 @@ if (MORE_BUTTONS) {
} }
/* ======================================================================== */ /* ======================================================================== */
if (label.equals("Illustrate Footage")) { if (label.equals("Illustrate Footage")) {
// if (LENS_DISTORTIONS==null) {
// IJ.showMessage("LENS_DISTORTION is not set"); // to use all grids imported
// return;
// }
// EYESIS_ABERRATIONS.setDistortions(LENS_DISTORTIONS);
if (EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory.length()>0){ if (EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory.length()>0){
File dFile=new File(EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory); File dFile=new File(EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory);
if (!dFile.isDirectory() && !dFile.mkdirs()) { if (!dFile.isDirectory() && !dFile.mkdirs()) {
...@@ -9500,10 +9495,31 @@ if (MORE_BUTTONS) { ...@@ -9500,10 +9495,31 @@ if (MORE_BUTTONS) {
SYNC_COMMAND.stopRequested, // AtomicInteger stopRequested, SYNC_COMMAND.stopRequested, // AtomicInteger stopRequested,
MASTER_DEBUG_LEVEL); // int debug_level); MASTER_DEBUG_LEVEL); // int debug_level);
} }
CALIBRATION_ILLUSTRATION.convertCapturedFiles(); CALIBRATION_ILLUSTRATION.convertCapturedLwirFiles();
CALIBRATION_ILLUSTRATION.convertCapturedEoFiles();
return;
}
/* ======================================================================== */
if (label.equals("Link Missing") ) {
File dFile=new File(EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory);
if (!dFile.isDirectory()) {
String msg="Directory "+EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory+" does not exist, aborting";
IJ.showMessage("Warning",msg);
System.out.println("Warning: "+msg);
return;
}
if (CALIBRATION_ILLUSTRATION == null) { //LWIR_PARAMETERS
CALIBRATION_ILLUSTRATION = new CalibrationIllustration(
LWIR_PARAMETERS, // LwirReaderParameters lwirReaderParameters,
CALIBRATION_ILLUSTRATION_PARAMETERS, // CalibrationIllustrationParameters illustrationParameters,
EYESIS_ABERRATIONS, // EyesisAberrations eyesisAberrations,
LENS_DISTORTIONS, // Distortions distortions,
SYNC_COMMAND.stopRequested, // AtomicInteger stopRequested,
MASTER_DEBUG_LEVEL); // int debug_level);
}
CALIBRATION_ILLUSTRATION.addMissingAsLinks();
return; return;
} }
//
/* ======================================================================== */ /* ======================================================================== */
if (label.equals("Illustrate Kernels")) { if (label.equals("Illustrate Kernels")) {
if (EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory.length()>0){ if (EYESIS_ABERRATIONS.aberrationParameters.illustrationsDirectory.length()>0){
...@@ -24,7 +24,8 @@ public class CalibrationIllustrationParameters { ...@@ -24,7 +24,8 @@ public class CalibrationIllustrationParameters {
double [][] lwir_offset_gains; // for balancing channels [0] - offset (subtract) [1] - gain (divide) double [][] lwir_offset_gains; // for balancing channels [0] - offset (subtract) [1] - gain (divide)
int palette = 0; // 0 - white - hot, 1 - black - hot, 2+ - colored int palette = 0; // 0 - white - hot, 1 - black - hot, 2+ - colored
String src_chn_prefix="src_chn-"; String src_chn_prefix="src_chn-";
boolean save_png = true; boolean save_png = true;
boolean save_png_eo = false;
int JPEG_quality = 90; int JPEG_quality = 90;
String channel_dir_prefix = "chn_"; String channel_dir_prefix = "chn_";
double [][] eo_rb2g_hi; // []{r2g,b2g,rgb_hi} double [][] eo_rb2g_hi; // []{r2g,b2g,rgb_hi}
...@@ -142,6 +143,7 @@ public class CalibrationIllustrationParameters { ...@@ -142,6 +143,7 @@ public class CalibrationIllustrationParameters {
} }
properties.setProperty(prefix+"palette", this.palette+""); properties.setProperty(prefix+"palette", this.palette+"");
properties.setProperty(prefix+"save_png", this.save_png+""); properties.setProperty(prefix+"save_png", this.save_png+"");
properties.setProperty(prefix+"save_png_eo", this.save_png_eo+"");
properties.setProperty(prefix+"JPEG_quality", this.JPEG_quality+""); properties.setProperty(prefix+"JPEG_quality", this.JPEG_quality+"");
properties.setProperty(prefix+"channel_dir_prefix", this.channel_dir_prefix); properties.setProperty(prefix+"channel_dir_prefix", this.channel_dir_prefix);
for (int i = 0; i < eo_rb2g_hi.length; i++) { for (int i = 0; i < eo_rb2g_hi.length; i++) {
...@@ -258,8 +260,9 @@ public class CalibrationIllustrationParameters { ...@@ -258,8 +260,9 @@ public class CalibrationIllustrationParameters {
*/ */
if (properties.getProperty(prefix+"palette")!=null) this.palette = Integer.parseInt(properties.getProperty(prefix+"palette")); if (properties.getProperty(prefix+"palette")!=null) this.palette = Integer.parseInt(properties.getProperty(prefix+"palette"));
if (properties.getProperty(prefix+"save_png")!=null) this.save_png = Boolean.parseBoolean(properties.getProperty(prefix+"save_png")); if (properties.getProperty(prefix+"save_png")!=null) this.save_png = Boolean.parseBoolean(properties.getProperty(prefix+"save_png"));
if (properties.getProperty(prefix+"save_png_eo")!=null) this.save_png_eo = Boolean.parseBoolean(properties.getProperty(prefix+"save_png_eo"));
if (properties.getProperty(prefix+"JPEG_quality")!=null) this.JPEG_quality = Integer.parseInt(properties.getProperty(prefix+"JPEG_quality")); if (properties.getProperty(prefix+"JPEG_quality")!=null) this.JPEG_quality = Integer.parseInt(properties.getProperty(prefix+"JPEG_quality"));
if (properties.getProperty(prefix+"channel_dir_prefix")!=null) this.channel_dir_prefix = (String) properties.getProperty(prefix+"channel_dir_prefix"); if (properties.getProperty(prefix+"channel_dir_prefix")!=null) this.channel_dir_prefix = (String) properties.getProperty(prefix+"channel_dir_prefix");
...@@ -399,7 +402,8 @@ public class CalibrationIllustrationParameters { ...@@ -399,7 +402,8 @@ public class CalibrationIllustrationParameters {
gd.addCheckbox("Use station "+i, ((this.station_sel >> i) & 1) != 0, "Include Station "+i+" in generated files."); gd.addCheckbox("Use station "+i, ((this.station_sel >> i) & 1) != 0, "Include Station "+i+" in generated files.");
} }
gd.addCheckbox("Include station number in result file names", this.station_in_filenames, "Use station number as a part of the result file names."); gd.addCheckbox("Include station number in result file names", this.station_in_filenames, "Use station number as a part of the result file names.");
gd.addCheckbox("Save as PNG instead of JPEG", save_png); gd.addCheckbox("Save as PNG instead of JPEG (LWIR channels)", save_png);
gd.addCheckbox("Save as PNG instead of JPEG (RGB channels)", save_png_eo);
gd.addNumericField("JPEG quality", this.JPEG_quality, 0,3,"","JPEG quality, 0 - use Tiff"); gd.addNumericField("JPEG quality", this.JPEG_quality, 0,3,"","JPEG quality, 0 - use Tiff");
gd.addNumericField("Threshold contrast", this.threshold_contrast, 3,6,"","Consider grid nodes with higher contrast to determine bad grids."); gd.addNumericField("Threshold contrast", this.threshold_contrast, 3,6,"","Consider grid nodes with higher contrast to determine bad grids.");
gd.addNumericField("Minimal number of high-contrast nodes", this.threshold_number, 0,3,"","Consider a failed grid if the number of strong nodes is below this."); gd.addNumericField("Minimal number of high-contrast nodes", this.threshold_number, 0,3,"","Consider a failed grid if the number of strong nodes is below this.");
...@@ -531,6 +535,7 @@ public class CalibrationIllustrationParameters { ...@@ -531,6 +535,7 @@ public class CalibrationIllustrationParameters {
} }
this.station_in_filenames = gd.getNextBoolean(); this.station_in_filenames = gd.getNextBoolean();
this.save_png = gd.getNextBoolean(); this.save_png = gd.getNextBoolean();
this.save_png_eo = gd.getNextBoolean();
this.JPEG_quality = (int) gd.getNextNumber(); this.JPEG_quality = (int) gd.getNextNumber();
this.threshold_contrast = gd.getNextNumber(); this.threshold_contrast = gd.getNextNumber();
this.threshold_number= (int) gd.getNextNumber(); this.threshold_number= (int) gd.getNextNumber();
...@@ -690,6 +695,10 @@ public class CalibrationIllustrationParameters { ...@@ -690,6 +695,10 @@ public class CalibrationIllustrationParameters {
public boolean usePNG() { public boolean usePNG() {
return this.save_png; return this.save_png;
} }
public boolean usePNG_EO() {
return this.save_png_eo;
}
public int getJPEG_quality() { public int getJPEG_quality() {
return this.JPEG_quality; return this.JPEG_quality;
} }
......
...@@ -95,6 +95,7 @@ import com.elphel.imagej.tileprocessor.ErsCorrection; ...@@ -95,6 +95,7 @@ import com.elphel.imagej.tileprocessor.ErsCorrection;
import com.elphel.imagej.tileprocessor.ImageDtt; import com.elphel.imagej.tileprocessor.ImageDtt;
import com.elphel.imagej.tileprocessor.MLStats; import com.elphel.imagej.tileprocessor.MLStats;
import com.elphel.imagej.tileprocessor.QuadCLT; import com.elphel.imagej.tileprocessor.QuadCLT;
import com.elphel.imagej.tileprocessor.SymmVector;
import com.elphel.imagej.tileprocessor.TwoQuadCLT; import com.elphel.imagej.tileprocessor.TwoQuadCLT;
import ij.CompositeImage; import ij.CompositeImage;
...@@ -150,7 +151,8 @@ private Panel panel1, ...@@ -150,7 +151,8 @@ private Panel panel1,
panelClt4, panelClt4,
panelClt5, panelClt5,
panelClt_GPU, panelClt_GPU,
panelLWIR panelLWIR,
panelLWIR16
; ;
JP46_Reader_camera JP4_INSTANCE=null; JP46_Reader_camera JP4_INSTANCE=null;
...@@ -191,7 +193,9 @@ private Panel panel1, ...@@ -191,7 +193,9 @@ private Panel panel1,
// Add macro for GPU_QUAD? // Add macro for GPU_QUAD?
public static GPUTileProcessor.GpuQuad GPU_QUAD = null; public static GPUTileProcessor.GpuQuad GPU_QUAD = null;
public static GPUTileProcessor.GpuQuad GPU_QUAD_AUX = null; public static GPUTileProcessor.GpuQuad GPU_QUAD_AUX = null;
public static LwirReader LWIR_READER = null; public static LwirReader LWIR_READER = null;
public static SymmVector SYMM_VECTOR_EO = null;
public static SymmVector SYMM_VECTOR_LWIR = null;
public static EyesisCorrectionParameters.DebayerParameters DEBAYER_PARAMETERS = new EyesisCorrectionParameters.DebayerParameters( public static EyesisCorrectionParameters.DebayerParameters DEBAYER_PARAMETERS = new EyesisCorrectionParameters.DebayerParameters(
64, // size //128; 64, // size //128;
...@@ -489,7 +493,7 @@ private Panel panel1, ...@@ -489,7 +493,7 @@ private Panel panel1,
}; };
instance=plugInFrame; instance=plugInFrame;
plugInFrame.addKeyListener(IJ.getInstance()); plugInFrame.addKeyListener(IJ.getInstance());
int menuRows=4 + (ADVANCED_MODE?4:0) + (MODE_3D?3:0) + (DCT_MODE?6:0) + (GPU_MODE?1:0) +(LWIR_MODE?1:0); int menuRows=4 + (ADVANCED_MODE?4:0) + (MODE_3D?3:0) + (DCT_MODE?6:0) + (GPU_MODE?1:0) +(LWIR_MODE?2:0);
plugInFrame.setLayout(new GridLayout(menuRows, 1)); plugInFrame.setLayout(new GridLayout(menuRows, 1));
panel6 = new Panel(); panel6 = new Panel();
panel6.setLayout(new GridLayout(1, 0, 5, 5)); panel6.setLayout(new GridLayout(1, 0, 5, 5));
...@@ -760,10 +764,16 @@ private Panel panel1, ...@@ -760,10 +764,16 @@ private Panel panel1,
addButton("AUX OUT 3D", panelLWIR, color_process_aux); addButton("AUX OUT 3D", panelLWIR, color_process_aux);
addButton("Main img AUX", panelLWIR, color_process_aux); addButton("Main img AUX", panelLWIR, color_process_aux);
addButton("Main to AUX", panelLWIR, color_process_aux); addButton("Main to AUX", panelLWIR, color_process_aux);
addButton("LWIR batch", panelClt4, color_process); addButton("LWIR batch", panelClt4, color_process);
// addButton("LWIR_TEST", panelLWIR, color_conf_process); // addButton("LWIR_TEST", panelLWIR, color_conf_process);
// addButton("LWIR_ACQUIRE", panelLWIR, color_conf_process); // addButton("LWIR_ACQUIRE", panelLWIR, color_conf_process);
plugInFrame.add(panelLWIR); plugInFrame.add(panelLWIR);
panelLWIR16 = new Panel();
panelLWIR16.setLayout(new GridLayout(1, 0, 5, 5)); // rows, columns, vgap, hgap
addButton("Generate Sym Vectors", panelLWIR16, color_configure);
plugInFrame.add(panelLWIR16);
} }
plugInFrame.pack(); plugInFrame.pack();
//"LWIR batch" //"LWIR batch"
...@@ -5288,6 +5298,60 @@ private Panel panel1, ...@@ -5288,6 +5298,60 @@ private Panel panel1,
/* ======================================================================== */ /* ======================================================================== */
} else if (label.equals("Rotations_test")) { } else if (label.equals("Rotations_test")) {
ErsCorrection.test_rotations(); ErsCorrection.test_rotations();
} else if (label.equals("Generate Sym Vectors")) {
DEBUG_LEVEL=MASTER_DEBUG_LEVEL;
ErsCorrection.test_rotations();
boolean full_type1 = false;
boolean full_type2 = false;
int num_cameras = 4; // will try other values
SYMM_VECTOR_EO = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
num_cameras = 8; // will try other values
SYMM_VECTOR_LWIR = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
num_cameras = 12; // will try other values
SYMM_VECTOR_LWIR = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
num_cameras = 16;
SYMM_VECTOR_LWIR = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
num_cameras = 20;
SYMM_VECTOR_LWIR = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
num_cameras = 24;
SYMM_VECTOR_LWIR = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
num_cameras = 28;
SYMM_VECTOR_LWIR = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
num_cameras = 32;
SYMM_VECTOR_LWIR = new SymmVector (
num_cameras, // int num_cameras,
full_type1, // boolean full_type1, // false - all R or all T, true - mixed
full_type2, // boolean full_type2) {// false - quarter 3 is negated quarter 1, true - independent
DEBUG_LEVEL);
//JTabbedTest //JTabbedTest
// End of buttons code // End of buttons code
} }
......
package com.elphel.imagej.tileprocessor; package com.elphel.imagej.tileprocessor;
/**
**
** CorrVector - Geometry correction vector
**
** Copyright (C) 2017 Elphel, Inc.
**
** -----------------------------------------------------------------------------**
**
** CorrVector.java is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
** -----------------------------------------------------------------------------**
*/
import com.elphel.imagej.common.GenericJTabbedDialog; import com.elphel.imagej.common.GenericJTabbedDialog;
//import com.elphel.imagej.tileprocessor.GeometryCorrection.CorrVector; //import com.elphel.imagej.tileprocessor.GeometryCorrection.CorrVector;
......
This diff is collapsed.
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