Image calibration method and system

By using image calibration methods in electronic devices, the calibration matrix is ​​determined using standard templates and actual images, and the target image is calibrated, the problem of poor image quality is solved and high-quality and uniform image acquisition is achieved.

CN119316709APending Publication Date: 2025-01-14BEIJING VISIONOX TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411630765.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In the prior art, the image quality obtained by electronic devices is poor, and there are problems of distortion and low uniformity.

Method used

By using an image calibration method in an electronic device, the image calibration matrix is ​​determined using the standard templates acquired by the camera and the actual image, the calibration process of the target image is performed, the post-calibration image is acquired, manual participation is reduced, and the uniformity and quality of the image are improved.

Benefits of technology

Accurate image calibration is realized, the degree of distortion is reduced, the image quality acquired by electronic devices is improved, manual error is reduced, and the calibration accuracy is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316709A_ABST
    Figure CN119316709A_ABST
Patent Text Reader

Abstract

The invention relates to an image calibration method and system. The method comprises the following steps: in response to a target image collected by a camera, determining an image calibration matrix of the camera according to an actual image of a standard template collected by the camera and a standard image of the standard template, and carrying out calibration processing on the target image according to the image calibration matrix to obtain a calibrated image of the target image, the lens focusing parameter of the camera for collecting the actual image is the same as the lens focusing parameter of the camera for collecting the target image. By adopting the method, the corresponding image calibration matrix can be determined through the actual image of the standard template acquired by the camera, and the actual image is acquired when the lens focusing parameter of the camera is the same as the lens focusing parameter of the to-be-calibrated image, so that the to-be-calibrated image can be accurately calibrated through the image calibration matrix; therefore, the distortion degree of the image finally obtained by the electronic equipment is small, the uniformity is high, and the quality of the image obtained by the electronic equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of display technology, and in particular to an image calibration method and system. Background Art

[0002] With the development of science and technology, shooting technology has been widely used in electronic devices such as televisions, computers, and mobile phones, forming electronic devices with camera shooting functions.

[0003] In the related art, before an electronic device uses a camera to take pictures, it is necessary to first focus the camera lens, and then collect image data through the camera to obtain a high-definition image.

[0004] However, the image obtained by the electronic device in the related art has the problem of poor quality. Summary of the invention

[0005] Based on this, it is necessary to provide an image calibration method and system to address the above technical issues, which can improve the quality of images acquired by electronic devices.

[0006] In a first aspect, an embodiment of the present application provides an image calibration method, the method comprising:

[0007] In response to the target image captured by the camera, an image calibration matrix of the camera is determined according to the actual image of the standard template captured by the camera and the standard image of the standard template; the lens focus parameters of the camera for capturing the actual image are the same as the lens focus parameters of the camera for capturing the target image;

[0008] According to the image calibration matrix, the target image is calibrated to obtain a calibrated image of the target image.

[0009] In one embodiment, determining the image calibration matrix of the camera according to the actual image of the standard template and the standard image of the standard template captured by the camera includes:

[0010] Acquire at least one first position matrix corresponding to a plurality of calibration points in the actual image; and acquire at least one second position matrix corresponding to a plurality of standard points in the standard image;

[0011] Determining compensation matrices according to the first position matrices and the second position matrices;

[0012] Each compensation matrix is ​​combined to obtain an image calibration matrix.

[0013] In one embodiment, the actual image includes a plurality of actual image blocks; obtaining at least one first position matrix corresponding to a plurality of calibration points in the actual image includes:

[0014] Perform convolution processing on each actual image block according to the convolution kernel to obtain the center position of the center of each actual image block;

[0015] Obtaining an actual quadrilateral formed by the centers of each of the four adjacent actual image blocks in the centers of each actual image block;

[0016] For any actual quadrilateral, determining a first position matrix of a plurality of calibration points in the actual quadrilateral according to the center positions of the actual quadrilateral and the corresponding four actual image block centers;

[0017] In one embodiment, the standard image includes a plurality of standard image blocks; obtaining at least one second position matrix corresponding to a plurality of standard points in the standard image includes:

[0018] According to each standard image block, a center position of the center of each standard image block is obtained;

[0019] Obtaining a standard quadrilateral formed by the centers of each of the four adjacent standard image blocks in the center of each standard image block;

[0020] For any standard quadrilateral, a second position matrix of a plurality of standard points in the standard quadrilateral is determined according to the center positions of the standard quadrilateral and the centers of the corresponding four standard image blocks.

[0021] In one embodiment, determining each compensation matrix according to each first position matrix and each second position matrix includes:

[0022] For any first position matrix, performing arithmetic operations on the elements at each initial position in the first position matrix and the elements at the corresponding initial position in the second position matrix to obtain operation results for the elements at each corresponding initial position;

[0023] The compensation matrix is ​​determined according to the operation results of the elements at the corresponding initial positions.

[0024] In one embodiment, merging the compensation matrices to obtain an image calibration matrix includes:

[0025] The compensation matrices are spliced ​​according to the target arrangement position to obtain an initial calibration matrix; the target arrangement position is the arrangement position of each actual image block in the actual image or the arrangement position of each standard image block in the standard image;

[0026] The image calibration matrix is ​​determined by performing cropping processing according to the initial calibration matrix.

[0027] In one embodiment, performing a cropping process according to an initial calibration matrix to determine an image calibration matrix includes:

[0028] An image calibration matrix is ​​obtained by deleting any row element from every two adjacent rows of identical elements in the initial calibration matrix, and / or deleting any column element from every two adjacent columns of identical elements in the initial calibration matrix.

[0029] In one embodiment, performing calibration processing on a target image according to an image calibration matrix to obtain a calibrated image of the target image includes:

[0030] Determine a plurality of corresponding target positions according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image;

[0031] According to each target position and target image, a calibrated image is obtained.

[0032] In one embodiment, the elements include a horizontal coordinate and a vertical coordinate; the initial position includes an initial row position and an initial column position; and the corresponding multiple target positions are determined according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image, including:

[0033] For any initial position, determine the target row position according to the abscissa of the initial position and the initial row position of the initial position in the image calibration matrix;

[0034] Obtaining the target column position according to the ordinate and the initial column position of the initial position in the image calibration matrix;

[0035] According to the target row position and the target column position, the corresponding target position is determined.

[0036] In one embodiment, obtaining a calibrated image according to each target position and target image includes:

[0037] The pixel values ​​corresponding to each target position in the target image are respectively used as the pixel values ​​of the corresponding initial positions in the calibrated image;

[0038] A calibrated image is generated based on the pixel values ​​at each initial position.

[0039] In a second aspect, an embodiment of the present application provides an image calibration system, the system comprising: an electronic device and an image acquisition system, the image acquisition system comprising an electronic device and a standard template of a camera, the electronic device comprising a camera, a lens of the camera and a surface light source;

[0040] A camera, used to collect a target image through a lens and to collect an actual image of a standard template placed on a surface light source;

[0041] An electronic device, used to execute the steps of the method of any embodiment in the first aspect above.

[0042] In a third aspect, an embodiment of the present application provides an image calibration device, the device comprising:

[0043] A determination module, for determining an image calibration matrix of the camera in response to a target image captured by the camera, according to an actual image of a standard template captured by the camera and a standard image of the standard template; a lens focus parameter of the camera capturing the actual image is the same as a lens focus parameter of the camera capturing the target image;

[0044] The calibration module is used to perform calibration processing on the target image according to the image calibration matrix to obtain a calibrated image of the target image.

[0045] In a fourth aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the method of any embodiment of the first aspect when executing the computer program.

[0046] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method of any embodiment in the above-mentioned first aspect are implemented.

[0047] In a sixth aspect, an embodiment of the present application further provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the steps of the method of any embodiment in the first aspect above.

[0048] The image calibration method and system provided by the embodiment of the present application include: in response to the target image captured by the camera, according to the actual image of the standard template captured by the camera and the standard image of the standard template, determining the image calibration matrix of the camera, and calibrating the target image according to the image calibration matrix to obtain the calibrated image of the target image, wherein the lens focus parameters of the camera capturing the actual image are the same as the lens focus parameters of the camera capturing the target image. The above method can determine the image calibration matrix of the camera through the actual image of the standard template captured by the camera, wherein, since the actual image is captured when the lens focus parameters of the camera are the same as the lens focus parameters of the image to be calibrated, the image to be calibrated can be accurately calibrated through the acquired image calibration matrix, further making the distortion degree of the image finally acquired by the electronic device smaller and the uniformity higher, thereby improving the quality of the image finally acquired by the electronic device; at the same time, the above method does not require manual participation, so that the error caused by manual participation in the image calibration process can be reduced, thereby improving the accuracy of image calibration, and greatly improving the quality of the image acquired by the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] FIG1 is a diagram of an application environment of an image calibration method according to an embodiment;

[0050] FIG2 is a schematic diagram of a flow chart of an image calibration method in one embodiment;

[0051] FIG3 is a schematic diagram of a standard image of a standard template in one embodiment;

[0052] FIG4 is a schematic flow chart of an image calibration method in another embodiment;

[0053] FIG5 is a schematic flow chart of an image calibration method in another embodiment;

[0054] FIG6 is a schematic diagram showing the position distribution of centers of multiple actual image blocks in an actual image in one embodiment;

[0055] FIG7 is a schematic flow chart of an image calibration method in another embodiment;

[0056] FIG8 is a schematic diagram showing the position distribution of centers of multiple standard image blocks in a standard image in one embodiment;

[0057] FIG9 is a schematic flow chart of an image calibration method in another embodiment;

[0058] FIG10 is a diagram showing a superimposed image of an actual quadrilateral in an actual image and a corresponding standard quadrilateral in a standard image in one embodiment;

[0059] FIG11 is a flow chart of an image calibration method according to another embodiment;

[0060] FIG12 is a schematic flow chart of an image calibration method in another embodiment;

[0061] FIG13 is a schematic flow chart of an image calibration method in another embodiment;

[0062] FIG14 is a schematic flow chart of an image calibration method in another embodiment;

[0063] FIG15 is a block diagram of an image calibration device according to an embodiment;

[0064] FIG. 16 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0066] In the field of electronic devices with camera shooting functions, images captured by the camera are usually output and displayed on the display panel of the electronic device. In the related art, before an electronic device uses a camera to shoot, it is necessary to focus the lens of the camera first, and then collect image data through the camera to obtain a high-definition image. However, due to the imaging characteristics of the lens itself, the image obtained by the electronic device in the related art has the problem of poor quality. Based on this, an embodiment of the present application provides an image calibration method that can improve the quality of the image obtained by the electronic device.

[0067] The image calibration method provided in the embodiment of the present application can be applied to an image calibration system, wherein the image calibration system includes an electronic device and a standard template of a camera, wherein the electronic device includes a camera, a lens of the camera, and a surface light source, as shown in FIG1 , which is an application scenario diagram between a camera, a lens of the camera, a surface light source, and a standard template on an electronic device in an image calibration system. Among them, the above-mentioned electronic device can be a device with data processing function such as a television, a computer, a mobile phone, a smart watch, a smart bracelet, a car, etc., and the camera in the electronic device can be a main camera, a telephoto camera, a wide-angle camera, a macro camera, and a depth of field camera, etc., which is not limited to the embodiment of the present application. Optionally, the above-mentioned surface light source can be composed of a light-emitting device, a light source, and a panel in an electronic device. At the same time, the standard template of the above-mentioned camera can be formed by printing a plurality of black areas on a film glass; the size of each black area in the standard template is equal, the size of the transparent area between each two adjacent black areas is equal, and the size of the transparent area between each two adjacent black areas is equal to the size of the black area. The following embodiments will specifically introduce the specific process of the image calibration method, and will introduce the specific process of the image calibration method by taking the execution subject as an electronic device; wherein the electronic device may be an electronic device in the image calibration system, or may be another electronic device outside the image calibration system, which is not limited in the embodiments of the present application.

[0068] As shown in FIG2 , it is a schematic diagram of a flow chart of an image calibration method provided in an embodiment of the present application. The method may include the following steps:

[0069] S100, in response to a target image captured by a camera, determining an image calibration matrix of the camera according to an actual image of a standard template and a standard image of the standard template captured by the camera, wherein the lens focus parameters of the camera for capturing the actual image and the lens focus parameters of the camera for capturing the target image are the same.

[0070] Among them, the camera in the electronic device can receive the image acquisition instruction in real time, and in response to the image acquisition instruction, acquire the target image. In practical applications, the camera can first acquire the optical data of the target image, then convert the optical data into image data, and then generate the target image based on the image data. Correspondingly, the actual image is also generated through this process.

[0071] Optionally, the image acquisition instruction may be input by the user through voice, gesture, button, etc.; the target image may be an image in any scene (such as sports scene, teaching scene, work scene, landscape scene, etc.). Optionally, the size of the target image may be determined according to the field of view of the camera.

[0072] Furthermore, after the electronic device acquires the target image captured by the camera, it can determine the image calibration matrix of the camera in response to the target image according to the actual image of the standard template captured by the camera and the standard image of the standard template.

[0073] In practical applications, the camera in the electronic device can also collect the actual image of the standard template. It should be noted here that the above actual image and target image are both original images collected by the camera in the electronic device, and both the actual image and the target image have the problem of poor uniformity or distortion.

[0074] In the embodiment of the present application, the standard image of the standard template may be an image with good uniformity and no distortion under ideal conditions; a standard image of a standard template is shown in FIG3. Meanwhile, the size of the standard image may be greater than or equal to the size of the actual image.

[0075] The size of the actual image corresponds to the size of the camera's image calibration matrix. For example, if the actual image is 256*256 pixels, the camera's image calibration matrix can be a 256*256 matrix.

[0076] In one embodiment, the method of determining the image calibration matrix of the camera according to the actual image of the standard template and the standard image of the standard template captured by the camera can be to pre-train a calibration matrix determination model, and then input the actual image of the standard template and the standard image of the standard template into the calibration matrix determination model, and the calibration matrix determination model outputs the image calibration matrix. Optionally, the calibration matrix determination model can be implemented by at least one of a convolutional neural network model, a recurrent neural network model, a long short-term memory neural network model, a fully connected neural network model, etc.

[0077] In another embodiment, the camera image calibration matrix can be determined based on the actual image of the standard template and the standard image of the standard template captured by the camera, and can also be determined by performing arithmetic operations on the coordinates of each pixel position in the actual image and the coordinates of the corresponding pixel position in the standard image to obtain the arithmetic operation results of the corresponding pixel positions, and combining the arithmetic operation results of all pixel positions to obtain the camera image calibration matrix. Optionally, the arithmetic operation can be implemented by at least one of addition, subtraction, multiplication, exponential operation, logarithmic operation, etc.

[0078] It should be noted here that the lens focus parameters of the above-mentioned camera can be understood as the rotation angle of the lens, and can also be understood as the relative position between the lens and the photosensitive chip in the camera. In addition, there is a one-to-one correspondence between the lens focus parameters of the camera and the image calibration matrix of the camera; for the same camera, different lens focus parameters correspond to different image calibration matrices. Correspondingly, in the embodiment of the present application, the lens focus parameters of the camera that captures the actual image are the same as the lens focus parameters of the camera that captures the target image, so that the target image can be accurately calibrated according to the image calibration matrix.

[0079] S200 , calibrating the target image according to the image calibration matrix to obtain a calibrated image of the target image.

[0080] Specifically, the electronic device may use an image calibration algorithm to perform calibration processing on the target image according to the image calibration matrix to obtain a calibrated image of the target image.

[0081] Optionally, the above-mentioned image calibration algorithm may be a bright field uniformity correction method, a lookup table correction method, a gamma correction method, etc. In the embodiment of the present application, the size of the image calibration matrix corresponds to the size of the calibrated image.

[0082] In the technical solution of the embodiment of the present application, in response to the target image captured by the camera, the image calibration matrix of the camera is determined according to the actual image of the standard template captured by the camera and the standard image of the standard template, and the target image is calibrated according to the image calibration matrix to obtain a calibrated image of the target image, wherein the lens focusing parameters of the actual image captured by the camera are the same as the lens focusing parameters of the target image captured; the above method can determine the image calibration matrix of the camera through the actual image of the standard template captured by the camera, wherein, since the actual image is captured when the lens focusing parameters of the camera are the same as the lens focusing parameters of the image to be calibrated, the image to be calibrated can be accurately calibrated through the acquired image calibration matrix, further making the distortion degree of the image finally acquired by the electronic device smaller and the uniformity higher, thereby improving the quality of the image finally acquired by the electronic device; at the same time, the above method does not require manual participation, so that the errors caused by manual participation in the image calibration process can be reduced, thereby improving the accuracy of image calibration, and greatly improving the quality of the image acquired by the electronic device.

[0083] The following is a description of the process of determining the camera's image calibration matrix based on the actual image of the standard template and the standard image of the standard template captured by the camera. In one embodiment, as shown in FIG4 , the steps in S100 above can be implemented in the following manner:

[0084] S110, obtaining at least one first position matrix corresponding to a plurality of calibration points in an actual image; and obtaining at least one second position matrix corresponding to a plurality of standard points in a standard image.

[0085] The number of calibration points in the actual image may be less than the number of pixels in the actual image; the number of calibration points in the standard image may be less than the number of pixels in the standard image. In practical applications, the size of each first position matrix is ​​equal, and the size of each second position matrix is ​​also equal. In an embodiment of the present application, the number of first position matrices may be equal to the number of second position matrices.

[0086] It should be noted here that each standard point in the actual image can be any pixel point on each black image block in the actual image; correspondingly, the first position matrix can include the coordinates of each standard point. At the same time, each standard point in the above standard image can be any pixel point on each black image block in the standard image; correspondingly, the second position matrix can include the coordinates of each standard point. Among them, the size of the first position matrix is ​​equal to the size of the second position matrix, and each position in the first position matrix and the corresponding position in the second position matrix are the same corresponding positions on the standard template.

[0087] Specifically, the electronic device can pre-train an algorithm model, and then input the actual image into the algorithm model, and the algorithm model outputs at least one first position matrix corresponding to multiple calibration points in the actual image. At the same time, the electronic device can also input the standard image into the algorithm model, and the algorithm model outputs at least one second position matrix corresponding to multiple standard points in the standard image.

[0088] S120, determining each compensation matrix according to each first position matrix and each second position matrix.

[0089] In practical applications, each first position matrix has a one-to-one correspondence with each second position matrix. Optionally, for any position matrix, the electronic device can perform an arithmetic operation on the first position matrix and the corresponding second position matrix to obtain a corresponding compensation matrix.

[0090] Optionally, the arithmetic operation may be implemented by at least one of an addition operation, a weighted sum operation, a division operation, a multiplication operation, and the like.

[0091] S130: Merge the compensation matrices to obtain an image calibration matrix.

[0092] It should be noted here that the above-mentioned merging process can be understood as a process of simply combining the compensation matrices; or, the merging process can also be understood as a process of comparing the compensation matrices and then splicing the compensation matrices according to the comparison process.

[0093] The technical solution in the embodiment of the present application obtains at least one first position matrix corresponding to multiple calibration points in the actual image, and obtains at least one second position matrix corresponding to multiple standard points in the standard image, determines each compensation matrix according to each first position matrix and each second position matrix, and merges each compensation matrix to obtain an image calibration matrix; the above method does not need to determine the image calibration matrix of the camera through all points in the actual image and the standard image, and can obtain the image calibration matrix of the camera through some points in the actual image and the standard image, thereby reducing the amount of data processed in the process of obtaining the image calibration matrix and reducing the complexity of obtaining the image calibration matrix.

[0094] In one embodiment, the actual image includes a plurality of actual image blocks; as shown in FIG5 , the step of obtaining at least one first position matrix corresponding to a plurality of calibration points in the actual image in S110 may be implemented by the following process:

[0095] S111 . Perform convolution processing on each actual image block according to the convolution kernel to obtain the center position of the center of each actual image block.

[0096] In the embodiment of the present application, each black image block in the actual image may be referred to as an actual image block. Since the actual image captured by the camera may be distorted, the size of each black image block in the actual image may be equal or unequal; however, the standard image is an ideal image without distortion, and therefore, the size of each standard image block in the standard image is equal.

[0097] The size of the convolution kernel corresponds to the size of the standard image block. If the standard image block is 3*3 pixels, the convolution kernel can be a 3*3 matrix. The convolution kernel can be user-defined or determined based on historical experience.

[0098] Specifically, for any actual image block in the actual image, the electronic device can perform convolution processing on the actual image block through the same convolution kernel to obtain the center position of the center of the actual image block.

[0099] S112: Obtain an actual quadrilateral formed by the centers of every four adjacent actual image blocks in the centers of each actual image block.

[0100] The shape formed by each of the four adjacent actual image block centers in each actual image block center can be called an actual quadrilateral. It should be noted that any four adjacent actual image block centers in each actual image block center can include two adjacent actual image block centers that are approximately in the same row and two adjacent actual image block centers that are in adjacent rows and approximately in the same two columns as the first two actual image block centers.

[0101] Exemplarily, if there are 9 actual image block centers (such as the black solid dots in FIG. 6 ) in an actual image, then each adjacent four actual image block centers among the 9 actual image block centers may include ABDE, DCEF, DEGH, and EFHI.

[0102] S113 . For any actual quadrilateral, determine a first position matrix of a plurality of calibration points in the actual quadrilateral according to the center positions of the actual quadrilateral and the centers of the corresponding four actual image blocks.

