Commit 0ef14ecf authored by Andrey Filippov's avatar Andrey Filippov

Disabled (optionally) alpha in textures, starting subdividing triangular

mesh instead
parent 8c67ed14
...@@ -1996,6 +1996,7 @@ public class ExtrinsicAdjustment { ...@@ -1996,6 +1996,7 @@ public class ExtrinsicAdjustment {
// find largest terrain area // find largest terrain area
int [] iterrains = tn. enumerateClusters( int [] iterrains = tn. enumerateClusters(
terrain, // boolean [] tiles, terrain, // boolean [] tiles,
null, // int [] num_clusters,
true); //boolean ordered) true); //boolean ordered)
boolean [] terrain_main = new boolean[clusters]; boolean [] terrain_main = new boolean[clusters];
for (int i = 0; i < clusters; i++) { for (int i = 0; i < clusters; i++) {
......
...@@ -11761,6 +11761,7 @@ public class OpticalFlow { ...@@ -11761,6 +11761,7 @@ public class OpticalFlow {
int [] clusters = tn.enumerateClusters( int [] clusters = tn.enumerateClusters(
over_thresh, // boolean [] tiles, over_thresh, // boolean [] tiles,
null, // int [] num_clusters,
false); // boolean ordered) false); // boolean ordered)
// check clusters contain super-threshold tile // check clusters contain super-threshold tile
double max_cluster = mov_thresh*mov_clust_max; // each cluster should have larger tile value to survive double max_cluster = mov_thresh*mov_clust_max; // each cluster should have larger tile value to survive
...@@ -11829,6 +11830,7 @@ public class OpticalFlow { ...@@ -11829,6 +11830,7 @@ public class OpticalFlow {
clusters = tn.enumerateClusters( clusters = tn.enumerateClusters(
move_mask, // boolean [] tiles, move_mask, // boolean [] tiles,
null, // int [] num_clusters,
false); // boolean ordered) false); // boolean ordered)
if(show_debug_images) { if(show_debug_images) {
for (int nTile = 0; nTile < motion.length; nTile++) if (clusters[nTile] > 0){ for (int nTile = 0; nTile < motion.length; nTile++) if (clusters[nTile] > 0){
......
...@@ -616,11 +616,13 @@ public class TileNeibs{ ...@@ -616,11 +616,13 @@ public class TileNeibs{
/** /**
* Enumerate clusters on rectangular area * Enumerate clusters on rectangular area
* @param tiles selected tiles, size should be sizeX * sizeY * @param tiles selected tiles, size should be sizeX * sizeY
* @param num_clusters if non null, will return number of clusters
* @param ordered if true, order tiles from largest to smallest5 * @param ordered if true, order tiles from largest to smallest5
* @return integer array, where 0 is unused, 1+ cluster it belongs to * @return integer array, where 0 is unused, 1+ cluster it belongs to
*/ */
public int [] enumerateClusters( public int [] enumerateClusters(
boolean [] tiles, boolean [] tiles,
int [] num_clusters,
boolean ordered) boolean ordered)
{ {
int [] waves = new int [tiles.length]; int [] waves = new int [tiles.length];
...@@ -652,6 +654,9 @@ public class TileNeibs{ ...@@ -652,6 +654,9 @@ public class TileNeibs{
} }
} }
} }
if (num_clusters != null) {
num_clusters[0] = numClust;
}
if (!ordered) { if (!ordered) {
return enum_clust; return enum_clust;
} }
......
...@@ -5660,6 +5660,7 @@ public class TilePlanes { ...@@ -5660,6 +5660,7 @@ public class TilePlanes {
null); // boolean [] prohibit, null); // boolean [] prohibit,
int [] clusters = tileNeibs.enumerateClusters( int [] clusters = tileNeibs.enumerateClusters(
grown_sel, // boolean [] tiles, grown_sel, // boolean [] tiles,
null, // int [] num_clusters,
false); // boolean ordered) false); // boolean ordered)
int num_clusters = TileNeibs.getMax( int num_clusters = TileNeibs.getMax(
...@@ -5698,6 +5699,7 @@ public class TilePlanes { ...@@ -5698,6 +5699,7 @@ public class TilePlanes {
int [] dbg_clusters = clusters.clone(); int [] dbg_clusters = clusters.clone();
clusters = tileNeibs.enumerateClusters( clusters = tileNeibs.enumerateClusters(
grown_sel, // boolean [] tiles, grown_sel, // boolean [] tiles,
null, // int [] num_clusters,
false); // boolean ordered) false); // boolean ordered)
num_clusters = TileNeibs.getMax( num_clusters = TileNeibs.getMax(
clusters); clusters);
......
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