Method for generating and processing answer sheet, electronic equipment and storage medium

By obtaining the document group information and style files to generate the answer sheet, and using the generated information to detect and identify the answer sheet, the linkage problems caused by independent task of answer sheet generation and processing in the existing technology are solved, and the efficient and intelligent answer sheets are realized .

CN119399783APending Publication Date: 2025-02-07SHANGHAI PROCESSOR TECH INNOVATION CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311464987.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-06
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, the task of generating and processing of answer sheets is regarded as independent tasks, resulting in the inability to effectively link up during the processing process, affecting the degree of intelligence.

Method used

By obtaining the document group information and style files, generating the answer sheet and recording the generated information, and then detecting and identifying the target answer sheet in the picture to be processed based on the generated information, realizing the integrated design of the answer sheet generation and processing.

Benefits of technology

The automatic generation and processing of answer sheets is realized, the degree of intelligence is improved, and the accuracy and efficiency of detection and identification processing are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399783A_ABST
    Figure CN119399783A_ABST
Patent Text Reader

Abstract

The invention discloses a method for generating and processing an answer sheet, electronic equipment and a storage medium. The method comprises the following steps: acquiring test paper composition information and a style file about an answer sheet; generating the answer sheet based on the test paper composition information and the style file, and recording generation information of the answer sheet; and in response to the acquired to-be-processed picture containing the target answer sheet, detecting and / or identifying the target answer sheet in the to-be-processed picture according to the generation information, the target answer sheet including the used answer sheet. Through the technical scheme disclosed by the invention, the answer sheet can be automatically generated by using the test paper composition information and the style file, and meanwhile, the generation information recorded in the answer sheet generation process can be used for assisting the subsequent answer sheet detection and / or recognition processing, so that the generation and processing of the answer sheet can be effectively linked, and the generation efficiency of the answer sheet is improved. The integrated design of generation and processing of the answer sheet is realized, and the overall intelligent degree is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of computer technology. More specifically, the present disclosure relates to a method for generating and processing an answer sheet, and an electronic device and a computer-readable storage medium for executing the aforementioned method. Background Art

[0002] In the current field of intelligent education, answer sheets, as a widely used carrier, are an important factor affecting the popularization of intelligent education. Their intelligence is mainly reflected in the practicality and reliability of the technical methods and systems for answer sheet generation and processing.

[0003] However, the existing technology for answer sheets only involves one of the multiple tasks such as the generation task or processing task of the answer sheet, that is, the generation task and processing task of the answer sheet are regarded as independent tasks. This design of independent execution of each task makes it impossible for each task to be effectively linked during the processing process. In particular, when executing the processing task, it is necessary to re-extract information from the answer sheet (for example, it is necessary to re-determine the answer area of ​​each question multiple times, etc.), which hinders the execution of the processing task, thereby affecting the processing effect of the task, and then affecting the overall intelligence level. Summary of the invention

[0004] In order to at least solve one or more of the technical problems mentioned above, the present disclosure proposes a solution for the integrated design of answer sheet generation and processing in multiple aspects.

[0005] In a first aspect of an embodiment of the present disclosure, a method for generating and processing answer sheets is provided, comprising: obtaining test paper composition information and a style file about an answer sheet; generating the answer sheet based on the test paper composition information and the style file, and recording the generation information of the answer sheet; and in response to obtaining a to-be-processed image containing a target answer sheet, detecting and / or identifying the target answer sheet in the to-be-processed image according to the generation information, wherein the target answer sheet includes an answer sheet that has been used.

[0006] In some embodiments, generating the answer sheet based on the test paper setting information and the style file includes: determining the test paper information and question information to be written based on the test paper setting information; and writing the test paper information and the question information into the style file according to predefined writing rules to obtain the answer sheet.

[0007] In some embodiments, recording the generation information of the answer sheet includes: obtaining at least a first positioning point of the style file; determining the answer area information corresponding to the question in the answer sheet; and recording at least the first positioning point and the answer area information corresponding to the question in the answer sheet.

[0008] In some embodiments, processing the target answer sheet in the image to be processed according to the generated information includes: obtaining a second positioning point of the image to be processed; and extracting the target answer sheet from the image to be processed according to the generated information and the second positioning point, and cutting the target answer sheet.

[0009] In some embodiments, wherein the generated information includes at least the first positioning point of the style file and the answer area information corresponding to the question in the answer sheet, extracting the target answer sheet from the image to be processed and cutting the target answer sheet includes: extracting the target answer sheet from the image to be processed according to the second positioning point; calculating the position deviation between the first positioning point and the same positioning point in the second positioning point, correcting the target answer sheet using the position deviation and the answer area information; and cutting the corrected target answer sheet according to the answer area information.

[0010] In some embodiments, calculating the position deviation between the same positioning point in the first positioning point and the second positioning point includes: calculating the coordinate difference and the connection line offset angle between the same positioning point in the first positioning point and the second positioning point.

[0011] In some embodiments, obtaining the second positioning point of the image to be processed includes: obtaining edge information of the image to be processed; determining the center point of the edge according to the edge information; and determining the second positioning point according to the center point of the edge.

[0012] In some embodiments, determining the second positioning point based on the center point of the edge includes cyclically performing the following operations: performing convolution processing on the image to be processed according to the first convolution kernel to screen out the center point that meets the preset conditions; judging whether the screened out center point can be used as the second positioning point; in response to determining that the screened out center point cannot be used as the second positioning point, changing the size of the first convolution kernel, and re-executing the screening and judgment of the center point based on the changed first convolution kernel; in response to still determining that the screened out center point cannot be used as the second positioning point based on the changed first convolution kernel, performing image enhancement processing on the image to be processed, and re-executing the screening and judgment of the center point based on the image after the image enhancement processing.

[0013] In some embodiments, wherein the target answer sheet comprises a fill-in sheet, and the generated information comprises the option positions of a question, identifying and processing the target answer sheet in the image to be processed according to the generated information comprises: obtaining the center point of all answer options in the fill-in sheet; traversing the center points of all answer options to find out whether there is a center point of an answer option located at the option position of any question; and in response to the center point of any answer option being located at the option position of any question, determining that any answer option matches any question.

[0014] In some embodiments, obtaining the center point of all answer options in the fill-in sheet includes: obtaining the coordinates of all edge pixels in the fill-in sheet; determining the contour information of all answer options based on the coordinates of all edge pixels; and determining the center point of all answer options based on the contour information of all answer options.

[0015] In a second aspect of the disclosed embodiment, an electronic device is provided, further comprising: a processor; and a memory storing computer instructions for generating and processing answer sheets, wherein when the computer instructions are executed by the processor, the electronic device executes the method described in the foregoing and following embodiments.

[0016] In a third aspect of the disclosed embodiments, a computer-readable storage medium is provided, comprising program instructions for generating and processing answer sheets, and when the program instructions are executed by a processor, the method described in the foregoing and following embodiments is implemented.

[0017] Through the scheme for generating and processing answer sheets as provided above, the disclosed embodiment can automatically generate answer sheets using test paper information and style files, and can implement subsequent detection and / or recognition processing of target answer sheets based on the generation information of the answer sheets. It can be seen that the scheme disclosed in the present invention can automatically generate answer sheets without excessive human intervention, thereby improving the intelligence level of the answer sheet generation process. At the same time, the generation information recorded in the process of generating answer sheets can be used to assist in subsequent answer sheet detection and / or recognition processing, so that the generation and processing of answer sheets can be effectively linked, thereby improving the accuracy and efficiency of detection and / or recognition processing. Thus, an integrated design of the generation and processing of answer sheets is achieved, and the overall intelligence level is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0019] Figure 1 A schematic flow chart of a method for generating and processing an answer sheet according to an embodiment of the present disclosure is shown;

[0020] Figure 2 A schematic flow chart of a method for generating and processing an answer sheet according to another embodiment of the present disclosure is shown;

[0021] Figure 3 A schematic flow chart of a method for generating an answer sheet according to an embodiment of the present disclosure is shown;

[0022] Figure 4 A schematic diagram showing a style file according to an embodiment of the present disclosure;

[0023] Figure 5 A schematic diagram showing an answer sheet generated according to an embodiment of the present disclosure is shown;

[0024] Figure 6 A schematic flow chart of a method for detecting an answer sheet according to an embodiment of the present disclosure is shown;

[0025] Figure 7 A schematic diagram showing edge detection results, positioning point determination results and image correction results involved in the answer sheet detection process according to the present disclosure is shown;

[0026] Figure 8 A schematic flow chart of a method for identifying a filled-in card according to the present disclosure is shown;

[0027] FIG. 9A to FIG. 9D A schematic diagram showing a filled card in various states according to the present disclosure; and

[0028] Fig.10 A schematic structural diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0030] It should be understood that the terms "include" and "comprising" used in the specification and claims of the present disclosure indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0031] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.

[0032] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0033] At present, there is a lack of integrated design for the generation and processing of answer sheets. Specifically, in terms of answer sheet generation, the answer sheet generation methods and systems involved in some existing technologies can be roughly divided into two categories: only processing the answer sheet generation task and only partially processing the answer sheet task.

[0034] Among them, some technologies that only consider answer sheet generation are mostly semi-automatic designs, requiring manual typesetting and other processing, and have a low degree of intelligence. In addition, the technology that only considers answer sheet generation cannot coordinate with related modules before answer sheet generation, such as question bank, typesetting and other modules, nor can it be linked with related modules after answer sheet generation, that is, detection, correction and other modules. Therefore, the degree of intelligence is low, and it is impossible to achieve the integration of answer sheet generation and processing.

