Error correction method for digital image

By intercepting square areas on digital images and calculating the extreme points of the cross-correlation function using nonlinear optimization methods, correcting the coordinates of feature points, solving the problem of recognition deviation caused by lighting and deformation, and improving the accuracy of feature points recognition and measurement results.

CN120451025APending Publication Date: 2025-08-08SUZHOU H C SOIL & WATER SCI & TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510566667.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing digital image measurement methods cannot effectively correct the identification deviation caused by factors such as changes in characteristic points during lighting and deformation, which affects the accuracy of the measurement results.

Method used

By intercepting square areas with a specific side length on the reference image and the deformed image, the extreme value points of the cross-correlation function are calculated using a nonlinear optimization method to obtain the sub-pixel displacement, and the correction of the feature points is determined based on the cross-correlation function value, and the coordinates of the feature points are corrected.

Benefits of technology

It improves the accuracy of feature point recognition, reduces recognition deviations caused by factors such as lighting changes and image noise, and ensures the accuracy and consistency of measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451025A_ABST
    Figure CN120451025A_ABST
Patent Text Reader

Abstract

The invention relates to an error correction method for a digital image, and the method comprises the steps: obtaining a reference image and the coordinates of each feature point in the reference image, and obtaining a to-be-corrected deformed image and the coordinates of each feature point in the to-be-corrected deformed image; for each corresponding feature point on the reference image and the deformed image, respectively intercepting a square region taking the feature point as a center on the reference image and the deformed image to obtain a reference sub-region and a deformed sub-region of the feature point; calculating an extreme point of a cross-correlation function of the reference sub-region and the deformation sub-region of the feature point, obtaining a sub-pixel displacement of the feature point and a cross-correlation function value of the reference sub-region and the deformation sub-region to which the feature point belongs, judging whether the correction of the feature point is qualified or not, if so, obtaining a corrected coordinate of the feature point in the deformation sub-region, and if not, obtaining a corrected coordinate of the feature point in the deformation sub-region; and after all feature points in the deformed image are corrected to be qualified, a corrected deformed image is obtained, and the feature point identification deviation caused by factors such as illumination change and image noise can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image measurement, and in particular to a method for correcting errors in digital images. Background Art

[0002] Digital images are obtained by digitizing images from the real world. This process includes two steps: sampling and quantization. Sampling is the process of discretizing a continuous image into individual pixels in space, while quantization is the process of representing the color, brightness, and other information of each pixel digitally, usually using a certain number of binary digits, such as the common 8-bit, 16-bit, or 32-bit numbers. This converts an image into a digital signal that can be processed and stored by a computer. Compared with traditional material deformation measurement methods, digital image measurement technology, as a non-contact measurement, has a broader application prospect and relatively high measurement accuracy. However, when it is used, due to the influence of lighting, changes in the background of feature points during deformation, etc., some feature point recognition may deviate, which affects the measurement results to a certain extent.

[0003] Existing image measurement methods can achieve sub-pixel-based edge detection and corner point recognition, measure and track the deformation of feature points in real time, and obtain the deformation field and strain field of the entire surface. However, they cannot overcome the deviation in the recognition of a small number of feature points caused by the influence of lighting and background changes of feature points during deformation, which affects the measurement results to a certain extent.

[0004] In addition, the existing comprehensive error correction method of digital image measurement system can correct camera distortion, pressure chamber cavity deformation and other aspects, but it cannot correct the error caused by feature point recognition deviation.

[0005] Therefore, how to correct the errors caused by feature point recognition deviation and improve recognition accuracy has become a technical problem that needs to be solved urgently. Summary of the Invention

[0006] (1) Technical issues to be solved

[0007] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a digital image error correction method, which can improve the problem of decreased feature point recognition accuracy caused by reasons such as lighting, and at the same time further improve the recognition accuracy of already identified sub-pixel feature points.

[0008] (2) Technical solution

[0009] In order to achieve the above objectives, the main technical solutions adopted by the present invention include:

[0010] In a first aspect, an embodiment of the present invention provides a method for correcting errors in a digital image, comprising:

[0011] S100, obtaining the coordinates of the reference image and each feature point therein, obtaining the coordinates of the deformed image to be corrected and each feature point therein,

