DetermineOMRThreshold (deprecated)
This action performs OMR, Optical Mark Recognition, checkbox detection by counting black pixels within each OMR box area in a Field with one or more OMR boxes.
Returns
False, if there is an error. Otherwise, TrueParameters
Floating point or integer values that specify the count of black pixels in OMR boxes:
- Threshold
- The percentage of pixels in the zone - the field zone; not the printed box that should be considered "checked", i.e. the lightest box that is not just noise, but should be considered a check mark.
- Background
- The percentage of pixels in the zone that might be due to scanner noise and/or the border of the printed box. This value also controls the range on either side of the Threshold value that is “low confidence".
The parameters should be experimentally adjusted on real-world scanned forms. First, determine the Threshold value that correctly identifies a light mark as “checked”, and correctly identifies noisy zones as “unchecked”. Second, adjust the Background parameter’s value to achieve an acceptable confidence interval.
Smart parameters are supported for all parameters.Level
Field.Details
This action performs OMR, Optical Mark Recognition, checkbox detection by counting black pixels within each OMR box area in a Field with one or more OMR boxes. This action can be used to perform OMR detection on a page that has drop-out boxes which leave just the mark and it can be used on black forms that where the bounding box has not been removed. The input parameters can be adjusted to allow OMR detection for both scenarios.
Text Boxes: The action sets the text value of the field to a string of 0's and 1's (one digit per OMR box); and assigns a Confidence String to the string of digits: '4' for Low Confidence up to '9' for High Confidence.
Density String and Confidence Value: The action also creates a DensityString variable for the Character String, indicating percentage-filled, from ASCII 48 ('0') through 148. For each possible OMR box, there will be a character. The character's ASCII value minus 48 is the percentage-filled. If the Density String=0X, the first OMR field was blank, and the second was 40% filled. The ASCII value for X is 88. 88 minus 48 = 40.
For each OMR mark a DCO variable named OMRXPct, where X is the numerical index of the OMR mark, is created and set with the percentage of the field that is black. This is provided in case this information is also useful for the application.
MultiPunch and Confidence Values
If the MultiPunch setting is set to 1 and multiple OMR's were filled beyond the threshold, the one that was filled the most will be marked and set to Low Confidence. If the percentage-filled is below the second parameter, the OMR box will not be selected and the confidence will be high. If the percentage-filled is between the two parameters, the OMR box will not be selected and the confidence will be low. If the percentage-filled is above the first parameter and below double the first parameter minus the second parameter, the OMR box will be selected and the confidence will be low.
If the percentage-filled is above double the first parameter minus the second parameter, the OMR box will be selected and the confidence will be high.
If you are using small visible mark bounding boxes on your image, it is best to zone the area by surrounding the entire visible box with room for alignment movement, then factor out the black from the box using the parameters. If you attempt to zone inside the borders of a visible box, you can get a false positive if the page does not align exactly because with poor alignment, part of the bounding box may be unexpectedly in the area that should be clear, causing a false positive.
The page image must be a 1 bit black and white image. If the image is not 1 bit, the action C2BW_Convert in the ColorToBW library can be used to convert the image to a black and white 1 bit image. When converting a color image to black and white, it is best to disable dithering of shaded areas.
This action requires the target field to be an OMR field with sub-fields for each OMR mark. The field must be defined as an OMR field by having the DCO variable "RecogType" defined with a value of "4".
- Example 1 :
-
DetermineOMRThreshold("10","5")
- Example 2:
-
DetermineOMRThreshold("2","0")