public void DetectFeatures() { //const int numFeatures = 15; //const double quality = 5000; //const double minDistance = 50; //const int blockSize = 11; // note, the histogram is a property of the cloud itself and is updated when the cloud is created // load depth image into something that emgucv likes Image <Gray, Byte> depthImage = new Image <Gray, byte>(depthX, depthY); // have to convert this to gray via luminosity byte[] bytes = colorizedDepth.Select(x => (byte)(0.21 * x.r + 0.71 * x.g + 0.07 * x.b)).ToArray(); depthImage.Bytes = bytes; // detect features of depth image using the fast detector // I don't really feel like implementing a Harris detector FastDetector fast = new FastDetector(10, true); var keyPoints = fast.DetectKeyPoints(depthImage, null); // no mask because I don't know what that is List <CloudPoint> cloudFeatures = new List <CloudPoint>(); foreach (var p in keyPoints) { cloudFeatures.Add(findCloudPoint((int)p.Point.X, (int)p.Point.Y)); } FeatureTree = KdTree <CloudPoint> .Construct(4, cloudFeatures, x => x.ColorLocation()); }
private void FASTedges(Image <Bgr, byte> source, Bgr color) { MKeyPoint[] keyPoints = fastDetect.DetectKeyPoints(source.Convert <Gray, byte>(), null); foreach (MKeyPoint keypt in keyPoints) { PointF pt = keypt.Point; source.Draw(new CircleF(pt, 2), color, 2); } }