[0012] The reference image and the deformed image are digital images of the same target sample with the same shape taken at different times under stress.

[0013] The reference image is a digital image of the target sample at time 0 before deformation, the deformed image is a digital image of the target sample after deformation, the feature points are pre-given points with significant features in the image, and the feature points in the reference image and the feature points in the deformed image are in one-to-one correspondence;

[0014] S200, for each corresponding feature point on the reference image and the deformed image, intercepting a square area centered on the feature point on the reference image and the deformed image, respectively, to obtain a reference sub-area and a deformed sub-area of the feature point;

[0015] S300: Calculate the extreme value of the cross-correlation function between the reference sub-region and the deformed sub-region of the feature point using a nonlinear optimization method, and obtain the sub-pixel displacement of the feature point and the cross-correlation function value between the reference sub-region and the deformed sub-region to which the feature point belongs based on the extreme value of the cross-correlation function, where the sub-pixel displacement is the position change of the feature point within the deformed sub-region relative to the reference sub-region;

[0016] Whether the correction of the feature point is qualified is determined based on the cross-correlation function value. If qualified, the corrected coordinates of the feature point in the deformed sub-region are obtained based on the coordinates of the feature point in the deformed image and the sub-pixel displacement, and the correction of the feature point is completed. After all feature points in the deformed image are qualified, a corrected deformed image is obtained.

[0017] The embodiment of the present invention respectively takes the corresponding feature point as the center on the reference image and the deformed image to be corrected, cuts out a square area of a specific side length as the object to be corrected, adopts a nonlinear optimization method to continuously iterate and find the extreme points of the cross-correlation function, obtains the sub-pixel displacement of the measured point, and then obtains the corrected coordinates of the feature point through coordinate transformation. Compared with the traditional full-field feature point recognition method, the embodiment of the present invention has the characteristics of fast speed, high accuracy, strong independence, and strong anti-interference ability. It can effectively reduce the feature point recognition deviation caused by factors such as illumination changes and image noise, and avoids the problem of interference with the recognition of other feature points due to the inability to recognize some feature points.

[0018] Optionally, when calculating the extreme value point of the cross-correlation function between the reference sub-region and the deformed sub-region of the feature point, the extreme value point is within a circular region with the feature point as the center and the sub-region radius r as the radius.

[0019] Optionally, judging whether the correction of the feature point is qualified according to the cross-correlation function value, if not, enlarging the sub-area radius r and recalculating the extreme value point of the cross-correlation function to continue the correction;

[0020] The side length of the square area is 2L. If the feature point cannot be corrected within the sub-area radius r≤L, the coordinates of the feature point before correction in the deformed image are recorded and output to the log.

[0021] Optionally, a nonlinear optimization method is used to calculate the extreme points of the cross-correlation function between the reference sub-region and the deformed sub-region of the feature point, including:

[0022] According to formula (1), the displacements u(x, y) and v(x, y) of the deformed sub-region relative to the point (x, y) in the reference sub-region in the X and Y directions are obtained;

[0023]

[0024] Where u0 and v0 represent the displacement of the deformed sub-region relative to the feature point (x0, y0) in the reference sub-region in the X direction and Y direction respectively;

[0025] according to Get the displacement parameter vector p, and assuming that the grayscale of the deformed sub-region is consistent with the grayscale of the reference sub-region, get the residual function,

[0026]

[0027] When the derivative of the residual function is 0, the linear equation system HΔp=b is obtained; Δp is iteratively solved until convergence, and the p at the convergence is used as the extreme point of the obtained cross-correlation function;

[0028] in, and Respectively represent the rate of change of displacement u(x, y) in the X direction and Y direction, and They represent the rate of change of displacement v(x, y) in the X and Y directions respectively, g(x′, y′) is the grayscale of the deformed sub-region at point (x′, y′), and f(x, y) is the grayscale of the reference sub-region at point (x, y); is the grayscale gradient of the reference sub-region at point (x, y); Δp is the increment of the displacement parameter vector p.

[0029] Optionally, the cross-correlation function values of the reference sub-region and the deformed sub-region to which the feature point belongs are calculated according to the extreme value points of the cross-correlation function using the following formula:

[0030]

[0031] Among them, ZNCC(u, v) is the zero-mean normalized cross-correlation function,

