A least square fast image matching method, device, equipment and medium
By using the least squares fast image matching method, the image transformation model is simplified to two-dimensional displacement parameters, and the cost function is directly solved. This solves the problems of low efficiency and insufficient accuracy in existing image matching technologies, and realizes efficient and reliable image matching and displacement measurement.
Patent Information
- Application Number
- CN202310894140.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-19
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-07-19
AI Technical Summary
Existing image matching algorithms suffer from problems such as high computational cost, long processing time, low robustness, low matching efficiency, and easy convergence to local optima in the field of high-precision displacement measurement.
The least squares fast image matching method is adopted. By constructing an image transformation model of real-time image and reference image, the transformation parameters are simplified to two displacement parameters. The cost function is directly solved by image interpolation algorithm and least squares method, avoiding iterative resampling and directly calculating the global optimal solution.
It improves the efficiency and accuracy of image matching, ensures reliability, realizes efficient and real-time image matching and positioning, and enhances the accuracy and reliability of displacement measurement.
Smart Images

Figure CN116883493B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and in particular to a least-squares fast image matching method, apparatus, computer device, and storage medium. Background Technology
[0002] With the rapid development of computer vision technology, image matching technology has been widely applied in precision industrial scenarios, such as closed-loop servo systems of CNC machine tools, for detection, measurement, and verification. Image matching refers to identifying corresponding points between two or more images using a specific matching algorithm. For example, in two-dimensional image matching, the correlation coefficients of windows of the same size in the target region and the search region are compared, and the center point of the window with the highest correlation coefficient in the search region is taken as the corresponding point. Essentially, it is an optimal search problem that applies matching criteria under the condition of primitive similarity.
[0003] Image matching algorithms are mainly classified into three categories: gray-scale, region, and feature point-based image matching. However, existing image matching algorithms used in high-precision displacement measurement have the following problems: (1) Although gray-scale-based image matching algorithms are simple to operate and have good accuracy for images with small deformation, they have a large computational load, slow operation time, and depend on the gray-scale value of the reference image, and have low robustness to scaling or affine transformations; (2) Image matching algorithms using a 6-parameter affine transformation model are computationally complex, such as the Scale Invariant Feature Transform (SIFT) algorithm; (3) Although image matching algorithms based on the Newton-Raphson algorithm or the Gauss-Newton algorithm have high matching accuracy, the matching process is an iterative process, and each iteration requires resampling of the template image, which is very time-consuming and makes the entire matching process inefficient; (4) Image matching iterative solutions based on the least squares algorithm tend to converge to local optima rather than global optima, and their accuracy and reliability are insufficient.
[0004] Therefore, existing technologies suffer from poor performance and low efficiency. Summary of the Invention
[0005] Therefore, it is necessary to provide a least-squares fast image matching method, apparatus, computer equipment, and storage medium that can improve the matching efficiency and reliability of image matching while ensuring high matching accuracy, in order to address the above-mentioned technical problems.
[0006] A least-squares fast image matching method, the method comprising:
[0007] In a high-precision displacement measurement scenario, an image transformation model is constructed for real-time and reference images. The transformation parameters of the image transformation model are two displacement parameters. The high-precision displacement measurement scenario consists of a displacement stage, a displacement stage fixture, a target object, and a camera. The camera is mounted on the displacement stage, and the displacement stage can move on the displacement stage fixture. The target object is fixed on the displacement stage fixture. The real-time image is obtained by the camera capturing images of the target object as the displacement stage moves. The reference image is obtained by stitching together images of the target object captured by the camera in advance. Based on the image transformation model, an image interpolation algorithm is used to obtain the first relation of the reference image with respect to the weight function matrix with the displacement parameters as independent variables.
[0008] By expressing the weight function as a product of a coefficient matrix and a displacement parameter matrix, a second relation of the reference image with respect to a known constant matrix and a two-dimensional displacement parameter matrix is obtained based on the first relation.
[0009] The cost function for matching the real-time image and the reference image is determined by the least squares method according to the second relation; the cost function is a function of the two-dimensional displacement parameter matrix.
[0010] During real-time positioning, the cost function is solved based on the real-time image to be positioned, the preset reference image, and the predetermined initial values of the two-dimensional displacement parameters to obtain the displacement parameter result of the best match between the real-time image to be positioned and the preset reference image. The positioning information of the displacement stage is determined based on the displacement parameter result.
[0011] In one embodiment, the method further includes: constructing an image transformation model of a real-time image and a reference image in a high-precision displacement measurement scenario; the transformation parameters of the image transformation model are two displacement parameters, including:
[0012] In high-precision displacement measurement scenarios, the image transformation model for constructing real-time and reference images is as follows:
[0013]
[0014] in, (x, y) represents the position information of the reference image, (s, t) represents the position information of the real-time image, and (s, t) represents the displacement parameters in two directions.
[0015] In one embodiment, the method further includes: based on the image transformation model, obtaining a first relation of the reference image with respect to the weight function matrix with the displacement parameter as the independent variable through an image interpolation algorithm performed within a 4-pixel × 4-pixel window, as follows:
[0016]
[0017] Among them, P m (s), m∈[0,3], P n (t), where n∈[0,3] is the weight function. Let g be the interpolation point parameter matrix. j,i This represents the interpolation point parameters.
[0018] In one embodiment, the method further includes: representing the weighting function as a product of a coefficient matrix and a displacement parameter matrix.
[0019] P m (u)=[a m0 a m1 a m2 a m3 ][1, u, u 2 u 3 ] T u∈{s,t}
[0020] Among them, [a m0 a m1 a m2 a m3 ] is the coefficient matrix, [1, u, u 2 u 3 [ ] represents the displacement parameter matrix;
[0021] Based on the first relation, the second relation of the reference image with respect to the known constant matrix and the two-dimensional displacement parameter matrix is:
[0022]
[0023] Where, G(i,j)=[g j-1,i-1 g j-1,i , ..., g j+1,i+2 g j+2,i+2 [This represents the integrated interpolation point parameter matrix.] The known constant matrix is composed of the coefficient matrix, U(s,t)=[1,t,t] 2 , t 3 ,s,st,st 2 ..., s 3 t 2 s 3 t 3 ] T Let be the two-dimensional displacement parameter matrix, which is a 16-column vector.
[0024] In one embodiment, the method further includes: determining the cost function for matching the real-time image and the reference image using the least squares method based on the second relation as follows:
[0025]
[0026] Where D and E represent variables defined to simplify the formula. B T The values of DB and EB can be directly calculated based on the reference image and the real-time image.
[0027] In one embodiment, the method further includes: solving the cost function using a gradient descent algorithm based on the real-time image to be located, a preset reference image, and predetermined initial values of two-dimensional displacement parameters, to obtain the displacement parameter result that best matches the real-time image to be located and the preset reference image.
[0028] In one embodiment, the target of the image capture is a pre-designed image with texture information.
[0029] A least-squares fast image matching device, the device comprising:
[0030] An image transformation model determination module is used to construct image transformation models for real-time and reference images in a high-precision displacement measurement scenario. The transformation parameters of the image transformation model are two displacement parameters. The high-precision displacement measurement scenario consists of a displacement stage, a displacement stage fixture, a target object, and a camera. The camera is mounted on the displacement stage, and the displacement stage is movable on the displacement stage fixture. The target object is fixed to the displacement stage fixture. The real-time image is obtained by the camera capturing images of the target object as the displacement stage moves. The reference image is obtained by stitching together images of the target object captured by the camera in advance.
[0031] The first relation determination module is used to obtain, based on the image transformation model, the first relation of the reference image with respect to the weight function matrix with the displacement parameter as the independent variable through an image interpolation algorithm;
[0032] The second relation determination module is used to obtain the second relation of the reference image with respect to the known constant matrix and the two-dimensional displacement parameter matrix by expressing the weight function as a product of the coefficient matrix and the displacement parameter matrix according to the first relation;
[0033] The cost function determination module is used to determine the cost function for matching the real-time image and the reference image using the least squares method according to the second relation; the cost function is a function of the two-dimensional displacement parameter matrix;
[0034] The image matching and positioning module is used to solve the cost function based on the real-time image to be positioned, the preset reference image, and the predetermined initial values of the two-dimensional displacement parameters during real-time positioning. The module obtains the displacement parameter result of the best match between the real-time image to be positioned and the preset reference image, and determines the positioning information of the displacement stage based on the displacement parameter result.
[0035] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0036] An image transformation model for real-time and reference images is constructed in a high-precision displacement measurement scenario. The transformation parameters of the image transformation model are two displacement parameters. The high-precision displacement measurement scenario consists of a displacement stage, a displacement stage fixture, a target object, and a camera. The camera is mounted on the displacement stage, and the displacement stage can move on the displacement stage fixture. The target object is fixed to the displacement stage fixture. The real-time image is obtained by the camera capturing images of the target object as the displacement stage moves. The reference image is obtained by stitching together images of the target object captured by the camera in advance.
[0037] Based on the image transformation model, the first relation of the reference image with respect to the weight function matrix with the displacement parameter as the independent variable is obtained through an image interpolation algorithm;
[0038] By expressing the weight function as a product of a coefficient matrix and a displacement parameter matrix, a second relation of the reference image with respect to a known constant matrix and a two-dimensional displacement parameter matrix is obtained based on the first relation.
[0039] The cost function for matching the real-time image and the reference image is determined by the least squares method according to the second relation; the cost function is a function of the two-dimensional displacement parameter matrix.
[0040] During real-time positioning, the cost function is solved based on the real-time image to be positioned, the preset reference image, and the predetermined initial values of the two-dimensional displacement parameters to obtain the displacement parameter result of the best match between the real-time image to be positioned and the preset reference image. The positioning information of the displacement stage is determined based on the displacement parameter result.
[0041] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0042] An image transformation model for real-time and reference images is constructed in a high-precision displacement measurement scenario. The transformation parameters of the image transformation model are two displacement parameters. The high-precision displacement measurement scenario consists of a displacement stage, a displacement stage fixture, a target object, and a camera. The camera is mounted on the displacement stage, and the displacement stage can move on the displacement stage fixture. The target object is fixed to the displacement stage fixture. The real-time image is obtained by the camera capturing images of the target object as the displacement stage moves. The reference image is obtained by stitching together images of the target object captured by the camera in advance.
[0043] Based on the image transformation model, the first relation of the reference image with respect to the weight function matrix with the displacement parameter as the independent variable is obtained through an image interpolation algorithm;
[0044] By expressing the weight function as a product of a coefficient matrix and a displacement parameter matrix, a second relation of the reference image with respect to a known constant matrix and a two-dimensional displacement parameter matrix is obtained based on the first relation.
[0045] The cost function for matching the real-time image and the reference image is determined by the least squares method according to the second relation; the cost function is a function of the two-dimensional displacement parameter matrix.
[0046] During real-time positioning, the cost function is solved based on the real-time image to be positioned, the preset reference image, and the predetermined initial values of the two-dimensional displacement parameters to obtain the displacement parameter result of the best match between the real-time image to be positioned and the preset reference image. The positioning information of the displacement stage is determined based on the displacement parameter result.
[0047] The aforementioned least-squares fast image matching method, apparatus, computer equipment, and storage medium simplify the image transformation model between real-time and reference images based on the characteristic that translational motion in high-precision displacement measurement scenarios only involves two translation parameters. It reduces the six affine parameters of the least-squares matching method to two translation parameters, thus directly expressing the least-squares objective function as a cost function of two-dimensional displacement parameters. By directly solving the cost function, the optimal displacement parameter result for the real-time and reference images is obtained, thereby determining the positioning information of the displacement stage. This invention expresses the objective function as a function of transformation parameters, allowing for direct numerical solution. It avoids multiple image resampling, obtains the global optimum, and avoids convergence to local optima, improving the efficiency of the least-squares image matching method in high-precision displacement measurement scenarios. It also enhances accuracy and reliability, offering advantages such as high execution efficiency, good real-time performance, and simplicity and reliability. Attached Figure Description
[0048] Figure 1This is a flowchart illustrating a least-squares fast image matching method in one embodiment;
[0049] Figure 2 This is a schematic diagram of a linear servo motor motion positioning scenario in one embodiment;
[0050] Figure 3 This is a schematic diagram of the target being photographed in one embodiment;
[0051] Figure 4 This is a schematic diagram of image interpolation for a 4-pixel × 4-pixel region in one embodiment.
[0052] Figure 5 This is a structural block diagram of a least-squares fast image matching device in one embodiment;
[0053] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] In one embodiment, such as Figure 1 As shown, a least-squares fast image matching method is provided, including the following steps:
[0056] Step 102: Construct an image transformation model for the real-time image and the reference image in a high-precision displacement measurement scenario.
[0057] Specifically, this embodiment describes a linear servo motor (LSM) motion positioning scenario. Linear servo motors offer advantages such as high speed, high precision, and good adaptability, making them suitable for various applications requiring high speed and precision, such as transportation equipment, CNC machine tools, and robot control in industry. Therefore, positioning measurement using LSM motors is of great significance.
[0058] like Figure 2 As shown, the linear servo motor motion positioning scenario consists of a servo motor 201, a servo motor displacement stage 202, a displacement stage fixing component 203, a target 204, and a camera 205. The camera 205 is mounted on the servo motor displacement stage 202, and the servo motor 201 controls the servo motor displacement stage 202 to move on the displacement stage fixing component 203. The target 204 is fixed on the displacement stage fixing component 203. The real-time image is obtained by the camera 205 capturing images of the target 204 as the servo motor displacement stage 202 moves. The reference image is obtained by the camera 205 capturing continuous images of the target 204 beforehand and then stitching them together.
[0059] The target image is a pre-designed image with texture information. In this embodiment, the cropped portion of the target image is as follows: Figure 3 As shown, in addition to the texture information used for image matching, the target image also has four feature lines. A reference image is obtained by capturing a pattern with these four feature lines using a camera, and the positions of the four lines on the image are then acquired. These four positions can also be acquired when a real-time image is obtained, and matched with the reference image for coarse localization. After coarse localization, the method of this invention is used for fine localization.
[0060] The transformation parameters of the image transformation model are two displacement parameters, and the displacement parameter S(s,t) is the transformation parameter to be determined.
[0061] Specifically, when performing image matching, assume that the real-time image and the reference image are named I(x, y) and I(y), respectively. The relationship between two images is typically described using an affine transformation model:
[0062]
[0063] a, b, c, d, e, and f are the six parameters of the model, which can be represented by a single parameter set U(a, b, c, d, e, f). The reference image can then be represented as:
[0064]
[0065] The accurate parameter values can be obtained when the following cost function satisfies its minimum value:
[0066]
[0067] For linear motion positioning and similar scenarios, the relationship between the real-time image and the reference image is merely a two-dimensional displacement relationship. In this case, the transformation model can be simplified to:
[0068]
[0069] s and t are two parameters of the image displacement, which can be represented by the parameters of S as S(s, t). Then the reference image can be represented as:
[0070]
[0071] Accurate image displacement can be obtained when the following cost function reaches its minimum value:
[0072]
[0073] Here, the cost Q is a function of the parameter S(s,t). In the existing method, since the reference image R(x,y,u) must be obtained first to calculate the new model parameters according to (3), iterative steps cannot be avoided. The same applies to the case of (6).
[0074] If the cost Q is solved directly and independently of the summation operation using S(s,t), the value of S(s,t) can be easily calculated from the minimum value of Q.
[0075] Step 104: Based on the image transformation model, obtain the first relation of the reference image with respect to the weight function matrix with displacement parameters as independent variables through the image interpolation algorithm.
[0076] The transformation from R(x,y) to R(x,y,S) is merely an image displacement as described in (4). Therefore, R(x,y,S) or... can be obtained from the reference image R(x,y) and the parameters S(s,t). Assume image displacements s and t are less than 1 pixel. Interpolation is performed within a 4-pixel × 4-pixel window, such as... Figure 4 As shown.
[0077] When the pixel value of a point is needed, select the nearest top-left integer point as g(i, j), and then interpolate to obtain the following relationship:
[0078]
[0079] The function in the formula is a weighting function. For example, using bicubic interpolation, it can be written as the following equation:
[0080]
[0081] u is P i The parameter can be replaced by s or t. (8) It can be rewritten in general form as:
[0082] P m (u)=[a m0 a m1 a m2 a m3 ][1, u, u 2 u 3 ] T (9)
[0083] Equation (7) can be written as:
[0084]
[0085] Equation (10) is the first relation of the reference image with respect to the weight function matrix with displacement parameters as independent variables.
[0086] Step 106: By representing the weight function as a product of the coefficient matrix and the displacement parameter matrix, the second relation of the reference image with respect to the known constant matrix and the two-dimensional displacement parameter matrix is obtained according to the first relation.
[0087] Specifically, if (10) is directly replaced with the cost function in (6), then the parameter S(s,t) cannot be separated from the summation operation. To separate S(s,t), According to (10), it is expressed as:
[0088]
[0089] In (11), G(i,j) is a 16-column vector, as follows:
[0090] G(i,j)=[g j-1,i-1 g j-1,i , ..., g j+1,i+2 g j+2,i +2] (12)
[0091] A(s,t) is a 16-item row vector:
[0092] A(s,t)=[P0(s)P0(t), P0(s)P1(t),...,P3(s)P3(t)] T (13)
[0093] The function P above n (s)P m (t) can be represented as:
[0094]
[0095] Define A(s,t) as:
[0096] A(s,t)=B·U(s,t) (15)
[0097] From the above equation, B is a 16×16 matrix with known values, which can be written as:
[0098]
[0099] U(s,t) is a 16-column vector, consisting of:
[0100] U(s,t)=[1,t,t] 2 , t 3 s, st, st 2 ..., s 3 t 2 s 3 t 3 ]T (17)
[0101] That is, the second relationship between the reference image and the known constant matrix and the two-dimensional displacement parameter matrix is:
[0102]
[0103] Where, G(i,j)=[g j-1,i-1 g j-1,i , ..., g j+1,i+2 g j+2,i+2 [This represents the integrated interpolation point parameter matrix.] Given a constant matrix consisting of coefficient matrices, U(s,t) = [1, t, t] 2 , t 3 ,s,st,st 2 ..., s 3 t 2 s 3 t 3 ] T It is a two-dimensional displacement parameter matrix, which is a 16-column vector.
[0104] Step 108: Determine the cost function for matching the real-time image and the reference image using the least squares method based on the second relation.
[0105] The cost function is a function of the two-dimensional displacement parameter matrix.
[0106] Specifically, the cost function (6) can be written as:
[0107]
[0108] I(i,j) is a constant value, which can be ignored for LS. Therefore, the cost function can be expressed by formula (18):
[0109]
[0110] In (19), ∑ i,j G T (i,j)G(i,j) can be defined as D, and can be expressed as:
[0111]
[0112] ∑ i,j G(i,j)I(i,j) can be defined as E and can be expressed as:
[0113]
[0114] Finally, the cost The function denoted as U(s,t) is expressed as:
[0115]
[0116] In (22), the reference image can be used. B is directly calculated from the real-time image I(x,y) T DB and EB. Thus, the cost function... It has been directly expressed as a function of the image displacement parameter U(s,t).
[0117] Step 110: During real-time positioning, the cost function is solved based on the real-time image to be positioned, the preset reference image, and the predetermined initial values of the two-dimensional displacement parameters to obtain the displacement parameter results of the best match between the real-time image to be positioned and the preset reference image. The positioning information of the displacement stage is determined based on the displacement parameter results.
[0118] In (22), the cost function It is already directly expressed as a function of the image displacement parameter U(s, t). Therefore, there is no need to resample the image. For example, using gradient descent, the optimal result S(s, t) satisfying the least squares condition can be obtained based on the given initial value S0(s0, t0).
[0119] The initial value is determined through coarse positioning. In this embodiment, it is determined by capturing four feature lines on the target image.
[0120] In the aforementioned least-squares fast image matching method, the image transformation model between the real-time image and the reference image is simplified based on the characteristic that translational motion in high-precision displacement measurement scenarios only involves two translation parameters. The six affine parameters of the least-squares matching method are reduced to two translation parameters, thus directly representing the least-squares objective function as a cost function of two-dimensional displacement parameters. Solving this cost function directly yields the displacement parameter result of the optimal match between the real-time image and the reference image, thereby determining the positioning information of the displacement stage. This invention represents the objective function as a function of transformation parameters, allowing for direct numerical solution. It avoids multiple image resampling, obtains the global optimum, and avoids convergence to local optima, improving the efficiency of the least-squares image matching method while enhancing accuracy and reliability. It boasts advantages such as high execution efficiency, good real-time performance, and simplicity and reliability.
[0121] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0122] In one embodiment, such as Figure 5 As shown, a least-squares fast image matching device is provided, comprising: an image transformation model determination module 502, a first relation determination module 504, a second relation determination module 506, a cost function determination module 508, and an image matching and localization module 510, wherein:
[0123] The image transformation model determination module 502 is used to construct image transformation models for real-time images and reference images in a high-precision displacement measurement scenario. The transformation parameters of the image transformation model are two displacement parameters. The high-precision displacement measurement scenario consists of a displacement stage, a displacement stage fixture, a target object, and a camera. The camera is mounted on the displacement stage, and the displacement stage can move on the displacement stage fixture. The target object is fixed on the displacement stage fixture. The real-time image is obtained by the camera capturing images of the target object while the displacement stage is moving. The reference image is obtained by stitching together images of the target object captured by the camera in advance.
[0124] The first relation determination module 504 is used to obtain the first relation of the reference image with respect to the weight function matrix with displacement parameters as independent variables based on the image transformation model and through the image interpolation algorithm.
[0125] The second relation determination module 506 is used to obtain the second relation of the reference image with respect to the known constant matrix and the two-dimensional displacement parameter matrix by expressing the weight function as a product of the coefficient matrix and the displacement parameter matrix according to the first relation;
[0126] The cost function determination module 508 is used to determine the cost function for matching the real-time image and the reference image using the least squares method according to the second relation; the cost function is a function of the two-dimensional displacement parameter matrix;
[0127] The image matching and positioning module 510 is used for real-time positioning. It solves the cost function based on the real-time image to be positioned, the preset reference image, and the predetermined initial values of the two-dimensional displacement parameters to obtain the displacement parameter result of the best match between the real-time image to be positioned and the preset reference image. The positioning information of the displacement stage is determined based on the displacement parameter result.
[0128] The image transformation model determination module 502 is also used to construct image transformation models for real-time images and reference images in high-precision displacement measurement scenarios as follows:
[0129]
[0130] in, (x, y) represents the position information of the reference image, (s, t) represents the position information of the real-time image, and (s, t) represents the displacement parameters in two directions.
[0131] The first relation determination module 504, based on the image transformation model, obtains the first relation of the reference image with respect to the weight function matrix with displacement parameters as independent variables through an image interpolation algorithm performed within a 4-pixel × 4-pixel window.
[0132]
[0133] Among them, P m (s), m∈[0,3], P n (t), where n∈[0,3] is the weight function. Let g be the interpolation point parameter matrix. j,i This represents the interpolation point parameters.
[0134] The second relation determination module 506 is also used to express the weight function as a product of the coefficient matrix and the displacement parameter matrix:
[0135] P m (u)=[a m0 a m1 a m2 a m3 ][1, u, u 2 u 3 ] T u∈{s,t}
[0136] Among them, [a m0 a m1 a m2 a m3 ] is the coefficient matrix, [1, u, u 2 u 3 [ ] represents the displacement parameter matrix;
[0137] Based on the first relation, the second relation of the reference image with respect to the known constant matrix and the two-dimensional displacement parameter matrix is:
[0138]
[0139] Where, G(i,j)=[g j-1,i-1 g j-1,i , ..., g j+1,i+2 g j+2,i+2 [This represents the integrated interpolation point parameter matrix.] Given a constant matrix consisting of coefficient matrices, U(s,t) = [1, t, t]2 , t 3 ,s,st,st 2 ..., s 3 t 2 s 3 t 3 ] T It is a two-dimensional displacement parameter matrix, which is a 16-column vector.
[0140] The cost function determination module 508 is also used to solve the cost function using a gradient descent algorithm based on the real-time image to be located, the preset reference image, and the predetermined initial values of the two-dimensional displacement parameters, so as to obtain the displacement parameter result that best matches the real-time image to be located and the preset reference image.
[0141] Specific limitations regarding the least-squares fast image matching device can be found in the limitations of the least-squares fast image matching method described above, and will not be repeated here. Each module in the aforementioned least-squares fast image matching device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0142] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements a least-squares fast image matching method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0143] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0144] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiment.
[0145] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0146] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0147] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0148] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method of least squares fast image matching, characterized by, The method comprises: An image transformation model of a real-time image and a reference image is constructed in a high-precision displacement measurement scene; transformation parameters of the image transformation model are two displacement parameters; the high-precision displacement measurement scene is composed of a displacement table, a displacement table fixing member, a shooting target and a camera; the camera is installed on the displacement table, the displacement table can move on the displacement table fixing member, and the shooting target is fixed on the displacement table fixing member; the real-time image is obtained by shooting the target by the camera when the displacement table moves; and the reference image is obtained by splicing the target after the camera pre-shoots the target continuously; Based on the image transformation model, a first relationship of a weight function matrix of the reference image with respect to the displacement parameters is obtained by an image interpolation algorithm, comprising: based on the image transformation model, a first relationship of a weight function matrix of the reference image with respect to the displacement parameters is obtained by an image interpolation algorithm in a 4-pixel×4-pixel window, and the first relationship is: wherein , is a weight function, is an interpolation point parameter matrix, denotes an interpolation point parameter; According to the first relationship, a second relationship of the reference image with respect to a known constant matrix and a two-dimensional displacement parameter matrix is obtained by representing the weight function as a multiplication of a coefficient matrix and a displacement parameter matrix, comprising: the weight function is represented as a multiplication of a coefficient matrix and a displacement parameter matrix. wherein, is the coefficient matrix, is the displacement parameter matrix; According to the first relationship, a second relationship of the reference image with respect to a known constant matrix and a two-dimensional displacement parameter matrix is obtained, and the second relationship is: wherein, is the integrated interpolation point parameter matrix, is the known constant matrix, which is composed of the coefficient matrix, is the two-dimensional displacement parameter matrix, which is a 16-item column vector; According to the second relationship, a cost function of matching the real-time image and the reference image is determined by a least square method, and the cost function is a function of the two-dimensional displacement parameter matrix. In real-time positioning, the cost function is solved according to a real-time image to be positioned, a preset reference image and a two-dimensional displacement parameter initial value, a displacement parameter result of best matching of the real-time image to be positioned and the preset reference image is obtained, and positioning information of the displacement table is determined according to the displacement parameter result.
2. The method of claim 1, wherein, An image transformation model of a real-time image and a reference image is constructed in a high-precision displacement measurement scene; transformation parameters of the image transformation model are two displacement parameters, comprising: An image transformation model of a real-time image and a reference image is constructed in a high-precision displacement measurement scene, and the transformation parameters of the image transformation model are two displacement parameters. wherein, represents position information of the reference image, represents position information of the real-time image, represents displacement parameters in two directions.
3. The method of claim 2, wherein, According to the second relationship, a cost function of matching the real-time image and the reference image is determined by a least square method, comprising: According to the second relationship, a cost function of matching the real-time image and the reference image is determined by a least square method, and the cost function is a function of the two-dimensional displacement parameter matrix. wherein the variable defined as a simplified formula, , denotes the transpose of the matrix , , , and The values of the reference image and the real-time image can be calculated directly according to the reference image and the real-time image, represents a constant value.
4. The method of claim 1, wherein, In real-time positioning, the cost function is solved according to a real-time image to be positioned, a preset reference image and a two-dimensional displacement parameter initial value, a displacement parameter result of best matching of the real-time image to be positioned and the preset reference image is obtained, and positioning information of the displacement table is determined according to the displacement parameter result. In real-time positioning, the cost function is solved according to a real-time image to be positioned, a preset reference image and a two-dimensional displacement parameter initial value, a displacement parameter result of best matching of the real-time image to be positioned and the preset reference image is obtained, and positioning information of the displacement table is determined according to the displacement parameter result.
5. The method according to any one of claims 1 to 4, characterized in that, The shooting target is a pre-designed image with texture information.
6. A least square fast image matching device, characterized by, The device implements the least square fast image matching method of any one of claims 1-5, comprising: An image transformation model determination module is configured to construct an image transformation model of a real-time image and a reference image in a high-precision displacement measurement scene; transformation parameters of the image transformation model are two displacement parameters; the high-precision displacement measurement scene is composed of a displacement table, a displacement table fixing member, a shooting target and a camera; the camera is installed on the displacement table, the displacement table can move on the displacement table fixing member, and the shooting target is fixed on the displacement table fixing member; the real-time image is obtained by shooting the target by the camera when the displacement table moves; and the reference image is obtained by splicing the target after the camera pre-shoots the target continuously; A first relationship determination module is configured to obtain a first relationship of a weight function matrix of the reference image with respect to the displacement parameters by an image interpolation algorithm based on the image transformation model; A second relationship determination module is configured to obtain a second relationship of the reference image with respect to a known constant matrix and a two-dimensional displacement parameter matrix by expressing the weight function as a form of multiplication of a coefficient matrix and a displacement parameter matrix according to the first relationship; A cost function determination module is configured to determine a cost function of matching the real-time image and the reference image by a least square method according to the second relationship; the cost function is a function with respect to the two-dimensional displacement parameter matrix; An image matching positioning module is configured to, when positioning in real time, solve the cost function according to a real-time image to be positioned, a preset reference image and a two-dimensional displacement parameter initial value determined in advance, obtain a displacement parameter result of the best matching of the real-time image to be positioned and the preset reference image, and determine positioning information of the displacement table according to the displacement parameter result. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Camera self-calibration method and device, apparatus and medium
CN113781583A
Image matching method, image matching apparatus, image matching system, and storage medium
US20190266737A1