A monocular vision positioning method, system and application thereof
By calculating the homogeneous position coordinate matrix of matching feature points on the query image and the database image, and iteratively compute the scale coefficient, the problem of scale ambiguity in monocular visual positioning is solved, and accurate positioning is achieved in the case of single-frame database image matching.
Patent Information
- Application Number
- CN202310008891.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-04
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-01-04
AI Technical Summary
When dealing with scale ambiguity, existing monocular visual positioning technology requires multiple matching database images to effectively solve it. However, not every query image can retrieve multiple matching database images, resulting in the inability to determine the absolute position of the query camera.
By calculating the homogeneous position coordinate matrix of matching feature points on the normalized query image and the matching database image, combining the rotation matrix and the translation vector, setting the initial value and iteratively computing the scale coefficient, the iterative reweighting method is used to continuously correct the estimated value of the scale coefficient until the iteration termination condition is met, thereby determining the position of the query camera.
It realizes that when only one database image is needed to match, the scale ambiguity problem can be effectively solved, the position of the query camera is accurately determined, and the accuracy and efficiency of monocular visual positioning are improved.
Smart Images

Figure CN116309820B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of visual positioning, and in particular relates to a monocular visual positioning method, system and application thereof. Background Art
[0002] Visual positioning technology in indoor scenes is currently the most widely studied indoor positioning technology. Visual positioning systems can be divided into monocular visual positioning systems and multi-camera visual positioning systems according to the number of query cameras.
[0003] In the actual positioning process, the query image needs to be uploaded to the server and the matching database image is retrieved in the visual map. After obtaining the database image that matches the query image, an epipolar geometry constraint relationship can be established between the matching database image and the query image. With the epipolar geometry constraint relationship, the relative position relationship between the query camera and the database camera can be estimated.
[0004] It should be noted that the epipolar geometry constraint relationship established between a query image and a database image has the problem of scale ambiguity. Therefore, only the relative position of the query camera can be estimated based on the relationship, but the absolute position of the query camera cannot be obtained. The usual method to solve the scale ambiguity problem is to use multiple matching database images to establish multiple epipolar geometry constraints, thereby avoiding the solution of the scale coefficient. However, not every query image can retrieve multiple matching database images.
[0005] In order to solve the scale ambiguity problem, existing algorithms often establish multiple epipolar geometric constraints through multiple database images, thereby avoiding solving the scale coefficient and indirectly solving the scale ambiguity problem. However, in actual positioning applications, it is found that not every database image can retrieve multiple matching database images. Therefore, when the query image can only retrieve one matching database image, multiple epipolar geometric constraints cannot be obtained. Summary of the invention
[0006] The purpose of the embodiments of the present invention is to provide a monocular vision positioning method, system and application thereof, aiming to solve the problems existing in the prior art identified in the background technology.
[0007] The embodiment of the present invention is implemented as follows: a monocular vision positioning method, the method comprising:
[0008] Calculate the homogeneous position coordinate matrix of the matching feature points on the normalized query image and the matching database image respectively;
[0009] According to the homogeneous position coordinate matrices of the query image and the matching database image, a rotation matrix and a translation vector for representing the relative position relationship between the query camera and the database camera are calculated;
[0010] Set initial values and calculate the initial solution of the scale coefficient based on the observation vector and the measurement vector;
[0011] Update the homotopy value according to the norm value;
[0012] Calculating an overall error vector and constructing a weight matrix for solving a least squares problem based on the overall error vector;
[0013] Calculate the iterative value of the scaling coefficient and the norm of the overall error vector according to the weight matrix, the observation vector and the measurement vector;
[0014] Determine whether an iteration termination condition is met, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold;
[0015] When the iteration termination condition is met, the iteration is terminated, and the position of the camera is queried according to the scale coefficient. When the iteration termination condition is not met, the iterative update of the homotopy value is continued until the iteration termination condition is met.
[0016] Another object of an embodiment of the present invention is to provide a monocular vision positioning system, the system comprising:
[0017] A homogeneous position coordinate matrix calculation module is used to calculate the homogeneous position coordinate matrices of the matching feature points on the normalized query image and the matching database image respectively;
[0018] A relative position relationship calculation module, used to calculate a rotation matrix and a translation vector used to characterize the relative position relationship between the query camera and the database camera according to the homogeneous position coordinate matrix of the query image and the matching database image;
[0019] A scale coefficient initial solution calculation module is used to set initial values and calculate the scale coefficient initial solution according to the observation vector and the measurement vector;
[0020] A homotopy value updating module, used for updating the homotopy value according to the norm value;
[0021] A weight matrix construction module, used for calculating an overall error vector and constructing a weight matrix for solving a least squares problem according to the overall error vector;
[0022] A scale coefficient iteration calculation module is used to calculate the scale coefficient iteration value and the overall error vector norm according to the weight matrix, the observation vector and the measurement vector;
[0023] A termination determination module is used to determine whether an iteration termination condition is met, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold;
[0024] The result output module is used to terminate the iteration when the iteration termination condition is met, and calculate the position of the query camera according to the scale coefficient. When the iteration termination condition is not met, the homotopy value is continued to be iteratively updated until the iteration termination condition is met.
[0025] Another object of an embodiment of the present invention is to provide an application of a monocular vision positioning method in indoor positioning.
[0026] The embodiment of the present invention uses the spatial position of the matching feature points to solve the scale coefficient in the epipolar geometric constraint relationship. When querying an image, only one database image needs to be matched to achieve the positioning function. In addition, in the process of solving the scale coefficient, the estimated value of the scale coefficient is continuously corrected by an iterative reweighting method, and the minimum domain solution of the scale coefficient is gradually obtained, thereby improving the accuracy of solving the scale coefficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of an execution of a monocular vision positioning method provided by an embodiment of the present invention;
[0028] Figure 2 A flow chart of a monocular vision positioning method provided by an embodiment of the present invention;
[0029] Figure 3 A flowchart of calculating a homogeneous position coordinate matrix provided by an embodiment of the present invention;
[0030] Figure 4 A flowchart for calculating a rotation matrix and a translation vector provided by an embodiment of the present invention;
[0031] Figure 5 A flowchart of constructing a weight matrix provided by an embodiment of the present invention;
[0032] Figure 6 A flow chart of calculating the iterative value of the scaling coefficient and the norm of the overall error vector provided by an embodiment of the present invention;
[0033] Figure 7 A structural block diagram of a monocular vision positioning system provided by an embodiment of the present invention;
[0034] Figure 8 FIG. 4 is a block diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0036] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0037] like Figure 1 and 2 As shown, in one embodiment, a monocular vision positioning method is proposed, which may specifically include the following steps:
[0038] Step S100, respectively calculating the homogeneous position coordinate matrices of the normalized matching feature points on the query image and the matching database image.
[0039] In the embodiment of the present invention, the query image I Q It is taken by the user through a handheld smart mobile terminal, and the matching database image I M is obtained through the retrieval algorithm and is consistent with the query image I Q The database images have certain visual feature similarities, and the query image and the database images have a certain number of visual feature matching points. Here, the retrieval algorithm belongs to the prior art, and the embodiment of the present invention does not specifically limit it.
[0040] Since the query image I Q Matching database image I M There are a certain number of visual feature matching points between them, based on which the normalized query image I can be calculated Q Matching database image I M The homogeneous position coordinate matrix of the matched feature points.
[0041] Step S200 , calculating a rotation matrix and a translation vector for representing the relative position relationship between the query camera and the database camera according to the homogeneous position coordinate matrices of the query image and the matching database image.
[0042] Step S300, setting initial values and calculating an initial solution of the scale coefficient according to the observation vector and the measurement vector.
[0043] In the embodiment of the present invention, the initial value includes a norm value, a homology parameter, an initial value of a homology value, an error threshold, an iteration threshold, and an iteration count value. The observation vector is a vector composed of observation data, that is, a sample value in statistics. The measurement vector is a vector obtained by performing operations on the basis of the observation vector. In the embodiment of the present invention, the observation vector is calculated from the translation vector and the image point coordinates; the measurement vector is calculated from the rotation matrix and the world point coordinates.
[0044] In the embodiment of the present invention, the norm value p is set to 10, the iteration number threshold k is set to L =20, homotopy parameter k H =1.5, initial value k of homotopy value HI =2, error threshold δ, iteration count value l=1, based on which, the initial solution μ0 of the scale coefficient can be defined as:
[0045]
[0046] Step S400, updating the homotopy value according to the norm value.
[0047] In the embodiment of the present invention, for the homotopy value k HI The update is carried out as follows:
[0048]
[0049] Among them, min(p,k H k HI ) represents the norm values p and k H k HI The smaller value in the function max(p,k H k HI ) represents the norm values p and k H k HI The larger value in .
[0050] Step S500, calculating the overall error vector and constructing a weight matrix for solving the least squares problem according to the overall error vector.
[0051] In the embodiment of the present invention, the weight matrix can assign greater weights to more reliable estimation results, which can improve the estimation accuracy of the least squares method.
[0052] Step S600, calculating the scaling coefficient iteration value and the overall error vector norm according to the weight matrix, the observation vector and the measurement vector.
[0053] Step S700, determining whether an iteration termination condition is satisfied, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold.
[0054] Step S800, when the iteration termination condition is met, the iteration is terminated, and the position of the query camera is calculated according to the scale coefficient. When the iteration termination condition is not met, the homotopy value is continuously iterated and updated until the iteration termination condition is met.
[0055] In the embodiment of the present invention, when the iteration termination condition is met, the obtained scale coefficient is assigned to the scale coefficient estimation value μ F , which is equivalent to calculating the position of the query camera based on the scale factor
[0056]
[0057] Among them, M R and M T are the rotation matrix and translation vector obtained in step S200, respectively. D is the position matrix of the feature points of the matching database image. Solve the position of the query camera After that, the location of the query camera is considered to be the location of the user, thus realizing the estimation of the user's location. When the iteration termination condition is not met, steps S400 to S700 are repeated until the termination condition is met.
[0058] The embodiment of the present invention utilizes the spatial position of the matching feature points to solve the scale coefficient in the epipolar geometric constraint relationship. When querying an image, only one database image needs to be matched to achieve the positioning function. In addition, in the process of solving the scale coefficient, the estimated value of the scale coefficient is continuously corrected by the iterative reweighting method, and the minimum domain solution of the scale coefficient is gradually obtained, thereby improving the accuracy of solving the scale coefficient. Compared with the least squares scale coefficient solution method in the prior art, the method of the embodiment of the present invention has certain advantages in terms of computational efficiency and computational accuracy.
[0059] In one embodiment, Figure 3 As shown, step S100 may specifically include the following steps:
[0060] Step S101 , performing accelerated robust feature point extraction on the query image and the matching database image respectively, to obtain a query image feature point position matrix and a matching database image feature point position matrix.
[0061] Step S102: obtaining a plurality of pairs of matching feature points between the query image and the matching database image through feature point matching.
[0062] Step S103, obtaining a homogeneous position coordinate matrix of matching feature points on the query image and the matching database image, and normalizing the matching feature points to obtain a normalized homogeneous position coordinate matrix.
[0063] In the embodiment of the present invention, the query image feature point position matrix is PQ , the position matrix of the feature points of the matching database image is P D The homogeneous position coordinate matrices of the matching feature points on the query image and the matching database image are P QM and P DM The normalized homogeneous position coordinate matrices are and in:
[0064]
[0065]
[0066] In one embodiment, Figure 4 As shown, step S200 may specifically include the following steps:
[0067] Step S201, solving the essential matrix according to the homogeneous position coordinate matrix and the epipolar constraint relationship.
[0068] In the embodiment of the present invention, the normalized homogeneous position coordinate matrix and The relationship between it and the essential matrix E satisfies the epipolar constraint, that is:
[0069]
[0070] By solving the above epipolar constraint relationship, the essential matrix E can be obtained. The essential matrix E can reflect the relative position relationship between the query camera and the database camera, which can be expressed by the rotation matrix M R and the translation vector M T Describe. Essential matrix E and rotation matrix M R and the translation vector M T The relationship between them is:
[0071] E=[M T ] × M R
[0072] Among them, [M T ] × is the translation vector M T The antisymmetric matrix of .
[0073] Step S202: performing singular value decomposition on the essential matrix to obtain a rotation matrix and a translation vector for characterizing the relative position relationship between the query camera and the database camera.
[0074] In the embodiment of the present invention, the rotation matrix M between cameras can be solved by performing singular value decomposition on the essential matrix E: R and the translation vector M T The rotation matrix MR is a 3×3 dimensional matrix consisting of m elements st (s=1,2,3,t=1,2,3) composition:
[0075]
[0076] Translation vector M T is a 3×1 dimensional vector consisting of m elements q (q=1,2,3) composition:
[0077] M T =[m1 m2 m3] T .
[0078] In one embodiment, Figure 5 As shown, step S500 may specifically include the following steps:
[0079] Step S501, calculating the overall error vector according to the scale coefficient, the observation vector and the measurement vector.
[0080] In the embodiment of the present invention, the overall error vector can be expressed by the observation vector H O and the measurement vector Y M Find:
[0081] Δ=μ (l) H O -Y M
[0082] Among them, μ (l) is the scale coefficient obtained in the first iteration, H O is the observation vector, Y M is the measurement vector.
[0083] In the embodiment of the present invention, it is considered that Y M is the measurement vector Y M is relatively reliable data, and the observation vector H O Multiplying by the scale factor is a quantity with error, and the difference between the two is the error Δ. By solving the minimized error, the optimal estimate of the scale factor is obtained.
[0084] Specifically, the observation vector H O =[(m3u1-m1),(m3v1-m2),…,(m3u n -m1),(m3v n -m2)] T , (u1,v1) is the image position coordinate of the first matching feature point, (u n ,v n ) is the image position coordinate of the nth matching feature point. Measurement vector Y M for:
[0085]
[0086] Among them, (x1, y1, z1) is the spatial position coordinate of the first matching feature point, (x n ,y n ,z n ) is the spatial position coordinate of the nth matching feature point. According to the position of the matching feature point on the database image, it can be found in the matrix M D Find the spatial coordinates of the matching feature points in the matrix M D is the spatial position coordinate matrix of the pixel points of the database image, matrix M D is an m D ×3-dimensional matrix, which contains m D Three-dimensional position coordinates, m D is the total number of pixels in the matching database image, and the matrix M D The three-dimensional position coordinates stored in the image correspond one by one to the data points in the matching database image. D The spatial position of each pixel in the matching database image can be found.
[0087] Based on this, the overall error vector Δ can be expressed as Δ=[e1,…,e i ,…e 2n ] T , the overall error vector Δ contains 2n error values in total.
[0088] Step S502: Calculate the diagonal element values of the weight matrix according to the overall error vector.
[0089] In the embodiment of the present invention, the diagonal element values of the weight matrix can be further calculated according to the overall error vector Δ
[0090]
[0091] Step S503, calculating the weight values in the weight matrix according to the diagonal element values, and completing the construction of the weight matrix.
[0092] In the embodiment of the present invention, the diagonal element values are used The weight value w in the weight matrix can be calculated i :
[0093]
[0094] Based on this, the weight matrix W for solving the least squares problem can be constructed:
[0095]
[0096] In one embodiment, Figure 6 As shown, step S600 may specifically include the following steps:.
[0097] Step S601, calculating the basic value of the scaling coefficient according to the weight matrix, the observation vector and the measurement vector.
[0098] In the embodiment of the present invention, the basic value μ of the scale factor is B for:
[0099]
[0100] Step S602, calculating Newton coefficients according to preset homotopy values.
[0101] The Newton coefficient q is:
[0102]
[0103] Step S603, iteratively update the scaling coefficient and assign a value to the error norm.
[0104] Scale factor μ (l) The update function is:
[0105]
[0106] The corresponding error norm p N The assignment function is:
[0107]
[0108] Step S604, solving the norm of the overall error vector.
[0109] The overall error vector norm is:
[0110] Δ F =||Δ|| pN
[0111] Step S605: update the number of iterations of the scaling coefficient.
[0112] In the embodiment of the present invention, after the above calculation is completed, the number of iterations of the scale coefficient is updated, that is, l is assigned a value of l+1.
[0113] like Figure 7 As shown, in one embodiment, a monocular vision positioning system is provided, which may specifically include a homogeneous position coordinate matrix calculation module 100, a relative position relationship calculation module 200, a scale coefficient initial solution calculation module 300, a homology value update module 400, a weight matrix construction module 500, a scale coefficient iterative calculation module 600, a termination judgment module 700 and a result output module 800.
[0114] The homogeneous position coordinate matrix calculation module 100 is used to calculate the homogeneous position coordinate matrices of the normalized query image and the matching feature points on the matching database image respectively.
[0115] The relative position relationship calculation module 200 is used to calculate a rotation matrix and a translation vector for representing the relative position relationship between the query camera and the database camera according to the homogeneous position coordinate matrices of the query image and the matching database image.
[0116] The scale coefficient initial solution calculation module 300 is used to set initial values and calculate the scale coefficient initial solution according to the observation vector and the measurement vector.
[0117] The homotopy value updating module 400 is used to update the homotopy value according to the norm value.
[0118] The weight matrix construction module 500 is used to calculate the overall error vector and construct a weight matrix for solving the least squares problem according to the overall error vector.
[0119] The scale coefficient iteration calculation module 600 is used to calculate the scale coefficient iteration value and the overall error vector norm according to the weight matrix, the observation vector and the measurement vector.
[0120] The termination determination module 700 is used to determine whether an iteration termination condition is met, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold.
[0121] The result output module 800 is used to terminate the iteration when the iteration termination condition is met, calculate the position of the query camera according to the scale coefficient, and continue to iteratively update the homotopy value until the iteration termination condition is met when the iteration termination condition is not met.
[0122] In one embodiment, an application of a monocular vision positioning method in indoor positioning is provided.
[0123] Figure 8An internal structure diagram of a computer device in an embodiment is shown. The computer device includes a processor, a memory, a network interface, an input device and a display screen connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, enables the processor to implement a monocular visual positioning method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute a monocular visual positioning method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or may be a button, trackball or touchpad provided on the housing of the computer device, or may be an external keyboard, touchpad or mouse, etc.
[0124] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0125] In one embodiment, the monocular vision positioning system provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 8 The computer device shown in the figure is run. The memory of the computer device can store various program modules that constitute the monocular vision positioning system, such as: Figure 7 The homogeneous position coordinate matrix calculation module 100, the relative position relationship calculation module 200, the scale coefficient initial solution calculation module 300, the homotopy value update module 400, the weight matrix construction module 500, the scale coefficient iteration calculation module 600, the termination determination module 700 and the result output module 800 are shown. The computer program composed of each program module enables the processor to execute the steps in the monocular vision positioning method of each embodiment of the present application described in this specification.
[0126] For example, Figure 8 The computer device shown can be Figure 7 The homogeneous position coordinate matrix calculation module 100 in the monocular vision positioning system shown in the figure performs step S100. The computer device can perform step S200 through the relative position relationship calculation module 200. The computer device can perform step S300 through the scale coefficient initial solution calculation module 300.
[0127] In one embodiment, a computer device is provided, the computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0128] Step S100, respectively calculating the homogeneous position coordinate matrices of the normalized matching feature points on the query image and the matching database image.
[0129] Step S200 , calculating a rotation matrix and a translation vector for representing the relative position relationship between the query camera and the database camera according to the homogeneous position coordinate matrices of the query image and the matching database image.
[0130] Step S300, setting initial values and calculating an initial solution of the scale coefficient according to the observation vector and the measurement vector.
[0131] Step S400, updating the homotopy value according to the norm value.
[0132] Step S500, calculating the overall error vector and constructing a weight matrix for solving the least squares problem according to the overall error vector.
[0133] Step S600, calculating the scaling coefficient iteration value and the overall error vector norm according to the weight matrix, the observation vector and the measurement vector.
[0134] Step S700, determining whether an iteration termination condition is satisfied, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold.
[0135] Step S800, when the iteration termination condition is met, the iteration is terminated, and the position of the query camera is calculated according to the scale coefficient. When the iteration termination condition is not met, the homotopy value is continuously iterated and updated until the iteration termination condition is met.
[0136] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following steps:
[0137] Step S100, respectively calculating the homogeneous position coordinate matrices of the normalized matching feature points on the query image and the matching database image.
[0138] Step S200 , calculating a rotation matrix and a translation vector for representing the relative position relationship between the query camera and the database camera according to the homogeneous position coordinate matrices of the query image and the matching database image.
[0139] Step S300, setting initial values and calculating an initial solution of the scale coefficient according to the observation vector and the measurement vector.
[0140] Step S400, updating the homotopy value according to the norm value.
[0141] Step S500, calculating the overall error vector and constructing a weight matrix for solving the least squares problem according to the overall error vector.
[0142] Step S600, calculating the scaling coefficient iteration value and the overall error vector norm according to the weight matrix, the observation vector and the measurement vector.
[0143] Step S700, determining whether an iteration termination condition is satisfied, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold.
[0144] Step S800, when the iteration termination condition is met, the iteration is terminated, and the position of the query camera is calculated according to the scale coefficient. When the iteration termination condition is not met, the homotopy value is continuously iterated and updated until the iteration termination condition is met.
[0145] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0146] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0147] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described 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 above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A monocular vision positioning method, characterized in that: The method comprises: Calculate the homogeneous position coordinate matrix of the matching feature points on the normalized query image and the matching database image respectively; According to the homogeneous position coordinate matrices of the query image and the matching database image, a rotation matrix and a translation vector for representing the relative position relationship between the query camera and the database camera are calculated; Set initial values and calculate the initial solution of the scale coefficient based on the observation vector and the measurement vector; Update the homotopy value according to the norm value; Calculating an overall error vector and constructing a weight matrix for solving a least squares problem based on the overall error vector; Calculate the iterative value of the scaling coefficient and the norm of the overall error vector according to the weight matrix, the observation vector and the measurement vector; Determine whether an iteration termination condition is met, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold; When the iteration termination condition is met, the iteration is terminated, and the position of the camera is queried according to the scale coefficient. When the iteration termination condition is not met, the homotopy value is iteratively updated until the iteration termination condition is met. The step of calculating the iterative value of the scale coefficient and the norm of the overall error vector according to the weight matrix, the observation vector and the measurement vector specifically includes: Calculate the basic value of the scale coefficient according to the weight matrix, the observation vector and the measurement vector; Calculate Newton coefficients based on preset homotopy values; Iteratively update the scale coefficient and assign a value to the error norm; Solve for the norm of the overall error vector; Update the number of iterations of the scale coefficient; The update function of the scale coefficient is: ; in, is the Newton coefficient, , is the homotopy value, is the basic value of the scale coefficient, and p is the norm value; When the iteration termination condition is met, the obtained scale coefficient is assigned to the scale coefficient estimate This is equivalent to calculating the position of the query camera based on the scale factor. : ; in, and are the obtained rotation matrix and translation vector respectively, To match the database image feature point position matrix; solve the query camera position After that, the location of the query camera is considered to be the location of the user; when the iteration termination condition is not met, the iteration number of the scale coefficient is repeatedly updated until the termination condition is met.
2. The method according to claim 1, characterized in that The step of respectively calculating the homogeneous position coordinate matrices of the matching feature points on the normalized query image and the matching database image specifically includes: Accelerated robust feature point extraction is performed on the query image and the matching database image respectively to obtain the query image feature point position matrix and the matching database image feature point position matrix; Obtaining several pairs of matching feature points between the query image and the matching database image through feature point matching; The homogeneous position coordinate matrix of the matching feature points on the query image and the matching database image is obtained, and the matching feature points are normalized to obtain a normalized homogeneous position coordinate matrix.
3. The method according to claim 1, characterized in that The step of calculating the rotation matrix and translation vector used to characterize the relative position relationship between the query camera and the database camera according to the homogeneous position coordinate matrix of the query image and the matching database image specifically includes: Solve the essential matrix based on the homogeneous position coordinate matrix and the epipolar constraint relationship; The singular value decomposition of the essential matrix is performed to obtain the rotation matrix and translation vector used to characterize the relative position relationship between the query camera and the database camera.
4. The method according to claim 1, characterized in that The step of calculating the overall error vector and constructing a weight matrix for solving the least squares problem according to the overall error vector specifically includes: Calculate the overall error vector based on the scale factor, the observation vector and the measurement vector; Calculate the diagonal element values of the weight matrix according to the overall error vector; The weight values in the weight matrix are calculated according to the diagonal element values, and the construction of the weight matrix is completed.
5. The method according to claim 3, characterized in that: The rotation matrix is a -dimensional matrix, consisting of elements Composition, rotation matrix for: ; The translation vector is a dimensional vector, consisting of elements composition; 。 6. A monocular vision positioning system, used to implement the method described in any one of claims 1 to 5, characterized in that: The system comprises: A homogeneous position coordinate matrix calculation module is used to calculate the homogeneous position coordinate matrices of the matching feature points on the normalized query image and the matching database image respectively; A relative position relationship calculation module, used to calculate a rotation matrix and a translation vector used to characterize the relative position relationship between the query camera and the database camera according to the homogeneous position coordinate matrix of the query image and the matching database image; A scale coefficient initial solution calculation module is used to set initial values and calculate the scale coefficient initial solution according to the observation vector and the measurement vector; A homotopy value updating module, used for updating the homotopy value according to the norm value; A weight matrix construction module, used for calculating an overall error vector and constructing a weight matrix for solving a least squares problem according to the overall error vector; A scale coefficient iteration calculation module is used to calculate the scale coefficient iteration value and the overall error vector norm according to the weight matrix, the observation vector and the measurement vector; A termination determination module is used to determine whether an iteration termination condition is met, wherein the iteration termination condition is that the norm of the overall error vector is not greater than a set first threshold or the iteration value of the scale coefficient reaches a set second threshold; The result output module is used to terminate the iteration when the iteration termination condition is met, and calculate the position of the query camera according to the scale coefficient. When the iteration termination condition is not met, the homotopy value is continued to be iteratively updated until the iteration termination condition is met.
7. Application of the monocular vision positioning method as described in any one of claims 1 to 5 in indoor positioning.
Citation Information
Patent Citations
Robot positioning method and system with monocular vision and encoder information fused
CN107516326A
Underground coal mine monocular vision positioning method and device based on prior map constraint
CN115170847A