An image skew correction method, system, terminal and readable storage medium

The method corrects image tilt by matching identifying features from skewed images with stored standard images, enhancing the efficiency and accuracy of image alignment in exam papers.

CN114627280BActive Publication Date: 2025-07-15BEIJING HEXFUTURE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210296301.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2025-07-15
Estimated Expiration
2042-03-24

AI Technical Summary

Technical Problem

The prior art is difficult to effectively correct image tilt deformation during image scanning, and the scope of application is small and inconvenient.

Method used

By obtaining the identification information of the image to be corrected, the corresponding standard image is retrieved, the corner points of the two images are calculated and matched to obtain the degree of image skewness information, and the image is corrected based on this information.

Benefits of technology

It improves the convenience and efficiency of image correction and can be widely used in the correction of different images, especially in the automatic scoring process of exam papers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114627280B_ABST
    Figure CN114627280B_ABST
Patent Text Reader

Abstract

The present application relates to an image skew correction method, system, terminal, and readable storage medium, which belong to the field of image processing. Among them, an image skew correction method includes obtaining identification information of an image to be corrected; retrieving a standard image corresponding to the identification information according to the identification information; calculating corner points of the image to be corrected and the standard image, and obtaining image skew degree information of the image to be corrected after matching the corner points of the two images; and correcting the image to be corrected according to the image skew degree information. The present application has the effect of improving the application universality of image correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and particularly to an image skew correction method, system, terminal, and readable storage medium. Background Art

[0002] For schools, examinations are a way to test students' knowledge. In an examination, different subjects correspond to different test papers. Students complete the examination by filling in the test papers, and then teachers will judge the content on the test papers and grade the students based on their answers.

[0003] During the marking process, in order to avoid marking errors, two marking methods are often used: manual marking by teachers and computer marking. For computer marking, the students' test papers need to be scanned first to convert the filled test papers into electronic versions, and then the computer judges the electronic test papers.

[0004] Regarding the above related technologies, the inventor found that during the scanning of test papers, image skew deformation may occur. For the problem of image skew deformation, generally, linear elements or rectangular elements in the image are detected, then the skew angle of the line or rectangle is calculated, and the image is corrected according to the skew angle. However, this correction method has a small application range, many limitations, cannot be widely applied, and is relatively inconvenient. Summary of the Invention

[0005] This application provides an image skew correction method, system, terminal, and readable storage medium, which has the characteristic of improving the convenience of image correction.

[0006] One object of this application is to provide an image skew correction method.

[0007] The above object of this application is achieved through the following technical solutions:

[0008] An image skew correction method:

[0009] Obtain the identification information of the image to be corrected;

[0010] Retrieve the standard image corresponding to the identification information according to the identification information;

[0011] Calculate the corner points of the image to be corrected and the standard image, and obtain the image skew degree information of the image to be corrected after matching the corner points of the two images;

[0012] Correct the image to be corrected according to the image skew degree information.

[0013] By adopting the above technical solution, the standard image is retrieved according to the identification information of the image to be corrected. Then, the image skew degree information of the image to be corrected can be obtained by matching the corner points of the two images. Then, the image to be corrected can be corrected based on this information. In this way, when the corner points of the image to be corrected are recognized, it means the completion of the image correction work, which is relatively convenient and can be completed through a preset program, improving the convenience of image correction.

[0014] In a preferred example of the present application, it can be further configured that the step of obtaining the identification information of the image to be corrected includes:

[0015] Obtain the image to be corrected according to the imaging device;

[0016] Obtain the identification information from the image to be corrected according to the feature recognition technology;

[0017] The identification information includes linear elements, rectangular frame elements, rectangular identification elements, and digital identification elements.

[0018] In a preferred example of the present application, it can be further configured that before retrieving the standard image corresponding to the identification information according to the identification information, the steps of performing corresponding processing on the standard images and identification information stored in the database include:

[0019] Obtain the standard image and the identification information on the standard image;

[0020] Bind the digital identification elements in the standard image and the identification information to each other and store them in the database.

[0021] In a preferred example of the present application, it can be further configured that before retrieving the standard image corresponding to the identification information according to the identification information, the steps of performing corresponding processing on the standard images and identification information stored in the database include:

[0022] Process the linear elements, rectangular frame elements, and rectangular identification elements in the identification information to obtain distance information;

[0023] Bind the standard image and the distance information to each other and store them in the database.

