[英]Crop Image with multiple X and Y points c#
您可以从Leadtools Image Processing Nuget查看KeyStoneCommand
这个 Nuget 包还包括一个检测文档 ip 命令,如果您不知道名片的边界框,您可以使用它来检测并返回名片的 4 个点。
这是一个代码片段:
private RasterImage DetectAndDeskew(RasterImage image)
{
DetectDocumentCommand detectDocumentCommand = new DetectDocumentCommand();
detectDocumentCommand.Run(image);
if (detectDocumentCommand.DocumentArea == null)
{
Console.WriteLine("No document detected");
return null;
}
KeyStoneCommand command = new KeyStoneCommand(detectDocumentCommand.DocumentArea);
command.Run(image);
image = command.TransformedImage;
return image;
}
这是此过程的输出图像:
免责声明:我受雇于这个 nuget 的制造商
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.