Commit 67228555 authored by Andrey Filippov's avatar Andrey Filippov

more tweaking

parent d059a2ac
This diff is collapsed.
......@@ -237,7 +237,7 @@ public class TilePlanes {
double [] px_py = getCenterPxPy();
if (zxy != null) s += String.format("\nzxy = [%8.3f, %8.3f, %8.3f] (pix)",zxy[0],zxy[1]+px_py[0],zxy[2]+px_py[1]);
else s += "\nzxy = null";
if (values != null) s += String.format(", values = [%8.3f, %8.3f, %8.3f] pix^2",values[0],values[1],values[2]);
if (values != null) s += String.format(", values = [%8.5f, %8.4f, %8.3f] pix^2",values[0],values[1],values[2]);
else s += " values = null";
if (vectors != null) s += String.format("\nvectors = [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f]",
vectors[0][0],vectors[0][1],vectors[0][2], vectors[1][0],vectors[1][1],vectors[1][2], vectors[2][0],vectors[2][1],vectors[2][2]);
......@@ -247,7 +247,7 @@ public class TilePlanes {
else s += " normal = null";
if (wxyz != null) s += String.format("\nwxyz = [%8.2f, %8.2f, %8.2f] (m)",wxyz[0],wxyz[1],wxyz[2]);
else s += "\nwxyz = null";
if (wvalues != null) s += String.format(" wvals = [%8.2f, %8.2f, %8.2f] (m^2)",wvalues[0],wvalues[1],wvalues[2]);
if (wvalues != null) s += String.format(" wvals = [%8.4f, %8.3f, %8.2f] (m^2)",wvalues[0],wvalues[1],wvalues[2]);
else s += " wvals = null";
if (wvectors != null) s += String.format("\nwvect = [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f], [%8.5f, %8.5f, %8.5f]",
wvectors[0][0],wvectors[0][1],wvectors[0][2], wvectors[1][0],wvectors[1][1],wvectors[1][2], wvectors[2][0],wvectors[2][1],wvectors[2][2]);
......@@ -287,7 +287,30 @@ public class TilePlanes {
nonexclusiveStarEq.world_xyz[0],nonexclusiveStarEq.world_xyz[1],nonexclusiveStarEq.world_xyz[2]);
else s += " normal = null";
}
s+="\n\n";
s+="\n";
if (link_costs != null){
for (int dir = 0; dir < link_costs.length; dir++){
s+=String.format("dir=%d: ", dir);
if (link_costs[dir] != null) {
int best_np = -1;
for (int np = 0; np < link_costs[dir].length; np++){
if (!Double.isNaN(link_costs[dir][np]) && ((best_np < 0) || (link_costs[dir][np] < link_costs[dir][best_np]))){
best_np = np;
}
}
for (int np = 0; np < link_costs[dir].length; np++){
if (np == best_np){
s+=String.format("%7.3f[%d] ", link_costs[dir][np],np);
} else {
s+=String.format("%7.3f ", link_costs[dir][np]);
}
}
}
s+="\n";
}
}
s+="\n";
return s;
}
......
......@@ -3317,19 +3317,33 @@ public class TileProcessor {
clt_parameters.tileX,
clt_parameters.tileY);
// * Possible problem is that "normalizing" merge quality for low weights is not applicable for "star" plane that include neighhbors
// * Switch to a single "cost" function (costSameTileConnectionsAlt())
// Still - how to merge stray tiles that do not have neighbors/star? Still merge them "old way" (costSameTileConnections()) if at least 1 does not
// have a "star"
// double [][][][][][] merge_cost_data =
lp.costSameTileConnections(
false, // final boolean ignore_weights,
1000.0, // final double threshold_worst,
1000.0, //final double threshold_world_worst,
st.planes, // ffinal TilePlanes.PlaneData [][] planes,
st.planes, // final TilePlanes.PlaneData [][] planes,
merge_candidates, // final int [][][] merge_candidates,
plane_nooverlaps, // final boolean [][][] valid_candidates, // will be updated
2, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
// System.out.println("merge_cost_data.length = " + merge_cost_data.length);
lp.costSameTileConnectionsAlt(
5.0, // final double threshold,
10.0, // final double threshold_nostar,
st.planes, // final TilePlanes.PlaneData [][] planes,
merge_candidates, // final int [][][] merge_candidates,
plane_nooverlaps, // final boolean [][][] valid_candidates, // will be updated
2, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
int [][][] merge_groups = lp.extractMergeSameTileGroups(
st.planes, // final TilePlanes.PlaneData [][] planes,
merge_candidates, // final int [][][] merge_candidates,
......@@ -3805,6 +3819,12 @@ public class TileProcessor {
0, // 1,// 0, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
lp.interPlaneCosts(
st.planes_mod, // final TilePlanes.PlaneData [][] planes,
2, // -1, // debugLevel, // final int debugLevel)
clt_parameters.tileX,
clt_parameters.tileY);
// recalculate links? more smooth?
} else {
st.planes_mod = st.planes; // just use the measured ones
......@@ -3824,6 +3844,22 @@ public class TileProcessor {
clt_parameters.tileY);
int [] wh = st.getShowPlanesWidthHeight();
double [][] plane_data_nonan_meas = st.getShowPlanes(
st.getPlanes(),
clt_parameters.plMinStrength, // minWeight,
clt_parameters.plMaxEigen, // maxEigen,
clt_parameters.plDispNorm,
false, //boolean use_NaN)
0.0,
10.0);
double [][] plane_data_nan_meas = st.getShowPlanes(
st.getPlanes(),
clt_parameters.plMinStrength, // minWeight,
clt_parameters.plMaxEigen, // maxEigen,
clt_parameters.plDispNorm,
true, //boolean use_NaN)
0.0,
10.0);
double [][] plane_data_nonan = st.getShowPlanes(
(planes_mod != null) ? st.getPlanesMod():st.getPlanes(),
clt_parameters.plMinStrength, // minWeight,
......@@ -3840,8 +3876,14 @@ public class TileProcessor {
true, //boolean use_NaN)
0.0,
10.0);
double [][] plane_data = new double [plane_data_nonan.length + plane_data_nan.length + 3][];
double [][] plane_data = new double [plane_data_nonan_meas.length + plane_data_nan_meas.length+ plane_data_nonan.length + plane_data_nan.length + 3][];
int indx = 0;
for (int i = 0; i < plane_data_nonan_meas.length; i++){
plane_data[indx++] = plane_data_nonan_meas[i];
}
for (int i = 0; i < plane_data_nan_meas.length; i++){
plane_data[indx++] = plane_data_nan_meas[i];
}
for (int i = 0; i < plane_data_nonan.length; i++){
plane_data[indx++] = plane_data_nonan[i];
}
......
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