using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Emgu.CV; using Emgu.CV.Structure; namespace bbiwarg.Images { class EdgeImage { private Image image; public EdgeImage(DepthImage depthImage) { int minDepth = depthImage.getMinDepth(); int maxDepth = depthImage.getMaxDepth(); Image depthImageInt16 = depthImage.getImage(); Image depthImageByte = depthImageInt16.Convert(delegate(Int16 depth) { return (byte)(((depth - minDepth) * Byte.MaxValue) / (maxDepth - minDepth)); }); image = depthImageByte.Canny(100, 75, 3); } public bool isEdgeAt(int x, int y) { return (image.Data[y,x,0] > 0); } public Image getImage() { return image; } } }