[0032] f(x, y) is the grayscale value of the reference sub-region at any point (x, y), is the grayscale mean of the reference sub-region,

[0033] g(xu, yv) is the grayscale value of the deformed sub-region at the point (xu, yv), where u and v are the displacements of the deformed sub-region relative to the point (x, y) in the reference sub-region in the X and Y directions, respectively. is the grayscale mean of the deformed sub-region.

[0034] Optionally, judging whether the correction of the feature point is qualified according to the cross-correlation function value includes:

[0035] When the cross-correlation function value is less than 0.95, it is determined that the correction of the feature point is unqualified; when the correlation function value is greater than or equal to 0.95, it is determined that the correction of the feature point is qualified.

[0036] Optionally, the method is applicable to the correction of digital image measurement of triaxial soil sample deformation.

[0037] In a second aspect, an embodiment of the present invention provides a digital image error correction device, comprising:

[0038] The acquisition module is used to obtain the coordinates of the reference image and each feature point therein, and to obtain the coordinates of the deformed image to be corrected and each feature point therein,

[0039] The reference image and the deformed image are digital images of the same target sample with the same shape taken at different times under stress.

[0040] The reference image is a digital image of the target sample at time 0 before deformation, the deformed image is a digital image of the target sample after deformation, the feature points are pre-given points with significant features in the image, and the feature points in the reference image and the feature points in the deformed image are in one-to-one correspondence;

[0041] A cropping module is used to, for each corresponding feature point on the reference image and the deformed image, cut out a square area with the feature point as the center and a side length of 2L on the reference image and the deformed image, respectively, to obtain a reference sub-area and a deformed sub-area of the feature point;

[0042] a correction module, configured to calculate, using a nonlinear optimization method, an extreme value of a cross-correlation function between the reference subregion and the deformed subregion of the feature point, and obtain, based on the extreme value of the cross-correlation function, a sub-pixel displacement of the feature point and a cross-correlation function value between the reference subregion and the deformed subregion to which the feature point belongs, wherein the sub-pixel displacement is a change in position of the feature point within the deformed subregion relative to the reference subregion;

[0043] Whether the correction of the feature point is qualified is determined based on the cross-correlation function value. If qualified, the corrected coordinates of the feature point in the deformed sub-region are obtained based on the coordinates of the feature point in the deformed image and the sub-pixel displacement, and the correction of the feature point is completed. After all feature points in the deformed image are qualified, a corrected deformed image is obtained.

[0044] In a third aspect, an embodiment of the present invention provides an electronic device comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program in the memory, specifically performing the steps of the digital image error correction method described in any one of the first aspects above.

[0045] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the digital image error correction method described in any one of the first aspects are implemented.

[0046] (3) Beneficial effects

[0047] The beneficial effects of the present invention are as follows: a digital image error correction method of the present invention, since a square area with a specific side length is intercepted as the object to be corrected with the corresponding feature point as the center on the reference image and the deformed image to be corrected, a nonlinear optimization method is used to continuously iterate to obtain the extreme point of its cross-correlation function, and the sub-pixel displacement of the measured point is obtained, and then the corrected coordinates of the feature point are obtained through coordinate transformation. Compared with the traditional full-field feature point recognition method, it has the characteristics of fast speed, high accuracy, strong independence, strong anti-interference ability, etc., can reduce and compensate for the feature point recognition deviation caused by factors such as illumination changes and image noise, and avoid the problem of interference with the recognition of other feature points due to the inability to recognize some feature points. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic flow chart of a digital image error correction method according to an embodiment of the present invention;

[0049] Figure 2 The figure is a schematic diagram of a process for correcting a series of digital images taken at different times according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation methods in conjunction with the accompanying drawings.

