Answer Card Identification Method Based on Pattern Recognition Technology

The traditional answer card reading method using OMR (Optical Mark Reader), most commonly, OMR special card special use, less versatile, high cost, aiming at the existing problems proposed a method based on pattern recognition of the answer card identification method. Using the method based on Line Segment Detector to detect the tilt of the image, the existence of tilt image rotation correction, and eventually achieve positioning and detection of answers to the answer sheet .Pattern recognition technology for automatic reading, high accuracy, detect faster.


Introduction
Examination questions include two types: objective and subjective questions, which objective standard, specification format can through the answer card answer, batch marking by computer systems.The traditional answer card automatic marking system, often adopts the photoelectric reader and a special card reader, can greatly improve the efficiency of the checking work, but at the same time, there are complicated operation,high cost and other shortcomings.With the development of digital image processing and pattern recognition techniques, the use of relatively inexpensive digital camera or scanner as the image data input device to capture the answer sheet image pattern recognition technology to achieve automatic marking the answer sheet, it can greatly reduce equipment costs, and can also identify a variety of types of answer sheet, which has good versatility.

Answer card image recognition
Answer card image recognition processing components, to achieve the picture adjustment, cutting, recognition and associated with the data, the bulk of the answer sheet for the recognition process.The examination system transmits answer card picture information, paper information, student number, after answer sheet image processing component processing,required to achieve: (1)The picture of answer card is associated with the student number; (2)Divided the picture into several parts by object answer area,every sub-picture is associated with corresponding papers questions.
(3)If the test questions is for the choice questions, the judge, then the corresponding answer card picture of the segmentation image need to identify the corresponding option.Answer card image recognition work flow shown in figure 1:

Image slope detection and rotation correction
In the process of image acquisition, the answer card may produce image tilt for a variety of reasons, and to properly identify must be corrected.Tilt correction, including the following two steps (1)Tilt angle detection (2)Image rotation correction

Image tilt angle detection
Using the Line Segment Detector (LSD) Line Segment detection method to detect whether the image is tilted.LSD is the core of pixels merging in error control.LSD is in linear time that the accuracy of subpixel level line segment detection algorithm.LSD in the actual use, the need to set the sampling rate and determine whether the two pixels are merged in the directional difference.Actually detection in the image line is looking for the larger pixel in the image gradient change.For a pair of images i and a rectangular r, denoted k (i, r) for the number of aligned points,n(r) is the total number of pixels within the rectangular r.Then hope to be able to see: Among them, Ntest is the number of rectangles to be considered.PH0 is a probability.I is a random image in the H0 model.In this paper, adopting H0 model,which mainly has the following two properties: (1){LLA(j)}, J is the pixel, is composed of a set of random variables; (2)LLA (j) uniform distribution on [0, 2 PI].So, Determine whether a pixel is not point aligned can be recorded as probability: p = τ /π Thus,then through error control, finally for line segment detection results are shown in figure 5. Red line for the final result of the detection , we can get the coordinates, the starting point of the line segment, the end point coordinates, indirectly calculated the straight line and the horizontal Angle and so on.

Image rotation correction
For tilting the image, three steps are needed to complete the rotation transformation.
(1)Translation of x'o'y' coordinate system to xoy; (2)Rotation transformation under xoy coordinate system; (3)After transformation, the coordinate system is translated back to the original position.By matrix: R representation of rotation transformation matrix.When the rotation doesn't change the image size, T and T 'are inverse matrix; When the rotating image becomes large, the T and T' are not the inverse matrix, because the image becomes larger, the first and second translation coordinates translation distance is not the same department.Since the algorithm implementation process is the formula we need the inverse transform, so we just write the inverse transform expression,as figure 6: Thus, the new figure for each point, we can find the corresponding point in the original basis of the inverse transformation formula above, get it gray.If beyond the original scope, set to the background color.Figure 7 gives a collection of the original image, figure 8 is the image after correction.

Conclusion
The server is 64 bit Linux system, support as a component integrated into the platform, also support independent release application.Pictures from uploaded successfully start time, adjusted, cutting, recognition to the output paper number, student id as a result, the processing speed is not less than 200 pieces of sheet per minute;After abnormal data processing to complete the confirmation of the beginning of the time, after cutting, identification to the output of the test results, processing speed shall not be less than 60 per minute;Image processing, should not affect the normal use of docking system, the use of 4 core processor 16G memory server, it is recommended that the CPU share of no more than 10%, memory usage is not more than 20%.The other component needs to support multi-threaded processing, processing speed to provide parameters adjustment.Image is divided into normal and abnormal images images, for the picture of the normal scope of cutting accuracy of 100%, image recognition accuracy of 100%;For abnormal image output image type is abnormal.Abnormal image is defined as: scan the answer sheet because the occurrence of wrinkles, deformation, missing picture critical information.

3
Closed area detectionDetailed algorithm description of the contour region.(1)Fromtop to bottom, from left to right traverse figure2successively.

( 2 )
As shown in figure2A, A is experiencing an outer contour point(in fact, white spots on the traversal of the DOI: 10.1051/ C Owned by the authors, published by EDP Sciences, 201 the outer contour point),and it has not been marked, then give A a new tag number.Started from point A, in accordance with certain rules(the rules in detail later) of the outer contour point A where the whole track to, and then back to point A, points on the path of all marked label A. (3)As shown in figure2B, if you have already encountered the outer contour point A 'which has been marked , from A' to the right, it would point to the right are labeled A 'label, until it encounters a black pixel up.(4)As shown in figure2C, if you encounter a point B, which has been labeled, and is the inner contour of the point(which is black pixel and not outside the contour), then start from the B point, tracking inner contour, the point on the path is set to B label, because B has been labeled with A same, so the inner and outer contour will be labeled with the same label.(5)As shown in figure2D, if the point on the inner contour is traversed, it also mark the point on the right side of the right side with the contour until the black pixels are encountered.(6)End of traversal.As shown in figures 3 and figures 4:

Figure 4 .
Figure 4.The effect diagram of the closed contour is identified.
Using random forest algorithm, generating training documents, as shown in figure 10, the results of the training to identify letters and figures, the results are shown in figure 11. .