public ProcessImage ( |
||
image | Source image data to process. | |
Результат | List |
public List<IntPoint> ProcessImage(Bitmap image)
{
// check image format
if (
(image.PixelFormat != PixelFormat.Format8bppIndexed) &&
(image.PixelFormat != PixelFormat.Format24bppRgb) &&
(image.PixelFormat != PixelFormat.Format32bppRgb) &&
(image.PixelFormat != PixelFormat.Format32bppArgb)
)
{
throw new UnsupportedImageFormatException("Unsupported pixel format of the source");
}
// lock source image
BitmapData imageData = image.LockBits(
new Rectangle(0, 0, image.Width, image.Height),
ImageLockMode.ReadOnly, image.PixelFormat);
List<IntPoint> corners;
try
{
// process the image
corners = ProcessImage(new UnmanagedImage(imageData));
}
finally
{
// unlock image
image.UnlockBits(imageData);
}
return corners;
}
FastCornersDetector::ProcessImage ( |
|
FastCornersDetector::ProcessImage ( |
/// <summary> /// Features from Accelerated Segment Test (FAST) corners detector. /// <para>Accord.NET internal call. Please see: <see cref="Accord.Imaging.FastCornersDetector"/> for details.</para> /// </summary> /// <param name="im">Image.</param> /// <param name="threshold">The suppression threshold. Decreasing this value increases the number of points detected by the algorithm.</param> /// <returns>Interest point locations.</returns> public static List<IntPoint> CornerFeaturesDetector(this Image<Gray, byte> im, int threshold = 20) { FastCornersDetector fast = new FastCornersDetector(threshold); var points = fast.ProcessImage(im.ToAForgeImage(copyAlways: false, failIfCannotCast: true)); return points; }