Intelligent correction method for answer sheet images based on improved robust feature matching
By improving robust feature matching technology, obtaining and filtering feature points and descriptors in the answer sheet image, and using the homography matrix for correction, the problem that traditional methods cannot handle complex deformation is solved, and more efficient answer sheet image correction is achieved.
Patent Information
- Application Number
- CN202510001128.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-02
AI Technical Summary
Traditional answer sheet image correction methods cannot effectively solve the deformation problems in answer sheet images caused by upside down, rotation, scaling, offset, stretching, edge distortion, stretching or compression deformation.
Using a method based on improved robust feature matching, by obtaining feature points and descriptors in the actual image of the answer sheet and the template image, multiple screening and corrections are performed using Euclidean distance and homography matrix, and finally correcting the actual image of the answer sheet based on the perspective transformation matrix.
It effectively solves the complex deformation problem in the answer sheet image, provides a good foundation for subsequent block lifting and improving the correction effect.
Smart Images

Figure CN119399421B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an intelligent correction method for answer sheet images based on improved robust feature matching. Background Art
[0002] Different answer sheet scanner models, parameters and other hardware aspects result in very different answer sheet images obtained by scanning the same answer sheet, which means that the answer sheet image is deformed. This deformation mainly includes inversion, rotation, scaling, edge distortion, stretching or compression deformation, etc.
[0003] The traditional answer sheet image correction method is to use Hough transform to detect straight lines in the binary answer sheet image, and then rotate the image based on the horizontal angle of the straight line to complete the correction of the answer sheet image.
[0004] However, traditional answer sheet image correction methods can only solve the deformation problem of the answer sheet caused by rotation, but cannot solve the deformation caused by inversion, scaling, offset, stretching, edge distortion, stretching or compression deformation, etc. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide an intelligent correction of answer sheet images based on improved robust feature matching, which can correct the feature points in the irregular answer sheet images scanned under complex conditions after multiple screening, and can solve the problems of inversion, rotation, scaling, offset, stretching, edge distortion, stretching or compression deformation in the answer sheet images, providing a good foundation for further block cutting later.
[0006] In a first aspect, an embodiment of the present application provides an answer sheet image method based on accelerated robust features and geometric transformation, and the answer sheet image method based on accelerated robust features and geometric transformation includes:
[0007] Obtaining the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and obtaining the first template feature point and the corresponding descriptor in the template image of the answer sheet;
[0008] Determine a second template feature point and a corresponding second actual feature point in the first template feature point according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point;
[0009] Determine a third actual feature point in the second actual feature points and a corresponding third template feature point according to a homography matrix between a set of all second template feature points and a set of all second actual feature points and second actual feature points corresponding to the second template feature points;
[0010] The actual image of the answer sheet is corrected based on the third actual feature point and the corresponding third template feature point.
[0011] In a possible implementation, determining a second actual feature point corresponding to a second template feature point in the first template feature points according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point includes:
[0012] Calculate the ratio between the nearest neighbor Euclidean distance and the next nearest neighbor Euclidean distance corresponding to the first template feature point;
[0013] If the ratio is less than a preset threshold, the first template feature point is determined as the second template feature point; and the nearest neighbor feature point corresponding to the first template feature point among all first actual feature points is determined as the second actual feature point corresponding to the second template feature point.
[0014] In a possible implementation, the homography matrix between the set consisting of all second template feature points and the set consisting of all second actual feature points is determined by the following steps:
[0015] Determine a preset number of second template feature points as target template feature points;
[0016] The homography matrix between the set of all target template feature points and the set of all second actual feature points corresponding to the target template feature points is determined as the homography matrix between the set of all second template feature points and the set of all second actual feature points.
[0017] In a possible implementation, determining a third actual feature point in the second actual feature points and a corresponding third template feature point according to a homography matrix between a set of all second template feature points and a set of all second actual feature points, and second actual feature points corresponding to the second template feature points, includes:
[0018] Calculate the position information of the predicted feature point according to the position information of the second actual feature point and the homography matrix;
[0019] Calculating the distance between the position information of the predicted feature point and the position information of the second template feature point corresponding to the second actual feature point;
[0020] If the distance is less than the preset distance, the second actual feature point is determined as the third actual feature point; and the second template feature point corresponding to the second actual feature point is determined as the third template feature point corresponding to the third actual feature point.
[0021] In a possible implementation, the preset distance is calculated by the following steps:
[0022] Determine the maximum distance among the distances between the position information of the predicted feature points corresponding to all the second actual feature points and the corresponding second template feature points;
[0023] The product of the maximum distance and the preset multiple is determined as the preset distance.
[0024] In a possible implementation, correcting the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point includes:
[0025] Generate a perspective transformation matrix according to the third actual feature point and the corresponding third template feature point;
[0026] Correct the actual image of the answer sheet according to the perspective transformation matrix.
[0027] In a possible implementation, obtaining a first template feature point and a corresponding descriptor in the answer sheet template image includes:
[0028] Extract feature points and corresponding descriptors and response values from the answer sheet template image;
[0029] A feature point whose response value is greater than a preset response value is determined as a first template feature point.
[0030] In a second aspect, the embodiment of the present application further provides an intelligent correction device for answer sheet images based on improved robust feature matching, the device comprising:
[0031] An acquisition module, used to acquire the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and acquire the first template feature point and the corresponding descriptor in the template image of the answer sheet;
[0032] A determination module, used to determine a second template feature point and a corresponding second actual feature point in the first template feature points according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point;
[0033] The determination module is further used to determine a third actual feature point in the second actual feature points and a corresponding third template feature point according to a homography matrix between a set composed of all second template feature points and a set composed of all second actual feature points, and second actual feature points corresponding to the second template feature points;
[0034] A correction module is used to correct the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point.
[0035] In a possible implementation, a determination module is specifically used to calculate the ratio between the nearest neighbor Euclidean distance and the next nearest neighbor Euclidean distance corresponding to the first template feature point; if the ratio is less than a preset threshold, the first template feature point is determined as the second template feature point; and the nearest neighbor feature point corresponding to the first template feature point among all first actual feature points is determined as the second actual feature point corresponding to the second template feature point.
[0036] In a possible implementation, a determination module is specifically used to determine a preset number of second template feature points as target template feature points; and determine the homography matrix between the set consisting of all target template feature points and the set consisting of all second actual feature points corresponding to the target template feature points as the homography matrix between the set consisting of all second template feature points and the set consisting of all second actual feature points.
[0037] In one possible implementation, a determination module is specifically used to calculate the position information of a predicted feature point based on the position information of a second actual feature point and a homography matrix; calculate the distance between the position information of the predicted feature point and the position information of a second template feature point corresponding to the second actual feature point; if the distance is less than a preset distance, determine the second actual feature point as a third actual feature point; and determine the second template feature point corresponding to the second actual feature point as a third template feature point corresponding to the third actual feature point.
[0038] In a possible implementation, the determination module is specifically used to determine the maximum distance among the distances between the position information of the predicted feature points corresponding to all the second actual feature points and the corresponding second template feature points; and determine the product of the maximum distance and the preset multiple as the preset distance.
[0039] In a possible implementation, the correction module is specifically used to generate a perspective transformation matrix according to the third actual feature point and the corresponding third template feature point; and correct the actual image of the answer sheet according to the perspective transformation matrix.
[0040] In a possible implementation, the acquisition module is specifically used to extract feature points and corresponding descriptors and response values in the answer sheet template image; and determine feature points whose response values are greater than a preset response value as first template feature points.
[0041] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of any one of the methods for intelligent correction of answer sheet images based on improved robust feature matching in the first aspect.
[0042] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for intelligent correction of answer sheet images based on improved robust feature matching as described in any one of the first aspects are executed.
[0043] The embodiment of the present application provides an intelligent correction method for answer sheet images based on improved robust feature matching, the method comprising: obtaining the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and obtaining the first template feature point and the corresponding descriptor in the template image of the answer sheet; determining the second template feature point and the corresponding second actual feature point in the first template feature point according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point; determining the third actual feature point and the corresponding third template feature point in the second actual feature point according to the homography matrix between the set composed of all second template feature points and the set composed of all second actual feature points, and the second actual feature point corresponding to the second template feature point; correcting the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point. The present application corrects the feature points in the answer sheet image after multiple screening, which can solve the problems of inversion, rotation, scaling, offset, stretching, edge distortion, stretching or compression deformation in the answer sheet image, and improves the correction effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A flowchart of an answer sheet image intelligent correction method based on improved robust feature matching provided in an embodiment of the present application is shown;
[0046] Figure 2 A flowchart of determining a third actual feature point and a corresponding third template feature point provided in an embodiment of the present application is shown;
[0047] Figure 3 A schematic diagram of the structure of an intelligent correction device for answer sheet images based on improved robust feature matching provided in an embodiment of the present application is shown;
[0048] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0050] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0051] In order to enable those skilled in the art to use the contents of this application, the following implementation is provided in conjunction with a specific application scenario, the "field of image processing technology". For those skilled in the art, the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the "field of image processing technology", it should be understood that this is only an exemplary embodiment.
[0052] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0053] The following is a detailed description of an intelligent correction method for answer sheet images based on improved robust feature matching provided in an embodiment of the present application.
[0054] Reference Figure 1 As shown, it is a flowchart of a method for intelligent correction of answer sheet images based on improved robust feature matching provided in an embodiment of the present application. The exemplary steps of the embodiment of the present application are described below:
[0055] S101, obtaining the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and obtaining the first template feature point and the corresponding descriptor in the template image of the answer sheet.
[0056] In the implementation manner of the present application, the SIFT (Scale-Invariant Feature Transform) algorithm is used to extract actual feature points and corresponding descriptors from the actual image of the answer sheet, and template feature points and corresponding descriptors in the answer sheet template image; all actual feature points are determined as first actual feature points, and all template feature points are determined as first template feature points.
[0057] Optionally, obtaining the first template feature point and the corresponding descriptor in the answer sheet template image also includes: extracting the template feature point and the corresponding descriptor and response value in the answer sheet template image; and determining the template feature point whose response value is greater than a preset response value as the first template feature point.
[0058] The response value indicates the prominence of the feature point in the image. The algorithm calculates the response value of each feature point based on the local structure of the image (such as gradient changes, corner features, etc.). The response value usually indicates whether the texture information of the feature point is sufficient.
[0059] Optionally, obtaining the first actual feature point in the actual image of the answer sheet and the corresponding descriptor also includes: extracting the actual feature point in the actual image of the answer sheet and the corresponding descriptor and response value; determining the actual feature point whose response value is greater than a preset response value as the first actual feature point.
[0060] S102 . Determine a second template feature point and a corresponding second actual feature point in the first template feature points according to a Euclidean distance between a descriptor corresponding to each first template feature point and a descriptor corresponding to each first actual feature point.
[0061] Step 1: Calculate the ratio between the nearest neighbor Euclidean distance and the next nearest neighbor Euclidean distance corresponding to the first template feature point.
[0062] In the implementation manner of the present application, the nearest neighbor Euclidean distance refers to the shortest distance among the Euclidean distances between the descriptor corresponding to the first template feature point and the descriptors corresponding to all the first actual feature points; the second nearest neighbor Euclidean distance refers to the second shortest distance among the Euclidean distances between the descriptor corresponding to the first template feature point and the descriptors corresponding to all the first actual feature points.
[0063] Step 2: If the ratio is less than a preset threshold, the first template feature point is determined as the second template feature point; and the nearest neighbor feature point corresponding to the first template feature point among all first actual feature points is determined as the second actual feature point corresponding to the second template feature point.
[0064] The nearest neighbor feature point corresponding to the first template feature point refers to the first actual feature point having the shortest Euclidean distance between the descriptors of all first actual feature points and the descriptors of the first template feature point.
[0065] In addition, the Euclidean distance between the descriptor corresponding to the first template feature point and the descriptor corresponding to the first actual feature point is calculated by the following formula:
[0066] ;
[0067] Among them, d is the descriptor corresponding to the first template feature point The descriptor corresponding to the first actual feature point The Euclidean distance between them, n is the total number of elements in the descriptor, Descriptor corresponding to the first template feature point The value of the i-th element in , is the descriptor corresponding to the first actual feature point The value of the i-th element in .
[0068] S103, determining a third actual feature point in the second actual feature points and a corresponding third template feature point according to a homography matrix between a set of all second template feature points and a set of all second actual feature points, and second actual feature points corresponding to the second template feature points.
[0069] The homography matrix is used to describe the geometric transformation relationship between the set of second template feature points and the set of second actual feature points.
[0070] Specifically, determining the homography matrix between the set consisting of all second template feature points and the set consisting of all second actual feature points includes: determining a preset number of second template feature points as target template feature points; and determining the homography matrix between the set consisting of all target template feature points and the set consisting of all second actual feature points corresponding to the target template feature points as the homography matrix between the set consisting of all second template feature points and the set consisting of all second actual feature points.
[0071] Reference Figure 2 As shown, it is a flowchart of determining the third actual feature point and the corresponding third template feature point provided in an embodiment of the present application, including:
[0072] S201. Calculate position information of a predicted feature point according to position information of a second actual feature point and a homography matrix.
[0073] In the implementation mode of the present application, the position information of the second actual feature point is Substitute the homography matrix H into the following formula to calculate the predicted feature points Location information:
[0074] .
[0075] S202: Calculate the distance between the position information of the predicted feature point and the position information of the second template feature point corresponding to the second actual feature point.
[0076] In the implementation mode of the present application, the position information of the predicted feature point is Position information of the second template feature point corresponding to the second actual feature point Substitute into the following formula to obtain the distance between the position information of the predicted feature point and the position information of the second template feature point corresponding to the second actual feature point: :
[0077] .
[0078] S203: If the distance is less than the preset distance, determine the second actual feature point as the third actual feature point; and determine the second template feature point corresponding to the second actual feature point as the third template feature point corresponding to the third actual feature point.
[0079] In an implementation manner of the present application, the maximum distance among the distances between the position information of the predicted feature points corresponding to all the second actual feature points and the corresponding second template feature points is determined; and the product of the maximum distance and a preset multiple (such as 0.3) is determined as the preset distance.
[0080] Here, the present application determines the homography matrix between the set of all second template feature points and the set of all second actual feature points through a set of a part of the second template feature points and a corresponding set of the second actual feature points, thereby improving the accuracy of perspective transformation correction.
[0081] Optionally, according to the first window of the first preset size, the window is slid in the area corresponding to each third template feature point in the answer sheet template image; if there is no handwriting in the currently sliding first window in the answer sheet template image, the third template feature point in the currently sliding first window is determined as the final third template feature point; and according to the window size of the second window corresponding to each third actual feature point, the window is slid in the area corresponding to each third actual feature point in the actual image of the answer sheet; if there is no handwriting in the currently sliding second window in the actual image of the answer sheet, the third actual feature in the currently sliding second window is determined as the final third actual feature point; all the final third template feature points and the third actual feature points are matched to obtain the final third actual feature points and the corresponding third template feature points.
[0082] Here, determining the size of the second window corresponding to each third actual feature point includes: for each third template feature point, calculating the ratio between the average value of the scales of all third template feature points in the first window at the position of the third template feature point in the answer sheet template image (i.e., the position of the center point of the first window is the same as the position of the third template feature point) and the average value of the scales of the third actual feature points corresponding to the first window (the first window at the position of the third template feature point) in the actual image of the answer sheet; and determining the product of the ratio and the first preset size as the size of the second window corresponding to the third actual feature point corresponding to the third template feature point.
[0083] S104: Correct the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point.
[0084] In the implementation mode of the present application, a perspective transformation matrix is generated according to the third actual feature point and the corresponding third template feature point; the actual image of the answer sheet is corrected according to the perspective transformation matrix. Perspective transformation is a mathematical operation that converts an image from one perspective to another. It can simulate the perspective change in the image, so that the position and proportion of the object in the image change, producing an effect similar to what the human eye sees. Perspective transformation is widely used in image processing, graphics and other fields.
[0085] The embodiment of the present application provides an intelligent correction method for answer sheet images based on improved robust feature matching, the method comprising: obtaining the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and obtaining the first template feature point and the corresponding descriptor in the template image of the answer sheet; determining the second template feature point and the corresponding second actual feature point in the first template feature point according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point; determining the third actual feature point and the corresponding third template feature point in the second actual feature point according to the homography matrix between the set composed of all second template feature points and the set composed of all second actual feature points, and the second actual feature point corresponding to the second template feature point; correcting the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point. The present application corrects the feature points in the answer sheet image after multiple screening, which can solve the problems of inversion, rotation, scaling, offset, stretching, edge distortion, stretching or compression deformation in the answer sheet image, and improves the correction effect.
[0086] Based on the same inventive concept, the embodiments of the present application also provide an intelligent correction device for answer sheet images based on improved robust feature matching corresponding to the intelligent correction method for answer sheet images based on improved robust feature matching. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the above-mentioned intelligent correction method for answer sheet images based on improved robust feature matching in the embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0087] Reference Figure 3 FIG. 1 is a schematic diagram of an intelligent correction device for answer sheet images based on improved robust feature matching provided in an embodiment of the present application. The intelligent correction device for answer sheet images based on improved robust feature matching includes:
[0088] The acquisition module 301 is used to acquire the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and acquire the first template feature point and the corresponding descriptor in the template image of the answer sheet;
[0089] A determination module 302, configured to determine a second template feature point and a corresponding second actual feature point in the first template feature points according to a Euclidean distance between a descriptor corresponding to each first template feature point and a descriptor corresponding to each first actual feature point;
[0090] The determination module 302 is further used to determine a third actual feature point in the second actual feature points and a corresponding third template feature point according to a homography matrix between a set composed of all second template feature points and a set composed of all second actual feature points, and second actual feature points corresponding to the second template feature points;
[0091] The correction module 303 is used to correct the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point.
[0092] In a possible implementation, the determination module 302 is specifically used to calculate the ratio between the nearest neighbor Euclidean distance corresponding to the first template feature point and the next nearest neighbor Euclidean distance; if the ratio is less than a preset threshold, the first template feature point is determined as the second template feature point; and the nearest neighbor feature point corresponding to the first template feature point among all first actual feature points is determined as the second actual feature point corresponding to the second template feature point.
[0093] In a possible implementation, the determination module 302 is specifically used to determine a preset number of second template feature points as target template feature points; and determine the homography matrix between the set consisting of all target template feature points and the set consisting of all second actual feature points corresponding to the target template feature points as the homography matrix between the set consisting of all second template feature points and the set consisting of all second actual feature points.
[0094] In a possible implementation, the determination module 302 is specifically used to calculate the position information of the predicted feature point based on the position information of the second actual feature point and the homography matrix; calculate the distance between the position information of the predicted feature point and the position information of the second template feature point corresponding to the second actual feature point; if the distance is less than the preset distance, determine the second actual feature point as the third actual feature point; and determine the second template feature point corresponding to the second actual feature point as the third template feature point corresponding to the third actual feature point.
[0095] In a possible implementation, the determination module 302 is specifically used to determine the maximum distance among the distances between the position information of the predicted feature points corresponding to all the second actual feature points and the corresponding second template feature points; and determine the product of the maximum distance and the preset multiple as the preset distance.
[0096] In a possible implementation, the correction module 303 is specifically configured to generate a perspective transformation matrix according to the third actual feature points and the corresponding third template feature points; and correct the actual image of the answer sheet according to the perspective transformation matrix.
[0097] In a possible implementation, the acquisition module 301 is specifically used to extract feature points and corresponding descriptors and response values in the answer sheet template image; and determine feature points with response values greater than a preset response value as first template feature points.
[0098] The embodiment of the present application provides an intelligent correction device for answer sheet images based on improved robust feature matching, and the device includes: an acquisition module 301, used to acquire the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and acquire the first template feature point and the corresponding descriptor in the template image of the answer sheet; a determination module 302, used to determine the second template feature point and the corresponding second actual feature point in the first template feature point according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point; the determination module 302 is also used to determine the third actual feature point and the corresponding third template feature point in the second actual feature point according to the homography matrix between the set composed of all second template feature points and the set composed of all second actual feature points, and the second actual feature point corresponding to the second template feature point; and a correction module 303, used to correct the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point. The present application performs correction after multiple screening of feature points in the answer sheet image, which can solve the problems of inversion, rotation, scaling, offset, stretching, edge distortion, stretching or compression deformation in the answer sheet image, and improve the correction effect.
[0099] like Figure 4As shown, an electronic device 400 provided in an embodiment of the present application includes: a processor 401, a memory 402 and a bus, the memory 402 stores machine-readable instructions executable by the processor 401, when the electronic device is running, the processor 401 communicates with the memory 402 through the bus, and the processor 401 executes the machine-readable instructions to perform the steps of the above-mentioned method for intelligent correction of answer sheet images based on improved robust feature matching.
[0100] Specifically, the above-mentioned memory 402 and processor 401 can be general-purpose memories and processors, which are not specifically limited here. When the processor 401 runs the computer program stored in the memory 402, it can execute the above-mentioned answer sheet image intelligent correction method based on improved robust feature matching.
[0101] Corresponding to the above-mentioned intelligent correction method for answer sheet images based on improved robust feature matching, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned intelligent correction method for answer sheet images based on improved robust feature matching are executed.
[0102] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0103] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0105] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the information processing method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0106] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An intelligent correction method for answer sheet images based on improved robust feature matching, characterized in that: The method comprises: Obtaining the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and obtaining the first template feature point and the corresponding descriptor in the template image of the answer sheet; Determine a second template feature point and a corresponding second actual feature point in the first template feature point according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point; According to the position information of the second actual feature point and the homography matrix, the position information of the predicted feature point is calculated; the distance between the position information of the predicted feature point and the position information of the second template feature point corresponding to the second actual feature point is calculated; the maximum distance among the distances between the position information of the predicted feature points corresponding to all the second actual feature points and the corresponding second template feature points is determined; the product of the maximum distance and a preset multiple is determined as the preset distance; if the distance is less than the preset distance, the second actual feature point is determined as the third actual feature point; and the second template feature point corresponding to the second actual feature point is determined as the third template feature point corresponding to the third actual feature point; The actual image of the answer sheet is corrected based on the third actual feature point and the corresponding third template feature point.
2. The intelligent correction method for answer sheet images based on improved robust feature matching according to claim 1 is characterized in that: The determining, according to the Euclidean distance between the descriptor corresponding to each first template feature point and the descriptor corresponding to each first actual feature point, a second actual feature point corresponding to a second template feature point in the first template feature points comprises: Calculating the ratio between the nearest neighbor Euclidean distance and the next nearest neighbor Euclidean distance corresponding to the first template feature point; If the ratio is less than a preset threshold, the first template feature point is determined as the second template feature point; and the nearest neighbor feature point corresponding to the first template feature point among all first actual feature points is determined as the second actual feature point corresponding to the second template feature point.
3. The intelligent correction method for answer sheet images based on improved robust feature matching according to claim 1, characterized in that: The homography matrix between the set consisting of all the second template feature points and the set consisting of all the second actual feature points is determined by the following steps: Determining a preset number of the second template feature points as target template feature points; The homography matrix between the set consisting of all the target template feature points and the set consisting of all the second actual feature points corresponding to the target template feature points is determined as the homography matrix between the set consisting of all the second template feature points and the set consisting of all the second actual feature points.
4. The intelligent correction method for answer sheet images based on improved robust feature matching according to claim 1, characterized in that: The correcting the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point includes: Generate a perspective transformation matrix according to the third actual feature point and the corresponding third template feature point; The actual image of the answer sheet is corrected according to the perspective transformation matrix.
5. The intelligent correction method for answer sheet images based on improved robust feature matching according to any one of claims 1 to 4, characterized in that: The step of obtaining the first template feature point and the corresponding descriptor in the answer sheet template image includes: Extracting feature points and corresponding descriptors and response values in the answer sheet template image; The feature point whose response value is greater than the preset response value is determined as the first template feature point.
6. An intelligent correction device for answer sheet images based on improved robust feature matching, characterized in that: The device comprises: An acquisition module, used to acquire the first actual feature point and the corresponding descriptor in the actual image of the answer sheet, and acquire the first template feature point and the corresponding descriptor in the template image of the answer sheet; A determination module, configured to determine a second template feature point and a corresponding second actual feature point among the first template feature points according to a Euclidean distance between a descriptor corresponding to each first template feature point and a descriptor corresponding to each first actual feature point; The determination module is further used to calculate the position information of the predicted feature point according to the position information of the second actual feature point and the homography matrix; calculate the distance between the position information of the predicted feature point and the position information of the second template feature point corresponding to the second actual feature point; determine the maximum distance among the distances between the position information of the predicted feature points corresponding to all the second actual feature points and the corresponding second template feature points; determine the product of the maximum distance and a preset multiple as the preset distance; if the distance is less than the preset distance, determine the second actual feature point as the third actual feature point; and determine the second template feature point corresponding to the second actual feature point as the third template feature point corresponding to the third actual feature point; A correction module is used to correct the actual image of the answer sheet based on the third actual feature point and the corresponding third template feature point.
7. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for intelligent correction of answer sheet images based on improved robust feature matching as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the method for intelligent correction of answer sheet images based on improved robust feature matching as described in any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Image matching method and device, storage medium and electronic equipment
CN115546818A
Information card correction method, device and equipment and readable storage medium
CN115631097A