From: Dan Zhu Date: Fri, 28 Jun 2019 21:07:44 +0000 (-0700) Subject: add flags for empty blocks X-Git-Tag: v1.8.2~177 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee097c75ce15cbcf6603e1a47a7da36ce16185ce;p=libvpx add flags for empty blocks Change-Id: Iedf3bdd87d203db5163d3cc47fcbef1fd002218f --- diff --git a/tools/3D-Reconstruction/sketch_3D_reconstruction/MotionField.pde b/tools/3D-Reconstruction/sketch_3D_reconstruction/MotionField.pde index 883a8f831..a5e04b6a9 100644 --- a/tools/3D-Reconstruction/sketch_3D_reconstruction/MotionField.pde +++ b/tools/3D-Reconstruction/sketch_3D_reconstruction/MotionField.pde @@ -61,6 +61,9 @@ class MotionField { PVector mv = motion_field.get(i); if (mv.z > 0) { motion_field.set(i, new PVector(mv.x / mv.z, mv.y / mv.z, 0)); + } else // there is nothing in the block, use -1 to mark it. + { + motion_field.set(i, new PVector(0.0, 0.0, -1)); } } } @@ -85,7 +88,12 @@ class MotionField { mvs[i] = ""; for (int j = 0; j < c_num; j++) { PVector mv = motion_field.get(i * c_num + j); - mvs[i] += str(mv.x) + "," + str(mv.y); + if (mv.z != -1) { + mvs[i] += str(mv.x) + "," + str(mv.y); + } else // there is nothing + { + mvs[i] += "-,-"; + } if (j != c_num - 1) mvs[i] += ";"; } }