[0024] In a preferred example of the application, it can be further configured that the step of processing the linear elements, rectangular frame elements, and rectangular identification elements in the identification information to obtain distance information includes:

[0025] Obtain the specific linear elements, specific rectangular frame elements, and specific rectangular identification elements in the identification information;

[0026] Calculate the first distance value between the specific linear element and the specific rectangular identification element;

[0027] Calculate a second distance value between a specific rectangular box element and a specific rectangular identification element;

[0028] Calculate a ratio value between the first distance value and the second distance value, and this ratio value is the distance information.

[0029] The application can be further configured in a preferred example to further include:

[0030] Obtain the to-be-corrected arrangement information of the rectangular box in the to-be-corrected image according to the to-be-corrected image and the identification information;

[0031] Obtain the standard arrangement information of the rectangular box in the standard image according to the standard image and the identification information;

[0032] Obtain the image occlusion degree information according to the to-be-corrected arrangement information and the standard arrangement information;

[0033] Obtain and output a prompt message according to the image occlusion degree information.

[0034] In a preferred example, the application can be further configured that the step of obtaining the image occlusion degree information according to the to-be-corrected arrangement information and the standard arrangement information includes:

[0035] Obtain a to-be-corrected arrangement matrix according to the to-be-corrected arrangement information;

[0036] Obtain a standard arrangement matrix according to the standard arrangement information;

[0037] After matching the to-be-corrected arrangement matrix and the standard arrangement matrix, obtain the rectangular box information missing in the to-be-corrected arrangement matrix compared with the standard arrangement matrix;

[0038] The missing rectangular box information is the image occlusion degree information.

[0039] The second object of the application is to provide an image skew correction system.

[0040] The above second object of the application is achieved through the following technical solutions:

[0041] An image skew correction system includes:

[0042] An acquisition module, configured to acquire the identification information of the to-be-corrected image;

[0043] An extraction module, configured to extract a standard image corresponding to the identification information according to the identification information;

[0044] A calculation module, configured to calculate the corner points of the to-be-corrected image and the standard image, and obtain the image skew degree information of the to-be-corrected image after matching the corner points of the two images;

[0045] A correction module, configured to correct the image to be corrected according to the image skew degree information.

[0046] A third object of the present application is to provide an intelligent terminal.

[0047] The above-mentioned third object of the present application is achieved through the following technical solutions:

[0048] An intelligent terminal includes a memory and a processor, and a computer program instruction for the above-mentioned image skew correction method that can be loaded and executed by the processor is stored on the memory.

[0049] A fourth object of the present application is to provide a computer medium that can store corresponding programs.

[0050] The above-mentioned fourth object of the present application is achieved through the following technical solutions:

[0051] A computer-readable storage medium stores a computer program that can be loaded and executed by a processor for any of the above-mentioned image skew correction methods. Description of the Drawings

[0052] Figure 1 It is a schematic flowchart of an image skew correction method in an embodiment of the present application.

[0053] Figure 2 It is a schematic structural diagram of an image skew correction system in an embodiment of the present application.

[0054] Description of the reference numerals: 1. Acquisition module; 2. Retrieval module; 3. Calculation module; 4. Correction module. Detailed Description of the Embodiment

[0055] This specific embodiment is only an explanation of the present application, and it is not a limitation of the present application. After reading this specification, those skilled in the art can make modifications to this embodiment without creative contributions as needed, but as long as they are within the scope of the claims of the present application, they are protected by the patent law.

