Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed scala nature.

  • Loading branch information...
commit c3c7e4f00a553605a4301d18a3a2b1e21b92904a 1 parent 8fa136d
Ying Yin authored
1  .classpath
@@ -4,7 +4,6 @@
4 4 <classpathentry kind="src" path="test"/>
5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
6 6 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
7   - <classpathentry kind="con" path="ch.epfl.lamp.sdt.launching.SCALA_CONTAINER"/>
8 7 <classpathentry kind="lib" path="lib/javacpp.jar"/>
9 8 <classpathentry kind="lib" path="lib/javacv-linux-x86_64.jar"/>
10 9 <classpathentry kind="lib" path="lib/javacv.jar"/>
9 .project
@@ -11,14 +11,13 @@
11 11 </arguments>
12 12 </buildCommand>
13 13 <buildCommand>
14   - <name>ch.epfl.lamp.sdt.core.scalabuilder</name>
15   - <arguments>
16   - </arguments>
17   - </buildCommand>
  14 + <name>org.eclipse.jdt.core.javabuilder</name>
  15 + <arguments>
  16 + </arguments>
  17 + </buildCommand>
18 18 </buildSpec>
19 19 <natures>
20 20 <nature>org.eclipse.jdt.core.javanature</nature>
21 21 <nature>com.aptana.ruby.core.rubynature</nature>
22   - <nature>ch.epfl.lamp.sdt.core.scalanature</nature>
23 22 </natures>
24 23 </projectDescription>
2  src/edu/mit/yingyin/tabletop/apps/CheckerboardTestAppController.java
@@ -82,7 +82,7 @@ public CheckerboardTestAppController() {
82 82 BufferedImage image = ImageIO.read(new File(IMAGE_FILE_NAME));
83 83 heController = new HandEventsController(image,
84 84 new Dimension(TABLETOP_WIDTH, TABLETOP_HEIGHT));
85   - engine = new HandTrackingEngine(OPENNI_CONFIG_FILE, CALIB_FILE,
  85 + engine = HandTrackingEngine.initInstance(OPENNI_CONFIG_FILE, CALIB_FILE,
86 86 EnvConstants.DEFAULT_MAX_DEPTH);
87 87 packetController = new ProcessPacketController(engine.depthWidth(),
88 88 engine.depthHeight(), null);
27 src/edu/mit/yingyin/tabletop/apps/HandTrackingApp.scala
... ... @@ -1,27 +0,0 @@
1   -package edu.mit.yingyin.tabletop.apps {
2   -import edu.mit.yingyin.tabletop.models.HandTrackingEngine
3   -import org.apache.commons.cli.OptionBuilder
4   -import edu.mit.yingyin.util.CommandLineOptions
5   -import edu.mit.yingyin.tabletop.models.EnvConstants
6   -
7   -object HandTrackingApp {
8   - def main(args:Array[String]) = {
9   - // Parse command line arguments.
10   - OptionBuilder.withArgName("main direction")
11   - OptionBuilder.withLongOpt("dir")
12   - OptionBuilder.hasArg
13   - OptionBuilder.withDescription("The main directory for input and output. " +
14   - "The configuration file should be in <dir>/config/folder." +
15   - "The default dir is the current directory.")
16   - val mainDirOpt = OptionBuilder.create("d")
17   - CommandLineOptions.addOption(mainDirOpt)
18   - CommandLineOptions.parse(args)
19   - val mainDir = CommandLineOptions.getOptionValue("d", "./")
20   -
21   - val openniConfigFile = mainDir + "config/config.xml"
22   - val calibrationFile = mainDir + "data/calibration/calibration.txt"
23   -
24   - val engine = new HandTrackingEngine(openniConfigFile, calibrationFile,
25   - EnvConstants.DEFAULT_MAX_DEPTH)
26   - }
27   -}}
2  src/edu/mit/yingyin/tabletop/apps/HandTrackingAppController.java
@@ -158,7 +158,7 @@ public HandTrackingAppController(String mainDir) {
158 158 displayOn = false;
159 159
160 160 try {
161   - engine = new HandTrackingEngine(openniConfigFile, calibrationFile,
  161 + engine = HandTrackingEngine.initInstance(openniConfigFile, calibrationFile,
162 162 maxDepth);
163 163 } catch (GeneralException ge) {
164 164 logger.info("OpenNI config file = " + openniConfigFile);
1  src/edu/mit/yingyin/tabletop/models/Background.java
@@ -302,6 +302,7 @@ private void computeAvgDiff() {
302 302 * as the depth array.
303 303 */
304 304 private void depthToImage(int[] depthRawData, IplImage image) {
  305 + // No scaling.
305 306 CvUtil.intToFloatIplImage(depthRawData,image, 1);
306 307 }
307 308
4 src/edu/mit/yingyin/tabletop/models/ForelimbFeatureDetector.java
@@ -24,7 +24,7 @@
24 24 import edu.mit.yingyin.util.CvUtil;
25 25 import edu.mit.yingyin.util.Geometry;
26 26 import edu.mit.yingyin.util.Matrix;
27   -import edu.mit.yingyin.util.Vector2fUtil;
  27 +import edu.mit.yingyin.util.VectorUtil;
28 28
29 29 /**
30 30 * A detector for forelimb features including fingertip positions.
@@ -93,7 +93,7 @@ public void extractFingertipsConvexityDefects(ProcessPacket packet) {
93 93 defect2.depth_point().y() - defect2.start().y());
94 94 float distance2 = CvUtil.distance2(defect1.depth_point(),
95 95 defect2.depth_point());
96   - if (Vector2fUtil.angle(v1, v2) <= FINGERTIP_ANGLE &&
  96 + if (VectorUtil.angle(v1, v2) <= FINGERTIP_ANGLE &&
97 97 distance2 >= FINGERTIP_WIDTH_THRESHOLD) {
98 98 int mx = (defect1.end().x() + defect2.start().x()) / 2;
99 99 int my = (defect1.end().y() + defect2.start().y()) / 2;
6 src/edu/mit/yingyin/tabletop/models/FullOpenNIDevice.java
@@ -16,6 +16,7 @@
16 16 import org.OpenNI.OutArg;
17 17 import org.OpenNI.Player;
18 18 import org.OpenNI.PlayerSeekOrigin;
  19 +import org.OpenNI.Point3D;
19 20 import org.OpenNI.ScriptNode;
20 21 import org.OpenNI.StatusException;
21 22
@@ -200,6 +201,11 @@ public void seekFrameBy(int diff) throws StatusException {
200 201 player.seekToFrame(depthGen, PlayerSeekOrigin.CURRENT, diff);
201 202 }
202 203
  204 + public Point3D[] convertProjectiveToRealWorld(Point3D[] points)
  205 + throws StatusException {
  206 + return depthGen.convertProjectiveToRealWorld(points);
  207 + }
  208 +
203 209 private void updateMetaData() {
204 210 if (depthGen.isDataNew())
205 211 depthMD = depthGen.getMetaData();
9 src/edu/mit/yingyin/tabletop/models/HandAnalyzer.java
@@ -58,7 +58,6 @@
58 58 */
59 59 private static final int BG_INIT_FRAMES = BG_INGNORE_FRAMES + 40;
60 60
61   -
62 61 private static final float BG_DIFF_LSCALE = 6;
63 62 private static final float BG_DIFF_HSCALE = 15;
64 63
@@ -102,6 +101,9 @@ public HandAnalyzer(int width, int height, int maxDepth) {
102 101 ffd = new ForelimbFeatureDetector(width, height);
103 102 }
104 103
  104 + /**
  105 + * @return true if background is initialized.
  106 + */
105 107 public boolean isBgInitialized() {
106 108 return background.isInitialized();
107 109 }
@@ -110,7 +112,7 @@ public FloatBuffer aveBg() {
110 112 return background.avgBuffer();
111 113 }
112 114
113   - public int aveBgWidth() {
  115 + public int aveBgWidthStep() {
114 116 return background.avgBufferWidthStep();
115 117 }
116 118
@@ -118,7 +120,7 @@ public FloatBuffer diffBg() {
118 120 return background.diffBuffer();
119 121 }
120 122
121   - public int diffBgWidth() {
  123 + public int diffBgWidthStep() {
122 124 return background.diffBufferWidthStep();
123 125 }
124 126
@@ -142,7 +144,6 @@ public void analyzeData(ProcessPacket packet) {
142 144 } else if (packet.depthFrameID == BG_INIT_FRAMES) {
143 145 background.createModelsFromStats((float) BG_DIFF_LSCALE,
144 146 (float) BG_DIFF_HSCALE);
145   - Table.instance().init(background);
146 147 logger.info(background.stats());
147 148 }
148 149
12 src/edu/mit/yingyin/tabletop/models/HandTracker.java
... ... @@ -1,5 +1,6 @@
1 1 package edu.mit.yingyin.tabletop.models;
2 2
  3 +import java.nio.FloatBuffer;
3 4 import java.util.ArrayList;
4 5 import java.util.List;
5 6
@@ -52,9 +53,6 @@ public String toString() {
52 53 private List<IHandEventListener> listeners =
53 54 new ArrayList<IHandEventListener>();
54 55
55   - /**
56   - * Reference to the table.
57   - */
58 56 private Table table;
59 57 /** Counts the duration of contact or noncontact. */
60 58 private int pressedCounter = 0, releasedCounter = 0;
@@ -63,10 +61,16 @@ public String toString() {
63 61 private CalibModel calibExample;
64 62
65 63 public HandTracker(CalibModel calibExample) {
66   - table = Table.instance();
67 64 this.calibExample = calibExample;
68 65 }
69 66
  67 + public boolean isTableInitialized() { return table != null; }
  68 +
  69 + public void initTable(FloatBuffer avg, FloatBuffer diff, int avgWidthStep,
  70 + int diffWidthStep, int width, int height) {
  71 + table = new Table(avg, diff, avgWidthStep, diffWidthStep, width, height);
  72 + }
  73 +
70 74 /**
71 75 * Updates forelimbs information and generates events.
72 76 * @param forelimbs information for all the forelimbs detected.
55 src/edu/mit/yingyin/tabletop/models/HandTrackingEngine.java
@@ -6,6 +6,8 @@
6 6 import java.util.logging.Logger;
7 7
8 8 import org.OpenNI.GeneralException;
  9 +import org.OpenNI.Point3D;
  10 +import org.OpenNI.StatusException;
9 11
10 12 import edu.mit.yingyin.calib.CalibModel;
11 13 import edu.mit.yingyin.image.ImageConvertUtils;
@@ -27,6 +29,10 @@
27 29 public void fingerPressed(List<FingerEvent> feList);
28 30 }
29 31
  32 + private static HandTrackingEngine instance;
  33 + private static String openniConfigFile, calibrationFile;
  34 + private static int maxDepth;
  35 +
30 36 private static Logger logger = Logger.getLogger(
31 37 HandTrackingEngine.class.getName());
32 38
@@ -38,6 +44,33 @@
38 44 private HandAnalyzer analyzer;
39 45
40 46 /**
  47 + * Initialize and returns the instance of <code>HandTrackingEngine</code>.
  48 + * @param _openniConfigFile
  49 + * @param _calibrationFile
  50 + * @param _maxDepth
  51 + * @return
  52 + * @throws GeneralException
  53 + */
  54 + public static HandTrackingEngine initInstance(String _openniConfigFile,
  55 + String _calibrationFile, int _maxDepth) throws GeneralException {
  56 + openniConfigFile = _openniConfigFile;
  57 + calibrationFile = _calibrationFile;
  58 + maxDepth = _maxDepth;
  59 + return instance();
  60 + }
  61 +
  62 + public static HandTrackingEngine instance() throws GeneralException {
  63 + if (openniConfigFile == null) {
  64 + logger.severe("HandTrackingEngine is not initialized");
  65 + System.exit(-1);
  66 + }
  67 + if (instance == null)
  68 + instance = new HandTrackingEngine(openniConfigFile, calibrationFile,
  69 + maxDepth);
  70 + return instance;
  71 + }
  72 +
  73 + /**
41 74 * Creates a new <code>HandTrackingEngine</code>.
42 75 *
43 76 * @param openniConfigFile
@@ -45,7 +78,7 @@
45 78 * @param maxDepth
46 79 * @throws GeneralException
47 80 */
48   - public HandTrackingEngine(String openniConfigFile,
  81 + private HandTrackingEngine(String openniConfigFile,
49 82 String calibrationFile, int maxDepth) throws GeneralException {
50 83
51 84 openni = new FullOpenNIDevice(openniConfigFile);
@@ -99,6 +132,11 @@ public void step() {
99 132
100 133 analyzer.analyzeData(packet);
101 134
  135 + if (!tracker.isTableInitialized() && analyzer.isBgInitialized()) {
  136 + tracker.initTable(analyzer.aveBg(), analyzer.diffBg(),
  137 + analyzer.aveBgWidthStep(), analyzer.diffBgWidthStep(), depthWidth,
  138 + depthHeight);
  139 + }
102 140 tracker.update(packet.forelimbs, packet.depthFrameID);
103 141 }
104 142
@@ -115,7 +153,7 @@ public FloatBuffer aveBg() {
115 153 }
116 154
117 155 public int aveBgWidth() {
118   - return analyzer.aveBgWidth();
  156 + return analyzer.aveBgWidthStep();
119 157 }
120 158
121 159 public FloatBuffer diffBg() {
@@ -123,6 +161,17 @@ public FloatBuffer diffBg() {
123 161 }
124 162
125 163 public int diffBgWidth() {
126   - return analyzer.diffBgWidth();
  164 + return analyzer.diffBgWidthStep();
  165 + }
  166 +
  167 + public Point3D[] convertProjectiveToRealWorld(Point3D[] points) {
  168 + Point3D[] converted = null;
  169 + try {
  170 + converted = openni.convertProjectiveToRealWorld(points);
  171 + } catch (StatusException se) {
  172 + logger.severe(se.getMessage());
  173 + System.exit(-1);
  174 + }
  175 + return converted;
127 176 }
128 177 }
2  src/edu/mit/yingyin/tabletop/models/ProcessPacket.java
@@ -47,7 +47,7 @@ public void release() {
47 47 }
48 48
49 49 /**
50   - * Integer array of raw depth values from Kinect.
  50 + * Integer array of raw depth values in mm from Kinect.
51 51 */
52 52 public int[] depthRawData;
53 53 public IplImage depthImage8U;
98 src/edu/mit/yingyin/tabletop/models/Table.java
... ... @@ -1,30 +1,38 @@
1 1 package edu.mit.yingyin.tabletop.models;
2 2
  3 +import static com.googlecode.javacv.cpp.opencv_core.CV_32FC3;
  4 +import static com.googlecode.javacv.cpp.opencv_imgproc.CV_DIST_L2;
  5 +import static com.googlecode.javacv.cpp.opencv_imgproc.cvFitLine;
  6 +
3 7 import java.nio.FloatBuffer;
  8 +import java.util.logging.Logger;
  9 +
  10 +import javax.vecmath.Vector3f;
  11 +
  12 +import org.OpenNI.GeneralException;
  13 +import org.OpenNI.Point3D;
  14 +
  15 +import com.googlecode.javacv.cpp.opencv_core.CvMat;
  16 +
  17 +import edu.mit.yingyin.util.VectorUtil;
4 18
5 19 /**
6   - * Model of the table.
  20 + * Model of a tabletop.
7 21 * @author yingyin
8 22 *
9 23 */
10 24 public class Table {
  25 + private static final Logger logger = Logger.getLogger(Table.class.getName());
11 26 private static final int DIFF_SCALE = 5;
12 27
13   - static private Table table;
14   -
15 28 /**
16   - * Average depth and depth difference scaled between 0 and 1.
  29 + * Average depth and depth difference in mm.
17 30 */
18 31 private FloatBuffer avg, diff;
19   - private int avgWidthStep, diffWidthStep;
  32 + private int avgWidthStep, diffWidthStep, width, height;
20 33 private boolean initialized = false;
  34 + private Vector3f surfaceNormal;
21 35
22   - public static Table instance() {
23   - if (table == null)
24   - table = new Table();
25   - return table;
26   - }
27   -
28 36 /**
29 37 * Initializes the table statistics.
30 38 * @param avg
@@ -33,18 +41,22 @@ public static Table instance() {
33 41 * @param diffWidthStep
34 42 * @param scale used to scale the depth value.
35 43 */
36   - public void init(FloatBuffer avg, FloatBuffer diff, int avgWidthStep,
37   - int diffWidthStep) {
  44 + public Table(FloatBuffer avg, FloatBuffer diff, int avgWidthStep,
  45 + int diffWidthStep, int width, int height) {
38 46 this.avg = avg;
39 47 this.diff = diff;
40 48 this.avgWidthStep = avgWidthStep;
41 49 this.diffWidthStep = diffWidthStep;
  50 + this.width = width;
  51 + this.height = height;
  52 + computeSurfaceNormal();
42 53 initialized = true;
43 54 }
44 55
45   - public void init(Background background) {
46   - init(background.avgBuffer(), background.diffBuffer(),
47   - background.avgBufferWidthStep(), background.diffBufferWidthStep());
  56 + public Table(Background background) {
  57 + this(background.avgBuffer(), background.diffBuffer(),
  58 + background.avgBufferWidthStep(), background.diffBufferWidthStep(),
  59 + background.width(), background.height());
48 60 }
49 61
50 62 /**
@@ -85,5 +97,57 @@ private float diffAt(int x, int y) {
85 97 return diff.get(y * diffWidthStep + x);
86 98 }
87 99
88   - private Table() {}
  100 + private void computeSurfaceNormal() {
  101 + HandTrackingEngine engine = null;
  102 + try {
  103 + engine = HandTrackingEngine.instance();
  104 + } catch (GeneralException ge) {
  105 + logger.severe(ge.getMessage());
  106 + System.exit(-1);
  107 + }
  108 + Point3D[] points = new Point3D[width];
  109 + int h = height / 2;
  110 + int startIndex = h * avgWidthStep;
  111 + for (int i = 0; i < width; i++) {
  112 + float depth = avg.get(startIndex + i);
  113 + points[i] = new Point3D(i, h, depth);
  114 + }
  115 +
  116 + Point3D[] converted = engine.convertProjectiveToRealWorld(points);
  117 + // projective = image coordinate space ((0,0) is top left corner of the
  118 + // image)
  119 + CvMat pointMat = CvMat.create(1, width, CV_32FC3);
  120 + for (int i = 0; i < converted.length; i++) {
  121 + pointMat.put(i * 3, converted[i].getX());
  122 + pointMat.put(i * 3 + 1, converted[i].getY());
  123 + pointMat.put(i * 3 + 2, converted[i].getZ());
  124 + }
  125 +
  126 + float[] hline = new float[6];
  127 + cvFitLine(pointMat, CV_DIST_L2, 0, 0.001, 0.001, hline);
  128 + pointMat.release();
  129 +
  130 + int w = width / 2;
  131 + points = new Point3D[height];
  132 + for (int i = 0; i < height; i++) {
  133 + points[i] = new Point3D(w, i, avg.get(avgWidthStep * i + w));
  134 + }
  135 +
  136 + converted = engine.convertProjectiveToRealWorld(points);
  137 + pointMat = CvMat.create(1, height, CV_32FC3);
  138 + for (int i = 0; i < converted.length; i++) {
  139 + pointMat.put(i * 3, converted[i].getX());
  140 + pointMat.put(i * 3 + 1, converted[i].getY());
  141 + pointMat.put(i * 3 + 2, converted[i].getZ());
  142 + }
  143 +
  144 + float[] vline = new float[6];
  145 + cvFitLine(pointMat, CV_DIST_L2, 0, 0.001, 0.001, vline);
  146 + pointMat.release();
  147 +
  148 + Vector3f v1 = new Vector3f(hline[0], hline[1], hline[2]);
  149 + Vector3f v2 = new Vector3f(vline[0], vline[1], vline[3]);
  150 + surfaceNormal = VectorUtil.cross(v1, v2);
  151 + logger.info("surface normal = " + surfaceNormal);
  152 + }
89 153 }
3  src/edu/mit/yingyin/util/CommandLineOptions.java
@@ -3,7 +3,6 @@
3 3 import org.apache.commons.cli.CommandLine;
4 4 import org.apache.commons.cli.CommandLineParser;
5 5 import org.apache.commons.cli.GnuParser;
6   -import org.apache.commons.cli.Option;
7 6 import org.apache.commons.cli.Options;
8 7 import org.apache.commons.cli.ParseException;
9 8
@@ -12,7 +11,7 @@
12 11 private static CommandLineParser parser = new GnuParser();
13 12 private static CommandLine line;
14 13
15   - public static void addOption(Option option) {
  14 + public static void addOption(org.apache.commons.cli.Option option) {
16 15 options.addOption(option);
17 16 }
18 17
20 src/edu/mit/yingyin/util/Vector2fUtil.java → src/edu/mit/yingyin/util/VectorUtil.java
@@ -3,13 +3,14 @@
3 3 import javax.vecmath.Point2f;
4 4 import javax.vecmath.Tuple2f;
5 5 import javax.vecmath.Vector2f;
  6 +import javax.vecmath.Vector3f;
6 7
7 8 /**
8   - * Utility class for 2D vector math.
  9 + * Utility class for 2D and 3D vector math.
9 10 * @author yingyin
10 11 *
11 12 */
12   -public class Vector2fUtil {
  13 +public class VectorUtil {
13 14 private static float EPS = (float)1e-5;
14 15
15 16 public static float dot(Vector2f a, Vector2f b) {
@@ -20,6 +21,11 @@ public static float cross(Vector2f a, Vector2f b) {
20 21 return a.x * b.y - a.y * b.x;
21 22 }
22 23
  24 + public static Vector3f cross(Vector3f a, Vector3f b) {
  25 + return new Vector3f(a.y * b.z - a.z * b.y, -a.x * b.z + a.z * b.x,
  26 + a.x * b.y - a.y * b.x);
  27 + }
  28 +
23 29 public static float lengthSquared(Tuple2f a) {
24 30 float dx = a.x;
25 31 float dy = a.y;
@@ -33,9 +39,9 @@ public static float lengthSquared(Tuple2f a) {
33 39 * @return
34 40 */
35 41 public static float angle(Vector2f a, Vector2f b) {
36   - float denom = (float)Math.sqrt(Vector2fUtil.lengthSquared(a) *
37   - Vector2fUtil.lengthSquared(b));
38   - float result = Vector2fUtil.dot(a, b) / denom;
  42 + float denom = (float)Math.sqrt(VectorUtil.lengthSquared(a) *
  43 + VectorUtil.lengthSquared(b));
  44 + float result = VectorUtil.dot(a, b) / denom;
39 45 return (float)Math.acos(result);
40 46 }
41 47
@@ -57,10 +63,10 @@ public static Point2f intersection(Point2f a, Point2f b, Point2f c, Point2f d)
57 63 ac.sub(c, a);
58 64 cd.sub(d, c);
59 65 ab.sub(b, a);
60   - float cp = Vector2fUtil.cross(ab, cd);
  66 + float cp = VectorUtil.cross(ab, cd);
61 67 if (cp < EPS && cp > -EPS)
62 68 return null;
63   - float s = Vector2fUtil.cross(ac, cd) / cp;
  69 + float s = VectorUtil.cross(ac, cd) / cp;
64 70 result.scaleAdd(s, ab, a);
65 71 return result;
66 72 }
4 test/edu/mit/yingyin/tabletop/models/HandTrackingEngineTest.java
@@ -13,8 +13,8 @@
13 13 @Test
14 14 public void testStep() {
15 15 try {
16   - HandTrackingEngine engine = new HandTrackingEngine(OPENNI_CONFIG_FILE,
17   - CALIB_FILE, MAX_DEPTH);
  16 + HandTrackingEngine engine = HandTrackingEngine.initInstance(
  17 + OPENNI_CONFIG_FILE, CALIB_FILE, MAX_DEPTH);
18 18 engine.step();
19 19 } catch (GeneralException ge) {
20 20 ge.printStackTrace();
3  test/edu/mit/yingyin/tabletop/models/TableTest.java
@@ -15,7 +15,6 @@
15 15
16 16 @Test
17 17 public void testTableContact() {
18   - Table table = Table.instance();
19 18 FloatBuffer avg = DirectBufferUtil.allocateFloatBuffer(WIDTH * HEIGHT);
20 19 FloatBuffer diff = DirectBufferUtil.allocateFloatBuffer(WIDTH * HEIGHT);
21 20 avg.rewind();
@@ -25,7 +24,7 @@ public void testTableContact() {
25 24 while(diff.remaining() > 0)
26 25 diff.put(1);
27 26
28   - table.init(avg, diff, WIDTH, WIDTH);
  27 + Table table = new Table(avg, diff, WIDTH, WIDTH, WIDTH, HEIGHT);
29 28 assertTrue(table.isInContact(0, 0, 1));
30 29 assertTrue(table.isInContact(0, 1, (float)1.9));
31 30 assertTrue(table.isInContact(1, 1, (float)0.1));

0 comments on commit c3c7e4f

Please sign in to comment.
Something went wrong with that request. Please try again.