[0051] In material deformation observation (such as universal material tension and compression testing) or triaxial soil sample deformation analysis, tracking of characteristic points (such as corner points and sub-pixel corner points) is the key to tracking the deformation of the target sample. Universal materials may undergo elastic, plastic or fatigue deformation when subjected to stress. The tiny displacement (sub-pixel level) of their surface characteristic points is the key to judging the state of the material such as yield and necking. If there is a deviation in the acquisition of characteristic point coordinates, it will lead to errors in the calculation of parameters such as displacement and strain, which in turn affects the judgment of the mechanical properties of the material (such as elastic deformation and plastic deformation). The deformation process of the target sample needs to be observed continuously. The position of the characteristic points may change due to the viewing angle, lighting or sample deformation of each measured image. Therefore, this embodiment corrects the coordinates of the characteristic points of the digital image to solve the problem of characteristic point recognition deviation caused by various interference factors during the digital image measurement process. Through correction, the characteristic point coordinates of the images at different times can be ensured to be consistent and accurate, thereby constructing a reliable deformation trajectory and strain field, ensuring the accuracy and reliability of the target sample deformation observation, more accurately reflecting the actual deformation of the material surface, and avoiding performance misjudgment caused by recognition errors.

[0052] Example

[0053] This embodiment provides a digital image error correction method, which is applicable to the correction of digital images of triaxial soil sample deformation or correction of digital images of universal materials subjected to stress deformation. It mainly performs error correction on sub-pixel feature points identified by digital image measurement. The method of this embodiment can be implemented on any computer device. Figure 1 , the method of this embodiment includes:

[0054] S100 , obtaining a reference image and the coordinates of each feature point therein, and obtaining a deformed image to be corrected and the coordinates of each feature point therein.

[0055] The reference image and the deformed image are digital images taken at different times of the same target sample with the same shape under a stress state.

[0056] The reference image is a digital image of the target sample at time 0 before deformation, the deformed image is a digital image of the target sample after deformation, the feature points are pre-given points in the image with significant features, the feature points in the reference image and the feature points in the deformed image are one-to-one corresponding, the coordinates of the feature points in the reference image are used as the reference coordinates, and the coordinates of the feature points in the deformed image are used as the deformation coordinates to be corrected.

[0057] For example, the target sample can be a universal material sample, such as carbon fiber or aluminum alloy; the deformation image can be a digital image of the target sample at the nth moment after deformation; and the feature point can be a sub-pixel feature point identified by the digital image measurement system.

[0058] It should be noted that before step S100, a parameter table can be established and initialized to provide a quantitative standard for subsequent local area processing of the digital image, ensuring algorithm repeatability and parameter adjustability, and adapting to the detection requirements of feature points of different sizes. Specifically, the parameters involved in this embodiment mainly include the block radius L (i.e., half the side length of the square used for cropping the reference sub-region and the deformed sub-region) and the sub-region radius, both of which are measured in pixels.

[0059] S200 , for each corresponding feature point on the reference image and the deformed image, cut out a square area with the feature point as the center and a side length of 2L on the reference image and the deformed image respectively, to obtain a reference sub-area and a deformed sub-area of the feature point.

[0060] The reference sub-region and the deformed sub-region can achieve local image matching and focus on the neighborhood information of feature points, thus avoiding global noise interference.

[0061] S300: Calculate the extreme value of the cross-correlation function between the reference sub-region and the deformed sub-region of the feature point using a nonlinear optimization method.

[0062] Specifically, the extreme value of the cross-correlation function between the reference sub-region and the deformed sub-region of the feature point is calculated within a circular area centered on the feature point and with the sub-region radius r as the radius, and the following method is used:

[0063] According to formula (1), the displacements u(x, y) and v(x, y) of the deformed sub-region relative to the point (x, y) in the reference sub-region in the X and Y directions are obtained;

[0064]

[0065] Where u0 and v0 represent the displacement of the deformed sub-region relative to the feature point (x0, y0) in the reference sub-region in the X direction and Y direction respectively;

[0066] according to Get the displacement parameter vector p, and assuming that the grayscale of the deformed sub-region is consistent with the grayscale of the reference sub-region, get the residual function,

[0067] When the derivative of the residual function is 0, the linear equation system HΔp=b is obtained; Δp is iteratively solved until convergence, and the p at the convergence is used as the extreme point of the obtained cross-correlation function;

[0068] in, and Respectively represent the rate of change of displacement u(x, y) in the X direction and Y direction, and They represent the rate of change of displacement v(x, y) in the X and Y directions respectively, g(x′, y′) is the grayscale of the deformed sub-region at point (x′, y′), and f(x, y) is the grayscale of the reference sub-region at point (x, y); is the grayscale gradient of the reference sub-region at point (x, y); Δp is the increment of the displacement parameter vector p.

