|
@@ -27,6 +27,9 @@ namespace bbiwarg
|
|
|
this.height = height;
|
|
|
this.image = image;
|
|
|
|
|
|
+ Stopwatch sw = new Stopwatch();
|
|
|
+ sw.Start();
|
|
|
+
|
|
|
this.image = this.image.SmoothMedian(3);
|
|
|
//minDepth
|
|
|
findMinDepth();
|
|
@@ -44,6 +47,9 @@ namespace bbiwarg
|
|
|
//findFingers
|
|
|
findFingers();
|
|
|
|
|
|
+ sw.Stop();
|
|
|
+ Console.WriteLine(sw.ElapsedMilliseconds);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public int getWidth() {
|
|
@@ -109,7 +115,7 @@ namespace bbiwarg
|
|
|
|
|
|
private void calculateEdges() {
|
|
|
Image<Gray, Byte> tmp = image.Convert<Byte>(delegate(Int16 depth) { return (byte)(((depth - minDepth) * Byte.MaxValue) / (maxDepth - minDepth)); });
|
|
|
- Image<Gray, byte> tmp2 = tmp.Canny(150, 75, 3);
|
|
|
+ Image<Gray, byte> tmp2 = tmp.Canny(100, 75, 3);
|
|
|
edges = tmp2.Convert<Int16>(delegate(byte depth) { if(depth > 0) {return Int16.MaxValue;} else {return 0;}});//((depth * Int16.MaxValue) / Byte.MaxValue); });
|
|
|
}
|
|
|
|