You are on page 1of 14

SIREKAP OCR R.

E
Analysis
(Raka Gunarto)
Our journey begins here…

cropped &
perspective
corrected bitmap
(no other
preprocessing yet
this is where
the magic
happens!
The magic of predict()
grayscale the
image (opencv
cvtColor)

true because april tag (the qr


yes general code looking thingy
election on the top right)
stuff to get form
type (not important)
“preprocess” (extract
ROIs and put them on
white page)
okay lets finally
do this
OCR/OMR
technology
preprocessing - ROI config
preprocessing - putting on a white page
finally OCR I don’t know what
this is, make sure
correct candidate is
being read? not
sure

finally OCR part 2


finally OCR part 2
we do OCR first
using tflite,
simple, won’t
cover.

OMR first if eligible (it is


look at config from earlier),
and if it fails, use the OCR
results

OMR is more reliable than


OCR especially with worse
quality photos
find all circle contours and apply non
opencv findContours to find circles
OMR maximum suppression technique to
collapse circle candidates
https://learnopencv.com/non-maximum-
suppression-theory-and-
opencv binary adaptive threshold, implementation-in-pytorch/
standard OMR preprocessing technique

less than 10
circles? fail!

find the
filled circle
OMR - circle selection

normal circle detection


but…

return 0 if fail??

remember this code from the


previous slide? I think this
means the prediction is 9 if it
fails?
Conclusions

- OMR is tried first, if fail, use OCR


(less reliable)
- OMR is good right? So why does it
fail… (next slide)
The Folded Page Problem
OMR should be good right? So why do any of the
this is what the
forms fail if it uses OMR first? This might be most
computer sees
likely why. after adaptive I did similar methods in
thresholding python opencv, here
Here’s a form sample
are the circles I could
notice the line? it find
notice the obscures the
crease? circles for
candidate 2!

according to
code, OMR
FAIL! (< 10
circles in
each
column)
The OMR Can’t Find Filled Circle Logic Error

- Circle selection code finds circle


more filled in than others.
- If it can’t decide on a circle, it just
returns 0.
- Code uses 9 - selectCircle(), so
default prediction if circle selection
fails is 9.
- Logic error.
Bonus Content
getFullLovelyPageUhuy()!

You might also like