Aspose.Imaging.AForge.Adapter is designed to extend the functionality of the Aspose.Imaging library by adding functions from FilFormat.AForge library.
$ dotnet add package Aspose.Imaging.AForge.AdapterAspose.Imaging.AForge.Adapter is designed to extend the functionality of the Aspose.Imaging library by adding functions from FileFormat.AForge library. This association allows all raster formats supported by the Aspose.Imaging library to be covered by popular methods from the FileFormat.AForge library. The following methods from the FileFormat.AForge library are applicable to all raster formats of the Aspose.Imaging library:
Aspose.Imaging.AForge.Adapter for .NET can be used to develop applications on Windows Desktop (x86, x64), Windows Server (x86, x64), Windows Azure, Windows Embedded (CE 6.0 R2), as well as Linux x64. The supported platforms include .NetStandard2.0, .Net Core 3.1, .Net6.0, .Net7.0, .Net8.0.
Are you ready to give Aspose.Imaging.AForge.Adapter for .NET a try? Simply execute
Install-Package Aspose.Imaging.AForge.Adapter
from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Aspose.Imaging.AForge.Adapter for .NET and want to upgrade the version, please execute
Update-Package Aspose.Imaging.AForge.Adapter
to get the latest version.
This product is dependent on :
Edge Detector
Aspose.Imaging.License imagingLic = new License();
System.Drawing.AsposeDrawing.License drawingLic = new System.Drawing.AsposeDrawing.License();
imagingLic.SetLicense("license.lic");
drawingLic.SetLicense("license.lic");
using (var image = (RasterImage)Image.Load("polygons.cdr.png"))
{
image.EdgeDetector(image.Bounds, EdgeDetectorType.Canny);
image.Save("result.png");
}
Blob Detector
Aspose.Imaging.License imagingLic = new License();
System.Drawing.AsposeDrawing.License drawingLic = new System.Drawing.AsposeDrawing.License();
imagingLic.SetLicense("license.lic");
drawingLic.SetLicense("license.lic");
using (var image = (RasterImage)Image.Load("sample2.jpg"))
{
var settings = new BlobCounterSettings
{
FilterBlobs = true,
MinHeight = 10,
MinWidth = 10,
Order = BlobsOrder.Size
};
var blobs = image.DetectBlobs(settings, image.Bounds);
var blob = blobs[0];
using (var b = blob.GetImage(false))
{
b.Save("result.png");
}
}
Corner Detector
Aspose.Imaging.License imagingLic = new License();
System.Drawing.AsposeDrawing.License drawingLic = new System.Drawing.AsposeDrawing.License();
imagingLic.SetLicense("license.lic");
drawingLic.SetLicense("license.lic");
using (var image = (RasterImage)Image.Load("polygons.cdr.png"))
{
var bounds = image.Bounds;
var points = image.CornersDetector(bounds, new MoravecCornerDetectorSettings());
AddCornersToImage(image, points);
image.Save("result.png");
}
void AddCornersToImage(RasterImage image, List<Point> points)
{
var graphics = new Graphics(image);
var pen = new Pen(Color.Red, 1);
for (var i = 0; i < points.Count; i++)
{
var point = points[i];
var rect = new Rectangle(point.X - 1, point.Y - 1, 2, 2);
graphics.DrawArc(pen, rect, 0, 360);
}
}
Exhaustive block matching
using (var image = (RasterImage)Image.Load("polygons.cdr.png"))
using (var tmp = (RasterImage)Image.Load("template.png"))
{
var similarity = image.ExhaustiveTemplateMatching(0.5f, tmp);
Console.WriteLine(similarity);
}