[0069] According to the extreme value point of the cross-correlation function, the sub-pixel displacement of the feature point and the cross-correlation function value of the reference sub-region and the deformed sub-region to which the feature point belongs are obtained. The sub-pixel displacement is the position change of the feature point in the deformed sub-region relative to the reference sub-region.

[0070] Specifically, the cross-correlation function values of the reference sub-region and the deformed sub-region to which the feature point belongs are calculated according to the extreme value points of the cross-correlation function using the following formula:

[0071]

[0072] Among them, ZNCC(u, v) is the zero-mean normalized cross-correlation function,

[0073] f(x,y) is the grayscale value of the reference sub-region at any point (x, y), is the grayscale mean of the reference sub-region,

[0074] g(xu, yv) is the grayscale value of the deformed sub-region at the point (xu, yv), where u and v are the displacements of the deformed sub-region relative to the point (x, y) in the reference sub-region in the X and Y directions, respectively. is the grayscale mean of the deformed sub-region.

[0075] The cross-correlation function value is used to determine whether the feature point has passed the correction. If so, the corrected coordinates of the feature point within the deformed sub-region are obtained based on the coordinates of the feature point in the deformed image and the sub-pixel displacement, completing the correction of the feature point. If not, the sub-region radius r is expanded and the extreme value of the cross-correlation function is recalculated to continue the correction. If the feature point cannot be corrected within the sub-region radius r ≤ L, the uncorrected coordinates of the feature point in the deformed image are recorded and output to the log to facilitate manual analysis and removal. After all feature points in the deformed image have passed the correction, the corrected deformed image is obtained.

[0076] It should be noted that the value of the box radius L depends on the spacing between the feature points to be corrected on the deformed figure. For example, it can be half the pixel distance between adjacent feature points. The initial value of the sub-area radius r can be 8, and it can be expanded incrementally by subset_add subset_add=8, provided that it cannot be larger than the box radius L. It can be 8, 16, 24, or 32.

[0077] When the correction is inappropriate, this embodiment introduces a dynamic expansion strategy of the sub-area radius r. By dynamically adjusting the search area, the adaptability to complex scenes (such as blurred feature points and excessive local deformation) is improved to avoid misjudgment or missed correction.

[0078] Specifically, judging whether the correction of the feature point is qualified according to the cross-correlation function value includes:

[0079] When the cross-correlation function value is less than 0.95, it is determined that the correction of the feature point is unqualified; when the correlation function value is greater than or equal to 0.95, it is determined that the correction of the feature point is qualified.

[0080] In this embodiment, step S300 employs a nonlinear optimization method to iteratively determine the extreme value of the cross-correlation function, thereby obtaining the sub-pixel displacement of the feature point to be corrected. This is then followed by coordinate transformation to obtain the corrected coordinates of the feature point to be corrected. This iterative optimization process continuously approximates the true displacement, significantly reducing the error in the corrected coordinates.

[0081] The cross-correlation function used in step S300 of this embodiment is a zero-mean normalized cross correlation function (ZNCC), which is used as a similarity measure.

[0082] This embodiment combines a fixed block radius L (determines the maximum search range) with a dynamic sub-area radius r (adaptively adjusts the matching window) to reduce the correction time of a single feature point and ensure computational efficiency while accurately capturing slight deformations of the target sample. It uses nonlinear optimization iteration and ZNCC as a similarity metric to achieve the conversion from "coarse recognition coordinates" to "high-precision sub-pixel coordinates", solving the problem of recognition deviation caused by changes in illumination and background.

[0083] The corrected feature point coordinates are compared and analyzed with the feature point coordinates before correction. The method of this embodiment can reduce and compensate for the feature point recognition deviation caused by factors such as illumination changes and image noise. While improving the feature point positioning accuracy, it further improves the recognition accuracy of sub-pixel feature points. The strain accuracy of the target sample can reach 2*10 -4 .

[0084] See also Figure 2 The method of this embodiment can be used to correct a series of digital images of the target sample with the same shape taken at different times under a stress state. After completing the correction of one digital image, the correction of the next digital image will continue until all digital images are corrected. The corrected feature point coordinates are output so that the deformation curve of the target sample can be drawn and observed based on the correction results.

[0085] This embodiment further provides a digital image error correction device, comprising:

