Commit fba24b20 authored by Andrey Filippov's avatar Andrey Filippov

Rewriting correlation processing to handle diagonal and multi-baseline

pairs
parent 421e0704
This diff is collapsed.
......@@ -432,6 +432,66 @@ public class DttRad2 {
}
}
/**
* Unfolds 2d correlation tile in pixel domain
* @param qdata 4-quadrant result of 2cd DCT2
* @param transform_size DCT transformation size
* @return packed array [(2*transform_size-1) * (2*transform_size-1)]
*/
public double [] corr_unfold_tile(
double [][] qdata, // [4][transform_size*transform_size] data after DCT2 (pixel domain)
int transform_size
)
{
int corr_pixsize = transform_size * 2 - 1;
double corr_pixscale = 0.25;
double [] rslt = new double [corr_pixsize*corr_pixsize];
rslt[corr_pixsize*transform_size - transform_size] = corr_pixscale * qdata[0][0]; // center
for (int j = 1; j < transform_size; j++) { // for i == 0
rslt[corr_pixsize*transform_size - transform_size + j] = corr_pixscale * (qdata[0][j] + qdata[1][j-1]);
rslt[corr_pixsize*transform_size - transform_size - j] = corr_pixscale * (qdata[0][j] - qdata[1][j-1]);
}
for (int i = 1; i < transform_size; i++) {
rslt[corr_pixsize*(transform_size + i) - transform_size] =
corr_pixscale * (qdata[0][i*transform_size] + qdata[2][(i-1)*transform_size]);
rslt[corr_pixsize*(transform_size - i) - transform_size] =
corr_pixscale * (qdata[0][i*transform_size] - qdata[2][(i-1)*transform_size]);
for (int j = 1; j < transform_size; j++) {
rslt[corr_pixsize*(transform_size + i) - transform_size + j] =
corr_pixscale * (qdata[0][i* transform_size + j] +
qdata[1][i* transform_size + j - 1] +
qdata[2][(i-1)*transform_size + j] +
qdata[3][(i-1)*transform_size + j - 1]);
rslt[corr_pixsize*(transform_size + i) - transform_size - j] =
corr_pixscale * ( qdata[0][i* transform_size + j] +
-qdata[1][i* transform_size + j - 1] +
qdata[2][(i-1)*transform_size + j] +
-qdata[3][(i-1)*transform_size + j - 1]);
rslt[corr_pixsize*(transform_size - i) - transform_size + j] =
corr_pixscale * (qdata[0][i* transform_size + j] +
qdata[1][i* transform_size + j - 1] +
-qdata[2][(i-1)*transform_size + j] +
-qdata[3][(i-1)*transform_size + j - 1]);
rslt[corr_pixsize*(transform_size - i) - transform_size - j] =
corr_pixscale * (qdata[0][i* transform_size + j] +
-qdata[1][i* transform_size + j - 1] +
-qdata[2][(i-1)*transform_size + j] +
qdata[3][(i-1)*transform_size + j - 1]);
}
}
return rslt;
}
public double [] dttt_iv(double [] x){
return dttt_iv(x, 0, 1 << (ilog2(x.length)/2));
}
......@@ -1085,4 +1145,5 @@ public class DttRad2 {
}
}
......@@ -2350,13 +2350,13 @@ public class EyesisCorrectionParameters {
public double corr_red = 0.5; // Red to green correlation weight
public double corr_blue = 0.2; // Blue to green correlation weight
public boolean corr_normalize = false; // normalize each correlation tile by rms
public double min_corr = 0.001; // minimal correlation value to consider valid
public double min_corr = 0.02; // minimal correlation value to consider valid
public double min_corr_normalized = 2.0; // minimal correlation value to consider valid when normalizing correlation results
public double max_corr_sigma = 1.5; // weights of points around global max to find fractional
public double max_corr_sigma = 1.2; // weights of points around global max to find fractional
// pixel location by quadratic approximation
public double corr_r2_offset = 0.0; // 0.0 - for compatibility with old, normally should be 2.0 (or 1.0)
public double max_corr_radius = 3.5; // maximal distance from int max to consider
public double max_corr_radius = 3.9; // maximal distance from int max to consider
// public int enhortho_width = 2; // reduce weight of center correlation pixels from center (0 - none, 1 - center, 2 +/-1 from center)
// public double enhortho_scale = 0.0; // 0.2; // multiply center correlation pixels (inside enhortho_width)
......
This diff is collapsed.
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