Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Normally, when analyzing paper forms, <strong>special marks on margins and form corners</strong> are used to identify scale and orientation of meaningful parts. For example, you can print several little black squares on borders of the form, find them with the same <code>cv2.matchTemplate</code> and thus define region of interest. </p> <p>Most probably your forms won't be perfectly captured (e.g. they may be scaled, rotated or seen in perspective), so you also need to normalize input. You may use <a href="http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html" rel="nofollow noreferrer"><strong>perspective or affine transformations</strong></a> for this. </p> <p>You may also want to enhance image by using <strong>histogram equalization</strong>, <strong>denoising</strong> and other techniques. </p> <p>At this point you should have completely normalized image which is much closer to a "perfect input". You can try out your algorithm on this input, but there's also simpler way (AFAIK, something like this is used in real applications for automatic form analysis). </p> <p>Your form has fixed layout and you already know its corners. So why not to calculate position of each interesting piece of the form? E.g. at the picture below I placed 4 black landmarks at the corners of the form. In a normalized image <strong>position of the dashed area</strong> will always be <strong>the same relative to these landmarks</strong>. </p> <p><img src="https://i.stack.imgur.com/6u4jq.png" alt="enter image description here"></p> <p>Finding out whether student was on the lecture or not is as simple as splitting dashed area into fixed square regions (one per student), summing pixel values in this area and comparing this value to a predefined threshold. Regions that have lower values tend to be more black than white (student attended the lecture), while regions with high values are most likely white (student was absent). </p> <p>So, to sum up: </p> <ol> <li>Use landmarks to define corners of the paper.</li> <li>Normalize image with respect to these landmarks. </li> <li>Enhance image if needed. </li> <li>Calculate positions of regions of interest. </li> <li>Determine if region is more likely black of white. </li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload