Image calibration method and device, terminal and storage medium

Automatically identify and calibrate images of scanning equipment through image recognition algorithms, solving the complex problem of manual calibration process and improving calibration efficiency.

CN120263906APending Publication Date: 2025-07-04BEIJING PANTUM INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410009275.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-03
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, the calibration of the Yubai of scanning equipment requires manual calibration, which is complex, cumbersome and has low efficiency.

Method used

The actual number of lines of the image to be calibrated is recognized through an image recognition algorithm, the image state is determined based on the actual and standard number of lines, calibration parameters are generated and sent to the scanning device for automatic calibration.

Benefits of technology

No manual intervention is required, which improves the efficiency of scanning equipment calibration and simplifies the calibration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120263906A_ABST
    Figure CN120263906A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image calibration method and device, a terminal and a storage medium. The method comprises the following steps: receiving a sample image and a to-be-calibrated image sent by scanning equipment; recognizing the actual line number of the to-be-calibrated image through an image recognition algorithm; determining the state of the to-be-calibrated image according to the actual line number and the standard line number, wherein the standard line number is used for indicating the line number of the sample image; if the state of the to-be-calibrated image is an abnormal state, determining a deviation distance based on the state of the to-be-calibrated image; and generating a calibration parameter according to the deviation distance, and sending the calibration parameter to the scanning device, so that the scanning device calibrates the to-be-calibrated image according to the calibration parameter. According to the technical scheme provided by the embodiment of the invention, complicated manual calibration is not needed, and the calibration efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of image calibration, and in particular, to an image calibration method, device, terminal, and storage medium.

Background Art

[0002] In the related art, for the calibration of scanning margins, it is necessary to scan a margin calibration sample sheet, and based on the scanned picture, manually distinguish and determine the parameters that need to be adjusted, and then manually adjust the parameters of the scanning device. The manual calibration process is relatively complex and cumbersome, and the calibration efficiency is relatively low.

Summary of the Invention

[0003] In view of this, the embodiments of the present invention provide an image calibration method, device, terminal, and storage medium, so as to solve the problem that the manual calibration process in the related art is relatively complex and cumbersome, and the calibration efficiency is relatively low.

[0004] In a first aspect, the embodiments of the present invention provide an image calibration method, and the method includes:

[0005] Receiving a sample image and a to-be-calibrated image sent by a scanning device;

[0006] Identifying the actual number of lines of the to-be-calibrated image through an image recognition algorithm;

[0007] Determining the state of the to-be-calibrated image according to the actual number of lines and a standard number of lines, where the standard number of lines is used to indicate the number of lines of the sample image;

[0008] If the state of the to-be-calibrated image is an abnormal state, determining a deviation distance based on the state of the to-be-calibrated image; generating a calibration parameter according to the deviation distance, and sending the calibration parameter to the scanning device for the scanning device to calibrate the to-be-calibrated image according to the calibration parameter.

[0009] In a possible implementation manner, the method further includes:

[0010] If the state of the to-be-calibrated image is a normal state, sending a calibration completion instruction to the scanning device for the scanning device to display a calibration completion message according to the calibration completion instruction; the calibration completion message is used to prompt the user that the calibration is completed.

[0011] In a possible implementation manner, the determining the state of the to-be-calibrated image according to the actual number of lines and the standard number of lines includes:

[0012] Judging whether the actual number of lines is less than the standard number of lines;

[0013] If it is determined that the actual number of lines is equal to the standard number of lines, the state of the image data to be calibrated is determined to be the normal state;

[0014] If it is determined that the actual number of lines is less than the standard number of lines, the state of the image data to be calibrated is determined to be the abnormal state.

[0015] In a possible implementation, the determining the deviation distance based on the state of the image to be calibrated includes:

[0016] Through an image recognition algorithm, recognize the actual number of special squares, the positions of the special squares, the actual number of reference lines in each special square, and the actual number of ordinary squares in each direction of the image to be calibrated;

[0017] Determine the deviation direction according to the actual number of special squares and the positions of the special squares;

[0018] Judge whether the actual number of reference lines in the special square in the deviation direction is zero;

[0019] If it is determined that the actual number of reference lines in the special square in the deviation direction is not zero, the state of the image to be calibrated is determined to be a slightly abnormal state, and a deviation distance is generated according to the actual number of reference lines and the reference distance in the deviation direction;

[0020] If it is determined that the actual number of reference lines in the special square in the deviation direction is zero, the state of the image to be calibrated is determined to be a severely abnormal state, and a deviation distance is generated according to the actual number of ordinary squares in the deviation direction, the standard number of ordinary squares in the deviation direction, the actual number of reference lines, and the reference distance.

[0021] In a possible implementation, the deviation distance includes a basic deviation distance and an accurate deviation distance;

[0022] The generating a deviation distance according to the actual number of ordinary squares in the deviation direction, the standard number of ordinary squares in the deviation direction, the actual number of reference lines, and the reference distance includes:

[0023] Take the difference between the standard number of ordinary squares in the deviation direction and the actual number of ordinary squares in the deviation direction as the number of missing ordinary squares in the deviation direction;

[0024] Generate a basic deviation distance according to the number of missing ordinary squares and the side length of the square in the deviation direction;

[0025] Generate basic calibration parameters based on the basic deviation distance, and send the basic calibration parameters to the scanning device for the scanning device to perform basic calibration on the image to be calibrated according to the basic calibration parameters;

[0026] Receive the basic calibration image sent by the scanning device, where the basic calibration image is used to indicate the image after basic calibration;

[0027] Identify the actual number of reference lines in the image to be calibrated through an image recognition algorithm;

[0028] Generate an accurate deviation distance based on the actual number of reference lines and the reference distance in the deviation direction.

[0029] In a possible implementation, the sample image is provided with a plurality of squares of equal length and width, and a special square is provided at each of the four corners of the sample image. A preset number of reference lines are provided in each special square, and the horizontal reference distance and the vertical reference distance between adjacent reference lines are equal.

[0030] In a possible implementation, the determining the deviation direction according to the actual number of special squares and the positions of the special squares includes:

[0031] If the position of the special square is on the upper side of the image to be calibrated, determine that the deviation direction is the lower side;

[0032] If the position of the special square is on the lower side of the image to be calibrated, determine that the deviation direction is the upper side;

[0033] If the position of the special square is on the left side of the image to be calibrated, determine that the deviation direction is the right side;

[0034] If the position of the special square is on the right side of the image to be calibrated, determine that the deviation direction is the left side.

[0035] In a second aspect, an embodiment of the present invention provides an image calibration device, and the device includes:

[0036] A receiving module, configured to receive a sample image and an image to be calibrated sent by a scanning device;

[0037] An identifying module, configured to identify the actual number of lines in the image to be calibrated through an image recognition algorithm;

[0038] A determining module, configured to determine the state of the image to be calibrated according to the actual number of lines and the standard number of lines, where the standard number of lines is used to indicate the number of lines in the sample image;

[0039] A first sending module, configured to, if the status of the image to be calibrated is an abnormal status, determine a deviation distance based on the status of the image to be calibrated; generate a calibration parameter according to the deviation distance, and send the calibration parameter to a scanning device for the scanning device to calibrate the image to be calibrated according to the calibration parameter.

[0040] In a third aspect, an embodiment of the present invention provides a terminal, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the terminal, cause the terminal to execute the image calibration method in the first aspect or any possible implementation manner of the first aspect.

[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored program, wherein, when the program runs, it controls the device where the computer-readable storage medium is located to execute the image calibration method in the first aspect or any possible implementation manner of the first aspect.

[0042] In the technical solution provided by the embodiment of the present invention, the terminal identifies the image to be calibrated through an image recognition algorithm, determines a calibration parameter, and sends the calibration parameter to the scanning device. The scanning device calibrates the image to be calibrated according to the calibration parameter by itself, without the need for complex manual calibration, improving the calibration efficiency.

BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.

[0044] Figure 1 It is a flowchart of an image calibration method provided by an embodiment of the present invention;

[0045] Figure 2 It is a flowchart of another image calibration method provided by an embodiment of the present invention;

[0046] Figure 3 It is a schematic diagram of a sample image provided by an embodiment of the present invention;

[0047] Figure 4 It is a schematic diagram of an image to be calibrated provided by an embodiment of the present invention;

[0048] Figure 5 It is a schematic diagram of another image to be calibrated provided by an embodiment of the present invention;

[0049] Figure 6 Another schematic diagram of an image to be calibrated provided by an embodiment of the present invention;

[0050] Figure 7 A flowchart of a deviation distance generation method provided by an embodiment of the present invention;

[0051] Figure 8 Another schematic diagram of an image to be calibrated provided by an embodiment of the present invention;

[0052] Figure 9 A schematic structural diagram of an image calibration device provided by an embodiment of the present invention;

[0053] Figure 10 A schematic diagram of a terminal provided by an embodiment of the present invention.

Detailed implementation manners

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

[0055] It should be clear that the described embodiments are only some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0056] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "said", and "the" used in the embodiments of the present invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0057] It should be understood that the term " / and" used herein is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, a and / or b can represent: a exists alone, a and b exist simultaneously, and b exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.

[0058] Depending on the context, as used herein, the word "if" can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".

[0059] Figure 1 The flowchart of an image calibration method provided by an embodiment of the present invention is as Figure 1 shown, and the method includes:

[0060] Step 101, receive a sample image and an image to be calibrated sent by a scanning device.

[0061] Each step of the embodiment of the present invention can be executed by a terminal. Among them, the terminal includes a server or a mobile terminal, and the mobile terminal includes but is not limited to a mobile phone, a tablet computer, a wearable device, etc.

[0062] Step 102, identify the actual number of lines of the image to be calibrated through an image recognition algorithm.

[0063] Step 103, determine the state of the image to be calibrated according to the actual number of lines and the standard number of lines; if the state of the image to be calibrated is an abnormal state, execute Step 104; if the state of the image to be calibrated is a normal state, execute Step 105.

[0064] Step 104, determine a deviation distance based on the state of the image to be calibrated; generate calibration parameters according to the deviation distance, and send the calibration parameters to the scanning device for the scanning device to calibrate the image to be calibrated according to the calibration parameters.

[0065] Step 105, send a calibration completion instruction to the scanning device for the scanning device to display a calibration completion message according to the calibration completion instruction.

[0066] In the technical solution provided by the embodiment of the present invention, the terminal identifies the image to be calibrated through an image recognition algorithm, determines the calibration parameters, and sends the calibration parameters to the scanning device. The scanning device calibrates the image to be calibrated according to the calibration parameters by itself, without the need for complex manual calibration, improving the calibration efficiency.

[0067] Figure 2 The flowchart of another image calibration method provided by an embodiment of the present invention is as Figure 2 shown, and the method includes:

[0068] Step 201, receive a sample image and an image to be calibrated sent by a scanning device.

[0069] Each step of the embodiments of the present invention can be executed by a terminal. Among them, the terminal includes a server or a mobile terminal, and the mobile terminal includes, but is not limited to, a mobile phone, a tablet computer, a wearable device, etc.

[0070] Figure 3 It is a schematic diagram of a sample image provided by an embodiment of the present invention, as Figure 3 shown. The sample image is provided with a plurality of squares of equal length and width. Four special squares are respectively arranged at the four corners of the sample image. A preset number of reference lines are arranged in each special square, and the horizontal reference distance and the vertical reference distance between adjacent reference lines are equal. In the example, the sample image is an A4 paper placed vertically, the size of the sample image is 210mm×297mm, the sample image is provided with 10 rows and 10 columns of squares of equal length and width, the horizontal side length of each square is 21mm, and the vertical side length is 29.7mm. Among them, four special squares are respectively arranged at the four corners of the sample image. Four reference lines are arranged in each special square. The horizontal reference distance between adjacent reference lines among the four reference lines is 4.2mm, and the vertical reference distance is 5.94mm. The squares other than the special squares are ordinary squares, and there are no reference lines in the ordinary squares. In practical applications, the horizontal reference distance and the vertical reference distance can be adjusted according to the actual situation. The horizontal reference distance and the vertical reference distance can be the same or different. For example, both the horizontal reference distance and the vertical reference distance between adjacent reference lines are 4.2mm.

[0071] Step 202: Identify the actual number of lines in the image to be calibrated through an image recognition algorithm.

[0072] In this step, the image recognition algorithm can include opencv Hough line transform (detecting lines in an image), LSD (Line Segment Detector) line extraction algorithm, etc.

[0073] The lines in the image to be calibrated include reference lines and dividing lines. Among them, the reference lines are arranged in the special squares, and the dividing lines are used to divide the sample image to obtain a plurality of squares of equal length and width. The actual number of lines in the image to be calibrated is the sum of the actual number of reference lines and the actual number of dividing lines. Among them, the actual number of reference lines in the image to be calibrated is the sum of the actual number of reference lines in each special square of the image to be calibrated.

[0074] Step 203: Determine whether the actual number of lines is less than the standard number of lines. If it is determined that the actual number of lines is equal to the standard number of lines, then execute step 204; if it is determined that the actual number of lines is less than the standard number of lines, then execute step 206.

[0075] In this step, the standard line number is used to indicate the number of lines in the sample image. The lines in the sample image include reference lines and dividing lines. Among them, the reference lines are set in special squares, and the dividing lines are used to divide the sample image to obtain a plurality of squares with equal length and width. The standard line number is the sum of the reference line number and the dividing line number. For example, there is one special square at each of the four corners of the standard sample, that is, the number of special squares in the standard sample is 4, and there are four reference lines in each special square, so the number of reference lines in the sample image is 16.

[0076] Step 204: Determine that the status of the image data to be calibrated is the normal status.

[0077] Step 205: Send a calibration completion instruction to the scanning device for the scanning device to display a calibration completion message according to the calibration completion instruction.

[0078] In this step, the calibration completion message is used to prompt the user that the calibration is completed. When the terminal is a server, only the scanning device displays the calibration completion message to prompt the user that the calibration is completed; when the terminal is a mobile terminal, the calibration completion message is displayed through the scanning device and the user terminal to prompt the user that the calibration is completed.

[0079] Step 206: Determine that the status of the image data to be calibrated is the abnormal status.

[0080] In this step, the abnormal status includes a slight abnormal status and a serious abnormal status.

[0081] Step 207: Through an image recognition algorithm, identify the actual number of special squares, the positions of the special squares, the actual number of reference lines in each special square, and the actual number of ordinary squares in each direction of the image to be calibrated.

[0082] In this step, the actual number of ordinary squares in each direction includes the actual number of ordinary squares in the horizontal direction and the actual number of ordinary squares in the vertical direction.

[0083] Step 208: Determine the deviation direction according to the actual number of special squares and the positions of the special squares.

[0084] In this step, if the position of the special square is on the upper side of the image to be calibrated, the deviation direction is the lower side; if the position of the special square is on the lower side of the image to be calibrated, the deviation direction is the upper side; if the position of the special square is on the left side of the image to be calibrated, the deviation direction is the right side; if the position of the special square is on the right side of the image to be calibrated, the deviation direction is the left side.

[0085] Step 209: Determine whether the actual number of reference lines in the special square in the deviation direction is zero. If it is determined that the actual number of reference lines in the special square in the deviation direction is not zero, then execute Step 210; if it is determined that the actual number of reference lines in the special square in the deviation direction is zero, then execute Step 211.

[0086] In this step, if it is determined that the actual number of reference lines in the special square in the deviation direction is not zero, it indicates that only a part of the special square in the deviation direction of the image to be calibrated is missing, then execute Step 210; if it is determined that the actual number of reference lines in the special square in the deviation direction is zero, it indicates that at least the entire special square in the deviation direction of the image to be calibrated is missing, then execute Step 211. Specifically, when the actual number of reference lines in the special square in the deviation direction is zero, the special square in the deviation direction is completely missing and the ordinary square is not missing; or, the special square in the deviation direction is completely missing and the ordinary square is also missing.

[0087] Step 210: Determine that the state of the image to be calibrated is a slightly abnormal state, and generate a deviation distance according to the actual number of reference lines and the reference distance in the deviation direction.

[0088] In this step, a preset number of reference lines is set in each special square of the sample image. The difference between the preset number and the actual number of reference lines of the image to be calibrated is used as the number of missing reference lines, and the deviation distance is the product of the number of missing reference lines and the reference distance in the deviation direction. When the deviation direction is the upper side or the lower side, the reference distance in the deviation direction is the longitudinal reference distance; when the deviation direction is the left side or the right side, the reference distance in the deviation direction is the horizontal reference distance.

[0089] Figure 4 is a schematic diagram of an image to be calibrated provided by an embodiment of the present invention. As Figure 4 shown, the actual number of special squares of the image to be calibrated is two, and the positions of the two special squares are on the right side of the image to be calibrated, then the deviation direction is the left side, and the reference distance in the deviation direction is the horizontal reference distance. The image to be calibrated only has a partial missing of the special square on the left side, and there are still some reference lines in the special square on the left side. The state of the image to be calibrated is a slightly abnormal state. For example, 4 reference lines are set in each special square of the sample image, and the horizontal reference distance between adjacent reference lines is 4.2 mm. The actual number of reference lines in each special square on the left side of the image to be calibrated is 2, the number of missing reference lines is 2, and the deviation distance is the product of the number of missing reference lines and the horizontal reference distance, that is, the deviation distance is 8.4 mm.

[0090] Figure 5 is another schematic diagram of an image to be calibrated provided by an embodiment of the present invention. As Figure 5As shown in the figure, the actual number of special squares in the image to be calibrated is two, and the positions of the two special squares are located on the lower side of the image to be calibrated. Then, the deviation direction is the upper side, and the reference distance in the deviation direction is the longitudinal reference distance. Only a part of the upper special squares in the image to be calibrated is missing, and there are still some reference lines in the upper special squares. The state of the image to be calibrated is a slightly abnormal state. For example, there are 4 reference lines in each special square of the sample image, and the longitudinal reference distance between adjacent reference lines is 5.94 mm. The actual number of reference lines in each special square located on the upper side of the image to be calibrated is 2, the number of missing reference lines is 2, and the deviation distance is the product of the number of missing reference lines and the horizontal reference distance, that is, the deviation distance is 11.88 mm.

[0091] Step 211: Determine that the state of the image to be calibrated is a severely abnormal state, and generate a deviation distance based on the actual number of ordinary squares in the deviation direction, the standard number of ordinary squares in the deviation direction, the actual number of reference lines, and the reference distance.

[0092] Figure 6 Another schematic diagram of the image to be calibrated provided by an embodiment of the present invention is shown in Figure 6 As shown in the figure, the actual number of special squares in the image to be calibrated is two, and the positions of the two special squares are located on the right side of the image to be calibrated. Then, the deviation direction is the left side, and the reference distance in the deviation direction is the horizontal reference distance. There is a complete absence of the left special squares in the image to be calibrated, there are no reference lines in the left special squares, and there is no absence of ordinary squares. The state of the image to be calibrated is a severely abnormal state. For example, there are 4 reference lines in each special square of the sample image, the horizontal reference distance between adjacent reference lines is 4.2 mm, and the longitudinal reference distance is 5.94 mm. The actual number of reference lines in each special square located on the left side of the image to be calibrated is 0, the number of missing reference lines is 4, and the deviation distance is the product of the number of missing reference lines and the horizontal reference distance, that is, the deviation distance is 16.8 mm.

[0093] Figure 7 A flowchart of a method for generating a deviation distance provided by an embodiment of the present invention is shown in Figure 7 As shown in the figure, step 211 may specifically include:

[0094] Step 2111: Take the difference between the standard number of ordinary squares in the deviation direction and the actual number of ordinary squares in the deviation direction as the number of missing ordinary squares in the deviation direction.

[0095] Figure 8 Another schematic diagram of the image to be calibrated provided by an embodiment of the present invention is shown in Figure 8As shown, the deviation direction is to the left, and the reference distance in the deviation direction is the horizontal reference distance. There is a complete absence of squares on the left side of the image to be calibrated. There are no reference lines in the special squares on the left side, and there are missing ordinary squares. The actual number of ordinary squares in the horizontal direction is 5. The state of the image to be calibrated is a severely abnormal state. For example, if there are two special squares and eight ordinary squares respectively in each row and each column where each special square of the sample image is located, then the number of missing ordinary squares in the deviation direction is 3.

[0096] Step 2112: Generate a basic deviation distance based on the number of missing ordinary squares in the deviation direction and the side length of the squares in the deviation direction.

[0097] In this step, the basic deviation distance is the product of the number of missing ordinary squares in the deviation direction and the side length of the squares in the deviation direction. When the deviation direction is upward or downward, the side length of the squares in the deviation direction is the vertical side length; when the deviation direction is to the left or right, the side length of the squares in the deviation direction is the horizontal side length. For example, if the deviation direction is to the left, the side length of the squares in the deviation direction is the horizontal side length, the number of missing ordinary squares in the deviation direction is 3, and the horizontal side length of each square is 21 mm, then the basic deviation distance is 63 mm.

[0098] Step 2113: Generate basic calibration parameters based on the basic deviation distance and send the basic calibration parameters to the scanning device for the scanning device to perform basic calibration on the image to be calibrated according to the basic calibration parameters.

[0099] Step 2114: Receive the basic calibration image sent by the scanning device.

[0100] In this step, the basic calibration image is used to indicate the image after basic calibration.

[0101] Step 2115: Identify the actual number of reference lines in the image to be calibrated through an image recognition algorithm.

[0102] Step 2116: Generate an accurate deviation distance based on the actual number of reference lines and the reference distance in the deviation direction.

[0103] In the embodiments of the present invention, the description of Step 2116 can refer to the description of Step 210, which will not be repeated here. In the severely abnormal state where the special squares in the deviation direction are completely missing and there are also missing ordinary squares, the deviation distance is the sum of the basic deviation distance and the accurate deviation distance.

[0104] Figure 9 It is a schematic structural diagram of an image calibration device provided by an embodiment of the present invention, as Figure 9As shown in the figure, the device includes a receiving module 11, an identifying module 12, a determining module 13, and a first transmitting module 14. The receiving module 11 is connected to the identifying module 12, the identifying module 12 is connected to the determining module 13, and the determining module 13 is connected to the first transmitting module 14. The receiving module 11 is configured to receive a sample image and a to-be-calibrated image sent by a scanning device. The identifying module 12 is configured to identify the actual number of lines of the to-be-calibrated image through an image recognition algorithm. The determining module 13 is configured to determine the state of the to-be-calibrated image according to the actual number of lines and a standard number of lines, where the standard number of lines is used to indicate the number of lines of the sample image. The first transmitting module 14 is configured to, if the determining module 13 determines that the state of the to-be-calibrated image is an abnormal state, determine a deviation distance based on the state of the to-be-calibrated image; generate calibration parameters according to the deviation distance, and send the calibration parameters to the scanning device for the scanning device to calibrate the to-be-calibrated image according to the calibration parameters.

[0105] In an embodiment of the present invention, the device further includes a second transmitting module 15. The second transmitting module 15 is connected to the determining module 13. The second transmitting module 15 is configured to, if the determining module 13 determines that the state of the to-be-calibrated image is a normal state, send a calibration completion instruction to the scanning device for the scanning device to display calibration completion information according to the calibration completion instruction; the calibration completion information is used to prompt the user that the calibration is completed.

[0106] In an embodiment of the present invention, the determining module 13 is specifically configured to determine whether the actual number of lines is less than the standard number of lines; if it is determined that the actual number of lines is equal to the standard number of lines, determine that the state of the to-be-calibrated image data is a normal state; if it is determined that the actual number of lines is less than the standard number of lines, determine that the state of the to-be-calibrated image data is an abnormal state.

[0107] In an embodiment of the present invention, the first sending module 14 includes an identification unit 141, a first determination unit 142, a judgment unit 143, a second determination unit 144, and a third determination unit 145. The identification unit 141 is configured to identify the actual number of special squares, the positions of the special squares, the actual number of reference lines in each special square, and the actual number of ordinary squares in each direction of the image to be calibrated through an image recognition algorithm. The first determination unit 142 is configured to determine the deviation direction according to the actual number of special squares and the positions of the special squares. The judgment unit 143 is configured to judge whether the actual number of reference lines in the special square in the deviation direction is zero. The second determination unit 144 is configured to, if the judgment unit 143 determines that the actual number of reference lines in the special square in the deviation direction is not zero, determine that the state of the image to be calibrated is a slightly abnormal state, and generate a deviation distance according to the actual number of reference lines and the reference distance in the deviation direction. The third determination unit 145 is configured to, if the judgment unit 143 determines that the actual number of reference lines in the special square in the deviation direction is zero, determine that the state of the image to be calibrated is a severely abnormal state, and generate a deviation distance according to the actual number of ordinary squares in the deviation direction, the standard number of ordinary squares in the deviation direction, the actual number of reference lines, and the reference distance.

[0108] In an embodiment of the present invention, the deviation distance includes a basic deviation distance and an accurate deviation distance. Specifically, the third determination unit 145 is configured to use the difference between the standard number of ordinary squares in the deviation direction and the actual number of ordinary squares in the deviation direction as the number of missing ordinary squares in the deviation direction; generate a basic deviation distance according to the number of missing ordinary squares and the side length of the square in the deviation direction; generate a basic calibration parameter according to the basic deviation distance, and send the basic calibration parameter to the scanning device for the scanning device to perform basic calibration on the image to be calibrated according to the basic calibration parameter; receive the basic calibration image sent by the scanning device, where the basic calibration image is used to indicate the image after basic calibration; identify the actual number of reference lines of the image to be calibrated through an image recognition algorithm; and generate an accurate deviation distance according to the actual number of reference lines and the reference distance in the deviation direction.

[0109] In an embodiment of the present invention, specifically, the first determination unit 142 is configured to, if the position of the special square is on the upper side of the image to be calibrated, determine that the deviation direction is the lower side; if the position of the special square is on the lower side of the image to be calibrated, determine that the deviation direction is the upper side; if the position of the special square is on the left side of the image to be calibrated, determine that the deviation direction is the right side; and if the position of the special square is on the right side of the image to be calibrated, determine that the deviation direction is the left side.

[0110] In the technical solution provided by the embodiment of the present invention, the image recognition algorithm is used to recognize the image to be calibrated, and the calibration parameters are determined. The calibration parameters are sent to the scanning device, and the scanning device calibrates the image to be calibrated according to the calibration parameters by itself, without complex manual calibration, improving the calibration efficiency.

[0111] The embodiment of the present invention provides a computer-readable storage medium. The computer-readable storage medium includes a stored program. When the program runs, it controls the device where the computer-readable storage medium is located to execute the embodiment of the above image calibration method.

[0112] Figure 10 FIG. is a schematic diagram of a terminal provided by an embodiment of the present invention. The terminal 3 in this embodiment includes: a processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the processor 31. When the computer program 33 is executed by the processor 31, it implements the image calibration method in the embodiment. To avoid repetition, it will not be elaborated here one by one.

[0113] The terminal 3 includes, but is not limited to, a processor 31 and a memory 32. Those skilled in the art can understand that Figure 10 This is only an example of the terminal 3 and does not constitute a limitation on the terminal 3. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the network device may also include input / output devices, network access devices, buses, etc.

[0114] The so-called processor 31 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0115] The memory 32 can be an internal storage unit of the terminal 3, such as the hard disk or memory of the terminal 3. The memory 32 can also be an external storage device of the terminal 3, such as a plug-in hard disk equipped on the terminal 3, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 32 can also include both the internal storage unit of the terminal 3 and the external storage device. The memory 32 is used to store computer programs and other programs and data required by the network device. The memory 32 can also be used to temporarily store the data that has been output or will be output.

[0116] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0117] In the description of this specification, the descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0118] Any process or method description in the flowchart or described in other ways herein can be understood to represent a module, segment, or part of code including one or more executable instructions for implementing a customized logic function or process, and the scope of the preferred embodiments of the present invention includes additional implementations, where the functions can be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0119] Depending on the context, the word "if" as used herein can be interpreted as "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)".

[0120] In several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be an indirect coupling or communication connection through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0121] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. An image calibration method, characterized in that, The method includes: Receiving a proof image and a to-be-calibrated image sent by a scanning device; Identifying the actual number of lines in the to-be-calibrated image through an image recognition algorithm; Determining the state of the to-be-calibrated image according to the actual number of lines and a standard number of lines, where the standard number of lines is used to indicate the number of lines in the proof image; If the state of the to-be-calibrated image is an abnormal state, determining a deviation distance based on the state of the to-be-calibrated image; generating a calibration parameter according to the deviation distance, and sending the calibration parameter to the scanning device for the scanning device to calibrate the to-be-calibrated image according to the calibration parameter.

