C# 图像去歪斜

标签 c# .net vb.net image-processing image-manipulation

有没有人在 C# 中看到过任何图像校正算法?我已经发现: http://www.codeproject.com/KB/graphics/Deskew_an_Image.aspx

但不幸的是,它对没有文本的图像作用不大。我专门尝试对具有纯边但文字最少的书籍图像进行自动校正。

有没有人见过可以做到这一点的东西?

最佳答案

基本算法是使用霍夫变换找到线条,然后尝试使大部分线条水平。这是一些基本代码 http://www.sydlogan.com/deskew.html

对于您的情况,您可能希望将变换定位在您知道可能具有最佳信息的图像片段上。例如,如果有页面边框 - 我需要查看示例以提供更好的建议。

免责声明,我在 Atalasoft 工作。

我们的 DotImage toolkit 为 .NET 内置了它,并且对于桌面应用程序来说运行时是免版税的。代码将是:

 AtalaImage img = new AtalaImage("imagefile.tif");
 AutoDeskewCommand cmd = new AutoDeskewCommand();
 AtalaImage resultImage = cmd.Apply(img).Image;
 resultImage.Save("result.tif", new TiffEncoder(), null);

或类似的多页或其他类型的图像。

我们在此视频中展示了如何将它与我们的查看器控件集成(在 1:14)

http://www.atalasoft.com/products/dotimage/tutorials/capture/lesson4.aspx

这些视频是构建文档扫描应用程序系列的一部分:

http://www.atalasoft.com/products/dotimage/tutorials/capture/lesson1.aspx http://www.atalasoft.com/products/dotimage/tutorials/capture/lesson2.aspx http://www.atalasoft.com/products/dotimage/tutorials/capture/lesson3.aspx

关于C# 图像去歪斜,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2562260/

相关文章:

c# - 错误 : Visual Studio 2022 "The build must be stopped before the solution can be closed." Disable Bullid option after build

c# - C# 中单个属性的多个属性的继承

c# - 如何覆盖 ServiceStack 中的默认 404 页面?

c# - 如何使用列表<动态>

asp.net - IFrame:此内容无法在框架中显示

.net - 如何自动将 datetimepicker 值设置为所选月份的 1 号?

c# - C#中如何将数据表绑定(bind)到datagridview

c# - 无法使用适用于 .NET 的 EMDK

c# - .NET 中非托管线程的异常

vb.net - VB.Net同时播放mp3