[0103] It should be noted here that for any actual quadrilateral, the electronic device can divide each side of the actual quadrilateral into n1 equal parts, n 1 It can be equal to the side length m of the actual image block in the actual image 1 The distance w between the two closest sides of two adjacent actual image blocks 1 The sum of 1 It can be equal to the number of horizontal pixels or vertical pixels of any actual image block in the actual image; w 1 It can be equal to the side length of the white image block between any two adjacent actual image blocks in the actual image, that is, the number of horizontal pixels or the number of vertical pixels of the white image block. In the embodiment of the present application, the size of each actual image block in the actual image is equal to the size of the white image block between any two adjacent actual image blocks.

[0104] For example, if the size of each actual image block in the actual image is 3*3, then m 1 and w 1 are all equal to 3, correspondingly n 1 Equals 6.

[0105] In practical applications, we can divide each side of the actual quadrilateral into (n 1 -1) points are numbered. Among them, each point divided on two approximately perpendicular opposite sides of the actual quadrilateral can be numbered from top to bottom or from bottom to top. Continuing with the previous example, each point divided on the approximately perpendicular side 1 of the actual quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from top to bottom or from bottom to top. Correspondingly, each point divided on the side 2 opposite to the side 1 of the actual quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from top to bottom or from bottom to top. Furthermore, the points on the opposite sides of the actual quadrilateral with the same number can be connected.

[0106] At the same time, each point divided on two approximately horizontal opposite sides of the actual quadrilateral can be numbered from left to right or from right to left. Continuing with the previous example, each point divided on the approximately vertical side 3 of the actual quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from left to right or from right to left, and correspondingly, each point divided on the side 4 opposite to the side 1 of the actual quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from left to right or from right to left. Further, the points with the same number on the opposite sides of the actual quadrilateral can be connected.

[0107] Based on the above steps, the intersection points between the connecting lines on the opposite sides of the actual quadrilateral and the intersection points between the connecting lines and the sides of the actual quadrilateral can be referred to as multiple calibration points in the actual quadrilateral.

[0108] Furthermore, a straight line fitting can be performed based on the coordinates of the four corner points of the actual quadrilateral (the center positions of the four actual image blocks corresponding to the deformation), and each side of the actual quadrilateral is fitted according to n 1 Based on the principle of equal division, the coordinates of each calibration point in the actual quadrilateral are determined, and the coordinates of each calibration point in the actual quadrilateral are combined to generate a first position matrix of multiple calibration points in the actual quadrilateral.

[0109] It should be noted here that the element at each position in the first position matrix of multiple calibration points in the actual quadrilateral can be equal to the coordinates of the corresponding calibration point in the actual quadrilateral; that is, the arrangement position of each element in the first position matrix is ​​determined according to the distribution position of each calibration point in the actual quadrilateral.

[0110] The technical solution in the embodiment of the present application performs convolution processing on each actual image block according to the convolution kernel to obtain the center position of the center of each actual image block, obtains the actual quadrilateral formed by the centers of each adjacent four actual image blocks in the center of each actual image block, and for any actual quadrilateral, determines the first position matrix of multiple calibration points in the actual quadrilateral according to the center positions of the actual quadrilateral and the corresponding four actual image block centers; the above method can perform convolution processing on each actual image block in the actual image, and indirectly obtain the first position matrix of multiple calibration points in the actual quadrilateral, and the processing process does not require the participation of complex algorithms, thereby simplifying the first position matrix acquisition process and reducing the complexity of the first position matrix acquisition process.

[0111] In one embodiment, the standard image includes a plurality of standard image blocks; as shown in FIG7 , the step of obtaining at least one second position matrix corresponding to a plurality of standard points in the standard image in S110 may be implemented by the following process:

[0112] S114. According to each standard image block, obtain the center position of the center of each standard image block.

[0113] In practical applications, each black image block in the standard image can be called a standard image block, and the above-mentioned multiple standard image blocks can be a cropped standard image. It should be noted here that since the size of the standard image is larger than the size of the image captured by the camera, in practical applications, the standard image can be cropped, and then at least one second position matrix corresponding to multiple standard points in the cropped standard image is obtained. Optionally, the size of the above-mentioned cropped standard image can be equal to the size of the actual image and the target image.

[0114] Optionally, the number of standard image blocks in the cropped standard image may be equal to the number of actual image blocks in the actual image; the number of standard image blocks in the cropped standard image may be equal to the result of dividing the number of horizontal pixels in the standard image by the sum of the horizontal size of the standard image block and the horizontal spacing between two adjacent standard image blocks, multiplied by the number of vertical pixels in the standard image by the sum of the vertical size of the standard image block and the vertical spacing between two adjacent standard image blocks.

[0115] Optionally, the horizontal spacing between two adjacent standard image blocks may be equal to the spacing between the two closest longitudinal sides of the two adjacent standard image blocks, where the two longitudinal sides are the longitudinal sides of the two adjacent standard image blocks, respectively. The horizontal size and the longitudinal size both represent the number of pixels.

[0116] Specifically, the electronic device can use any point in the cropped standard image as the origin of the two-dimensional coordinate system, obtain the coordinates of four specific points on each standard image block in the cropped standard image, and then directly calculate the coordinates of the center of each standard image block, that is, the center position, based on the coordinates of the four specific points using the intersection formula of two straight lines.

[0117] Optionally, for any standard image block, the four specific points on the standard image block may be four corner points on the standard image block, or may be the midpoint of each edge on the standard image block, or of course, may be the 1 / 4 point of each edge on the standard image block.

[0118] S115 , obtaining a standard quadrilateral formed by the centers of every four adjacent standard image blocks in the centers of each standard image block.

[0119] The shape formed by each of the four adjacent standard image block centers in each standard image block center can be called a standard quadrilateral. It should be noted that any four adjacent standard image block centers in each standard image block center can include two adjacent standard image block centers that are approximately in the same row and two adjacent standard image block centers that are in adjacent rows and approximately in the same two columns as the first two standard image block centers.

[0120] Exemplarily, if there are 9 standard image block centers (such as the black solid dots in FIG8 ) in a cropped standard image, then each adjacent four standard image block centers among the 9 standard image block centers may include abde, dcef, degh, and efhi.

[0121] S116 . For any standard quadrilateral, determine a second position matrix of a plurality of standard points in the standard quadrilateral according to the center positions of the standard quadrilateral and the centers of the corresponding four standard image blocks.

[0122] It should be noted here that for any standard quadrilateral, the electronic device can be n for each side of the standard quadrilateral 2 Equal parts, n 2 It can be equal to the side length m of the standard image block in the cropped standard image 2 The distance w between the two closest sides of two adjacent standard image blocks 2 The sum of 2 It can be equal to the number of horizontal pixels or vertical pixels of any standard image block in the cropped standard image; w 2 It may be equal to the side length of the white image block between any two adjacent standard image blocks in the cropped standard image, that is, the number of horizontal pixels or the number of vertical pixels in the white image block. In an embodiment of the present application, the size of each standard image block in the cropped standard image is equal to the size of the white image block between any two adjacent standard image blocks.

[0123] For example, if the size of each standard image block in the cropped standard image is 3*3, then m 2 and w 2 are all equal to 3, correspondingly n 2 Equals 6.

[0124] In practical applications, we can divide each side of the standard quadrilateral into (n 2 -1) points are numbered. Among them, each point divided on two approximately perpendicular opposite sides of the standard quadrilateral can be numbered from top to bottom or from bottom to top. Continuing with the previous example, each point divided on the approximately perpendicular side 1 of the standard quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from top to bottom or from bottom to top. Correspondingly, each point divided on the side 2 opposite to the side 1 of the standard quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from top to bottom or from bottom to top. Furthermore, the points on the opposite sides of the standard quadrilateral with the same number can be connected.

[0125] At the same time, each point divided on two approximately horizontal opposite sides of the standard quadrilateral can be numbered from left to right or from right to left. Continuing with the previous example, each point divided on the approximately vertical side 3 of the standard quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from left to right or from right to left, and correspondingly, each point divided on the side 4 opposite to the side 1 of the standard quadrilateral is numbered 1, 2, 3, 4 and 5 in sequence from left to right or from right to left. Further, the points with the same number on the opposite sides of the standard quadrilateral can be connected.

[0126] Based on the above steps, the intersection points between the connecting lines on the opposite sides of the standard quadrilateral and the intersection points between the connecting lines and the sides of the standard quadrilateral can be referred to as multiple calibration points in the standard quadrilateral.

[0127] Furthermore, a straight line fitting can be performed based on the coordinates of the four corner points of the standard quadrilateral (the center positions of the four standard image blocks corresponding to the standard pair deformation), and each side of the standard quadrilateral is fitted according to n 2 The coordinates of each calibration point in the standard quadrilateral are determined based on the principle of equal division, and the coordinates of each calibration point in the standard quadrilateral are combined to generate a second position matrix of multiple calibration points in the standard quadrilateral.

[0128] It should be noted here that the element at each position in the second position matrix of multiple calibration points in the standard quadrilateral can be equal to the coordinates of the corresponding calibration point in the standard quadrilateral; that is, the arrangement position of each element in the second position matrix is ​​determined according to the distribution position of each calibration point in the standard quadrilateral.

[0129] The technical solution in the embodiment of the present application obtains the center position of the center of each standard image block according to each standard image block, obtains the standard quadrilateral formed by the centers of each adjacent four standard image blocks in the center of each standard image block, and for any standard quadrilateral, determines the second position matrix of multiple standard points in the standard quadrilateral according to the center positions of the standard quadrilateral and the corresponding four standard image block centers; the above method can determine the second position matrix of multiple calibration points in the standard quadrilateral without performing convolution processing, which makes the processing process simpler and greatly reduces the complexity of the second position matrix acquisition process.

[0130] The process of determining each compensation matrix according to each first position matrix and each second position matrix is ​​described below. In one embodiment, as shown in FIG9 , the step in S120 can be implemented in the following manner:

[0131] S121. For any first position matrix, perform arithmetic operations on the elements at each initial position in the first position matrix and the elements at the corresponding initial position in the second position matrix to obtain operation results for the elements at each corresponding initial position.

[0132] It should be noted here that the size of the first position matrix is ​​equal to the size of the second position matrix. Among them, for the same standard template, each actual image block in the actual image of the standard template may be distorted, but the standard image blocks of the standard template are not distorted. Naturally, any four adjacent actual image block centers in the actual image have corresponding four adjacent standard image block centers in the standard image. Correspondingly, the first position matrix determined by the actual quadrilateral formed by any four adjacent actual image block centers in the actual image corresponds to the second position matrix determined by the standard quadrilateral formed by the corresponding four adjacent standard image block centers in the standard image.

[0133] In practical applications, each position in the first position matrix may be referred to as an initial position. Specifically, for any first position matrix, the electronic device may perform arithmetic operations on the elements of each initial position in the first position matrix and the elements of the corresponding initial position in the corresponding second position matrix, respectively, to obtain the element operation results of each corresponding initial position. Optionally, the arithmetic operation may be a subtraction operation.

[0134] Exemplarily, if a first position matrix is ​​a 3*3 matrix and the corresponding second position matrix is ​​also a 3*3 matrix, the horizontal coordinate x1 in the element in the 1st row and 2nd column of the first position matrix is ​​subtracted from the horizontal coordinate x2 in the element in the 1st row and 2nd column of the corresponding second position matrix to obtain the horizontal coordinate (x1-x2) in the element in the 1st row and 2nd column of the corresponding compensation matrix. At the same time, the vertical coordinate y1 in the element in the 1st row and 2nd column of the first position matrix is ​​subtracted from the vertical coordinate y2 in the element in the 1st row and 2nd column of the corresponding second position matrix to obtain the vertical coordinate (y1-y2) in the element in the 1st row and 2nd column of the corresponding compensation matrix. The horizontal coordinate and the vertical coordinate in the element in the 1st row and 2nd column of the second position matrix are combined to obtain the element [x1-x2, y1-y2] in the 1st row and 2nd column of the second position matrix.

[0135] As shown in FIG10, a superimposed image display diagram of an actual quadrilateral in an actual image and a corresponding standard quadrilateral in a standard image is shown. In FIG10, the side lengths of the actual quadrilateral and the standard quadrilateral are both 6 equal parts. The first position matrix corresponding to the corresponding actual quadrilateral can be a 7*7 matrix, and the second position matrix corresponding to the standard quadrilateral can also be a 7*7 matrix. Points 1, 2, 3, and 4 in FIG10 are the four corner points of an actual quadrilateral in an actual image, and points 5, 6, 7, and 8 are the four corner points of the corresponding standard quadrilateral in the standard image. Among them, the point Cn[0,0] (i.e., point 1) on the actual quadrilateral corresponds to the point On[0,0] (i.e., point 5) on the standard quadrilateral. In actual applications, the coordinates of point Cn[0,0] and point On[0,0] are subtracted to obtain the element corresponding to the initial position (row 1, column 1) in the corresponding compensation matrix. At the same time, the point Cn[1, 1] on the actual quadrilateral corresponds to the point On[1, 1] on the standard quadrilateral. In practical applications, the coordinates of point [1, 1] and point On[1, 1] are subtracted to obtain the element corresponding to the initial position (row 2, column 2) in the corresponding compensation matrix.

[0136] S122, determining a compensation matrix according to the operation results of the elements corresponding to the initial positions.

[0137] In the embodiment of the present application, the element operation results of each corresponding initial position can be combined according to the arrangement position of each initial position in the first position matrix or the second position matrix to generate a compensation matrix.

[0138] The technical solution in the embodiment of the present application, for any first position matrix, performs arithmetic operations on the elements of each initial position in the first position matrix and the elements of the corresponding initial position in the second position matrix to obtain the element operation results of each corresponding initial position, and determines the compensation matrix according to the element operation results of each corresponding initial position; the above method does not require the participation of complex algorithms, and the processing process is relatively simple, thereby reducing the amount of data required to be processed during the processing process and improving the determination speed of the correction matrix.

[0139] The following is an explanation of the process of combining the compensation matrices to obtain the image calibration matrix. In one embodiment, as shown in FIG11 , the step in S130 can be implemented in the following manner:

[0140] S131, splicing the compensation matrices according to the target arrangement position to obtain an initial calibration matrix, wherein the target arrangement position is the arrangement position of each actual image block in the actual image or the arrangement position of each standard image block in the standard image.

[0141] In practical applications, the electronic device may perform splicing processing on the compensation matrices according to the arrangement position of each actual image block in the actual image, or the arrangement position of each standard image block in the standard image, to obtain an initial calibration matrix.

[0142] S132: Perform cropping processing according to the initial calibration matrix to determine the image calibration matrix.

[0143] Furthermore, the electronic device may perform cropping processing on the initial calibration matrix to obtain an image calibration matrix.

[0144] In one implementation, some elements in the initial calibration matrix may be deleted according to a preset cropping strategy to obtain an image calibration matrix. The preset cropping strategy may include the position of the elements to be cropped in the initial calibration matrix and may also include the elements to be cropped.

[0145] In another implementation, a cropping model may be pre-trained, and then the initial calibration matrix is ​​input into the cropping model, and the cropping model outputs the image calibration matrix. Optionally, the cropping model may be implemented by at least one of a fully connected neural network model, a recurrent neural network model, a long short-term memory neural network model, a convolutional neural network model, and the like.

[0146] In one embodiment, the step of performing cropping processing according to the initial calibration matrix to determine the image calibration matrix in S132 may include: deleting any row element from every two adjacent rows of identical elements in the initial calibration matrix, and / or deleting any column element from every two adjacent columns of identical elements in the initial calibration matrix, to obtain the image calibration matrix.

[0147] Among them, since in acquiring each first position array and each second position matrix, except for the four actual image block centers closest to the four corner points in the actual image, the other actual image block centers are used twice, therefore, there are at least two adjacent rows of elements with equal elements in the acquired initial calibration matrix, and / or there are at least two adjacent columns of elements with equal elements. In the embodiment of the present application, in order to improve the accuracy of image calibration, each element in the image calibration matrix needs to be an element corresponding to a different initial position. Naturally, any row element can be deleted from each two adjacent rows of the same elements in the initial calibration matrix, and / or any column element can be deleted from each two adjacent columns of the same elements in the initial calibration matrix to obtain the image calibration matrix.

[0148] It should be noted here that if the initial calibration matrix is ​​a matrix composed of two rows and multiple columns of elements, any column element can be deleted from each two adjacent columns of the same elements in the initial calibration matrix to obtain the image calibration matrix; if the initial calibration matrix is ​​a matrix composed of multiple rows and two columns of elements, any row element can be deleted from each two adjacent rows of the same elements in the initial calibration matrix to obtain the image calibration matrix; if the initial calibration matrix is ​​a matrix composed of multiple rows and multiple columns of elements, any row element can be deleted from each two adjacent rows of the same elements in the initial calibration matrix, and any column element can be deleted from each two adjacent columns of the same elements in the initial calibration matrix to obtain the image calibration matrix.

[0149] The technical solution in the embodiment of the present application is to splice the compensation matrices according to the target arrangement position to obtain an initial calibration matrix, and to crop the initial calibration matrix to determine the image calibration matrix; the above method can crop the initial calibration matrix to obtain the image calibration matrix, so that the size of the image calibration matrix is ​​the same as the size of the image captured by the camera, so as to prepare for further correct calibration of the calibration image through the image calibration matrix.

[0150] The following is a description of the process of calibrating the target image according to the image calibration matrix to obtain a calibrated image of the target image. In one embodiment, as shown in FIG. 12 , the steps in S200 may include:

[0151] S210 , determining a plurality of corresponding target positions according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image.

[0152] Specifically, the electronic device can pre-train an algorithm model, and then input the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image into the algorithm model, and the algorithm model outputs the target position corresponding to each initial position. There is a one-to-one correspondence between different initial positions and different target positions.

[0153] It should be noted here that any initial position in the above-mentioned target image may represent a specific position of the initial position in the target image, that is, the nth row and the mth column.

[0154] In addition, for any initial position, the electronic device may perform an arithmetic operation on the element of the initial position in the image calibration matrix and the corresponding initial position in the target image to obtain the target position corresponding to the initial position.

[0155] In one embodiment, the above elements include a horizontal coordinate and a vertical coordinate; the initial position includes an initial row position and an initial column position; as shown in FIG13 , the step of determining the corresponding multiple target positions in S210 according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image may include:

[0156] S211 . For any initial position, determine a target row position according to the horizontal coordinate of the initial position and the initial row position of the initial position in the image calibration matrix.

[0157] Specifically, for any initial position, the electronic device may add the horizontal coordinate of the initial position and the initial row position of the initial position in the image calibration matrix to obtain the row position in the target position, ie, the target row position.

[0158] Exemplarily, if an initial position in the image calibration matrix is ​​the nth row and mth column, the initial row position of the initial position is n, and the target row position can be equal to the sum of the horizontal coordinate Comp[n,m].x of the nth row and mth column in the image calibration matrix and the initial row position n.

[0159] S212: Obtain the target column position according to the elements at the initial position and the initial column position in the image calibration matrix.

[0160] Specifically, for any initial position, the electronic device may add the elements of the initial position in the image calibration matrix and the initial column position of the initial position to obtain the column position in the target position, ie, the target column position.

[0161] For example, if an initial position in the image calibration matrix is ​​the nth row and the mth column, the initial column position of the initial position is m, and the target column position can be equal to the sum of the ordinate Comp[n,m].y of the nth row and the mth column in the image calibration matrix and the initial row position n.

[0162] S213: Determine the corresponding target position according to the target row position and the target column position.

[0163] Furthermore, the target row position and the target column position may be combined to obtain a target position corresponding to the initial position.

[0164] This embodiment does not require the participation of complex algorithms, and the processing process is relatively simple, thereby being able to improve the speed and efficiency of determining the target position.

[0165] S220: Acquire a calibrated image according to each target position and target image.

[0166] In the embodiment of the present application, the size of the target image is equal to the size of the calibrated image. In practical applications, the electronic device can move the target position in the target image by a plurality of pixels in the longitudinal direction or in the transverse direction to obtain the moved position, and use the pixel value of the moved position in the target image as the pixel value of the corresponding initial position in the calibrated image to obtain the calibrated image.

[0167] In one embodiment, as shown in FIG. 14 , the step of acquiring a calibrated image according to each target position and target image in S220 may include:

[0168] S221, corresponding pixel values ​​of each target position in the target image are used as pixel values ​​of corresponding initial positions in the calibrated image.

[0169] Exemplarily, if any initial position in the target image is (n, m) and the corresponding target position is (n', m'), the pixel value of the target position (n', m') in the target image can be used as the pixel value of the corresponding initial position (n, m) in the calibrated image.

[0170] S222: Generate a calibrated image according to the pixel values ​​at each initial position.

[0171] In practical applications, the electronic device may generate a calibrated image according to the pixel values ​​at each initial position in the acquired calibrated image.

[0172] The technical solution in the embodiment of the present application determines the corresponding multiple target positions according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image, and obtains the calibrated image according to each target position and the elements of the corresponding initial position in the target image; the above method can calibrate the elements of the initial position in the target image to obtain the calibrated image of the target image, and the processing process is relatively simple, thereby improving the speed and efficiency of image calibration, and can make the image (i.e., the calibrated image) finally obtained by the electronic device have a smaller degree of distortion and higher uniformity, thereby improving the quality of the image obtained by the electronic device.

[0173] In one embodiment, the present application also provides an image calibration method, which includes the following process:

[0174] (1) in response to a target image captured by a camera, obtaining at least one first position matrix corresponding to a plurality of calibration points in the actual image; and obtaining at least one second position matrix corresponding to a plurality of standard points in the standard image; the lens focus parameters of the camera for capturing the actual image and the lens focus parameters of the camera for capturing the target image are the same;

[0175] The step of obtaining at least one first position matrix corresponding to a plurality of calibration points in the actual image in (1) above includes:

[0176] (11) Performing convolution processing on each actual image block in the actual image according to the convolution kernel to obtain the center position of the center of each actual image block;

[0177] (12) obtaining an actual quadrilateral formed by the centers of each of the four adjacent actual image blocks in the centers of each actual image block;

[0178] (13) for any actual quadrilateral, determining a first position matrix of a plurality of calibration points in the actual quadrilateral according to the center positions of the actual quadrilateral and the corresponding four actual image block centers;

[0179] The step of obtaining at least one second position matrix corresponding to a plurality of standard points in the standard image in the above (1) includes:

[0180] (14) according to each standard image block in the standard image, obtaining the center position of the center of each standard image block;

[0181] (15) Obtaining a standard quadrilateral formed by the centers of each of the four adjacent standard image blocks in the center of each standard image block;

[0182] (16) for any standard quadrilateral, determining a second position matrix of a plurality of standard points in the standard quadrilateral according to the center positions of the standard quadrilateral and the corresponding four standard image blocks;

[0183] (2) For any first position matrix, perform arithmetic operations on the elements at each initial position in the first position matrix and the elements at the corresponding initial position in the second position matrix to obtain the operation results of the elements at each corresponding initial position;

[0184] (3) Determine the compensation matrix based on the element operation results of each corresponding initial position;

[0185] (4) splicing the compensation matrices according to the target arrangement position to obtain an initial calibration matrix; the target arrangement position is the arrangement position of each actual image block in the actual image or the arrangement position of each standard image block in the standard image;

[0186] (5) deleting any row element from every two adjacent rows of identical elements in the initial calibration matrix, and / or deleting any column element from every two adjacent columns of identical elements in the initial calibration matrix, to obtain an image calibration matrix;

[0187] (6) For any initial position, determine the target row position according to the horizontal coordinate of the element of the initial position in the image calibration matrix and the initial row position of the initial position;

[0188] (7) Obtaining the target column position according to the ordinate and the initial column position of the element at the initial position in the image calibration matrix;

[0189] (8) Determine the corresponding target position according to the target row position and the target column position;

[0190] (9) The pixel values ​​corresponding to each target position in the target image are used as the pixel values ​​of the corresponding initial positions in the calibrated image;

[0191] (10) Generate a calibrated image based on the pixel values ​​at each initial position.

[0192] The execution process of the above (1) to (10) can be specifically referred to the description of the above embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0193] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0194] The embodiment of the present application also provides an image calibration system, which includes: an electronic device and a standard template of a camera, wherein the electronic device includes a camera, a lens of the camera, and a surface light source; FIG1 is an application scenario diagram between the camera, the lens of the camera, the surface light source, and the standard template on the electronic device in the image calibration system; wherein:

[0195] A camera, used to collect a target image through a lens and to collect an actual image of a standard template placed on a surface light source;

[0196] An electronic device, used to execute the steps of the method in any of the above embodiments.

[0197] The implementation principle and technical effect of the image calibration system provided in the embodiment of the present application are similar to those of the above-mentioned image calibration method, and will not be repeated here.

[0198] Based on the same inventive concept, the embodiment of the present application also provides an image calibration device for implementing the above-mentioned image calibration method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image calibration device embodiments provided below can refer to the limitations of the image calibration method above, and will not be repeated here.

[0199] In one embodiment, FIG15 is a schematic diagram of the structure of an image calibration device in an embodiment of the present application. The image calibration device provided in the embodiment of the present application can be applied to electronic devices. As shown in FIG15, the image calibration device in the embodiment of the present application may include: a determination module 11 and a calibration module 12, wherein:

[0200] A determination module 11 is used to determine the image calibration matrix of the camera in response to the target image captured by the camera, according to the actual image of the standard template captured by the camera and the standard image of the standard template; the lens focus parameters of the camera capturing the actual image are the same as the lens focus parameters of the camera capturing the target image;

[0201] The calibration module 12 is used to perform calibration processing on the target image according to the image calibration matrix to obtain a calibrated image of the target image.

[0202] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0203] In one embodiment, the determination module 11 includes: an acquisition unit, a determination unit and a merging processing unit, wherein:

[0204] A first acquisition unit, configured to acquire at least one first position matrix corresponding to a plurality of calibration points in an actual image; and to acquire at least one second position matrix corresponding to a plurality of standard points in a standard image;

[0205] A first determining unit, configured to determine each compensation matrix according to each first position matrix and each second position matrix;

[0206] The merging processing unit is used to merge the compensation matrices to obtain an image calibration matrix.

[0207] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0208] In one embodiment, the actual image includes a plurality of actual image blocks; the first acquisition unit includes: a convolution processing subunit, a first acquisition subunit and a first determination subunit, wherein:

[0209] A convolution processing subunit, used for performing convolution processing on each actual image block according to a convolution kernel to obtain a center position of the center of each actual image block;

[0210] A first acquisition subunit is used to acquire an actual quadrilateral formed by the centers of each of four adjacent actual image blocks in the centers of each actual image block;

[0211] The first determination subunit is used to determine, for any actual quadrilateral, a first position matrix of multiple calibration points in the actual quadrilateral according to the center positions of the actual quadrilateral and the corresponding four actual image block centers.

[0212] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0213] In one embodiment, the standard image includes a plurality of standard image blocks; the first acquisition unit includes: a second acquisition subunit, a third acquisition subunit and a second determination subunit, wherein:

[0214] A second acquisition subunit is used to acquire the center position of the center of each standard image block according to each standard image block;

[0215] A third acquisition subunit is used to acquire a standard quadrilateral formed by the centers of each of four adjacent standard image blocks in the centers of each standard image block;

[0216] The second determining subunit is used to determine, for any standard quadrilateral, a second position matrix of a plurality of standard points in the standard quadrilateral according to the center positions of the standard quadrilateral and the corresponding four standard image blocks.

[0217] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0218] In one embodiment, the first determination unit includes: a calculation processing subunit and a third determination subunit, wherein:

[0219] An operation processing subunit, for performing an arithmetic operation on any first position matrix according to the elements at each initial position in the first position matrix and the elements at the corresponding initial position in the second position matrix, to obtain an operation result of the elements at each corresponding initial position;

[0220] The third determination subunit is used to determine the compensation matrix according to the element operation results of each corresponding initial position.

[0221] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0222] In one embodiment, the merging processing unit includes: a splicing processing subunit and a cropping processing subunit, wherein:

[0223] A splicing processing subunit is used to splice the compensation matrices according to the target arrangement position to obtain an initial calibration matrix; the target arrangement position is the arrangement position of each actual image block in the actual image or the arrangement position of each standard image block in the standard image;

[0224] The cropping processing subunit is used to perform cropping processing according to the initial calibration matrix to determine the image calibration matrix.

[0225] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0226] In one embodiment, the clipping processing subunit is specifically used for:

[0227] An image calibration matrix is ​​obtained by deleting any row element from every two adjacent rows of identical elements in the initial calibration matrix, and / or deleting any column element from every two adjacent columns of identical elements in the initial calibration matrix.

[0228] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0229] In one embodiment, the calibration module 12 includes: a second determination unit and a second acquisition unit, wherein:

[0230] A second determining unit, configured to determine a plurality of corresponding target positions according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image;

[0231] The second acquisition unit is used to acquire a calibrated image according to each target position and target image.

[0232] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0233] In one embodiment, the element includes a horizontal coordinate and a vertical coordinate, and the initial position includes an initial row position and an initial column position; and the second determining unit is specifically configured to:

[0234] For any initial position, determine the target row position according to the abscissa of the initial position and the initial row position of the initial position in the image calibration matrix;

[0235] Obtaining the target column position according to the ordinate and the initial column position of the initial position in the image calibration matrix;

[0236] According to the target row position and the target column position, the corresponding target position is determined.

[0237] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0238] In one embodiment, the second acquisition unit is specifically used for:

[0239] The pixel values ​​corresponding to each target position in the target image are respectively used as the pixel values ​​of the corresponding initial positions in the calibrated image;

[0240] A calibrated image is generated based on the pixel values ​​at each initial position.

[0241] The image calibration device provided in the embodiment of the present application can be used to execute the technical solution in the above-mentioned image calibration method embodiment of the present application. Its implementation principle and technical effect are similar and will not be repeated here.

[0242] For the specific definition of the image calibration device, please refer to the definition of the image calibration method above, which will not be repeated here. Each module in the above-mentioned image calibration device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, or can be stored in the memory of the electronic device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0243] In one embodiment, an electronic device is provided, and the internal structure diagram of the electronic device can be shown in Figure 16. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide processing capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store target images and actual images. The network interface of the electronic device is used to communicate with an external end point through a network connection. When the computer program is executed by the processor, an image calibration method is implemented.

[0244] Those skilled in the art will understand that the structure shown in FIG. 16 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0245] In one embodiment, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the technical solution in the above-mentioned image calibration method embodiment of the present application is implemented. The implementation principle and technical effect are similar and will not be repeated here.

[0246] In one embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the technical solution of the above-mentioned image calibration method of the present application is implemented. The implementation principle and technical effect are similar and will not be repeated here.

[0247] In one embodiment, a computer program product is also provided, including a computer program. When the computer program is executed by a processor, the technical solution of the above-mentioned image calibration method of the present application is implemented. The implementation principle and technical effect are similar and will not be repeated here.

[0248] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0249] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0250] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. An image calibration method, characterized in that: The method comprises: In response to a target image captured by a camera, an image calibration matrix of the camera is determined according to an actual image of a standard template captured by the camera and a standard image of the standard template; a lens focus parameter of the camera for capturing the actual image is the same as a lens focus parameter of the camera for capturing the target image; The target image is calibrated according to the image calibration matrix to obtain a calibrated image of the target image.

2. The method according to claim 1, characterized in that The step of determining the image calibration matrix of the camera according to the actual image of the standard template acquired by the camera and the standard image of the standard template comprises: Acquire at least one first position matrix corresponding to a plurality of calibration points in the actual image; and acquire at least one second position matrix corresponding to a plurality of standard points in the standard image; Determining compensation matrices according to the first position matrices and the second position matrices; The compensation matrices are combined to obtain the image calibration matrix.

3. The method according to claim 2, characterized in that The actual image includes a plurality of actual image blocks; and obtaining at least one first position matrix corresponding to a plurality of calibration points in the actual image includes: Performing convolution processing on each of the actual image blocks according to the convolution kernel to obtain the center position of the center of each actual image block; Obtaining an actual quadrilateral formed by four adjacent actual image block centers among the actual image block centers; For any actual quadrilateral, determining a first position matrix of a plurality of calibration points in the actual quadrilateral according to the center positions of the actual quadrilateral and the corresponding four actual image block centers; Correspondingly, the standard image includes a plurality of standard image blocks; the step of acquiring at least one second position matrix corresponding to a plurality of standard points in the standard image includes: According to each of the standard image blocks, obtaining the center position of the center of each standard image block; Obtaining a standard quadrilateral formed by the centers of each of four adjacent standard image blocks in the centers of each of the standard image blocks; For any standard quadrilateral, a second position matrix of a plurality of standard points in the standard quadrilateral is determined according to the center positions of the standard quadrilateral and the corresponding four standard image block centers.

4. The method according to any one of claims 2 to 3, characterized in that: The determining of each compensation matrix according to each first position matrix and each second position matrix comprises: For any first position matrix, performing an arithmetic operation on the elements at each initial position in the first position matrix and the elements at the corresponding initial position in the second position matrix to obtain an operation result of the elements at each corresponding initial position; The compensation matrix is ​​determined according to the element operation results of each corresponding initial position.

5. The method according to any one of claims 2 to 3, characterized in that: The merging of the compensation matrices to obtain the image calibration matrix includes: The compensation matrices are spliced ​​according to a target arrangement position to obtain an initial calibration matrix; the target arrangement position is the arrangement position of each actual image block in the actual image or the arrangement position of each standard image block in the standard image; A cropping process is performed according to the initial calibration matrix to determine the image calibration matrix.

6. The method according to claim 5, characterized in that The performing a cropping process according to the initial calibration matrix to determine the image calibration matrix includes: The image calibration matrix is ​​obtained by deleting any row element from every two adjacent rows of identical elements in the initial calibration matrix, and / or deleting any column element from every two adjacent columns of identical elements in the initial calibration matrix.

7. The method according to any one of claims 1 to 3, characterized in that The step of performing calibration processing on the target image according to the image calibration matrix to obtain a calibrated image of the target image includes: Determining a plurality of corresponding target positions according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image; The calibrated image is acquired according to each of the target positions and the target image.

8. The method according to claim 7, characterized in that The elements include a horizontal coordinate and a vertical coordinate, and the initial position includes an initial row position and an initial column position; and determining the corresponding multiple target positions according to the elements of each initial position in the image calibration matrix and the corresponding initial position in the target image includes: For any initial position, determining a target row position according to the abscissa of the initial position and the initial row position of the initial position in the image calibration matrix; Acquire a target column position according to the ordinate of the initial position and the initial column position in the image calibration matrix; A corresponding target position is determined according to the target row position and the target column position.

9. The method according to claim 7, characterized in that: The step of acquiring the calibrated image according to each of the target positions and the target image comprises: The pixel values ​​corresponding to each target position in the target image are used as the pixel values ​​of the corresponding initial positions in the calibrated image; The calibrated image is generated according to the pixel values ​​of each of the initial positions.

10. An image calibration system, characterized in that: The system comprises: a standard template of an electronic device and a camera, wherein the electronic device comprises the camera, a lens of the camera and a surface light source; The camera is used to capture a target image through the lens, and to capture an actual image of the standard template placed on the surface light source; The electronic device is used to execute the method described in any one of claims 1 to 9.