2. The method according to claim 1, characterized in that, The method further includes: If the state of the to-be-calibrated image is a normal state, sending a calibration completion instruction to the scanning device for the scanning device to display a calibration completion message according to the calibration completion instruction; the calibration completion message is used to prompt the user that the calibration is completed.

3. The method according to claim 1, wherein The determining the state of the to-be-calibrated image according to the actual number of lines and the standard number of lines includes: Judging whether the actual number of lines is less than the standard number of lines; If it is judged that the actual number of lines is equal to the standard number of lines, determining that the state of the to-be-calibrated image data is a normal state; If it is judged that the actual number of lines is less than the standard number of lines, determining that the state of the to-be-calibrated image data is an abnormal state.

4. The method according to claim 1, wherein The determining the deviation distance based on the state of the to-be-calibrated image includes: Identifying the actual number of special squares, the positions of special squares, the actual number of reference lines in each special square, and the actual number of ordinary squares in each direction in the to-be-calibrated image through an image recognition algorithm; Determining a deviation direction according to the actual number of special squares and the positions of the special squares; Judging whether the actual number of reference lines in the special square in the deviation direction is zero; If it is judged that the actual number of reference lines in the special square in the deviation direction is not zero, determining that the state of the to-be-calibrated image is a slightly abnormal state, and generating a deviation distance according to the actual number of reference lines and the reference distance in the deviation direction; If it is judged that the actual number of reference lines in the special square in the deviation direction is zero, determining that the state of the to-be-calibrated image is a severely abnormal state, and generating a deviation distance according to the actual number of ordinary squares in the deviation direction, the standard number of ordinary squares in the deviation direction, the actual number of reference lines, and the reference distance.

5. The method according to claim 4, characterized in that, The deviation distance includes a basic deviation distance and an accurate deviation distance; The generating a deviation distance according to the actual number of ordinary squares in the deviation direction, the standard number of ordinary squares in the deviation direction, the actual number of reference lines, and the reference distance includes: Taking the difference between the standard number of ordinary squares in the deviation direction and the actual number of ordinary squares in the deviation direction as the number of missing ordinary squares in the deviation direction; Generating a basic deviation distance according to the number of missing ordinary squares and the side length of the square in the deviation direction; Generate basic calibration parameters based on the described basic deviation distance, and send the basic calibration parameters to the scanning device for the scanning device to perform basic calibration on the image to be calibrated according to the basic calibration parameters; Receive the basic calibration image sent by the scanning device, where the basic calibration image is used to indicate the image after basic calibration; Identify the actual number of reference lines in the image to be calibrated through an image recognition algorithm; Generate an accurate deviation distance based on the actual number of reference lines and the reference distance in the deviation direction.

6. The method according to claim 1, wherein The sample image is provided with a plurality of squares of equal length and width, and a special square is provided at each of the four corners of the sample image. A preset number of reference lines are provided in each special square, and the horizontal reference distance and the vertical reference distance between adjacent reference lines are equal.

7. The method according to claim 4, wherein The determining the deviation direction according to the actual number of special squares and the positions of the special squares includes: If the position of the special square is on the upper side of the image to be calibrated, determine that the deviation direction is the lower side; If the position of the special square is on the lower side of the image to be calibrated, determine that the deviation direction is the upper side; If the position of the special square is on the left side of the image to be calibrated, determine that the deviation direction is the right side; If the position of the special square is on the right side of the image to be calibrated, determine that the deviation direction is the left side.

8. An image calibration device, characterized in that, The apparatus includes: A receiving module, configured to receive the sample image and the image to be calibrated sent by the scanning device; An identifying module, configured to identify the actual number of lines in the image to be calibrated through an image recognition algorithm; A determining module, configured to determine the state of the image to be calibrated according to the actual number of lines and the standard number of lines, where the standard number of lines is used to indicate the number of lines in the sample image; A first sending module, configured to, if the state of the image to be calibrated is an abnormal state, determine a deviation distance based on the state of the image to be calibrated; generate calibration parameters according to the deviation distance, and send the calibration parameters to the scanning device for the scanning device to calibrate the image to be calibrated according to the calibration parameters.

9. A terminal, characterized in that, Comprises: One or more processors; A memory; And one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the terminal, cause the terminal to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program runs, it controls the device where the computer-readable storage medium is located to execute the method according to any one of claims 1 to 7.