2

A worker has a printed piece of paper (standardized from template) with options (say a checkbox). He checks stuff, sign dots - this ok, this is not, do this, do that based on that report.

I want to create a program (probably with c#) that will read the signed dots from scanned paper and order stuff based on data it will get. Right now another worker is doing this.

Is there a way in any programing language?

If not maybe there is a free program that already is doing this, produce output if file and programing go from there. (I found freemark for example but it's not free and far from perfect from what I read)

I know this question is a little broad - sorry for this.

GoldenAge
  • 2,918
  • 5
  • 25
  • 63
baron_bartek
  • 1,073
  • 2
  • 20
  • 39

1 Answers1

1

I've recently tackled a similar situation, I too searched for ready made software but ended up solving it programatically

The idea is to use some OCR tool (like tesseract) to identify the position of each checkbox, by their labels.

Every checkbox should have a label before or after the rectangle/mark, use the OCR to identify it's position, using the label position you can easily crop out just the rectangle with the check-mark

Once you have the checkbox's rectangle isolated you can choose an algorithm to know if it's checked or not, here's some approaches:

  • Use some machine learning to recognize a check-mark(X or whatever)
  • Calculate the average color of the rectangles, darker checkboxes will have something in them
  • Count the number of pixels you have to expand from the center to reach a black pixel, if there's a mark on the checkbox you'll quickly reach a black pixel, if not you'll only reach one when you hit the rectangle. Here you can decide a threshold, like if you have to walk more than 40% of the checkbox, it's probably empty

The same ideas apply for other stuff like radio buttons, the only difference is that they are circular

victormeriqui
  • 151
  • 2
  • 10
  • Thx for this answear. So you have a linux where you install tesseract. You run it from console, to get checkboxes, and then use any programing language to figure out whether they are signed or not? Should work fine. I will investigate this solution. – baron_bartek Jul 30 '19 at 08:00
  • 1
    Yes in this case the program just runs tesseract and gets the output from the console stdout, you can also use tesseract from some API, but I don't think its necessary to complicate it here. Tesseract works on Windows also – victormeriqui Jul 30 '19 at 10:30
  • 1
    To get the actual position with tesseract you need to use either hocr mode so the positions of the words get printed in html, or tsv mode which i think is easier to parse. Heres a helpful link [tesseract wiki](https://github.com/tesseract-ocr/tesseract/wiki/Command-Line-Usage) – victormeriqui Jul 30 '19 at 10:33