[0086] The acquisition module is used to obtain the coordinates of the reference image and each feature point therein, and to obtain the coordinates of the deformed image to be corrected and each feature point therein,

[0087] The reference image and the deformed image are digital images of the same target sample with the same shape taken at different times under stress.

[0088] The reference image is a digital image of the target sample at time 0 before deformation, the deformed image is a digital image of the target sample after deformation, the feature points are pre-given points with significant features in the image, and the feature points in the reference image and the feature points in the deformed image are in one-to-one correspondence;

[0089] A cropping module is used to, for each corresponding feature point on the reference image and the deformed image, cut out a square area with the feature point as the center and a side length of 2L on the reference image and the deformed image, respectively, to obtain a reference sub-area and a deformed sub-area of the feature point;

[0090] a correction module, configured to calculate, using a nonlinear optimization method, an extreme value of a cross-correlation function between the reference subregion and the deformed subregion of the feature point, and obtain, based on the extreme value of the cross-correlation function, a sub-pixel displacement of the feature point and a cross-correlation function value between the reference subregion and the deformed subregion to which the feature point belongs, wherein the sub-pixel displacement is a change in position of the feature point within the deformed subregion relative to the reference subregion;

[0091] Whether the correction of the feature point is qualified is determined based on the cross-correlation function value. If qualified, the corrected coordinates of the feature point in the deformed sub-region are obtained based on the coordinates of the feature point in the deformed image and the sub-pixel displacement, and the correction of the feature point is completed. After all feature points in the deformed image are qualified, a corrected deformed image is obtained.

[0092] This embodiment further provides an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program in the memory, specifically performing the steps of the above-mentioned digital image error correction method.

[0093] This embodiment further provides a computer storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned digital image error correction method are implemented.

[0094] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0095] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.

[0096] It should be noted that, in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims enumerating several means, several of these means may be embodied by one and the same hardware. The use of the words first, second, third etc. is for convenience only and does not indicate any order. These words may be understood as part of the component name.

[0097] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0098] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments after learning the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0099] Obviously, those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if such modifications and variations fall within the scope of the claims and their equivalents, the present invention shall also include such modifications and variations.

Claims

1. A digital image error correction method, characterized in that: include: S100, obtaining the coordinates of the reference image and each feature point therein, obtaining the coordinates of the deformed image to be corrected and each feature point therein, The reference image and the deformed image are digital images of the same target sample with the same shape taken at different times under stress. The reference image is a digital image of the target sample at time 0 before deformation, the deformed image is a digital image of the target sample after deformation, the feature points are pre-given points with significant features in the image, and the feature points in the reference image and the feature points in the deformed image are in one-to-one correspondence; S200, for each corresponding feature point on the reference image and the deformed image, intercepting a square area centered on the feature point on the reference image and the deformed image, respectively, to obtain a reference sub-area and a deformed sub-area of the feature point; S300: Calculate the extreme value of the cross-correlation function between the reference sub-region and the deformed sub-region of the feature point using a nonlinear optimization method, and obtain the sub-pixel displacement of the feature point and the cross-correlation function value between the reference sub-region and the deformed sub-region to which the feature point belongs based on the extreme value of the cross-correlation function, where the sub-pixel displacement is the position change of the feature point within the deformed sub-region relative to the reference sub-region; Whether the correction of the feature point is qualified is determined based on the cross-correlation function value. If qualified, the corrected coordinates of the feature point in the deformed sub-region are obtained based on the coordinates of the feature point in the deformed image and the sub-pixel displacement, and the correction of the feature point is completed. After all feature points in the deformed image are qualified, a corrected deformed image is obtained.

2. The method according to claim 1, characterized in that When calculating the extreme value point of the cross-correlation function between the reference sub-region and the deformed sub-region of the feature point, the extreme value point is within the range of a circular region with the feature point as the center and the sub-region radius r as the radius.

3. The method according to claim 2, characterized in that Determine whether the correction of the feature point is qualified according to the cross-correlation function value; if not, expand the sub-area radius r and recalculate the extreme value point of the cross-correlation function to continue the correction; The side length of the square area is 2L. If the feature point cannot be corrected within the sub-area radius r≤L, the coordinates of the feature point before correction in the deformed image are recorded and output to the log.

