在C#图像变换 [英] Image transformation in C#

查看:134
本文介绍了在C#图像变换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作产生并读取形式的文档处理应用程序。附着在样品形式的印刷文件中产生,由人填写,扫描并反馈到应用以检测​​填充值,包括光学标记(气泡),文本(OCR)等点击此处查看表格样本

I am working on a document processing application that generates and reads forms. The sample form attached is generated as a printed document, filled out by people, scanned and fed back to the application to detect filled values including Optical Marks (Bubbles), Text (OCR), etc. Click here for Sample Form.

由于扫描扭曲而言图像旋转,缩放和平移的,我用三个标记检测方向和在是计算和存储非常昂贵的一个相当原始的方式调整影像。下面是它的要点:

Since scanning distorts the image in terms of rotation, scale and translation, I use the three markers to detect orientation and correct the image in a rather primitive way that is VERY expensive on computation and memory. Here is the gist of it:


  1. 从磁盘读取图像中

  2. 检测使用bolbs AForge.net。

  3. 使用形状,相对大小和其他属性过滤掉标记。

  4. 计算旋转和旋转图像。

  5. 使用AForge.net从旋转的图像检测bolbs。

  6. 计算比例和规模旋转图像。

  7. 从检测bolbs缩放后的图像使用AForge.net。

  8. 计算翻译和翻译旋转,缩放后的图像。

  9. 使用检测从翻译图像bolbs AForge.net。

  10. 中筛选出答案标记(气泡),因为我已经有了原始形态的位置。

  11. 提取平均颜色,并比较阈值确定选项填写。

  1. Read in the image from disk.
  2. Detect bolbs using AForge.net.
  3. Filter out the markers using shape, relative size and other properties.
  4. Calculate rotation and rotate image.
  5. Detect bolbs from the rotated image using AForge.net.
  6. Calculate scale and scale rotated image.
  7. Detect bolbs from the scaled image using AForge.net.
  8. Calculate translation and translate rotated, scaled image.
  9. Detect bolbs from the translated image using AForge.net.
  10. Filter out answer marks (bubbles) since I already have the positions of the original form.
  11. Extract mean color and compare to threshold to determine if the option is filled.

是处理一个非常准确的,但低效的方式,我希望利用几何的方法来提取斑点以上只有一次,过滤掉标记/气泡和使用简单的数学计算出相对于标记的气泡期望职位。这应该由60%减少加工时间80%和内存使用情况。

The above being an extremely accurate but inefficient way to process, I am looking to take a geometric approach to extracting blobs only ONCE, filtering out markers/bubbles and using simple math to figure out expected positions of bubbles relative to the markers. This should cut down the processing time by 80% and memory usage by 60%.

另外,必须有适用单个图像上的所有三个转变没有办法1影响下。这也将减少斑点检测三次的需求。

Alternately, there HAS to be a way to apply all three transformations on a single image without one affecting the next. That would also reduce the need for blob detection thrice.

推荐答案

我的图像模型,并且在内存模式转换而不是实际的图像。然后,一旦你已经计算出的变换矩阵可以将其应用到实际的图像做OCR。

I would model the image and do the transformations on that model in memory instead of the actual image. Then once you have calculated the transformation matrix you can apply it to the actual image to do the OCR.

这篇关于在C#图像变换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