* Cross product of 2 3-d vectors as column matrices
* @param v1
* @param v2
* @return v1 x v2 as a column (3x1) matrix
*/
publicMatrixcross3d(Matrixv1,Matrixv2)
{
double[][]av1=v1.getArray();
double[][]av2=v2.getArray();
double[][]ar={
{av1[1][0]*av2[2][0]-av1[2][0]*av2[1][0]},
{av1[2][0]*av2[0][0]-av1[0][0]*av2[2][0]},
{av1[0][0]*av2[1][0]-av1[1][0]*av2[0][0]}};
returnnewMatrix(ar);
}
publicdouble[]getWorldXYZ(
booleancorrect_distortions,
intdebugLevel)
{
doubledelta=0.0001;
if(world_xyz!=null)returnworld_xyz;
setCorrectDistortions(correct_distortions);
// get pixel coordinates of the plane origin point
doublepx=tileSize*(superTileSize*sTileXY[0]+superTileSize/2)+zxy[1];// [3] - plane point {disparity, x, y), x=0, y=0 is a 4,4 point of an 8x8 supertile
@@ -1530,35 +1532,60 @@ public class TileProcessor {
publicvoidfillGaps(// grows, then shrinks
intdepth,// same as grow - odd - 4 directions, even - 8
booleanpoison,// do not fill gaps that even touch prohibited
boolean[]tiles,
boolean[]prohibit){
boolean[]orig_tiles=tiles.clone();
growTiles(
depth,// grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
tiles,
prohibit);
// invert selection, so "grow" will be "shrink"
for(inti=0;i<tiles.length;i++)tiles[i]=!tiles[i];
growTiles(
depth,// grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
tiles,
prohibit);
// invert selection again (restore)
for(inti=0;i<tiles.length;i++)tiles[i]=!tiles[i];
// for (int i =0; i< tiles.length; i++) tiles[i] = !tiles[i] || orig_tiles[i]; // and or with original (why result does not have some of original - only with prohibit?
if(prohibit!=null){// second pass w/o prohoibit, then end results
if(poison&&(prohibit!=null)){
growTiles(
depth,// grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
depth,// grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
tiles,
prohibit);
// invert selection, so "grow" will be "shrink"
for(inti=0;i<tiles.length;i++)tiles[i]=!tiles[i];
growTiles(
depth,// grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
tiles,
prohibit);
// invert selection again (restore)
for(inti=0;i<tiles.length;i++)tiles[i]=!tiles[i];
// for (int i =0; i< tiles.length; i++) tiles[i] = !tiles[i] || orig_tiles[i]; // and or with original (why result does not have some of original - only with prohibit?
if(prohibit!=null){// second pass w/o prohibit, then and results
growTiles(
depth,// grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more