4. The method according to claim 1, wherein The nonlinear optimization method is used to calculate the extreme points of the cross-correlation function of the reference sub-region and the deformed sub-region of the feature point, including: According to formula (1), the displacements u(x, y) and v(x, y) of the deformed sub-region relative to the point (x, y) in the reference sub-region in the X and Y directions are obtained; Where u0 and v0 represent the displacement of the deformed sub-region relative to the feature point (x0, y0) in the reference sub-region in the X direction and Y direction respectively; according to Get the displacement parameter vector p, and assuming that the grayscale of the deformed sub-region is consistent with the grayscale of the reference sub-region, get the residual function, When the derivative of the residual function is 0, the linear equation system HΔp=b is obtained; Δp is iteratively solved until convergence, and the p at the convergence is used as the extreme point of the obtained cross-correlation function; in, and Respectively represent the rate of change of displacement u(x, y) in the X direction and Y direction, and They represent the rate of change of displacement v(x, y) in the X and Y directions respectively, g(x′, y′) is the grayscale of the deformed sub-region at point (x′, y′), and f(x, y) is the grayscale of the reference sub-region at point (x, y); is the grayscale gradient of the reference sub-region at point (x, y); Δp is the increment of the displacement parameter vector p.

5. The method according to claim 1, wherein The cross-correlation function values of the reference sub-region and the deformed sub-region to which the feature point belongs are calculated according to the extreme value points of the cross-correlation function using the following formula: Among them, ZNCC(u, v) is the zero-mean normalized cross-correlation function, f(x, y) is the grayscale value of the reference sub-region at any point (x, y), is the grayscale mean of the reference sub-region, g(xu, yv) is the grayscale value of the deformed sub-region at the point (xu, yv), where u and v are the displacements of the deformed sub-region relative to the point (x, y) in the reference sub-region in the X and Y directions, respectively. is the grayscale mean of the deformed sub-region.

6. The method according to claim 5, characterized in that Judging whether the correction of the feature point is qualified according to the cross-correlation function value includes: When the cross-correlation function value is less than 0.95, it is determined that the correction of the feature point is unqualified; when the correlation function value is greater than or equal to 0.95, it is determined that the correction of the feature point is qualified.

7. The method according to claim 1, characterized in that The method is used for correcting digital image measurement of triaxial soil sample deformation.

8. A digital image error correction device, characterized in that: include: The acquisition module is used to obtain the coordinates of the reference image and each feature point therein, and to obtain the coordinates of the deformed image to be corrected and each feature point therein, The reference image and the deformed image are digital images of the same target sample with the same shape taken at different times under stress. The reference image is a digital image of the target sample at time 0 before deformation, the deformed image is a digital image of the target sample after deformation, the feature points are pre-given points with significant features in the image, and the feature points in the reference image and the feature points in the deformed image are in one-to-one correspondence; A cropping module is used to, for each corresponding feature point on the reference image and the deformed image, cut out a square area with the feature point as the center and a side length of 2L on the reference image and the deformed image, respectively, to obtain a reference sub-area and a deformed sub-area of the feature point; a correction module, configured to calculate, using a nonlinear optimization method, an extreme value of a cross-correlation function between the reference subregion and the deformed subregion of the feature point, and obtain, based on the extreme value of the cross-correlation function, a sub-pixel displacement of the feature point and a cross-correlation function value between the reference subregion and the deformed subregion to which the feature point belongs, wherein the sub-pixel displacement is a positional change of the feature point within the deformed subregion relative to the reference subregion; Whether the correction of the feature point is qualified is determined based on the cross-correlation function value. If qualified, the corrected coordinates of the feature point in the deformed sub-region are obtained based on the coordinates of the feature point in the deformed image and the sub-pixel displacement, and the correction of the feature point is completed. After all feature points in the deformed image are qualified, a corrected deformed image is obtained.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program in the memory, specifically performing the steps of the digital image error correction method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the digital image error correction method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method for preprocessing video image based on image quality diagnosis

    CN105069801A

  • Image correction method and terminal

    CN111656391A

  • Real-time detection method of digital image correlation method based on SIFT improvement

    CN113095323A

  • Topographic map generation method and device

    CN114187415A

  • SAR (Synthetic Aperture Radar) offset tracking method, device and equipment based on strong scattering amplitude suppression and abnormal value identification and medium

    CN115143877A