图片文档扫描矫正处理(手机扫描仪),OCR识别,图片修改库整合

 原文链接:https://blog.csdn.net/u014133119/article/details/82222656


1.https://github.com/weichao66666/OpenCV_image_comparator
图片相似度计算(直方图、峰值信噪比、结构相似性、感知哈希算法)、轮廓检测、直线检测、圆检测、角点检测、直线交点计算、旋转角度矫正、图像匹配的对应相似处连线、灰度、二值化、直方图均衡化。

2.https://github.com/pqpo/SmartCropper
智能图片裁剪框架。自动识别边框,手动调节选区,使用透视变换裁剪并矫正选区;适用于身份证,名片,文档等照片的裁剪。

 

 

 

3. https://github.com/ay27/ImageDragZoomTest
模仿“扫描全能王”裁剪界面的一种实现方式

 

4.https://github.com/jhansireddy/AndroidScannerDemo/tree/master/ScanDemoExample
 

 

 5.https://github.com/wildma/IDCardCamera
 

 

OCR
 

1.https://github.com/rmtheis/android-ocr
 

 

2. https://github.com/tesseract-ocr/tesseract
 

3.https://github.com/GautamGupta/Simple-Android-OCR
 

4.https://github.com/simplezhli/Tesseract-OCR-Scanner

 

5.https://github.com/wenchaosong/OCR_identify
身份证自动识别,银行卡识别,驾驶证识别,行驶证识别,根据百度文字识别 api 封装,能快速识别身份证信息,银行卡信息,驾驶证信息,行驶证信息,使用非常方便

6.https://github.com/wangtaoT/AndroidOCR
基于Google Tesseract-OCR 文字识别 仿小猿搜题、作业帮

 

 
修改美颜图片
 

1.https://github.com/wuhaoyu1990/MagicCamera
 

 

2.https://github.com/zerochl/MagicShow
包含美颜等40余种实时滤镜相机,可拍照、图片修改 图片编辑包含常规参数设置(对比度,饱和度等)、美颜(美白,磨皮)、滤镜

 
3.https://github.com/Dean1990/MagicCamera

 

4.https://github.com/crazycodeboy/TakePhoto
一款用于在Android设备上获取照片(拍照或从相册、文件中选择)、裁剪图片、压缩图片的开源工具库

 

5.https://github.com/LuckSiege/PictureSelector
Picture Selector Library for Android or 多图片选择器

 

6.https://github.com/Skykai521/StickerCamera
.贴纸标签相机,功能:拍照,相片裁剪,给图片贴贴纸,打标签。

 

扫描类 App
1. Office Lens

2 .Scanbot     官网https://scanbot.io/en/sdk/info.html

3. 扫描全能王(CamScanner)

4. FineScanner

5 .Scanner Pro

 

原文链接:https://blog.csdn.net/u014133119/article/details/82222656

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
以下是使用OpenCVSharp对扫描文档图片进行处理的代码: ```csharp using System; using System.Drawing; using System.IO; using OpenCvSharp; namespace DocumentScanner { class Program { static void Main(string[] args) { // Load input image Mat inputImage = Cv2.ImRead("input.jpg"); // Convert to grayscale Mat grayImage = new Mat(); Cv2.CvtColor(inputImage, grayImage, ColorConversionCodes.BGR2GRAY); // Apply thresholding to make text more visible Mat thresholdedImage = new Mat(); Cv2.Threshold(grayImage, thresholdedImage, 0, 255, ThresholdTypes.Binary | ThresholdTypes.Otsu); // Find contours of text regions Point[][] contours; HierarchyIndex[] hierarchy; Cv2.FindContours(thresholdedImage, out contours, out hierarchy, RetrievalModes.External, ContourApproximationModes.ApproxSimple); // Find largest contour (which should be the document) int largestContourIndex = -1; double largestContourArea = 0; for (int i = 0; i < contours.Length; i++) { double contourArea = Cv2.ContourArea(contours[i]); if (contourArea > largestContourArea) { largestContourIndex = i; largestContourArea = contourArea; } } // Approximate polygon of largest contour Point2f[] approxPolygon; Cv2.ApproxPolyDP(contours[largestContourIndex], out approxPolygon, 0.02 * Cv2.ArcLength(contours[largestContourIndex], true), true); // Find bounding rectangle of polygon RotatedRect boundingRect = Cv2.MinAreaRect(approxPolygon); // Calculate rotation angle of bounding rectangle double angle = boundingRect.Angle; if (boundingRect.Size.Width < boundingRect.Size.Height) { angle += 90; } // Rotate image to correct for angle of bounding rectangle Mat rotatedImage = new Mat(); Point2f center = new Point2f(inputImage.Width / 2f, inputImage.Height / 2f); Mat rotationMatrix = Cv2.GetRotationMatrix2D(center, angle, 1); Cv2.WarpAffine(inputImage, rotatedImage, rotationMatrix, inputImage.Size, InterpolationFlags.Linear, BorderType.Replicate); // Crop image to remove black border Mat croppedImage = new Mat(); Cv2.GetRectSubPix(rotatedImage, boundingRect.Size, boundingRect.Center, croppedImage); // Resize image to A4 paper size Size a4Size = new Size(2480, 3508); // A4 paper size in pixels at 300 DPI Mat resizedImage = new Mat(); Cv2.Resize(croppedImage, resizedImage, a4Size); // Save output image Cv2.ImWrite("output.jpg", resizedImage); } } } ``` 该代码实现了以下操作: 1. 加载输入图像。 2. 将图像转换为灰度图像。 3. 应用二值化以使文本更清晰可见。 4. 找到文本区域的轮廓。 5. 找到最大的轮廓(应该是文档)。 6. 近似最大轮廓的多边形。 7. 找到多边形的边界矩形。 8. 计算边界矩形的旋转角度。 9. 旋转图像以校正边界矩形的角度。 10. 裁剪图像以删除黑色边框。 11. 将图像大小调整为A4纸张大小。 12. 保存输出图像。 可以根据需要调整代码中的一些参数,例如二值化阈值、多边形近似精度和A4纸张大小。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值