Commit 04a6a7dd authored by Andrey Filippov's avatar Andrey Filippov

Autoranging for lwir images/texture tiles

parent ea60a595
......@@ -11,6 +11,9 @@ public class ColorProcParameters {
public boolean lwir_islwir = false;
public double lwir_low = 27000;
public double lwir_high = 31000;
public boolean lwir_autorange = true;
public double lwir_too_cold = 100.0; // discard this number of pixels too cold
public double lwir_too_hot = 3.0; // discard this number of pixels too hot
public int lwir_palette = 0; // 0 - white - hot, 1 - black - hot, 2+ - colored
public boolean lwir_subtract_dc = false;
public boolean lwir_eq_chn = true; // adjust average temperature between channels
......@@ -68,12 +71,20 @@ public class ColorProcParameters {
public boolean isMonochrome() {
return lwir_islwir; // for now it is the only reason to be monochrome
}
public boolean isLwir() {
return lwir_islwir;
}
private ColorProcParameters() {}
public ColorProcParameters(
boolean lwir_islwir, // false;
double lwir_low, // 27000;
double lwir_high, // 31000;
boolean lwir_autorange, // true;
double lwir_too_cold, // 100.0; // discard this number of pixels too cold
double lwir_too_hot, // 3.0; // discard this number of pixels too hot
int lwir_palette, // 0 - white - hot, 1 - black - hot, 2+ - colored
boolean lwir_subtract_dc, // = false;
boolean lwir_eq_chn, // true
......@@ -128,6 +139,11 @@ public class ColorProcParameters {
this.lwir_islwir = lwir_islwir;
this.lwir_low = lwir_low;
this.lwir_high = lwir_high;
this.lwir_autorange = lwir_autorange;
this.lwir_too_cold = lwir_too_cold;
this.lwir_too_hot = lwir_too_hot;
this.lwir_palette = lwir_palette;
this.lwir_subtract_dc = lwir_subtract_dc;
this.lwir_eq_chn =lwir_eq_chn;
......@@ -183,6 +199,11 @@ public class ColorProcParameters {
properties.setProperty(prefix+"lwir_islwir", this.lwir_islwir+"");
properties.setProperty(prefix+"lwir_low", this.lwir_low+"");
properties.setProperty(prefix+"lwir_high", this.lwir_high+"");
properties.setProperty(prefix+"lwir_autorange", this.lwir_autorange+"");
properties.setProperty(prefix+"lwir_too_cold", this.lwir_too_cold+"");
properties.setProperty(prefix+"lwir_too_hot", this.lwir_too_hot+"");
properties.setProperty(prefix+"lwir_palette", this.lwir_palette+"");
properties.setProperty(prefix+"lwir_subtract_dc", this.lwir_subtract_dc+"");
properties.setProperty(prefix+"lwir_eq_chn", this.lwir_eq_chn+"");
......@@ -244,9 +265,14 @@ public class ColorProcParameters {
}
public boolean getProperties(String prefix,Properties properties){
if (properties.getProperty(prefix+"lwir_islwir")!=null) this.lwir_islwir=Boolean.parseBoolean(properties.getProperty(prefix+"lwir_islwir"));
if (properties.getProperty(prefix+"lwir_low")!=null) this.lwir_low=Double.parseDouble(properties.getProperty(prefix+"lwir_low"));
if (properties.getProperty(prefix+"lwir_high")!=null) this.lwir_high=Double.parseDouble(properties.getProperty(prefix+"lwir_high"));
if (properties.getProperty(prefix+"lwir_islwir")!=null) this.lwir_islwir=Boolean.parseBoolean(properties.getProperty(prefix+"lwir_islwir"));
if (properties.getProperty(prefix+"lwir_low")!=null) this.lwir_low=Double.parseDouble(properties.getProperty(prefix+"lwir_low"));
if (properties.getProperty(prefix+"lwir_high")!=null) this.lwir_high=Double.parseDouble(properties.getProperty(prefix+"lwir_high"));
if (properties.getProperty(prefix+"lwir_autorange")!=null) this.lwir_autorange=Boolean.parseBoolean(properties.getProperty(prefix+"lwir_autorange"));
if (properties.getProperty(prefix+"lwir_too_cold")!=null) this.lwir_too_cold=Double.parseDouble(properties.getProperty(prefix+"lwir_too_cold"));
if (properties.getProperty(prefix+"lwir_too_hot")!=null) this.lwir_too_hot=Double.parseDouble(properties.getProperty(prefix+"lwir_too_hot"));
if (properties.getProperty(prefix+"lwir_palette")!=null) this.lwir_palette=Integer.parseInt(properties.getProperty(prefix+"lwir_palette"));
if (properties.getProperty(prefix+"lwir_subtract_dc")!=null) this.lwir_subtract_dc=Boolean.parseBoolean(properties.getProperty(prefix+"lwir_subtract_dc"));
if (properties.getProperty(prefix+"lwir_eq_chn")!=null) this.lwir_eq_chn=Boolean.parseBoolean(properties.getProperty(prefix+"lwir_eq_chn"));
......@@ -316,8 +342,13 @@ public class ColorProcParameters {
}
gd.addMessage("--- Parameters related to thermal imaging ---");
gd.addCheckbox ("These sensors are thermal vision with absolute temperature", this.lwir_islwir);
gd.addNumericField("Lowest value (temperature) to display", this.lwir_low, 3); //0.53
gd.addNumericField("Highest value (temperature) to display", this.lwir_high, 3); //0.53
gd.addNumericField("Lowest value (temperature) to display", this.lwir_low, 6); //0.53
gd.addNumericField("Highest value (temperature) to display", this.lwir_high, 6); //0.53
gd.addCheckbox ("Autorange LWIR low/high temperatures (within limits above)", this.lwir_autorange); // true
gd.addNumericField("Number of too cold pixels/image to ignore during autorange", this.lwir_too_cold, 4); // 100.0
gd.addNumericField("Number of too hot pixels/image to ignore during autorange", this.lwir_too_hot, 4); // 0.53
gd.addNumericField("LWIR pallet (0-white hot, 1-black hot, 2+ - pseudo colors ", this.lwir_palette, 0);
gd.addCheckbox ("Subtract each image DC when conditioning", this.lwir_subtract_dc);
gd.addCheckbox ("Adjust average temperature between cameras", this.lwir_eq_chn);
......@@ -401,6 +432,11 @@ public class ColorProcParameters {
this.lwir_islwir= gd.getNextBoolean();
this.lwir_low= gd.getNextNumber();
this.lwir_high= gd.getNextNumber();
this.lwir_autorange = gd.getNextBoolean();
this.lwir_too_cold= gd.getNextNumber();
this.lwir_too_hot= gd.getNextNumber();
this.lwir_palette= (int) gd.getNextNumber();
this.lwir_subtract_dc= gd.getNextBoolean();
this.lwir_eq_chn= gd.getNextBoolean();
......@@ -462,6 +498,11 @@ public class ColorProcParameters {
cp.lwir_islwir = this.lwir_islwir;
cp.lwir_low = this.lwir_low;
cp.lwir_high = this.lwir_high;
cp.lwir_autorange = this.lwir_autorange;
cp.lwir_too_cold = this.lwir_too_cold;
cp.lwir_too_hot = this.lwir_too_hot;
cp.lwir_palette = this.lwir_palette;
cp.lwir_subtract_dc = this.lwir_subtract_dc;
cp.lwir_eq_chn = this.lwir_eq_chn;
......@@ -521,6 +562,11 @@ public class ColorProcParameters {
this.lwir_islwir = cp.lwir_islwir;
this.lwir_low = cp.lwir_low;
this.lwir_high = cp.lwir_high;
this.lwir_autorange = cp.lwir_autorange;
this.lwir_too_cold = cp.lwir_too_cold;
this.lwir_too_hot = cp.lwir_too_hot;
this.lwir_palette = cp.lwir_palette;
this.lwir_subtract_dc = cp.lwir_subtract_dc;
this.lwir_eq_chn = cp.lwir_eq_chn;
......
......@@ -245,7 +245,10 @@ private Panel panel1,
false, // boolean lwir_islwir, // false;
27000, // double lwir_low, // 27000;
31000, // double lwir_high, // 31000;
0, // int lwir_palette, // 0 - white - hot, 1 - black - hot, 2+ - colored
true, // boolean lwir_autorange, // true;
100.0, // double lwir_too_cold, // 100.0; // discard this number of pixels too cold
3.0, // double lwir_too_hot, // 3.0; // discard this number of pixels too hot
1, // int lwir_palette, // 0 - white - hot, 1 - black - hot, 2+ - pseudocolored
false, // boolean lwir_subtract_dc, // = false;
true, // boolean lwir_eq_chn = true; // adjust average temperature between channels
true, // boolean correct_vignetting, // = true;
......
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