[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts fall within the scope of protection of the present application.

[0057] The following further describes the embodiments of the present application in detail with reference to the accompanying drawings of the specification.

[0058] This application provides an image skew correction method, and the main process of the method is described as follows.

[0059] As Figure 1 shown:

[0060] Step S101: Obtain the identification information of the image to be corrected.

[0061] Step S102: Retrieve the standard image corresponding to the identification information according to the identification information.

[0062] Step S103: Calculate the corner points of the image to be corrected and the standard image, and obtain the image skew degree information of the image to be corrected after matching the corner points of the two images.

[0063] Step S104: Correct the image to be corrected according to the image skew degree information.

[0064] Currently, during the process of scanning test papers, generally, the method of taking pictures with a mobile phone or using other photographing devices to take pictures is adopted to collect the image to be corrected; it can be understood that in the embodiments of this application, it is aimed at the skewed image after taking pictures with a mobile phone, that is, by default, the image obtained after taking pictures with a mobile phone will be somewhat skewed and needs to be corrected; moreover, the test papers in the embodiments of this application are special test papers, and identification information will be printed on the test papers when printing the test papers, and the identification information of each test paper. In this way, each test paper can be specifically identified, making it more convenient, time-saving, and improving efficiency during the process of identifying and correcting test papers.

[0065] In the embodiments of this application, the specific steps for obtaining the identification information of the image to be corrected are as follows: obtain the image to be corrected according to the imaging device, and then obtain the identification information from the image to be corrected according to the feature recognition technology; the identification information includes linear elements, rectangular frame elements, rectangular identification elements, and digital identification elements; the identification information here is all the relevant information printed on the test papers when printing the test papers; it can be understood that the imaging device here can be a mobile phone or a camera, etc., which is not limited here; then retrieve the standard image corresponding to the identification information from the database; it should be noted that retrieving the standard image corresponding to the identification information from the database here means that the identification information and the standard image correspond to each other. Therefore, before retrieving the standard image corresponding to the identification information according to the identification information, corresponding processing needs to be performed on the standard images and identification information stored in the database.

[0066] It can be understood that after the test papers are printed, the electronic document files of the test papers are stored in the database, but the electronic document files of the test papers answered by students are not stored in the database. Therefore, it is necessary to scan the test papers with answers filled in. However, for the blank test papers without answers on them, the electronic document files are stored in the database. Here, the electronic document file is the standard image, and the same identification information as that in the image to be corrected is also included in the standard image.

[0067] Each element included in the identification information here has its own meaning; the straight-line element represents the position on the test paper where blanks need to be filled, that is, the blank area that students need to fill in during the exam. There is a straight line below it, and there are a text element and a rectangular frame element before and after the straight line respectively; while the rectangular frame element represents the position where the teacher judges whether the student's answer is correct or not, that is, the element that the teacher fills in the rectangular frame to indicate whether the student's answer is correct or not; the rectangular identification element is located at the position close to the boundary around the test paper, and the positions of the rectangular identification elements in each test paper are roughly the same; the digital identification element is used to identify the test paper, and the digital identification element is a string of numbers. The positions, arrangements, and contents of the numbers on each test paper are all different.

[0068] Specifically, the steps for performing corresponding processing on the standard image and the identification information stored in the database are as follows: first, obtain the standard image and the identification information on the standard image, and then bind the standard image and the digital identification element in the identification information to be stored in the database; it can be understood that in the embodiment of the present application, the first step in identifying the test paper is to bind the digital identification element on each test paper to the test paper. Because the numbers on each test paper are specific, it is more convenient to directly bind the digital identification element to the test paper; it can be understood that the test paper here refers to the standard image, which refers to the blank test paper that students have not filled in yet.

[0069] After binding the test paper and the digital identification element, when it is necessary to retrieve the standard image according to the identification information, only need to identify the number in the image to be corrected, and then match the number with the number in the standard image pre-stored in the database. When the two match successfully, it means that the standard image corresponding to the image to be corrected is found in the database, and then the next step is to correct the image to be corrected.

[0070] The following problems may exist in the process of retrieving the standard image in the above manner. Because in the process of retrieving the standard image, only one variable, the digital identification element, is involved. Although the digital identification element has directivity and particularity, when there are situations such as incorrect identification or incorrect matching of the digital identification element, this method of retrieving the standard image will fail; therefore, in view of this problem, the following steps are adopted in the embodiment of the present application.

[0071] After processing the straight line elements, rectangular frame elements, and rectangular identification elements in the identification information, distance information is obtained; then the standard image and the distance information are bound to each other and stored in the database; specifically, specific straight line elements, specific rectangular frame elements, and specific rectangular identification elements in the identification information are obtained; a first distance value between the specific straight line element and the specific rectangular identification element is calculated; a second distance value between the specific rectangular frame element and the specific rectangular identification element is calculated; a ratio value between the first distance value and the second distance value is calculated, and this ratio value is the distance information.

[0072] It can be understood that the test papers in the embodiments of the present application are special test papers. Although each test paper has straight line elements and rectangular identification elements, each test paper needs to be distinguished to ensure that when the digital identification elements cannot be recognized, other methods can be used for recognition; therefore, specific straight line elements, specific rectangular frame elements, and specific rectangular identification elements in the identification information are obtained; here, the specific straight line elements, specific rectangular frame elements, and specific rectangular identification elements all represent the specified elements at the specified positions, and there is one and only one; then, by calculation, the distance value between the specific straight line element and the specific rectangular identification element, and the distance value between the specific rectangular frame element and the specific rectangular identification element are obtained. After obtaining the two distance values, the ratio value of the two distance values is calculated, and then the distance value is bound to the standard image and stored in the database; since the content on each test paper is different, the distance value between the specific straight line element and the specific rectangular identification element, and the distance value between the specific rectangular frame element and the specific rectangular identification element are also different, so the ratio value between the two distance values is also different. In this way, when the digital identification elements on the test paper cannot be recognized, the image to be corrected can still be recognized and processed, so as to realize retrieving the standard image corresponding to the identification information from the database according to the identification information.

[0073] After obtaining the standard image, the corner points of the image to be corrected and the standard image are calculated, and after matching the corner points of the two images, the image skew degree information of the image to be corrected is obtained; then the image to be corrected is corrected according to the image skew degree information; it can be understood that the corner points are the relatively special points in the image. The corner points in the embodiments of the present application are the rectangular identification elements in the identification information. By matching the rectangular identification elements in the two images, the correction of the image to be corrected can be realized; for the specific process, the single homography transformation matrix can be calculated by the RANSAC algorithm, and then the image to be corrected is corrected according to the matrix. The above process is a commonly used technical means in the related art and will not be elaborated here.

[0074] During the process of image correction, another problem may occur. For the image to be corrected, there may be occluded areas in the image. The rectangular box for teacher grading is a relatively important position. Therefore, for the rectangular box element, the following steps can be taken for processing.

[0075] Obtain the to-be-corrected arrangement information of the rectangular box in the to-be-corrected image based on the to-be-corrected image and identification information; obtain the standard arrangement information of the rectangular box in the standard image based on the standard image and identification information; obtain the image occlusion degree information based on the to-be-corrected arrangement information and the standard arrangement information; obtain and output a prompt message based on the image occlusion degree information; specifically, obtain the to-be-corrected arrangement matrix based on the to-be-corrected arrangement information; obtain the standard arrangement matrix based on the standard arrangement information; match the to-be-corrected arrangement matrix and the standard arrangement matrix to obtain the missing rectangular box information in the to-be-corrected arrangement matrix compared to the standard arrangement matrix; the missing rectangular box information is the image occlusion degree information.

[0076] Through the above method, it is possible to detect and correct the occlusion of the rectangular box in the to-be-corrected image.

[0077] This application also provides an image skew correction system, as Figure 2 shown, an image skew correction system includes an acquisition module 1 for acquiring the identification information of the to-be-corrected image; a retrieval module 2 for retrieving the standard image corresponding to the identification information according to the identification information; a calculation module 3 for calculating the corner points of the to-be-corrected image and the standard image, and obtaining the image skew degree information of the to-be-corrected image after matching the corner points of the two images; a correction module 4 for correcting the to-be-corrected image according to the image skew degree information.

[0078] To better execute the program of the above method, this application also provides an intelligent terminal, which includes a memory and a processor.

[0079] Among them, the memory can be used to store instructions, programs, codes, code sets or instruction sets. The memory can include a program storage area and a data storage area. The program storage area can store instructions for implementing the operating system, instructions for at least one function, and instructions for implementing the above image skew correction method, etc.; the data storage area can store data involved in the above image skew correction method, etc.

[0080] The processor may include one or more processing cores. By running or executing instructions, programs, code sets, or instruction sets stored in the memory, the processor invokes the data stored in the memory, performs various functions of this application, and processes the data. The processor may be at least one of an application specific integrated circuit, a digital signal processor, a digital signal processing device, a programmable logic device, a field programmable gate array, a central processing unit, a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic devices for implementing the above processor functions may also be others, and the embodiments of this application do not make specific limitations.

[0081] This application also provides a computer-readable storage medium, for example, including: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs. The computer-readable storage medium stores a computer program that can be loaded and executed by the processor to perform the above image skew correction method.

[0082] The above description is only a preferred embodiment of this application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the foregoing disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. An image skew correction method, characterized in that, Including: Obtaining the identification information of the image to be corrected; The step of obtaining the identification information of the image to be corrected includes: obtaining the image to be corrected according to the imaging device; obtaining the identification information from the image to be corrected according to the feature recognition technology; the identification information includes straight line elements, rectangular frame elements, rectangular identification elements, and digital identification elements; The steps of performing corresponding processing on the standard images and identification information stored in the database include: Obtaining the standard images and the identification information on the standard images; Storing the digital identification elements in the standard images and the identification information in a bound manner in the database; Processing the straight line elements, rectangular frame elements, and rectangular identification elements in the identification information to obtain distance information; The step of processing the straight line elements, rectangular frame elements, and rectangular identification elements in the identification information to obtain distance information includes: obtaining specific straight line elements, specific rectangular frame elements, and specific rectangular identification elements in the identification information; calculating a first distance value between the specific straight line element and the specific rectangular identification element; calculating a second distance value between the specific rectangular frame element and the specific rectangular identification element; calculating a proportional value between the first distance value and the second distance value, and this proportional value is the distance information, and the distance information corresponding to different test papers is different; Storing the standard images and the distance information in a bound manner in the database; Retrieving the standard image corresponding to the identification information according to the identification information; wherein, when the digital identification element cannot be recognized, retrieving the standard image according to the distance information; Calculating the corner points of the image to be corrected and the standard image, and obtaining the image skew degree information of the image to be corrected after matching the corner points of the two images; Correcting the image to be corrected according to the image skew degree information.

2. The image skew correction method according to claim 1, wherein Also including: Obtaining the to-be-corrected arrangement information of the rectangular frame in the image to be corrected according to the image to be corrected and the identification information; Obtaining the standard arrangement information of the rectangular frame in the standard image according to the standard image and the identification information; Obtaining the image occlusion degree information according to the to-be-corrected arrangement information and the standard arrangement information; Obtaining and outputting a prompt message according to the image occlusion degree information.

3. The image skew correction method according to claim 2, characterized in that, The step of obtaining the image occlusion degree information according to the to-be-corrected arrangement information and the standard arrangement information includes: Obtaining the to-be-corrected arrangement matrix according to the to-be-corrected arrangement information; Obtaining the standard arrangement matrix according to the standard arrangement information; Matching the to-be-corrected arrangement matrix and the standard arrangement matrix to obtain the rectangular frame information missing in the to-be-corrected arrangement matrix compared with the standard arrangement matrix; The missing rectangular frame information is the image occlusion degree information.

4. An image skew correction system, characterized in that, Including: An obtaining module (1) for obtaining the identification information of the image to be corrected; The obtaining module (1) is further configured to obtain the image to be corrected according to the imaging device; Obtain identification information from the image to be corrected according to feature recognition technology; the identification information includes straight line elements, rectangular frame elements, rectangular identification elements, and digital identification elements; the steps of performing corresponding processing on the standard images and identification information stored in the database include: obtaining the standard images and the identification information on the standard images; storing the digital identification elements in the standard images and the identification information in a bound manner in the database; obtaining distance information after processing the straight line elements, rectangular frame elements, and rectangular identification elements in the identification information; the step of obtaining distance information after processing the straight line elements, rectangular frame elements, and rectangular identification elements in the identification information includes: obtaining specific straight line elements, specific rectangular frame elements, and specific rectangular identification elements in the identification information; calculating a first distance value between the specific straight line element and the specific rectangular identification element; calculating a second distance value between the specific rectangular frame element and the specific rectangular identification element; calculating a proportional value between the first distance value and the second distance value, and this proportional value is the distance information; storing the standard image and the distance information in a bound manner in the database; A retrieval module (2), configured to retrieve a standard image corresponding to the identification information according to the identification information; wherein, when the digital identification element cannot be recognized, retrieve the standard image according to the distance information, and the distance information corresponding to different test papers is different; A calculation module (3), configured to calculate the corner points of the image to be corrected and the standard image, and obtain the image skew degree information of the image to be corrected after matching the corner points of the two images; A correction module (4), configured to correct the image to be corrected according to the image skew degree information.

5. An intelligent terminal, characterized in that, It includes a memory and a processor, and a computer program instruction capable of being loaded and executed by the processor, such as any one of the methods in claims 1-3, is stored on the memory.

6. A computer-readable storage medium, characterized in that, A computer program capable of being loaded and executed by the processor, such as any one of the methods in claims 1-3, is stored.

Citation Information

Patent Citations

  • Test paper and paper inspection system capable of preventing examinees from cheating

    CN103870911A

  • Answer sheet correction method and device, electronic equipment and storage medium

    CN112348019A