Objective question marking method, device, equipment and storage medium based on answer sheet
By shooting answer sheets in real time in class and using discrete curve positioning technology, and combining pre-trained models for handwriting recognition, the problem of slow answer sheet recognition speed and low accuracy in the existing technology is solved, and efficient classroom test review and learning situation are achieved monitor.
Patent Information
- Application Number
- CN202110422319.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-20
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-04-20
Smart Images

Figure CN113033480B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, equipment and storage medium for marking objective questions based on answer sheets. Background Art
[0002] With the development of artificial intelligence technology, smart education has gradually entered the classroom. The real-time review and statistics of students' classroom tests in the classroom is a major challenge in the application field of smart education, and the demand is also very strong. If the real-time review and statistics of students' classroom tests can be completed in the classroom in real time, teachers can grasp the learning situation in time, optimize the organization of classroom teaching activities, improve the efficiency of teaching and learning, and reduce the after-school burden of students and teachers.
[0003] The existing technology mainly adopts two solutions to realize the marking of classroom tests. The first solution is to issue a tablet computer to each student, and the student completes the classroom test on the tablet computer. After the tablet computer collects data, it is sent to the networked backend service system to complete automatic marking and statistics. The advantages of this solution are good real-time performance and high accuracy of automatic marking, but the system construction cost is high, and the use and maintenance costs are also high. The screen of the tablet computer has a negative effect on students' eyesight, and it is inconvenient to write on the screen. It is more suitable for vocational education and higher education, but not suitable for primary and secondary school classroom applications, and the use scenarios are relatively limited.
[0004] The second solution is to install a high-speed scanner in the classroom, and students answer questions on paper with ordinary pens. After the answers are completed, the teacher collects the papers and scans them into digital images using a high-speed scanner. The networked backend system automatically reviews and counts the results based on the digital images. Compared with the first solution, this solution does not require students to use any electronic devices, which reduces the cost of system use and maintenance. However, the disadvantage is that it is not real-time enough, because the scanned test paper image data is unstructured data, and the automatic review accuracy is not as high as that of solution one.
[0005] In recent years, with the advancement of artificial intelligence technology, especially deep learning technology, artificial intelligence technology has gradually been widely used in all walks of life. People are full of eager expectations for the popularization and application of artificial intelligence technology. However, general artificial intelligence technology that truly has logical reasoning and thinking capabilities is still in the early stages of theoretical research and is still a long way from large-scale commercial applications. However, it is still possible to maximize the use of AI technology by structuring the target to be identified and combining traditional image processing algorithms with popular AI technology.
[0006] When the answer sheet is deformed, such as warping, if a line detection algorithm based on Hough transform or projection transform is used, the positioning accuracy of the grid unit is not high and the computing power cost is not small. If a deep learning-based algorithm is used to detect grid corners, the preparation cost of training data is high and the computing power demand is greater, which is not suitable for real-time application scenarios based on edge computing. Therefore, it is necessary to invent a low-computing grid unit recognition algorithm suitable for real-time application scenarios to improve the efficiency and accuracy of answer sheet structure recognition. Summary of the invention
[0007] In view of this, embodiments of the present invention provide an objective question marking method, apparatus, device and storage medium based on answer sheets, so as to solve the problem of slow recognition speed and low accuracy of handwritten answer sheets in the prior art in real-time application scenarios.
[0008] In a first aspect, an embodiment of the present invention provides an objective question marking method based on an answer sheet, wherein the answer sheet includes a two-dimensional grid composed of horizontal line segments and vertical line segments, wherein the two-dimensional grid includes a plurality of grid units, and the grid units are provided to a test subject for handwriting answers, wherein the method includes:
[0009] S10: photographing the completed answer sheet to obtain a digital image thereof;
[0010] S20: acquiring a discrete curve corresponding to the horizontal line segment and a discrete curve corresponding to the vertical line segment based on the digital image; wherein the discrete curve corresponding to the horizontal line segment is recorded as a horizontal discrete curve, and the discrete curve corresponding to the vertical line segment is recorded as a vertical discrete curve;
[0011] S30: locating the grid unit from the digital image according to the horizontal discrete curve and the vertical discrete curve;
[0012] S40: Acquire the handwritten answer content of each question from each of the located grid units;
[0013] S50: Recognize the handwritten answer content to obtain recognition results of each question;
[0014] S60: Compare the recognition result of each question with the preset standard answer one by one to obtain the review result of each question.
[0015] The embodiment of the present invention discloses a method for marking objective questions based on answer sheets, which uses an intelligent document collection system installed on the ceiling of a classroom to shoot the completed answer sheet facing the student desk to obtain its digital image, which is more suitable for real-time application scenarios than the technical solution of scanning with a scanner. The horizontal discrete curve and the vertical discrete curve are obtained based on the digital image to locate the grid unit. Compared with the use of straight line detection algorithms such as Hough transform, the positioning of the grid unit is more accurate in the case of warping and distortion of the answer sheet, and the computing power requirement is relatively small, which basically realizes the real-time marking of objective questions of students' classroom tests in real time in the classroom. Without the need to equip students with any electronic equipment, the collection and recognition of exercise / test results are completed in real time in the classroom, which has extremely high application convenience, allowing teachers to grasp the learning situation in real time in the classroom, timely optimize the organization of classroom teaching activities, improve the efficiency of teaching and learning, and reduce the after-school burden of students and teachers.
[0016] Preferably, in said S20, it includes:
[0017] S21: performing binarization processing on the digital image;
[0018] S22: Calculating a horizontal feature image and a vertical feature image based on the binary processed digital image;
[0019] S23: performing a horizontal discrete curve tracing process based on the horizontal direction feature image to obtain a horizontal discrete curve, and performing a vertical discrete curve tracing process based on the vertical direction feature image to obtain a vertical discrete curve.
[0020] The embodiment of the present invention obtains horizontal discrete curves and vertical discrete curves based on horizontal feature images and vertical feature images. The entire process does not require floating-point operations or GPU acceleration, has a fast execution speed, and requires little computing power, and is very suitable for real-time application scenarios.
[0021] Preferably, the horizontal discrete curve includes a first horizontal discrete curve and a second horizontal discrete curve. The coordinate of the right endpoint of the first horizontal discrete curve is (x a ,y a ), let the left endpoint coordinate of the second horizontal discrete curve be (x b ,y b ), if |x a -x b |<T hx And|y a -y b |<T hy , T hx and T hyis a preset threshold value, and after S23, the method further includes: taking the second horizontal discrete curve as the right part of the first horizontal discrete curve and merging it into the first horizontal discrete curve.
[0022] The embodiment of the present invention further avoids misidentification caused by errors due to image distortion and other reasons by merging horizontal discrete curves with smaller coordinate differences, thereby improving positioning accuracy.
[0023] Preferably, in said S30, it includes:
[0024] S31: determining a corner point of each of the grid units according to the horizontal discrete curve and the vertical discrete curve;
[0025] S32: Positioning the grid unit according to the corner point.
[0026] The embodiment of the present invention determines the corner points of each grid unit according to the horizontal discrete curve and the vertical discrete curve, and uses the corner points to complete the positioning of the grid unit. Each grid unit only needs 4 corner points to complete the positioning, which is accurate and efficient.
[0027] Preferably, in said S31, it includes:
[0028] S311: for any corner point of the grid unit, determine whether the horizontal discrete curve and the vertical discrete curve corresponding to the corner point have overlapping coordinate points; if so, execute S312; if not, execute S313;
[0029] S312: Taking the coordinate mean of the overlapping coordinate points as the coordinate of the corner point;
[0030] S313: Determine whether at least one of the horizontal discrete curve and the vertical discrete curve corresponding to the corner point is located at the edge of the two-dimensional grid; if so, execute S314; if not, execute S315;
[0031] S314: taking one coordinate point from each of the horizontal discrete curve and the vertical discrete curve corresponding to the corner point, extending the coordinate point belonging to the horizontal discrete curve in the horizontal direction and extending the coordinate point belonging to the vertical discrete curve in the vertical direction until there are overlapping coordinate points, and taking the coordinates of the overlapping coordinate points as the coordinates of the corner point;
[0032] S315: Taking the midpoint coordinates between two coordinate points with the smallest coordinate difference from the horizontal discrete curve and the vertical discrete curve corresponding to the corner point as the coordinates of the corner point.
[0033] The embodiments of the present invention optimize the coordinates of the corner points according to whether there are overlapping coordinate points of the horizontal discrete curve and the vertical discrete curve corresponding to the corner points, thereby further improving the positioning accuracy of the grid units, thereby improving the accuracy of obtaining handwritten answer content, reducing the probability of errors in subsequent tasks, and further improving the accuracy of automatic marking.
[0034] Preferably, the answer sheet further includes a positioning mark encoded with format parameters, and the format parameters include one or more of the number of rows and columns of the two-dimensional grid and the height and width of the grid unit. Between S30 and S40, the method further includes:
[0035] S301: Decoding the positioning identifier based on the digital image to obtain the format parameter;
[0036] S302: Verify and correct the positioning of the grid unit according to the format parameters.
[0037] The embodiment of the present invention sets a positioning mark in the answer sheet. When positioning the grid unit, the positioning mark can be parsed to verify and correct the positioning according to the format parameters obtained by the analysis, so as to avoid the entire application system from performing subsequent text recognition based on erroneous grid recognition results or erroneous answer sheet input, thereby eliminating the influence of human error factors and occasional algorithm error factors on the overall recognition accuracy.
[0038] Preferably, S50 includes: according to the pre-set standard answers for each question, respectively selecting the pre-trained models corresponding to the minimum character set to recognize the handwritten answer content corresponding to each question to obtain the recognition results of each question.
[0039] When performing text recognition on the handwritten answers corresponding to each question, the embodiment of the present invention selects a pre-trained model corresponding to the minimum character set for recognition based on the pre-set standard answers to each question. Compared with using a large model that fully supports all character sets, it can significantly improve recognition efficiency and accuracy, solve the technical problems of low accuracy and efficiency in recognizing unstructured handwritten text, and has lower requirements on computing power, making it very suitable for real-time application scenarios.
[0040] Preferably, after S60, the method further includes:
[0041] S70: Obtaining handwritten answer content or recognition results corresponding to each question;
[0042] S80: Paste the handwritten answer content or recognition result of each question to the corresponding position of the blank test paper to synthesize a complete answered test paper image.
[0043] The embodiment of the present invention pastes the handwritten answer content or recognition results of each question to the corresponding position area to synthesize a complete answered test paper image, thereby solving the technical problem of the separation of the answer results and the questions, making it easier to build students' learning files and facilitate students' review and consolidation.
[0044] Preferably, the horizontal discrete curve consists of coordinate points whose x coordinates are continuous and whose y coordinates change by no more than 1; the vertical discrete curve consists of coordinate points whose y coordinates are continuous and whose x coordinates change by no more than 1.
[0045] In a second aspect, an embodiment of the present invention provides an objective question marking device based on an answer sheet, wherein the answer sheet includes a two-dimensional grid composed of horizontal line segments and vertical line segments, wherein the two-dimensional grid includes a plurality of grid units, and the grid units are used to provide a test subject with a handwritten answer, wherein the device includes:
[0046] A digital image acquisition module is used to photograph the completed answer sheet to obtain its digital image;
[0047] A discrete curve acquisition module, used for acquiring a discrete curve corresponding to the horizontal line segment and a discrete curve corresponding to the vertical line segment based on the digital image; wherein the discrete curve corresponding to the horizontal line segment is recorded as a horizontal discrete curve, and the discrete curve corresponding to the vertical line segment is recorded as a vertical discrete curve;
[0048] A positioning module, configured to locate the grid unit from the digital image according to the horizontal discrete curve and the vertical discrete curve;
[0049] A handwritten answer content acquisition module, used to acquire the handwritten answer content of each question from each of the located grid cells;
[0050] A text recognition module, used to recognize the handwritten answer content to obtain a recognition result for each question;
[0051] The review module is used to compare the recognition result of each question with the pre-set standard answer one by one to obtain the review result of each question.
[0052] In a third aspect, an embodiment of the present invention provides an objective question marking device based on an answer sheet, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the method of the first aspect in the above embodiment is implemented.
[0053] In a fourth aspect, an embodiment of the present invention provides a storage medium having computer program instructions stored thereon, which implements the method of the first aspect in the above-mentioned embodiment when the computer program instructions are executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the drawings required for use in the embodiment of the present invention will be briefly introduced below. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work, and these are all within the protection scope of the present invention.
[0055] Figure 1 It is a schematic diagram of an answer sheet provided in an embodiment of the present invention.
[0056] Figure 2 It is a schematic diagram of another answer sheet provided by an embodiment of the present invention.
[0057] Figure 3 It is a schematic diagram of an answer sheet configuration software provided by an embodiment of the present invention.
[0058] Figure 4 It is a flow chart of an objective question marking method based on an answer sheet provided in an embodiment of the present invention.
[0059] Figure 5 The present invention is a flowchart of a method for obtaining a discrete curve provided by an embodiment of the present invention.
[0060] Fig. 6A It is a digital image provided by an embodiment of the present invention.
[0061] Figure 6B It is a schematic diagram of a process of obtaining a discrete curve provided by an embodiment of the present invention.
[0062] Figure 6C It is a schematic diagram of a process of obtaining a discrete curve provided by an embodiment of the present invention.
[0063] Fig.6D It is a schematic diagram of a process of obtaining a discrete curve provided by an embodiment of the present invention.
[0064] Fig. 6E It is a schematic diagram of a process of obtaining a discrete curve provided by an embodiment of the present invention.
[0065] Fig. 6F This is an effect diagram of obtaining a discrete curve provided by an embodiment of the present invention.
[0066] Figure 7 It is a flowchart of a method for locating grid units provided by an embodiment of the present invention.
[0067] Figure 8 It is a flowchart of a method for determining corner point coordinates provided by an embodiment of the present invention.
[0068] Fig. 9A It is a schematic diagram of a plurality of overlapping coordinate points provided by an embodiment of the present invention.
[0069] Fig. 9B It is a schematic diagram of an overlapping coordinate point provided by an embodiment of the present invention.
[0070] Fig. 9C This is a schematic diagram of a non-overlapping coordinate point provided by an embodiment of the present invention.
[0071] Fig.9D This is a schematic diagram of a non-overlapping coordinate point provided by an embodiment of the present invention.
[0072] Fig.9E This is a schematic diagram of a non-overlapping coordinate point provided by an embodiment of the present invention.
[0073] Fig.10 It is a flow chart of a method for verifying and correcting grid unit positioning provided by an embodiment of the present invention.
[0074] Fig.11 It is a flowchart of a method for synthesizing a complete test paper image provided by an embodiment of the present invention.
[0075] Fig.12 It is a schematic diagram of a topic indexing software provided by an embodiment of the present invention.
[0076] Fig.13 It is a schematic diagram of a completed answer sheet provided by an embodiment of the present invention.
[0077] Fig.14 It is a schematic diagram of a complete test paper image provided by an embodiment of the present invention.
[0078] Fig.15 It is a schematic diagram of an objective question marking device based on an answer sheet provided in an embodiment of the present invention.
[0079] Fig.16 The present invention is a schematic diagram of the hardware structure of an objective question marking device based on an answer sheet provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0080] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0081] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0082] The existing automatic scoring technology mainly includes the question-cutting link, question stem recognition link, handwriting recognition link and judgment link. The question-cutting link includes locating the area of each question from the overall test paper image, and separating the question stem and the answer area of each question. In particular, in some scenarios, it is also necessary to handle the situation where the question stem spans columns and pages, and the answer area spans columns and pages. The question stem recognition link includes performing printed text recognition on the question stem, organizing the text recognition results into a structured character stream that can be used for question bank database query, and then querying the standard answer in the character stream format from the question bank database. The handwriting recognition link includes performing handwriting text recognition on the test answer content in the answer area, and organizing the handwriting text recognition results into a character stream in the same format as the standard answer. The judgment link includes comparing the character streams obtained by question stem recognition and handwriting recognition, thereby judging the answer situation.
[0083] The above technical solutions have the following difficulties and drawbacks: First, the test paper image needs to be cut into questions, especially when it comes to cross-page scenes, which is cumbersome and error-prone. Second, since the input of the task (test paper image) is unstructured pixel image data, its processing and calculation results are probabilistic results, which cannot be as highly accurate as structured database operations. The image's tilt, rotation, scaling, light and shadow noise, nonlinear distortion and other factors will affect the accuracy of the above-mentioned cutting-to-question link, question stem recognition link and handwriting recognition link. Errors in each step will lead to the failure of the task. It can be seen that before the general artificial intelligence technology achieves a breakthrough, the application of the above technical solutions requires a large amount of manual intervention.
[0084] In view of this, the embodiments of the present invention provide an objective question marking method, device, equipment and storage medium based on answer sheets to simplify the links in automatic marking, and optimize the positioning of grid units accordingly, so as to improve the recognition accuracy and efficiency of automatic marking, reduce the demand for computing power, and be more suitable for the real-time application scenario of "on-the-spot testing and on-the-spot evaluation" in the classroom.
[0085] The answer sheet includes a two-dimensional grid composed of horizontal line segments and vertical line segments, and the two-dimensional grid includes a plurality of grid units, and the grid units are provided to the test taker for handwriting answers. Figure 1 , is a schematic diagram of an answer sheet provided by an embodiment of the present invention. The answer sheet includes a two-dimensional grid 10 consisting of four horizontal line segments and four vertical line segments, and the two-dimensional grid 10 includes grid units 20 arranged in a two-dimensional matrix form, and one grid unit 20 is used to fill in the answer to a question. It is obvious that the number of rows and columns of the two-dimensional grid 10 and the height and width of the grid unit 20 can be set according to actual needs.
[0086] For further information, see Figure 2 In order to facilitate positioning, the answer sheet can also be provided with a positioning mark 30, and the positioning mark 30 is a two-dimensional code. When positioning, the center point of the two-dimensional code can be used as the coordinate origin. In other embodiments of the present invention, the positioning mark can also be a mark of other specific positioning functions, such as a variable label, a barcode, etc. In one embodiment of the present invention, format parameters can also be encoded in the positioning mark, and the format parameters can be information such as the number of rows and columns of the two-dimensional grid 10, the height and width of the grid unit 20, etc.
[0087] Furthermore, in some embodiments of the present invention, in order to distinguish the identity of the test taker, an identity mark 40 may be provided on the answer sheet, and the identity mark 40 is a unit provided for the test taker to fill in. It should be noted that in other embodiments of the present invention, information other than name and student number may be used as the identity mark. Of course, the identity mark may also be a label that can encode information, such as a QR code.
[0088] In order to facilitate the design of answer sheets, the embodiment of the present invention also provides an answer sheet configuration software. Figure 3 , is a schematic diagram of an answer sheet configuration software provided by an embodiment of the present invention. Specifically, the user fills the standard answer of the test question into each corresponding unit to complete the pre-setting of the standard answer, and obtains the data packet including the standard answer of each question through the "Export Answer File" control, that is, the question number is used as the index and the standard answer is used as the return value; and the answer sheet is generated through the "Print Answer Sheet" control. It should be noted that when generating the answer sheet, the format parameters such as the number of rows and columns of the two-dimensional grid 10, the height and width of the grid unit 20 are integrated on the answer sheet by encoding into a two-dimensional code. In other embodiments of the present invention, the user can also pre-assign scores to each question, and the corresponding score of each question is included in the data packet as the return value. Further, the user can also adjust the number of rows, columns, height and width of the two-dimensional grid 10 through the answer sheet configuration software.
[0089] Based on the answer sheet disclosed in the above embodiment, the embodiment of the present invention provides an objective question marking method based on the answer sheet, see Figure 4 , the method comprising:
[0090] S10: photographing the completed answer sheet to obtain a digital image thereof;
[0091] S20: acquiring a discrete curve corresponding to the horizontal line segment and a discrete curve corresponding to the vertical line segment based on the digital image; wherein the discrete curve corresponding to the horizontal line segment is recorded as a horizontal discrete curve, and the discrete curve corresponding to the vertical line segment is recorded as a vertical discrete curve;
[0092] S30: locating the grid unit from the digital image according to the horizontal discrete curve and the vertical discrete curve;
[0093] S40: Acquire the handwritten answer content of each question from each of the located grid units;
[0094] S50: Recognize the handwritten answer content to obtain recognition results of each question;
[0095] S60: Compare the recognition result of each question with the preset standard answer one by one to obtain the review result of each question.
[0096] Specifically, when implementing the embodiment of the present invention, the user first uses the answer sheet configuration software to design the answer sheet and pre-set the standard answers, and then prints the answer sheet and distributes it to each test taker. After the test taker completes the answer (or after the answer time is over), the completed answer sheet is photographed to obtain its digital image. After the digital image is obtained, it can be converted into a grayscale image and binarized for subsequent processing. Furthermore, the test scene is usually a classroom, so an intelligent document acquisition device can be installed on the ceiling of the classroom to take real-time photos of the answer sheets placed on the desks of the students, which is more efficient. The specific technical solution for the intelligent document acquisition device to capture digital images of answer sheets can be found in the public document CN109274898A.
[0097] Furthermore, since the answer sheet may be deformed such as warping, the horizontal line segments and vertical line segments may be distorted in the digital image. In the field of image processing, discrete curves are usually used to describe the "horizontal line segments" and "vertical line segments" in the digital image. Based on the acquired digital image, the discrete curves corresponding to the horizontal line segments and the discrete curves corresponding to the vertical line segments can be obtained. For ease of description, the discrete curves corresponding to the horizontal line segments are recorded as horizontal discrete curves, and the discrete curves corresponding to the vertical line segments are recorded as vertical discrete curves. Specifically, the embodiment of the present invention uses continuous (x, y) coordinate points to record the horizontal discrete curve, and the x-coordinates of adjacent coordinate points of the same horizontal discrete curve differ by 1, and the y-coordinates differ by 0, 1 or -1; correspondingly, continuous (x, y) coordinate points are used to record the vertical discrete curve, and the y-coordinates of adjacent coordinate points of the same vertical discrete curve differ by 1, and the x-coordinates differ by 0, 1 or -1. In other words, the horizontal discrete curve is composed of coordinate points whose x coordinates are continuous and whose y coordinates change by no more than 1; the vertical discrete curve is composed of coordinate points whose y coordinates are continuous and whose x coordinates change by no more than 1.
[0098] See also Figure 5 , is a flow chart of a method for obtaining a horizontal discrete curve and a vertical discrete curve provided by an embodiment of the present invention, comprising:
[0099] S21: performing binarization processing on the digital image;
[0100] S22: Calculating a horizontal feature image and a vertical feature image based on the binary processed digital image;
[0101] S23: performing a horizontal discrete curve tracing process based on the horizontal direction feature image to obtain a horizontal discrete curve, and performing a vertical discrete curve tracing process based on the vertical direction feature image to obtain a vertical discrete curve.
[0102] Specifically, the horizontal discrete curve is obtained for illustration. Taking the upper left corner pixel of the image as the origin, each horizontal discrete curve is recorded by continuous (x, y) coordinate points, and the x coordinates of adjacent coordinate points differ by 1, and the y coordinates differ by 0, 1 or -1.
[0103] First, Fig. 6A The digital image shown is binarized to obtain I b (x, y), 0≤x<W, 0≤y<H, W is the image width, H is the image height, I b (x,y) takes 0xff to represent the background, I b (x,y) takes 0 to represent the foreground. The digital image after binary processing is as follows Figure 6B Of course, the definition of background and foreground can be the opposite.
[0104] Then, calculate the horizontal feature image F h (x,y). Specifically, the formula F can be used h (x,y)=I b (x,y)XORI b (x,y+1)AND I b (x, y) is calculated. Among them, 0≤x<W, 0≤y<H-1, XOR is a binary bit XOR operation, and AND is a binary bit AND operation. The digital image after XOR operation is as follows Figure 6C The digital image after AND operation is shown in 6D. The calculated horizontal feature image F h The feature of (x, y) is that the foreground color contains only 0, 1 or more horizontal discrete curves with a pixel width of 1, a length of 1 to W, and an absolute value of the slope at any point is less than or equal to 1. Specifically, the horizontal discrete curve is the upper edge of the horizontal grid line. Of course, those skilled in the art can use the lower edge of the horizontal grid line to characterize the horizontal discrete curve after simple replacement based on the content disclosed in the present invention.
[0105] Then from F h Start from (1,1), first row and then column, F h (x,y) is traversed. For each foreground color pixel F h (x,y), if F h (x,y-1),F h (x,y+1),F h (x-1,y-1),F h (x-1,y),Fh (x-1, y+1) are both background colors, then F h (x, y) is the left end point of a horizontal discrete curve, with F h (x, y) is the starting point, and the horizontal discrete curve tracing process is performed to obtain the horizontal discrete curve set S h (i), i ≥ 0 is the index number of the horizontal discrete curve. h The process of performing horizontal discrete curve tracing with (x,y) as the starting point includes:
[0106] Add the point (x,y) to S h (i) h (x,y) is set to the background color;
[0107] The loop starts:
[0108] If F h (x+1,y) is the foreground color:
[0109] Let x equal x+1 and add the point (x,y) to S h (i) h (x,y) is set to the background color;
[0110] Otherwise, if F h (x+1,y-1) is the foreground color:
[0111] Let x equal x+1 and y equal y-1, and add the point (x,y) to S. h (i) h (x,y) is set to the background color;
[0112] Otherwise, if F h (x+1,y+1) is the foreground color:
[0113] Let x equal x+1 and y equal y+1, and add the point (x, y) to S. h (i) h (x,y) is set to the background color;
[0114] otherwise:
[0115] End the loop;
[0116] The loop ends.
[0117] Based on the above process, the acquisition of the horizontal discrete curve is completed, and the effect diagram is as follows: Fig. 6EAs shown. Based on the above disclosed technical solution, those skilled in the art can easily know how to obtain the vertical discrete curve, which will not be described here. In one embodiment of the present invention, the digital image pixel matrix can be transposed and then the above method can be executed, and then the xy coordinates of the obtained horizontal discrete curve can be exchanged to obtain the vertical discrete curve. After obtaining the horizontal discrete curve and the vertical discrete curve, the following is obtained: Fig. 6F The above discrete curve recognition algorithm has the advantages of simple algorithm, small computing power requirement and stable curve detection results.
[0118] Due to image distortion and other reasons, the identification of the horizontal discrete curve and the vertical discrete curve may be disconnected. Therefore, in one embodiment of the present invention, the horizontal discrete curve includes a first horizontal discrete curve and a second horizontal discrete curve. The coordinates of the right endpoint of the first horizontal discrete curve are denoted as (x a ,y a ), let the left endpoint coordinate of the second horizontal discrete curve be (x b ,y b ), if |x a -x b |<T hx And|y a -y b |<T hy , T hx and T hy is a preset threshold value, and after S23, the method further includes: taking the second horizontal discrete curve as the right part of the first horizontal discrete curve and merging it into the first horizontal discrete curve.
[0119] Specifically, for the horizontal discrete curve S h The first level discrete curve S in (i) h (a) and the second level discrete curve S h (b) S h The last coordinate point (x a ,y a ) and S h The first coordinate point (x b ,y b ), if |x a -x b |<T hx And|y a -y b |<T hy ,T hx and T hy is the preset threshold, then S h (b) As S h The right part of (a) is merged into S h (a), and delete Sh (b) This process is repeated recursively until no more merges can be performed. h (b) As S h The right part of (a) is merged into S h (a), additional coordinates (x a ,y a ) and coordinates (x b ,y b ), the principle of filling points is that the x coordinate values of adjacent points differ by 1, and the y coordinate values of adjacent points differ by 0, or 1, or -1, and the one with the least number of filling points is preferred. In one embodiment of the present invention, the number of coordinate points less than N is eliminated. h The discrete curve S h (i), N h is a preset threshold value used to filter out noise segments. In one embodiment of the present invention, in order to facilitate the subsequent algorithm steps, after calculating the horizontal feature image F h (x, y), we can give the horizontal feature image F h (x,y) Add a row of background image after the last row, and then add F h The top row, leftmost column, and rightmost column of (x, y) are all set to the background color. If this solution is adopted, before the horizontal discrete curve tracing process begins, F h The boundary pixels of (x, y) have all been set to the background color. The above process does not need to determine whether the x coordinate and y coordinate exceed the valid coordinate range of the image. When the values of the x coordinate and y coordinate reach the boundary value, the loop ends automatically. Similarly, vertical discrete curves can be merged based on the same principle, which will not be repeated here.
[0120] After the horizontal discrete curve and the vertical discrete curve are obtained, the grid unit can be positioned. The embodiment of the present invention provides at least two positioning methods.
[0121] First, for any grid unit, the horizontal discrete curve and the vertical discrete curve corresponding to it can be determined according to the number of rows and columns in the two-dimensional grid, so the grid unit can be located from the digital image. Specifically, the horizontal discrete curve can be equally divided to determine the part of the horizontal discrete curve corresponding to each grid unit. Similarly, the vertical discrete curve can be equally divided to determine the part of the vertical discrete curve corresponding to each grid unit. For example, if the two-dimensional grid is 4 rows and 4 columns, the first horizontal discrete curve (defined from top to bottom) and the second horizontal discrete curve are equally divided into 4 parts, and the first vertical discrete curve (defined from left to right) and the second vertical discrete curve are equally divided into 4 parts, then the first quarter of the first horizontal discrete curve, the first quarter of the second horizontal discrete curve, the first quarter of the first vertical discrete curve and the first quarter of the second vertical discrete curve constitute the grid unit of the first row and the first column, thereby achieving positioning.
[0122] Second, see Figure 7 , is a flow chart of another method for locating a grid unit provided by an embodiment of the present invention. Specifically, in S30, it includes:
[0123] S31: determining a corner point of each of the grid units according to the horizontal discrete curve and the vertical discrete curve;
[0124] S32: Positioning the grid unit according to the corner point.
[0125] Specifically, m horizontal discrete curves and n vertical discrete curves divide the two-dimensional grid into R rows and C columns of grid cells, R = m-1, C = n-1. The grid cell B(i,j) in the i-th row and j-th column is determined by the quadrilateral surrounded by the four corner points Vertex(i,j,k), and the upper left corner point Vertex(i,j,0) is determined by the horizontal discrete curve H i and the vertical discrete curve V j The upper right corner point Vertex(i,j,1) is determined by the horizontal discrete curve H i and the vertical discrete curve V j+1 The lower right corner point Vertex(i,j,2) is determined by the horizontal discrete curve H i+1 and the vertical discrete curve V j+1 The lower left corner point Vertex(i,j,3) is determined by the horizontal discrete curve H i+1 and the vertical discrete curve V j The coordinates of the intersection point can be determined according to the same elements (i.e., the same coordinate points) of the horizontal discrete curve and the vertical discrete curve. Therefore, any grid unit can be positioned by the horizontal discrete curve and the vertical discrete curve.
[0126] After the grid unit is located, the handwritten answer content of each question can be obtained from each grid unit. After handwriting recognition, the recognition result corresponding to each question is obtained. Furthermore, the question number is used as an index to query in the aforementioned data packet to obtain the corresponding standard answer, and then the recognition result can be compared with the standard answer one by one to determine the review result of each question, thereby realizing automatic review of objective questions.
[0127] In some scenarios, due to the warping of the answer sheet, the horizontal discrete curve and the vertical discrete curve detected from the digital image may have multiple intersections or no intersections. For this, see Figure 8 The embodiment of the present invention proposes an optimization solution. Specifically, in S31, it includes:
[0128] S311: for any corner point of the grid unit, determine whether the horizontal discrete curve and the vertical discrete curve corresponding to the corner point have overlapping coordinate points; if so, execute S312; if not, execute S313;
[0129] S312: Taking the coordinate mean of the overlapping coordinate points as the coordinate of the corner point;
[0130] S313: Determine whether at least one of the horizontal discrete curve and the vertical discrete curve corresponding to the corner point is located at the edge of the two-dimensional grid; if so, execute S314; if not, execute S315;
[0131] S314: taking one coordinate point from each of the horizontal discrete curve and the vertical discrete curve corresponding to the corner point, extending the coordinate point belonging to the horizontal discrete curve in the horizontal direction and extending the coordinate point belonging to the vertical discrete curve in the vertical direction until there are overlapping coordinate points, and taking the coordinates of the overlapping coordinate points as the coordinates of the corner point;
[0132] S315: Taking the midpoint coordinates between two coordinate points with the smallest coordinate difference from the horizontal discrete curve and the vertical discrete curve corresponding to the corner point as the coordinates of the corner point.
[0133] Specifically, for each corner point, there is a corresponding horizontal discrete curve and a vertical discrete curve. Therefore, it can be determined whether there are overlapping coordinate points based on whether the two discrete curves have the same elements.
[0134] like Fig. 9A As shown in , if there are multiple overlapping coordinate points between the horizontal discrete curve 101 and the vertical discrete curve 102, the coordinate mean of the overlapping coordinate points is taken as the coordinate of the corner point. Fig. 9BAs shown, the horizontal discrete curve 101 and the vertical discrete curve 102 have only one overlapping coordinate point, and the coordinates of the overlapping coordinate point are taken as the coordinates of the corner point.
[0135] If Fig. 9C , Fig.9D and Fig.9E As shown, if there are no overlapping coordinate points between the horizontal discrete curve 101 and the vertical discrete curve 102, it is first determined whether the horizontal discrete curve and / or the horizontal discrete curve corresponding to the corner point is the edge of the two-dimensional grid. The determination of whether it is the edge of the two-dimensional grid can be implemented based on the coordinate value or based on the line segment index number of the horizontal discrete curve or the vertical discrete curve.
[0136] If at least one of the horizontal discrete curves or the vertical discrete curves is at the edge of the two-dimensional grid, an element is selected from the horizontal discrete curve, its x coordinate is increased or decreased, and an element is selected from the vertical discrete curve, its y coordinate is increased or decreased, until the two have the same coordinate, which is used as the coordinate of the corner point.
[0137] If neither the horizontal discrete curve nor the vertical discrete curve is at the edge of the two-dimensional grid, select a point on the horizontal discrete curve and the vertical discrete curve respectively, and ensure that they are the two coordinate points with the smallest difference in coordinates between the horizontal discrete curve and the vertical discrete curve, calculate the coordinates of the midpoint, and use the coordinates of the midpoint as the coordinates of the corner point.
[0138] See also Fig.10 , is a method for checking and correcting grid unit positioning according to format parameters provided by an embodiment of the present invention. Between S30 and S40, the method further includes:
[0139] S301: Decoding the positioning identifier based on the digital image to obtain the format parameter;
[0140] S302: Verify and correct the positioning of the grid unit according to the format parameters.
[0141] As mentioned above, the positioning mark is encoded with format parameters, and the format parameters include the number of rows and columns of the two-dimensional grid, the height and width of the grid unit, etc. Therefore, after decoding the positioning mark, these format parameters can be obtained.
[0142] Then, the positioning of the grid unit can be checked and corrected according to the format parameters. For example, in the aforementioned scheme, a total of m horizontal discrete curves and n vertical discrete curves are recorded, which is equivalent to detecting a two-dimensional grid including m-1 rows and n-1 columns. The number of rows and columns detected can be compared with the pre-encoded format parameters. If the number of rows / columns detected is more than the number of grid rows / columns in the format parameters, the adjacent grid rows / columns with the smallest height / width are merged. If the number of grid rows / columns detected is less than the number of grid rows / columns in the format parameters, the adjacent grid rows / columns with the largest height / width are split. Of course, the above checking and error correction method is only an exemplary description. Those skilled in the art can set different format parameters to achieve different checking and error correction methods based on the disclosure of the present invention.
[0143] In one embodiment of the present invention, S50 includes: according to the pre-set standard answers for each question, respectively selecting the pre-trained models corresponding to the minimum character set to recognize the handwritten answer content corresponding to each question to obtain the recognition results of each question.
[0144] Specifically, after obtaining the handwritten answers to each question, the pre-trained models corresponding to the minimum character set can be selected for text recognition according to the standard answers corresponding to each question. For example, the standard answer to the first question is the letter A, so a pre-trained model that only supports the recognition of English letters can be selected to recognize the handwritten answer content of the first question. For another example, the standard answer to the fifth question is the symbol "√", so a pre-trained model that only supports the symbols "√" and "×" can be selected to recognize the handwritten answer content of the fifth question. The selection of the above pre-trained model is only a description of an embodiment. Those skilled in the art can set the optimal pre-trained model for recognition based on the content disclosed in the present invention and according to the type of standard answer. It is worth mentioning that when recognizing approximate characters such as the number 0 and the letter O, the recognition accuracy can be effectively improved by using the technical solution disclosed in the embodiment of the present invention. The embodiment of the present invention greatly reduces the complexity of the grading task and improves the recognition efficiency and recognition accuracy of the system through the structured design of the answer sheet and the information input by the teacher in the lesson preparation stage (the graphic structure of the answer sheet and the standard answers to the questions); in particular, the recognition of the handwritten answer content in each grid unit, because the target recognition result can be known from the structured answer information file before recognition, the corresponding small model can be selected for recognition. Compared with using only a large and comprehensive handwriting recognition model that supports all character sets, the recognition accuracy can be significantly improved. At the same time, the computing power of ordinary computers in the classroom can match the computing power requirements of the small model, and there is no need to use cloud computing power, which saves bandwidth costs and cloud computing power costs and improves the real-time performance of the system.
[0145] See also Fig.11In one embodiment of the present invention, after S60, the method further includes:
[0146] S70: Obtaining handwritten answer content or recognition results corresponding to each question;
[0147] S80: Paste the handwritten answer content or recognition result of each question to the corresponding position of the blank test paper to synthesize a complete answered test paper image.
[0148] Specifically, the user obtains a test paper and sets a positioning area for each question. After the question is marked, the handwritten answer content or recognition result of the question is pasted in the positioning area, so as to synthesize a complete answer paper image. In the specific implementation, when the user sets the positioning area, the question number corresponding to the positioning area and the position of the positioning area in the test paper are recorded. The corresponding handwritten answer content or recognition result can be retrieved by the question number, and then pasted into the positioning area. When setting the positioning area, the coordinate information of the positioning area in the test paper is obtained, and the origin of the coordinate system can be set to the first pixel in the upper left corner of the test paper. Therefore, a data packet with the question number as the index and the coordinate information as the return value is determined. When pasting, the corresponding coordinate information is retrieved according to the question number, so that the handwritten answer content or recognition result is pasted into the corresponding coordinate to synthesize a complete answer paper image.
[0149] To facilitate the implementation of the above technical solutions, please refer to Fig.12 , is a schematic diagram of a question indexing software provided by an embodiment of the present invention. The user makes indexing on the electronic file of the test paper, that is, draws an answer box in the answer area of the question and fills in the indexing information, which includes the question number, standard answer, score, coordinate information, etc., wherein the coordinate information can be automatically generated based on the software, and then jumps to the answer sheet configuration software through the "Print Answer Sheet" control to edit the answer sheet. The configuration operation of the answer sheet configuration software has been described in detail above and will not be repeated here; and a data packet including the question number, standard answer, score, coordinate information, etc. can be generated through the "Export Answer File" control.
[0150] For easier understanding, please also refer to Fig.13 and Fig.14 When students finish answering, they will get Fig.13 After reviewing the answer sheet shown in FIG. 1 , the handwritten answer content and the recognition result are obtained (the handwritten answer content is used as the pasting object for explanation here). According to the question number of each handwritten answer content, the corresponding coordinate information can be retrieved from the data package, and the handwritten answer content is pasted into the test paper according to the coordinate information, and the result is as follows: Fig.14 The completed examination paper shown.
[0151] In one embodiment of the present invention, after S80, the method further includes:
[0152] S90: According to the review results of the questions, a corresponding identifier is pasted for each question in the complete answered test paper image, wherein the identifier is used to identify the review result of the question.
[0153] Specifically, if the review result is correct, the identifier "√" is pasted to the corresponding area of the question, and if the review result is wrong, the identifier "×" is pasted to the corresponding area of the question. Of course, other identifiers can also be used, and the present invention is not specifically limited.
[0154] In an embodiment of the present invention, after S60, the method further includes: calculating the score corresponding to each answer sheet according to the review result of each question and the score corresponding to each question.
[0155] As mentioned above, each question can be assigned a corresponding score through the answer sheet configuration software. When the grading result is correct, the score of the question is accumulated into the total score; when the grading result is wrong, no accumulation operation is performed.
[0156] Furthermore, the method also includes: parsing the identity identifier to determine the identity of the test taker; and determining the total score of the test taker based on the review results of each question and the score corresponding to each question.
[0157] Based on the analysis of the identity identifier, the embodiment of the present invention can determine the identity of the test taker, and thus determine the total score of the test taker according to the marking results of each question and the score corresponding to each question. It should be noted that for handwriting recognition in the identity identifier, a pre-trained model corresponding to the minimum character set can also be used for high-precision recognition. As mentioned above, the identity identifier may include a name and a student number. A pre-trained handwriting recognition model of a specified language is used to recognize the name, and a pre-trained handwriting digit recognition model is used to recognize the student number, so as to obtain the name and student number information of the answering student. The name language on the answer sheet is pre-specified by the user.
[0158] Furthermore, statistical information is generated based on the review results of each question, the scores of each test-taker and other information, which is convenient for users to view and analyze, thereby improving the quality of classroom teaching.
[0159] See also Fig.15 , is an objective question marking device based on an answer sheet provided by an embodiment of the present invention, the device comprising:
[0160] A digital image acquisition module is used to photograph the completed answer sheet to obtain its digital image;
[0161] A discrete curve acquisition module, used for acquiring a discrete curve corresponding to the horizontal line segment and a discrete curve corresponding to the vertical line segment based on the digital image; wherein the discrete curve corresponding to the horizontal line segment is recorded as a horizontal discrete curve, and the discrete curve corresponding to the vertical line segment is recorded as a vertical discrete curve;
[0162] A positioning module, configured to locate the grid unit from the digital image according to the horizontal discrete curve and the vertical discrete curve;
[0163] A handwritten answer content acquisition module, used to acquire the handwritten answer content of each question from each of the located grid cells;
[0164] A text recognition module, used to recognize the handwritten answer content to obtain a recognition result for each question;
[0165] The review module is used to compare the recognition result of each question with the pre-set standard answer one by one to obtain the review result of each question.
[0166] In addition, combined Figure 1 The objective question marking method based on the answer sheet of the described embodiment of the present invention can be implemented by the objective question marking device based on the answer sheet. Fig.16 A schematic diagram of the hardware structure of an objective question marking device based on an answer sheet provided in an embodiment of the present invention is shown.
[0167] The answer sheet-based objective question marking device may include a processor and a memory storing computer program instructions.
[0168] Specifically, the processor may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present invention.
[0169] The memory may include a large capacity memory for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory may include a removable or non-removable (or fixed) medium. Where appropriate, the memory may be inside or outside a data processing device. In a particular embodiment, the memory is a non-volatile solid-state memory. In a particular embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0170] The processor implements any one of the objective question marking methods based on the answer sheet in the above embodiments by reading and executing the computer program instructions stored in the memory.
[0171] In one example, the objective question marking device based on the answer sheet may also include a communication interface and a bus. Fig.16 As shown, the processor, memory, and communication interface are connected via a bus and communicate with each other.
[0172] The communication interface is mainly used to implement communication between the modules, devices, units and / or equipment in the embodiments of the present invention.
[0173] The bus includes hardware, software or both, and the components of the objective question marking equipment based on the answer sheet are coupled to each other. For example, but not limitation, the bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, the bus may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.
[0174] In addition, in combination with the objective question marking method based on the answer sheet in the above embodiment, the embodiment of the present invention can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the objective question marking methods based on the answer sheet in the above embodiment is implemented.
[0175] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0176] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0177] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0178] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A method for marking objective questions based on answer sheets, characterized in that: The answer sheet includes a two-dimensional grid composed of horizontal line segments and vertical line segments, and the two-dimensional grid includes a plurality of grid units, and the grid units are used to provide the test taker with handwritten answers. The method includes: S10: photographing the completed answer sheet to obtain a digital image thereof; S20: acquiring a discrete curve corresponding to the horizontal line segment and a discrete curve corresponding to the vertical line segment based on the digital image; wherein the discrete curve corresponding to the horizontal line segment is recorded as a horizontal discrete curve, and the discrete curve corresponding to the vertical line segment is recorded as a vertical discrete curve; S30: locating the grid unit from the digital image according to the horizontal discrete curve and the vertical discrete curve; S40: Acquire the handwritten answer content of each question from each of the located grid units; S50: Recognize the handwritten answer content to obtain recognition results of each question; S60: comparing the recognition result of each question with the preset standard answer one by one to obtain the review result of each question; Wherein, the S20 includes: S21: performing binarization processing on the digital image; S22: Calculating a horizontal feature image and a vertical feature image based on the binary processed digital image; S23: performing a horizontal discrete curve tracing process based on the horizontal direction feature image to obtain a horizontal discrete curve, and performing a vertical discrete curve tracing process based on the vertical direction feature image to obtain a vertical discrete curve; The S30 includes: S31: determining a corner point of each of the grid units according to the horizontal discrete curve and the vertical discrete curve; S32: Positioning the grid unit according to the corner point.
2. The method according to claim 1, characterized in that The horizontal discrete curve includes a first horizontal discrete curve and a second horizontal discrete curve. The coordinate of the right end point of the first horizontal discrete curve is (x a ,y a ), let the left endpoint coordinate of the second horizontal discrete curve be (x b ,y b ), if |x a -x b |<T hx And|y a -y b |<T hy , T hx and T hy is a preset threshold value, and after S23, the method further includes: taking the second horizontal discrete curve as the right part of the first horizontal discrete curve and merging it into the first horizontal discrete curve.
3. The method according to claim 1, characterized in that: In said S31, it includes: S311: for any corner point of the grid unit, determine whether the horizontal discrete curve and the vertical discrete curve corresponding to the corner point have overlapping coordinate points; if so, execute S312; if not, execute S313; S312: Taking the coordinate mean of the overlapping coordinate points as the coordinate of the corner point; S313: Determine whether at least one of the horizontal discrete curve and the vertical discrete curve corresponding to the corner point is located at the edge of the two-dimensional grid; if so, execute S314; if not, execute S315; S314: taking one coordinate point from each of the horizontal discrete curve and the vertical discrete curve corresponding to the corner point, extending the coordinate point belonging to the horizontal discrete curve in the horizontal direction and extending the coordinate point belonging to the vertical discrete curve in the vertical direction until there are overlapping coordinate points, and taking the coordinates of the overlapping coordinate points as the coordinates of the corner point; S315: Taking the midpoint coordinates between two coordinate points with the smallest coordinate difference from the horizontal discrete curve and the vertical discrete curve corresponding to the corner point as the coordinates of the corner point.
4. The method according to claim 1, characterized in that The answer sheet further includes a positioning mark encoded with format parameters, wherein the format parameters include one or more of the number of rows and columns of the two-dimensional grid and the height and width of the grid unit. Between S30 and S40, the method further includes: S301: Decoding the positioning identifier based on the digital image to obtain the format parameter; S302: Verify and correct the positioning of the grid unit according to the format parameters.
5. The method according to claim 1, characterized in that The S50 includes: according to the pre-set standard answers for each question, respectively selecting the pre-trained models corresponding to the minimum character set to recognize the handwritten answer content corresponding to each question to obtain the recognition results of each question.
6. The method according to claim 1, characterized in that After S60, the method further includes: S70: Obtaining handwritten answer content or recognition results corresponding to each question; S80: Paste the handwritten answer content or recognition result of each question to the corresponding position of the blank test paper to synthesize a complete answered test paper image.
7. The method according to any one of claims 1 to 6, characterized in that: The horizontal discrete curve is composed of coordinate points whose x coordinates are continuous and whose y coordinates change by no more than 1; the vertical discrete curve is composed of coordinate points whose y coordinates are continuous and whose x coordinates change by no more than 1.
8. An objective question marking device based on an answer sheet, characterized in that: The answer sheet includes a two-dimensional grid composed of horizontal line segments and vertical line segments, and the two-dimensional grid includes a plurality of grid units, and the grid units are used to provide the test subject with a handwritten answer. The device includes: A digital image acquisition module is used to photograph the completed answer sheet to obtain its digital image; A discrete curve acquisition module, used for acquiring a discrete curve corresponding to the horizontal line segment and a discrete curve corresponding to the vertical line segment based on the digital image; wherein the discrete curve corresponding to the horizontal line segment is recorded as a horizontal discrete curve, and the discrete curve corresponding to the vertical line segment is recorded as a vertical discrete curve; A positioning module, configured to locate the grid unit from the digital image according to the horizontal discrete curve and the vertical discrete curve; A handwritten answer content acquisition module, used to acquire the handwritten answer content of each question from each of the located grid cells; A text recognition module, used to recognize the handwritten answer content to obtain a recognition result for each question; A review module, used to compare the recognition result of each question with a preset standard answer one by one to obtain a review result of each question; The discrete curve acquisition module includes: a module for binarizing the digital image; calculating a horizontal feature image and a vertical feature image based on the binarized digital image; performing a horizontal discrete curve tracking process based on the horizontal feature image to obtain a horizontal discrete curve, and performing a vertical discrete curve tracking process based on the vertical feature image to obtain a vertical discrete curve; The positioning module includes: determining the corner points of each of the grid units according to the horizontal discrete curve and the vertical discrete curve; and completing the positioning of the grid units according to the corner points.
9. An objective question marking device based on an answer sheet, characterized in that: include: At least one processor, at least one memory and computer program instructions stored in the memory, when the computer program instructions are executed by the processor, implement the method according to any one of claims 1 to 7.
10. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
