简体   繁体   English

如何确定是否标记字段(光学标记识别)?

[英]How to decide the field marked or not (Optical mark recognition)?

I'm making a java OMR (Optical mark recognition) application that let the user design the template he needs( draw the areas of the marks) then when he scan the document the application use the templates to get the coordinates of the areas (check boxes) my question is if I have the Image and the rectangle (X, Y , width , high ) how to decide whether the area marked or not 我正在制作一个Java OMR (光学标记识别)应用程序,该应用程序让用户设计他需要的模板(绘制标记的区域),然后当他扫描文档时,该应用程序使用模板来获取区域的坐标(检查框),我的问题是,如果我有图像和矩形(X,Y,宽度,高),如何确定是否标记了该区域

I'm using Java advanced imaging (JAI) 我正在使用Java高级映像(JAI)

As I understand your question, you know the position of each check box on the scanned paper. 据我了解您的问题,您知道每个复选框在扫描纸上的位置。 You just need to compute in advance the average pixels intensity of each check box in a non-filled form. 您只需要事先以非填充形式计算每个复选框的平均像素强度。

Then for a filled-in and scanned form compute the average pixel insity within each box. 然后,对于填写和扫描的表格,计算每个框中的平均像素惰性。 Apply a threshold to each set of pixels within each box. 将阈值应用于每个框内的每个像素集。 Average box checked, average>threshold, box not checked. 平均框已选中,平均值>阈值,未选中框。

I assume that you have a gray-level image (one color band). 我假设您有一个灰度图像(一个色带)。 Otherwise convert your color image to a gray level image (there are standard ways of doing this), and apply the theshold to each check-box pixel average. 否则,将您的彩色图像转换为灰度图像(有标准的方法),并将阈值应用于每个复选框像素平均值。 Voilà! 瞧!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM