Method for automatically identifying and correcting handwritten answer sheet

By improving the morphological segmentation algorithm, the sticky characters in the handwritten answer sheet are solved, and the problem of special writing style and sticky characters is difficult to segment, which improves the recognition accuracy and realizes automatic correction of the entire process.

CN119832559APending Publication Date: 2025-04-15ZHONGNAN XUNZHI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510308259.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing automatic identification and correction technology of handwritten answer sheets is insufficient when dealing with special writing styles or serious character sticking, resulting in character segmentation errors and affecting the recognition accuracy.

Method used

Using a segmentation algorithm based on improved morphology, the hyphen is expanded and corroded, so that it is initially separated and enhanced boundaries, while optimizing the segmentation of the characters is combined with the structural characteristics and context information.

Benefits of technology

It effectively solves the problem of special writing styles and difficult hyphen segmentation, improves the recognition accuracy of handwritten answer sheets, and realizes automatic correction of the entire process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832559A_ABST
    Figure CN119832559A_ABST
Patent Text Reader

Abstract

The invention particularly relates to a method for automatically identifying and correcting a handwritten answer sheet, which relates to the field of image processing and comprises the following steps of: firstly acquiring an image and preprocessing the image, determining the edge and the inclination angle of the answer sheet by means of Hough transform, correcting the edge and the inclination angle of the answer sheet into a standard rectangle and performing interpolation processing, and then dividing regions for histogram equalization. Constructing an XML (Extensive Makeup Language) format template database aiming at the manual annotation of different types of answer sheets, and matching with the preprocessed image; and then segmenting the matched image instance, determining a character segmentation position through vertical and horizontal projection analysis, adopting an improved morphological algorithm for adhered characters, and optimizing a segmentation result in combination with structural features and context information. Characters are recognized, confidence is evaluated, and manual intervention is provided for low confidence. And recombining the characters into a text and verifying, scoring according to semantic similarity, and finally feeding back a correction result to a user in a report form to realize full-process automatic correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image processing, and in particular relates to a method for automatically identifying and correcting handwritten answer sheets. Background Art

[0002] In the field of education, handwritten answer sheets are an important tool for assessing students' knowledge. Traditional manual grading methods are inefficient when facing a large number of test papers, and are easily affected by subjective factors and produce grading errors. With the continuous expansion of the scale of education and the increasing requirements for evaluation efficiency and accuracy, it is crucial to develop efficient and accurate automatic recognition and grading technology for handwritten answer sheets. At the same time, existing character segmentation methods are insufficient in dealing with special writing styles (such as cursive writing, cursive writing, etc.) or serious character adhesion, resulting in character segmentation errors and affecting recognition accuracy, which urgently needs to be improved. Summary of the invention

[0003] The purpose of the present invention is to provide a method for automatically identifying and correcting handwritten answer sheets to solve the problems raised in the above-mentioned background technology.

[0004] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, a method for automatically identifying and correcting handwritten answer sheets comprises the steps of: Obtain handwritten answer sheet images and perform image preprocessing; Detect the straight lines in the image, analyze the straight line parameters to determine the edge and tilt angle of the answer sheet; correct the tilted answer sheet image to a standard rectangle; The image is divided into multiple sub-regions, and the histogram is calculated and equalized for each sub-region separately; For the answer sheet, manual annotation is performed in advance, the annotation data is stored, and a template database is constructed; the collected and pre-processed answer sheet image is matched with the template in the template database; the similarity score between the image and each template is calculated, and the template with the highest score is selected as the matching template for the current answer sheet; Perform instance segmentation on the matched answer sheet image; Perform vertical and horizontal projection analysis on the handwritten characters on the answer sheet, and determine the segmentation position of the characters according to the peaks and troughs of the projection curve; for the adhered characters, first perform an expansion operation to expand the edge of the characters and initially separate the adhered parts; then perform an erosion operation to shrink the characters; and optimize the segmentation results based on the structural characteristics and contextual information of the characters; Recognize the segmented single character image and evaluate the confidence of the recognition result; Reassemble the recognized individual characters into complete text; Assign scores to handwritten answer sheet responses based on semantic similarity; The correction results are sent to the user in the form of a report.

[0005] Furthermore, the vertical and horizontal projection analysis includes a vertical projection analysis: the handwritten character area in the answer sheet image is regarded as a two-dimensional matrix, and pixel values ​​of the area are accumulated by column.

[0006] Furthermore, the vertical and horizontal projection analysis includes a horizontal projection analysis: the handwritten character area in the answer sheet image is regarded as a two-dimensional matrix, and pixel values ​​of the area are accumulated row by row.

[0007] Furthermore, image preprocessing includes converting the color image into a grayscale image using a weighted average method and reducing noise using a Gaussian filter algorithm.

[0008] Furthermore, instance segmentation is performed on the matched answer sheet image, which also includes using a contour detection algorithm to screen out contours that meet the characteristics of the answer area and remove small areas that are incorrectly segmented.

[0009] Furthermore, a contour detection algorithm is used to screen out contours that meet the characteristics of the answer area, where the answer area has specific shape and size characteristics. During the screening process, those area contours that do not have the specific shape and size characteristics are removed.

[0010] Furthermore, before scoring the handwritten answer sheet answers according to semantic similarity, the following steps are also included: A keyword library is established in advance. The keyword library includes the problem-solving keywords and terms required for the subject. From the recognized text, the key information of problem-solving steps and conclusions is extracted through keyword matching and grammatical analysis.

[0011] Furthermore, when the character segmentation position cannot be determined based on the peaks and troughs of the projection curve, a distance transform is performed on the adhered character area, and the distance from each pixel to the background is calculated. Based on the result of the distance transform, the local minimum point of the distance is found, and the local minimum point of the distance is used as the segmentation point between the characters.

[0012] Beneficial effects: This application is based on image processing technology, and recognizes the handwritten content of the collected answer sheet image to achieve automatic correction of the entire process. In view of the problem of character segmentation, a segmentation algorithm based on improved morphology is adopted for special writing styles and for adhered characters. First, a dilation operation is performed to expand the edge of the character so that the adhered part is initially separated; then an erosion operation is performed to shrink the character and enhance the boundary between the characters. At the same time, the segmentation results are optimized in combination with the structural characteristics and contextual information of the characters, such as the stroke direction of the character and the spacing between characters. In addition, a projection analysis is performed on the handwritten characters on the handwritten answer sheet, and the segmentation position of the characters is determined according to the peaks and troughs of the projection curve. When the segmentation position of the characters cannot be determined according to the peaks and troughs of the projection curve, a distance transformation is performed on the adhered character area, and the distance from each pixel to the background is calculated. According to the result of the distance transformation, the local minimum point of the distance is found, and the local minimum point of the distance is used as the segmentation point between the characters. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 The present invention provides a flow chart of a method for automatically identifying and correcting handwritten answer sheets.

[0014] Figure 2 A schematic diagram of the structure of the electronic device provided in this application. DETAILED DESCRIPTION

[0015] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0016] The present application discloses a method for automatically identifying and correcting handwritten answer sheets. Figure 1 , including the steps of: S100 obtains the handwritten answer sheet image and performs image preprocessing: The weighted average method is used to convert color images into grayscale images, and the color information of the image is converted into a single grayscale value. This not only reduces the amount of data and speeds up subsequent processing, but also highlights the brightness characteristics of the image, providing convenience for subsequent processing.

[0017] Use the Gaussian filter algorithm to reduce noise, and dynamically adjust the Gaussian kernel parameters according to the statistical characteristics of image noise. For areas with more noise, increase the Gaussian kernel size to enhance the noise reduction effect; for areas with rich details, reduce the Gaussian kernel size to avoid excessive smoothing and loss of details. Effectively remove Gaussian noise in the image, make the image smoother, and provide a clear image foundation for subsequent character recognition and area positioning.

[0018] S101 uses Hough transform to detect straight lines in the image, and determines the edge and tilt angle of the answer sheet by analyzing the straight line parameters. The tilted answer sheet image is corrected to a standard rectangle. During the correction process, the image edge is interpolated to ensure that the image is not distorted, maintain the integrity and clarity of the image, and provide accurate image morphology for subsequent recognition and analysis.

[0019] Furthermore, during the correction process, the image edge is interpolated to ensure that the image is not distorted. For the newly generated pixels at the edge of the image, the bilinear interpolation method is used to determine its pixel value. The bilinear interpolation method is based on the grayscale values ​​of the four surrounding known pixels, and the grayscale value of the new pixel is calculated by linear interpolation. For example, for a new pixel point P, the four known pixels around it are A, B, C, and D. The grayscale value of point P is obtained by weighted averaging the grayscale values ​​of points A, B, C, and D, and the weight is determined according to the relative position relationship between point P and these four points. In this way, in the process of transforming the tilted image into a standard rectangle, the pixel information at the edge of the image can be reasonably supplemented, maintaining the integrity and clarity of the image, and providing accurate image morphology for subsequent processes such as character recognition, area positioning, and extraction and analysis of answers to subjective questions.

[0020] S102 divides the image into multiple sub-areas, calculates the histogram for each sub-area and performs equalization processing. According to the histogram distribution of the local area of ​​the image, the image is contrast enhanced to highlight the characters and marks, making the image details clearer and facilitating subsequent recognition and analysis.

[0021] First, the image is divided into multiple sub-regions of equal size according to certain rules. The basis for division is to ensure that the sub-region can fully reflect the local characteristics of the image, but not introduce too much noise due to the sub-region being too small or fail to reflect the difference in local details due to the sub-region being too large. Usually, the size of the sub-region can be set to, for example, 8×8 pixels, 16×16 pixels, etc. The specific size will be adjusted according to the resolution of the image and the actual effect.

[0022] For each sub-region, its histogram is calculated independently. The histogram is a statistical chart of the frequency of occurrence of different gray values ​​in the sub-region. By analyzing the histogram, you can understand the distribution of gray values ​​in the sub-region. For example, if the histogram of a sub-region shows that most of the gray values ​​are concentrated in the darker area, it means that the sub-region is darker overall; if the gray value distribution is relatively uniform, it means that the contrast of the sub-region is relatively good.

[0023] After obtaining the histogram of each sub-region, it is equalized. The purpose of equalization is to redistribute the grayscale values ​​in the sub-region so that the grayscale values ​​in the sub-region are more evenly distributed, thereby enhancing the contrast of the image. The specific method is to calculate a grayscale value mapping table based on the histogram of the sub-region, which can map the original grayscale value to the new grayscale value so that the new grayscale value is more evenly distributed. For example, the grayscale values ​​originally concentrated in the darker area will be distributed to a wider grayscale range after mapping, so that the image of the sub-region becomes brighter and the details are clearer.

[0024] After sub-region histogram equalization, the contrast of the entire image is enhanced. Characters and marks that were difficult to distinguish in low-contrast areas become more prominent due to the increased contrast of their sub-regions. Details in the image, such as the strokes of handwritten characters and tiny printed marks on answer sheets, are enhanced.

[0025] S103: Manually mark different types of answer sheets in advance, and mark the position and size of each answer area (such as multiple choice questions, fill-in-the-blank questions, and answer questions) in detail. The marked data is stored in XML format to build a template database.

[0026] S104 matches the collected and preprocessed answer sheet image with the templates in the template database one by one, calculates the similarity score between the image and each template, and selects the template with the highest score as the matching template of the current answer sheet, thereby determining the answer sheet type and layout.

[0027] S105 performs instance segmentation on the matched answer sheet image, accurately segmenting the option boxes of multiple-choice questions, horizontal lines of fill-in-the-blank questions, answer areas of answer questions, etc. For the segmented areas, a contour detection algorithm is used to filter out contours that meet the characteristics of the answer area, remove small areas that are mistakenly segmented, and improve the accuracy of segmentation.

[0028] The contour detection algorithm detects the edges of each segmented area and generates a series of contour lines. These contour lines represent the shape information of the boundary of the area. Among the many contours, the contours that meet the characteristics of the answer area are selected. The answer area usually has specific shape and size characteristics. During the screening process, small area contours that do not meet the above characteristics will be removed. These small areas may be mis-segmented areas due to image noise, slight errors in the segmentation algorithm, etc. For example, some contours that are too small, whose area is much smaller than the area of ​​any normal answer area, or whose shape characteristics do not meet the characteristics of any answer area at all, these small area contours will be identified as mis-segmented areas and removed to improve the accuracy of the segmentation results.

[0029] Then S106 performs vertical and horizontal projection analysis on the handwritten characters on the handwritten answer sheet, and determines the segmentation position of the characters according to the peaks and valleys of the projection curve.

[0030] Vertical projection analysis: The handwritten character area in the answer sheet image is regarded as a two-dimensional matrix, and the pixel values ​​are accumulated by column for this area. Since the character strokes have pixel distribution in the vertical direction, the vertical projection curve will show a peak at the character position. For example, when encountering a character with many vertical strokes, the projection value corresponding to the column will increase significantly, forming an obvious peak. In the blank area between characters, due to the small number of pixels, the vertical projection curve will have a trough. By traversing and analyzing the vertical projection curve, the position information of the peaks and troughs is recorded. Generally speaking, the area between adjacent troughs is likely to correspond to the vertical range of a character.

[0031] Horizontal projection analysis: The handwritten character area is also regarded as a two-dimensional matrix, and this time the pixel values ​​are accumulated row by row. In the horizontal direction of the character, if there are character strokes, the accumulated pixel values ​​of the row will be higher, which is reflected as a peak on the horizontal projection curve. For example, for a character with a horizontal stroke, the horizontal projection value of the row where the character is located will be relatively large, forming a peak. In the blank area between character rows, the horizontal projection curve will have troughs. By analyzing the horizontal projection curve, the positions of the peaks and troughs are determined, and the area between adjacent troughs can be preliminarily determined as the horizontal range of a character row.

[0032] For the stuck characters, a segmentation algorithm based on improved morphology is adopted. First, a dilation operation is performed to expand the edge of the characters so as to initially separate the stuck parts; then an erosion operation is performed to shrink the characters and enhance the boundaries between characters.

[0033] Expansion operation: First, define a structural element, which can be in the shape of a square, circle, or cross. For example, a 3×3 square structural element is selected. The structural element acts as a template and slides on the image.

[0034] For image areas containing glued characters, the center of the structural element is placed on each pixel of the image in turn. If there are stroke pixels of the character (i.e., pixels whose grayscale values ​​meet the stroke characteristics of the character) in the area covered by the structural element, the pixel values ​​corresponding to the entire area covered by the structural element are set to the character stroke pixel values. This is equivalent to expanding the edge of the character outward, so that the parts of the characters that were originally glued together are initially separated to a certain extent. For example, if there are two glued characters, the pixels of the glued parts were originally continuous. After the expansion operation, due to the effect of the structural element, the edges of the glued parts will be expanded, making the boundaries of the glued parts relatively clear.

[0035] After the dilation operation is completed, the erosion operation is performed immediately, using the previously defined or reselected structural element (the size and shape of the structural element can also be adjusted according to actual conditions).

[0036] In contrast to the dilation operation, in the erosion operation, the pixel at the center of the structural element is retained as a character stroke pixel only when all pixels in the area covered by the structural element are character stroke pixels, otherwise it is set to the background pixel value. In this way, the edge of the character will shrink inward. For example, the edge of the character that was expanded after the dilation operation will gradually shrink back in the erosion operation, while the adhesion part is expanded more obviously during the dilation. After shrinking during the erosion process, the boundary between the characters will be further enhanced, making the distinction between the adhesion characters clearer. At the same time, the segmentation results are optimized based on the structural characteristics and contextual information of the characters, such as the stroke direction of the characters, the spacing between characters, etc.

[0037] S107 further performs distance transformation on the contiguous character region when the character segmentation position cannot be determined according to the peaks and valleys of the projection curve, and calculates the distance from each pixel to the background. Pixels with larger distances are usually located at the center of the character, while pixels with smaller distances are located at the edge of the character. Based on the result of the distance transformation, the local minimum point of the distance is found, and the local minimum point of the distance is used as the segmentation point between the characters.

[0038] Specific operations of distance transformation: Binarize the determined image of the adhesion character area and convert the image into an image with only two pixel values: foreground (character) and background. This can simplify the subsequent distance calculation process and improve processing efficiency. The global threshold method or adaptive threshold method can be used for binarization. According to the specific situation of the image, the appropriate threshold is selected so that the character part is the foreground pixel (usually white, the pixel value is 255) and the background part is the background pixel (usually black, the pixel value is 0).

[0039] Perform distance transformation on the binarized adhesion character area and calculate the distance from each pixel to the background. In actual operation, different distance measurement methods such as Euclidean distance, Manhattan distance or Chebyshev distance can be used. Euclidean distance calculates the straight-line distance from a pixel to a background pixel, which can more accurately reflect the positional relationship of pixels in space; Manhattan distance calculates the sum of the distances from a pixel to a background pixel in the horizontal and vertical directions, and the calculation speed is relatively fast; Chebyshev distance calculates the maximum distance from a pixel to a background pixel in the horizontal and vertical directions. Select the appropriate distance measurement method according to specific needs and image characteristics.

[0040] Analysis of distance transformation results: After distance transformation, pixels with larger distances are usually located at the center of the character, while pixels with smaller distances are located at the edge of the character. By analyzing the distance transformation result image, the center and edge distribution of the character can be intuitively seen. For example, the distance transformation result image can be visualized, with different colors or grayscale values ​​representing different distance values, to facilitate the subsequent finding of the local minimum point of the distance.

[0041] Finding local minimum points Definition of local minimum: In the distance transformation result image, the local minimum point refers to the point whose distance value is less than the distance value of its adjacent pixels. These local minimum points are usually located at the adhesion position between characters, so they can be used as segmentation points for character segmentation.

[0042] The neighborhood search method is used to find local minimum points. A suitable neighborhood range can be defined, such as 3×3, 5×5, etc., and each pixel point in the distance transformation result image is traversed to compare the distance value of the point with other pixels in the neighborhood. If the distance value of the point is less than the distance value of all other pixels in the neighborhood, it is marked as a local minimum point. In order to avoid misjudgment, a distance threshold can be set. Only when the distance value of the local minimum point is less than the threshold, it will be regarded as a valid segmentation point.

[0043] S108 character recognition recognizes the segmented single character image and performs confidence evaluation on the recognition result. For characters whose confidence is lower than the threshold, a manual intervention interface is provided.

[0044] When the recognition result is output, the probability distribution of each character category is obtained. We take the probability value corresponding to the category with the highest probability as the confidence of the character recognition result. For example, if the probability of outputting the character "a" is 0.8, the probability of the character "b" is 0.1, and the sum of the probabilities of other characters is 0.1, then the confidence of the character being recognized as "a" is 0.8. The reliability of the recognition result is judged by setting a reasonable confidence threshold (for example, 0.7). If the confidence of a character is higher than the threshold, it means that the recognition result of the character is relatively confident and the recognition result is believed to be correct with a high probability; if the confidence is lower than the threshold, it means that there is a certain uncertainty in the recognition of the character and there may be a risk of recognition error. For characters with confidence lower than the threshold, the system will provide a manual intervention interface. The interface is designed to allow users (such as teachers or relevant staff) to check and correct the recognition results. When the system detects that the confidence of a character is lower than the threshold, the character will be highlighted on the interface and the original image of the character will be displayed so that the user can observe the details of the character more intuitively. At the same time, the system will provide an input box where the user can manually enter the correct characters.

[0045] S109 reassembles the recognized single characters into a complete text according to the order and position information of the character segmentation, and performs grammar and semantic verification on the reconstructed text to further improve the accuracy of the text.

[0046] In terms of text reconstruction, the identified individual characters are reassembled into complete text in the correct arrangement order according to the order and position information recorded during character segmentation. In this process, factors such as the spacing between characters and the connection of strokes are fully considered. For example, for the spacing between adjacent characters, if the horizontal or vertical distance between characters is detected to be large during the character segmentation stage, appropriate spacing will be left between characters when assembling the text to conform to normal writing habits and text formats. For some characters with stroke connection features, such as some characters in ligatures, they will be reasonably combined together according to the direction and connection method of the strokes to form a coherent text when they are combined. At the same time, during the text reconstruction process, the answer area information on the answer sheet will also be referred to. If it is in the fill-in-the-blank question area, the reconstructed text should match the context and format requirements of the fill-in-the-blank question; if it is in the answer question area, the characters will be combined into meaningful sentences and paragraphs according to the logical structure of the answer question. In terms of semantic verification, the reconstructed text is semantically verified. First, convert the text into a semantic vector representation, and judge whether the semantics of the text is reasonable by matching and comparing it with the knowledge nodes in the knowledge graph and the concepts in the domain ontology. For example, when answering scientific questions, the scientific concepts and principles mentioned in the text should be consistent with the existing scientific knowledge in the knowledge graph. Calculate the semantic similarity between the text and the relevant standard semantics or reference answers. Use technologies such as word vector models (such as Word2Vec) to represent the text and standard semantics in vector form, and then measure the degree of semantic matching between them by calculating methods such as cosine similarity between vectors.

[0047] A keyword library is established in advance. The keyword library includes the problem-solving keywords and terms required for the subject. From the recognized text, the key information of problem-solving steps and conclusions is extracted through keyword matching and grammatical analysis.

[0048] According to the characteristics of the subject and the grammatical structure, keywords are used to guide the extraction of problem-solving steps. In math problems, if keywords indicating order such as "first", "then", "next", and "finally" are identified, the sentence content guided by these keywords is extracted as the problem-solving steps in combination with the sentence structure determined by dependency syntactic analysis. For example, when "First, we move the terms of this equation" appears in the text, the keyword "first" is used to locate the sentence, and then the syntactic analysis is used to determine that "moving the terms of this equation" is a complete action description, which can be extracted as the problem-solving steps. For subjects such as physics and chemistry, similarly, the specific experimental operation steps are extracted based on keywords related to the experimental steps (such as "put...into...", "heat...to...", etc.), combined with the grammatical structure of the sentence. Search for keywords related to the conclusion in the text, such as "so", "therefore", "in summary", "it can be obtained", etc. After finding these keywords, the core content that follows them is determined as the conclusion based on syntactic analysis. For example, in a math proof question, "So, triangle ABC is an equilateral triangle", the keyword "so" is used to determine that the sentence is the conclusion part, and combined with syntactic analysis, it is clear that "triangle ABC is an equilateral triangle" is the key conclusion information that needs to be extracted. For the extraction of conclusion content such as the main idea of ​​the article and the author's point of view in Chinese reading comprehension, the relevant keywords (such as "expressed", "embodied", "explained", etc.) are also used to extract accurate conclusion information from the text in combination with the sentence grammatical structure.

[0049] S110 scores the handwritten answer sheet answers based on semantic similarity.

[0050] Calculate the cosine similarity between the candidate's answer vector and the standard answer vector to measure the semantic proximity between the two. The closer the cosine similarity value is to 1, the more similar the semantics are. For different question types, scores are given according to pre-established detailed scoring rules. For math questions, if the semantic similarity is high and the problem-solving steps are complete, the logic is correct, and the calculations are accurate, a higher score can be given; if there are missing steps or logical errors, points will be deducted according to the specific circumstances. For Chinese essays, if the semantic similarity reaches a certain level, a higher score can also be obtained. For experimental questions in subjects such as physics and chemistry, if the candidate's answer is consistent with the semantics of the standard answer when describing the experimental steps, principles, and conclusions, and the key information is accurate, the corresponding score can be obtained; if there is information missing or error, points will be deducted according to the rules.

[0051] S111 sends the correction result to the user in the form of a report.

[0052] Export the report in PDF format. The PDF format has good compatibility and stability, and can maintain the consistency of the report format and layout on different devices, making it convenient for users to print and save. At the same time, an export option in Excel format is provided. The Excel format facilitates users to further analyze and process the data, such as statistically analyzing the type distribution of wrong questions, calculating the score rate, etc. Based on image processing technology, this application recognizes the handwritten content of the collected answer sheet image to achieve automatic correction of the entire process. In response to the problem of character segmentation, an improved morphological segmentation algorithm is used for special writing styles and for adhered characters. First, an expansion operation is performed to expand the edge of the character and initially separate the adhered part; then an erosion operation is performed to shrink the character and enhance the boundaries between characters. At the same time, the segmentation results are optimized based on the structural characteristics and contextual information of the characters, such as the stroke direction and character spacing of the characters. In addition, projection analysis is performed on the handwritten characters on the answer sheet, and the character segmentation positions are determined based on the peaks and troughs of the projection curve. When the character segmentation positions cannot be determined based on the peaks and troughs of the projection curve, distance transformation is performed on the adhered character area, and the distance from each pixel to the background is calculated. Based on the results of the distance transformation, the local minimum point of the distance is found, and the local minimum point of the distance is used as the segmentation point between the characters.

[0053] Figure 2 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0054] like Figure 2As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In RAM43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, ROM42 and RAM43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0055] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0056] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as the method of automatic recognition and automatic correction of handwritten answer sheets.

[0057] In some embodiments, the method for automatic recognition and automatic correction of handwritten answer sheets can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the method for automatic recognition and automatic correction of handwritten answer sheets described above can be performed.

[0058] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. Ordinary technicians in this field can understand and implement it without creative work.

Claims

1. A method for automatically identifying and correcting handwritten answer sheets, characterized in that: Includes steps: Obtain handwritten answer sheet images and perform image preprocessing; Detect the straight lines in the image, analyze the straight line parameters to determine the edge and tilt angle of the answer sheet; correct the tilted answer sheet image to a standard rectangle; The image is divided into multiple sub-regions, and the histogram is calculated and equalized for each sub-region separately; For the answer sheets, manual annotation is performed in advance, the annotated data is stored, and a template database is constructed; Matching the collected and preprocessed answer sheet image with the template in the template database; Calculate the similarity scores between the image and each template, and select the template with the highest score as the matching template for the current answer sheet; Perform instance segmentation on the matched answer sheet image; Perform vertical and horizontal projection analysis on the handwritten characters on the answer sheet, and determine the character segmentation position based on the peaks and troughs of the projection curve; for the stuck characters, first perform an expansion operation to expand the character edges and initially separate the stuck parts; Then perform the erosion operation to shrink the characters; optimize the segmentation results based on the structural characteristics and context information of the characters; Recognize the segmented single character image and evaluate the confidence of the recognition result; Reassemble the recognized individual characters into complete text; Assign scores to handwritten answer sheet responses based on semantic similarity; The correction results are sent to the user in the form of a report.

2. The method for automatic recognition and automatic correction of handwritten answer sheets according to claim 1, characterized in that: The vertical and horizontal projection analysis includes a vertical projection analysis: the handwritten character area in the answer sheet image is regarded as a two-dimensional matrix, and pixel values ​​are accumulated column by column for the area.

3. The method for automatic recognition and automatic correction of handwritten answer sheets according to claim 1, characterized in that: The vertical and horizontal projection analysis includes a horizontal projection analysis: the handwritten character area in the answer sheet image is regarded as a two-dimensional matrix, and pixel values ​​are accumulated row by row for the area.

4. The method for automatic recognition and automatic correction of handwritten answer sheets according to claim 1, characterized in that: The image preprocessing includes converting the color image into a grayscale image using a weighted average method and reducing noise using a Gaussian filtering algorithm.

5. The method for automatic recognition and automatic correction of handwritten answer sheets according to claim 1, characterized in that: The matched answer sheet image is subjected to instance segmentation, which also includes using a contour detection algorithm to select contours that meet the characteristics of the answer area and remove small areas that are incorrectly segmented.

6. The method for automatic recognition and automatic correction of handwritten answer sheets according to claim 5, characterized in that: A contour detection algorithm is used to screen out contours that meet the characteristics of the answer area, where the answer area has specific shape and size characteristics. During the screening process, those area contours that do not have the specific shape and size characteristics are removed.

7. The method for automatic recognition and automatic correction of handwritten answer sheets according to claim 1, characterized in that: Before scoring the handwritten answer sheet answers based on semantic similarity, the following steps are also included: A keyword library is established in advance. The keyword library includes the problem-solving keywords and terms required for the subject. From the recognized text, the key information of problem-solving steps and conclusions is extracted through keyword matching and grammatical analysis.

8. The method for automatic recognition and automatic correction of handwritten answer sheets according to claim 1, characterized in that: When the character segmentation position cannot be determined based on the peaks and troughs of the projection curve, a distance transform is performed on the adhered character area to calculate the distance from each pixel to the background. Based on the result of the distance transform, the local minimum point of the distance is found and the local minimum point of the distance is used as the segmentation point between the characters.

Citation Information

Patent Citations

  • License plate recognition method in hazy weather

    CN110443166A

  • Intelligent paper test paper total score identification method and system

    CN110443235A

  • Intelligent paper marking system and processing method thereof

    CN110689018A

  • Intelligent method and system integrating deep learning and logical judgment

    CN113283431A

  • Method and system for identifying handwritten content of test paper

    CN118053162A