[0035] In addition, some existing answer sheet detection technologies need to rely on detection points in each area to detect the answer area, which will not only face accuracy issues, but also limit its use to standard images obtained by scanners, and cannot handle problems such as rotation and shadows caused by taking pictures.

[0036] In addition, the recognition of the filled-in card image in the answer sheet is an important part of the answer sheet processing. In the past, the technology was split into independent modules for processing, and there are currently many different solutions. These technologies for the recognition of filled-in card images usually use the recognition of filled-in card images as a separate module, and use the cut-out filled-in card image as input. Once there is a problem with the detection of the previous filled-in area, it will affect the recognition accuracy of the subsequent filled-in card, and cannot cope with scenarios such as offset filled-in card images.

[0037] In general, the generation and processing task limitations of answer sheets are mainly reflected in the following aspects: First, the generation of answer sheets does not follow the principle of integration, and the generation and processing of answer sheets are regarded as two independent tasks, thereby providing reference points or positioning points for each row during generation, and requiring the respective answer areas to be re-determined multiple times during processing, which brings obstacles to the cutting of answer areas such as filling in the sheet. Second, the failure to follow the principle of integration also limits the application scenarios. The accurate segmentation of multiple answer areas depends on the stable image provided by the scanner, making the existing technology unable to cope with scenes such as rotation and blur, and unable to receive camera input, making it difficult for answer sheets to be used in more general scenarios where students submit their answers independently, such as small tests and homework.

[0038] Based on this, the inventors have discovered through research that it is possible to record the generation information during the process of generating an answer sheet, and to assist in subsequent answer sheet detection and / or recognition processing based on the generation information of the answer sheet, so that the generation and processing of the answer sheet can be effectively linked, realizing an integrated design of the generation and processing of the answer sheet, thereby improving the accuracy and efficiency of the detection and / or recognition processing.

[0039] The specific implementation of the present disclosure is described in detail below with reference to the accompanying drawings.

[0040] Figure 1 A schematic flow chart of a method 100 for generating and processing an answer sheet according to an embodiment of the present disclosure is shown.

[0041] like Figure 1 As shown, at step S101, the test paper information and style file about the answer sheet can be obtained. In practical applications, there can be a variety of ways to obtain the test paper information. For example, some information extraction rules can be predefined to extract test questions from the question bank. For another example, the test questions in the question bank can be displayed to the user for the user to select the required test questions, etc. After the test questions are obtained, the test paper information can be extracted from these test questions. Among them, the test paper information can include test paper information such as test paper name, test paper number, and question information such as question type, quantity, QR code, etc. In addition, the style file in this embodiment can be pre-prepared. Specifically, a style file can be set by default, or a selection interface containing multiple style files can be provided to filter out the required style files. It should be noted that the detailed description of the test paper information and style files here is only an exemplary description, and the scheme disclosed herein is not limited to this.

[0042] At step S102, an answer sheet can be generated based on the test paper information and the pattern file, and the generation information of the answer sheet can be recorded. After obtaining the test paper information and the pattern file, the test paper information can be automatically written into the pattern file to generate the answer sheet.

[0043] For example, in some embodiments, the test paper information and question information to be written can be determined based on the aforementioned test paper information. For example, test paper information such as test paper name and number can be extracted from the test paper information, and question information such as question type and corresponding quantity, QR code, etc. can be extracted from the test paper information. Then, the test paper information and question information are written into the style file according to the predefined writing rules to obtain the answer sheet. Among them, the writing rules can be pre-set, and they can be specifically set according to the style file and application requirements.

[0044] Thus, the answer sheet can be automatically generated using the test paper information and the style file. After the test paper information is written into the style file, the generation information of the answer sheet needs to be recorded. In some embodiments, at least the first positioning point of the style file can be obtained, and then the answer area information corresponding to the question in the answer sheet (such as the distribution and position of the answer area) can be determined, and at least the first positioning point and the answer area information corresponding to the question in the answer sheet can be recorded.

[0045] It should be noted that the generated information of the answer sheet is not limited to the positioning point and answer area information of the style file, but may also include other information about the answer sheet. For example, the positioning point of the selected style file, the position information of the overall answer frame line, and the number, question type, and answer area information of each question on the test paper may be recorded, and the recorded generated information may be stored. For example, the generated information may be written into the data entry corresponding to the test paper number.

[0046] At step S103, in response to obtaining a to-be-processed image containing a target answer sheet, the target answer sheet in the to-be-processed image can be detected and / or identified according to the aforementioned generation information. Among them, the target answer sheet includes a used answer sheet. After the answer sheet is generated, the generated answer sheet can be output to the user. In practical applications, if the user needs to use the answer sheet, the answer sheet can be directly downloaded. After the answer sheet is used, the used answer sheet (that is, the target answer sheet) can be collected by scanning or taking pictures, thereby obtaining a to-be-processed image containing the target answer sheet. Then, the target answer sheet in the to-be-processed image is detected and / or identified using the aforementioned generation information. As a result, the generation and processing of the answer sheet can be effectively linked to achieve an integrated design of the generation and processing of the answer sheet, thereby improving the accuracy and efficiency of the detection and / or identification processing.

[0047] In this example, the processing tasks for the target answer sheet include, but are not limited to, answer sheet detection, answer area cutting, filled-in sheet recognition, and the like.

[0048] In some embodiments, the process of detecting the target answer sheet in the image to be processed according to the aforementioned generated information may specifically involve obtaining the second positioning point of the image to be processed, and then extracting the target answer sheet from the image to be processed according to the generated information and the second positioning point, and performing a cutting process on the target answer sheet. When obtaining the second positioning point of the image to be processed, the edge information of the image to be processed is specifically obtained, and then the center point of the edge can be determined according to the edge information, and the second positioning point is determined according to the center point of the edge.

[0049] In some embodiments, the second positioning point can be determined by cyclically performing the following operations: performing convolution processing on the image to be processed according to the first convolution kernel to screen out the center point that meets the preset conditions, and judging whether the screened out center point can be used as the second positioning point. In response to determining that the screened out center point cannot be used as the second positioning point, the size of the first convolution kernel is changed, and the screening and judgment of the center point are re-executed based on the changed first convolution kernel. In response to still determining that the screened out center point cannot be used as the second positioning point based on the changed first convolution kernel, image enhancement processing is performed on the image to be processed, and the screening and judgment of the center point are re-executed based on the image after the image enhancement processing.

[0050] This example does not limit the size of the first convolution kernel. In the specific implementation process, a convolution kernel can be used to convolve the image to be processed to screen out the four center points with the strongest response. Then, it can be determined whether the screened center point is used as the second positioning point. If it is determined that it can be used as the second positioning point, the coordinates of the second positioning point are output. If it is determined that it cannot be used as the second positioning point, it is necessary to change the size of the first convolution kernel, and continue to use the changed convolution kernel to convolve the image and re-screen the center point. If the size of the first convolution kernel is changed many times and a suitable center point that can be used as the second positioning point is still not found, it is necessary to perform image enhancement processing on the image to be processed (for example, adjusting the grayscale difference between pixels to enhance the contrast of the image, etc.), and use the enhanced image to re-find the center point. If the second positioning point still cannot be found, an error value can be returned, and it is prompted that there is a problem with the image and the coordinates of the positioning point cannot be determined.

[0051] After completing the search for the second positioning point, the target answer sheet can be extracted from the image to be processed based on the second positioning point. Next, the position deviation between the first positioning point and the same positioning point in the second positioning point is calculated, and the target answer sheet is corrected using the position deviation and the answer area information. Specifically, the coordinate difference and the connection line offset angle between the same positioning point in the first positioning point and the second positioning point can be calculated, and the target answer sheet can be corrected using the coordinate difference and the connection line offset angle. Then, the corrected target answer sheet is cut according to the answer area information.

[0052] Therefore, according to the position information and positioning point information recorded in the answer sheet generation stage, the rotation of the shooting angle and image blur can be processed. In addition, by enhancing the image contrast, the robustness of the algorithm is improved, and images under different lighting conditions can be processed. Based on the positioning points recorded in the answer sheet generation stage, the positioning points can be detected multiple times to improve the accuracy of the algorithm. Based on the answer area information recorded in the answer sheet generation stage, the corresponding answer area of ​​each question can be read by locating the overall answer area, which can avoid the error accumulation caused by repeated detection. Only a single detection is required and errors can be judged. Feedback to the user can be given in time, realizing human-computer coupling and improving practicality.

[0053] In this embodiment, the target answer sheet in the image to be processed can also be identified based on the aforementioned generation information, and the target answer sheet can be a fill-in sheet. When the question types of the target answer sheet are all multiple-choice questions, the target answer sheet can be used as a fill-in sheet. When the question types in the target answer sheet are not limited to multiple-choice questions, the fill-in sheet in this embodiment can be understood as a target answer sheet containing a fill-in area, or it can be a fill-in part obtained after cutting the target answer sheet. In addition, in this embodiment, the generation information recorded in the answer sheet generation stage can also include the option position of the question, etc.

[0054] In some embodiments, the recognition process of the fill-in card may specifically involve: the center point of all answer options in the fill-in card may be obtained. For example, the coordinates of all edge pixels in the fill-in card may be obtained, the outline information of all answer options may be determined based on the coordinates of all edge pixels, and the center point of all answer options may be determined based on the outline information of all answer options. Then, the center points of all answer options are traversed to find out whether there is a center point of an answer option located at the option position of any question. In response to the center point of any answer option being located at the option position of any question, it is determined that any answer option matches any question.

