protected override void ProcessFilter(UnmanagedImage image) { List <IntPoint> list = detector.ProcessImage(image); foreach (IntPoint item in list) { Drawing.FillRectangle(image, new Rectangle(item.X - 1, item.Y - 1, 3, 3), markerColor); } }
/// <summary> /// Process the filter on the specified image. /// </summary> /// /// <param name="image">Source image data.</param> /// protected override unsafe void ProcessFilter(UnmanagedImage image) { // get collection of corners List <IntPoint> corners = detector.ProcessImage(image); // mark all corners foreach (IntPoint corner in corners) { Drawing.FillRectangle(image, new Rectangle(corner.X - 1, corner.Y - 1, 3, 3), markerColor); } }
/// <summary> /// Process image looking for corners. /// </summary> /// <param name="cornerDetector">Corner detection algorithm instance.</param> /// <param name="image">Source image to process.</param> /// <returns>Returns list of found corners (X-Y coordinates).</returns> public static List <Point> ProcessImage(this ICornersDetector cornerDetector, Gray <byte>[,] image) { List <Point> points = null; using (var uImg = image.Lock()) { points = cornerDetector.ProcessImage(uImg.AsAForgeImage()); } return(points); }
/// <summary> /// Process image looking for corners. /// </summary> /// <param name="cornerDetector">Corner detection algorithm instance.</param> /// <param name="image">Source image to process.</param> /// <returns>Returns list of found corners (X-Y coordinates).</returns> public static List <Point> ProcessImage(this ICornersDetector cornerDetector, Image <Gray, byte> image) { return(cornerDetector.ProcessImage(image.ToAForgeImage(copyAlways: false, failIfCannotCast: true))); }