[0055] Therefore, the filling card recognition is achieved by matching the recorded option position with the center point of the answer area. This method uses the center point of the answer area to represent the answer area, and screens out certain question options with center points. Even if some of the fillings are not standardized, this recognition method can effectively eliminate the impact of irregular fillings, and under a certain degree of interference, it still shows a high accuracy rate and can effectively avoid wrong selections.

[0056] Figure 2 FIG. 2 is a schematic flow chart of a method 200 for generating and processing an answer sheet according to another embodiment of the present disclosure. It should be noted that: Figure 2 It can be understood that Figure 1 Therefore, the above combined with Figure 1 The relevant description also applies to the following.

[0057] In this embodiment, an integrated system for generating and processing answer sheets can be set up. The integrated system can include an answer sheet generation module, an answer sheet detection module, and a filled-in sheet recognition module, and the functions described in method 100 are implemented by cooperating with the answer sheet generation module, the answer sheet detection module, and the filled-in sheet recognition module.

[0058] Specifically, if Figure 2 As shown, at step S201, the user can initiate the test paper generation process and select the required questions from the question bank to generate the test paper. The system automatically inputs the test paper generation information including the test paper information and the question information into the answer sheet generation module.

[0059] At step S202, the test paper information is input into the answer sheet generation module, and the answer sheet generation module generates corresponding answer areas according to the corresponding question type of each question, records the generation status, and returns the answer sheet. Specifically, the integrated system can automatically input the test paper information into the answer sheet generation module, and the answer sheet generation module first draws the name, number and other global information according to the test paper information, and then automatically generates an answer sheet with appropriate pages according to the question type and quantity, and draws each answer area. After completion, it records the generation information such as each answer area, and returns the answer sheet.

[0060] At step S203, the user may be notified to download the answer sheet, and then upload the image of the used answer sheet by scanning or taking a photo. Specifically, the integrated system may notify the user to download and use the answer sheet, and after the answer sheet is used, the user may take a photo and upload a certain answer sheet separately, or take a photo or scan and upload all answer sheets at the same time.

[0061] At step S204, the picture is detected and cut by the answer sheet detection module. Specifically, after the uploaded picture is received by the answer sheet detection module, the answer area can be segmented using the positioning point recognition technology involved in the edge detection algorithm (such as the Canny algorithm) and allocated to each question type correction module. For example, the entire answer area can be intercepted based on the positioning point according to the detection image, and the regional position information stored in the answer sheet generation module can be read to cut the answer area of ​​each small question.

[0062] At step S205, when the filling card recognition module receives the picture, it can identify and process the filling area in the picture. Specifically, the filling card module correction module uses a recognition method based on the matching of the position information recorded when the answer sheet is generated with the answer area position information to perform recognition and correction. In addition, the other segmented areas mentioned above can be distributed to other question type correction modules or designated personnel, and the system will automatically publish statistics after all corrections are completed.

[0063] Therefore, the integrated system in this example mainly realizes the above functions through the cooperation of the answer sheet generation module, the answer sheet detection module and the filled-in sheet recognition module, thereby reducing the steps of human participation, improving system efficiency and robustness, and promoting the intelligence of the entire integrated system.

[0064] In addition, the integrated system in this example includes core functional modules such as answer sheet generation module, answer sheet detection module and filled sheet recognition module, and can also include other functions such as question bank, class information, statistical information, etc. The module components in the integrated system can be adjusted according to business process requirements.

[0065] Figure 3 FIG. 3 is a schematic flow chart of a method 300 for generating an answer sheet according to an embodiment of the present disclosure. It should be noted that: Figure 3 It can be understood that Figure 1 The specific implementation of some steps in method 100 and method 200, especially the further limitation of the generation process of the answer sheet in the above text. Figure 1 and Figure 2 The relevant description also applies to the following.

[0066] Specifically, if Figure 3 As shown, at step S301, the pre-made style file can be read and the corresponding test paper name, test paper number and QR code and other test paper information can be written. The style file can include multiple types, Figure 4 A specific type of style file is shown as an example. Figure 4 As shown, the style file includes a home page 401 and an extension page 402. In addition, in addition to displaying the test paper information, the home page 401 and the extension page 402 also display the positioning points of the style file (e.g. Figure 4 is a small black square in the middle).

[0067] At step S302, the answer area can be written in the order of multiple-choice, fill-in-the-blank (judgment), and answer questions, and during the writing process, step S303 is executed to determine whether there is enough remaining space.

[0068] When it is determined that the remaining space is insufficient, step S304 can be executed to fill in the remaining space of the current page with an X line as a prohibited writing area, and then use the extended page style and fill in the test paper number. When it is determined that the remaining space is sufficient, step S305 can be executed.

[0069] In some embodiments, Figure 5As shown, the writing rule for multiple-choice questions is: after the multiple-choice questions are divided into three columns on the answer sheet, the answer option area can be filled in line by line, and the position information of each option area when filled in can be recorded. After each line is filled in, the line can be changed according to the preset interval, and step S303 is executed. The writing rule for fill-in-the-blank (judgment) questions is: after the fill-in-the-blank (judgment) questions are divided into two columns on the answer sheet, the question number area and the answer area can be filled in line by line, and the position information of the answer area corresponding to each question number can be recorded. After each line is filled in, the corresponding line break line is filled in, and step S303 is executed. The writing rule for answer questions is: for answer questions, the question number can be directly written in the preset space, and step S303 is executed. It should be noted that the description of the writing rules for each question type here is only an exemplary description, and the scheme disclosed herein is not limited to this.

[0070] At step S305, when all answer sheets are completed, the positioning point of the selected style file (i.e., the first positioning point in the previous text), the position information of the overall answer frame line, and the generated information such as the number of each question on the test paper, the question type and the answer area information can be recorded, and the generated information can be written into the data entry corresponding to the test paper number, and the generated answer sheet can be returned for output.

[0071] It can be seen that the answer sheet generation module in this embodiment can provide different style files according to the needs to cope with different sizes of paper and examination or homework scenarios, can automatically generate the required answer sheet according to the test paper, without too much manual intervention and adjustment, and can also be linked with the subsequent answer sheet detection module. Specifically, the answer area information recorded by the answer sheet generation module enables the answer sheet detection module to read the corresponding answer area of ​​each question only by locating the overall answer area, which can avoid the accumulation of errors caused by repeated detection, only requires a single detection and can judge the error, and can provide timely feedback to the user, realizing human-computer coupling and improving practicality.

[0072] Figure 6 FIG. 6 is a schematic flow chart of a method 600 for detecting an answer sheet according to an embodiment of the present disclosure. It should be noted that: Figure 6 It can be understood that Figure 1 The specific implementation of some steps in method 100 and method 200, in particular, limits the detection process of the target answer sheet using the generated information of the answer sheet. Figure 1 , Figure 2 and Figure 3 The relevant description also applies to the following.

[0073] Specifically, if Figure 6As shown, at step S601, the image to be processed can be converted into a single-channel grayscale image (hereinafter referred to as a grayscale image). The image to be processed in this example can be understood as an image containing a target answer sheet, and the target answer sheet can be understood as a used answer sheet. Figure 1 , Figure 2 or Figure 3 Answer sheet generated by the presented method.

[0074] At step S602, the grayscale image may be subjected to Gaussian blurring. Since there are usually many noise points in the captured image, it is necessary to perform Gaussian blurring on the image in order to improve the accuracy of subsequent operations.

[0075] At step S603, after removing the noise, the median and standard deviation of the grayscale image are calculated, and then the high threshold and the low threshold are calculated according to the median and the standard deviation. The high threshold can be set to three times the low threshold.

[0076] In step S604, the gradient magnitude and direction of each pixel in the grayscale image can be calculated by using a Sobel operator or the like, and non-maximum suppression is performed on the gradient magnitude and direction, retaining only the local maximum points in the gradient direction to retain the true edge information.

[0077] In step S605, double threshold processing is performed on the edge after non-maximum suppression, and the high threshold and low threshold obtained in step S603 are used to classify the pixels into three categories: strong edge, weak edge and non-edge. The strong edges are connected to form a complete edge, and the complete edge information is obtained. The result is shown in FIG. Figure 7 Picture 701 in .

[0078] In step S606, the center point of the edge can be calculated through the complete edge information, and a convolution kernel is used to convolve the original image to screen out the four center points with the strongest response as positioning points (ie, the second positioning points in the previous text).

[0079] At step S607, the filtered positioning points are judged. If the judgment is passed, step S610 is executed. If the judgment is not passed, step S608 is executed to change the convolution kernel size, and then return to step S606. If the judgment is still not passed after changing the convolution kernel size multiple times, step S606 is no longer executed.

[0080] In step S609, after changing the convolution kernel size multiple times, if the filtered positioning points still fail to pass the judgment, the grayscale image can be enhanced and the positioning points can be re-determined based on the processed image.

[0081] Specifically, the histogram of the grayscale image can be calculated and normalized, and the proportion of pixels with grayscale levels of 0 to i (foreground pixels) in the entire image can be counted, and the average grayscale of the foreground pixels can be counted; then the proportion of pixels with grayscale levels of i to 255 (background pixels) in the entire image can be counted, and the average grayscale of the background pixels can be counted. i, which has the largest variance between the foreground grayscale and the background grayscale, is used as the global threshold of the image. This global threshold cannot be used directly. When there are many blank areas on the answer sheet and the grayscale difference is large, i can be adjusted appropriately. Specifically, the grayscale values ​​below i can be lowered, and the grayscale values ​​above i can be increased to enhance the contrast of the image. Then, the enhanced image is used to execute steps S606 to S608. If the judgment of the positioning point still fails, an error value is returned, and it is prompted that there is a problem with the image and the coordinates of the positioning point cannot be determined.

[0082] At step S610, the coordinates of the positioning point are returned. Figure 7 As shown in picture 702.

[0083] At step S611, according to the coordinates of the positioning points and the position information recorded by the answer sheet generation module, the target answer sheet is cut out from the image and the image size is appropriately modified. Specifically, the coordinate difference between the image and the same positioning point in the position information and the offset angle of the positioning point connection line can be calculated. The coordinates of the answer area in the image can be calculated based on this information and the coordinates of the answer area. The result is as follows: Figure 7 As shown in Figure 703.

[0084] Therefore, the answer sheet detection module can handle problems such as rotation of the shooting angle and image blur according to the position information and positioning point information recorded by the answer sheet generation module. In addition, by enhancing the image contrast, the robustness of the algorithm is improved, and images under different lighting conditions can be processed. In addition, based on the position information recorded by the answer sheet generation module, multiple detections of targets such as positioning points can be performed, which can greatly improve the accuracy of the algorithm.

[0085] Figure 8 FIG. 8 is a schematic flow chart of a method 800 for identifying a filled-in card according to an embodiment of the present disclosure. It should be noted that: Figure 8 It can be understood that Figure 1 The specific implementation of some steps in method 100 and method 200, in particular, limits the process of identifying the target answer sheet using the generated information of the answer sheet. Figure 1 , Figure 2 , Figure 3 ,and Figure 6The relevant description also applies to the following. In addition, the target answer sheet in this embodiment can be a fill-in card. When the question types of the target answer sheet are all multiple-choice questions, the target answer sheet can be used as a fill-in card. When the question types in the target answer sheet are not limited to multiple-choice questions, the fill-in card in this embodiment can be understood as a target answer sheet containing a fill-in area, or it can be the fill-in part obtained after cutting the target answer sheet.

[0086] Specifically, if Figure 8 As shown, at step S801, the answer sheet generation module records the position information when generating the answer sheet, and simultaneously records and retains the option position information of each question.

[0087] At step S802, the image containing the filled area is converted into a single-channel grayscale image (hereinafter referred to as a grayscale image). Fig. 9A shown.

[0088] At step S803, the histogram of the grayscale image can be calculated and normalized. Specifically, the proportion of foreground pixels in the entire image is counted, and the average grayscale of the foreground pixels is counted. The proportion of background pixels in the entire image is counted, and the average grayscale of the background pixels is counted. The i with the largest variance between the foreground grayscale and the background grayscale is used as the global threshold of the image, and the threshold is used for binarization to obtain a binary image. The result is as follows: Fig. 9B shown.

[0089] At step S804, convolution calculation is performed on each pixel in the binary image, and the convolution kernel is covered on the pixel. If all pixels in the convolution kernel match the pixels covered by it, the pixel is retained, otherwise it is set to 0 to remove noise.

[0090] At step S805, convolution calculation is performed on each pixel in the convolution image, and the convolution kernel is covered on the pixel. If any pixel in the convolution kernel matches the pixel it covers, the pixel is set to 1 to further enhance the answer contour. The result is as follows: Fig. 9C shown.

[0091] At step S806, the processed binary image is reprocessed, the foreground pixels in the image are assigned a value of 1, and the background pixels are assigned a value of 0, to obtain a binary matrix, and the binary matrix is ​​tested to obtain the coordinates of all edge pixels.

[0092] In step S807, contour tracing is performed on the obtained edge pixels, all contours are stored in an array, and each contour is approximated or fitted, and the points on the contour are smoothed to obtain a smooth curve. Finally, all contour information can be obtained. The result is as follows: Fig.9D shown.

[0093] In step S808, the center point of each answer option is calculated based on all the obtained outline information.

[0094] At step S809, the center coordinates of all answer options are traversed to find out whether they are within the option position of a certain question. If so, the answer option is matched with the question.

[0095] At step S810, the answer to each multiple-choice question is output.

[0096] Therefore, the generation information recorded in the answer sheet generation stage can assist in matching the answer position information with the answer sheet recognition pattern, without the need for repeated detection, positioning and comparison for each question, thereby improving accuracy and efficiency, while also effectively reducing the impact of irregular filling and interference.

[0097] After introducing the method of the exemplary embodiment of the present disclosure, next, reference is made to Fig.10 An electronic device according to an exemplary embodiment of the present disclosure is described.

[0098] Fig.10 A schematic block diagram of an electronic device 1000 according to an embodiment of the present disclosure is schematically shown.

[0099] like Fig.10 As shown, the electronic device 1000 may include a processor 1001 and a memory 1002. The memory 1002 stores computer instructions for generating and processing answer sheets. When the computer instructions are executed by the processor 1001, the electronic device 1000 executes the above-mentioned Figure 1 , Figure 2 , Figure 3 , Figure 6 and Figure 8 The method described. For example, in some embodiments, the electronic device 1000 can automatically generate an answer sheet without excessive human intervention, thereby improving the intelligence of the answer sheet generation process. At the same time, the generation information recorded in the process of generating the answer sheet can be used to assist the subsequent answer sheet detection and / or recognition processing, so that the generation and processing of the answer sheet can be effectively linked, thereby improving the accuracy and efficiency of the detection and / or recognition processing. In this way, an integrated design of the generation and processing of the answer sheet is achieved, and the overall intelligence is improved.

[0100] In addition, the present disclosure also provides a computer-readable storage medium in which program instructions are stored, and the program instructions are configured to be executed at runtime. Figure 1 , Figure 2 , Figure 3 , Figure 6 and Figure 8 A method for generating and processing an answer sheet as shown in any of the figures.

[0101] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0102] It should be noted that although several devices or sub-devices of the device are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more devices described above can be embodied in one device. Conversely, the features and functions of one device described above can be further divided into multiple devices to be embodied.

[0103] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims. The scope of the attached claims conforms to the broadest interpretation, thereby including all such modifications and equivalent structures and functions.

Claims

1. A method for generating and processing an answer sheet, characterized in that: include: Get the test paper information and style files about the answer sheet; Generate the answer sheet based on the test paper composition information and the style file, and record the generation information of the answer sheet; as well as In response to obtaining a to-be-processed image containing a target answer sheet, the target answer sheet in the to-be-processed image is detected and / or identified according to the generated information, wherein the target answer sheet includes an answer sheet that has been used.

2. The method according to claim 1, characterized in that Generating the answer sheet based on the test paper setting information and the style file includes: Based on the test paper information, determine the test paper information and question information to be written; and The test paper information and the question information are written into the style file according to a predefined writing rule to obtain the answer sheet.

3. The method according to claim 2, characterized in that The generation information of the answer sheet includes: At least obtaining a first positioning point of the style file; Determining the answer area information corresponding to the question in the answer sheet; and At least the first positioning point and the answer area information corresponding to the question in the answer sheet are recorded.

4. The method according to claim 1, characterized in that: Detecting the target answer sheet in the image to be processed according to the generated information includes: Acquire a second positioning point of the image to be processed; and According to the generated information and the second positioning point, the target answer sheet is extracted from the image to be processed, and the target answer sheet is cut.

5. The method according to claim 4, characterized in that The generated information at least includes the first positioning point of the style file and the answer area information corresponding to the question in the answer sheet, and extracting the target answer sheet from the image to be processed and cutting the target answer sheet includes: Extracting the target answer sheet from the image to be processed according to the second positioning point; Calculating the position deviation between the first positioning point and the same positioning point in the second positioning point, and using the position deviation and the answer area information to perform correction processing on the target answer sheet; and The corrected target answer sheet is cut according to the answer area information.

6. The method according to claim 5, characterized in that Calculating the position deviation between the same positioning point in the first positioning point and the second positioning point includes: The coordinate difference between the first positioning point and the same positioning point in the second positioning point and the connecting line offset angle are calculated.

7. The method according to claim 4, characterized in that Acquiring the second positioning point of the image to be processed includes: Acquiring edge information of the image to be processed; Determine the center point of the edge according to the edge information; and The second positioning point is determined according to the center point of the edge.

8. The method according to claim 7, characterized in that Determining the second positioning point according to the center point of the edge includes cyclically performing the following operations: Performing convolution processing on the image to be processed according to the first convolution kernel to filter out a center point that meets a preset condition; Determine whether the selected center point can be used as the second positioning point; In response to determining that the screened center point cannot be used as the second positioning point, changing the size of the first convolution kernel, and re-performing the screening and judgment of the center point based on the changed first convolution kernel; In response to determining that the screened out center point cannot be used as the second positioning point based on the modified first convolution kernel, image enhancement processing is performed on the image to be processed, and the screening and judgment of the center point are re-executed based on the image after the image enhancement processing.

9. The method according to any one of claims 1 to 8, characterized in that: The target answer sheet includes a fill-in sheet, the generated information includes the position of the options of the question, and the recognition processing of the target answer sheet in the to-be-processed picture according to the generated information includes: Obtaining the center point of all answer options in the fill-in card; Traversing the center points of all the answer options to find out whether there is a center point of an answer option located at the option position of any question; and In response to a center point of any of the answer options being located at an option position of any of the questions, it is determined that any of the answer options matches the any of the questions.

10. The method according to claim 9, characterized in that Obtaining the center point of all answer options in the fill-in sheet includes: Obtaining the coordinates of all edge pixels in the fill card; Determining contour information of all answer options according to the coordinates of all edge pixels; and Based on the outline information of all the answer options, the center point of all the answer options is determined.

11. An electronic device, characterized in that: Also includes: processor; as well as A memory storing computer instructions for generating and processing an answer sheet, wherein when the computer instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 10.

12. A computer-readable storage medium, characterized in that: It includes program instructions for generating and processing answer sheets. When the program instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.