Single-beacon visual high-precision positioning method based on feature matching
Patent Information
- Application Number
- CN202311320145.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-12
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-10-12
AI Technical Summary
[0006]综上所述,已有利用二维码实现视觉定位的相关研究仍然受到来自信标数目和可靠性的挑战,一方面单个信标承载信息不足以支持高精度的定位,另一方面图像本身的噪声和系统干扰等因素会对定位性能带来一定的影响,因此需要研究基于单信标的高精度视觉定位技术
[0045] (1) The single beacon visual positioning method based on feature matching of the present invention reduces the dependence on the number of beacons and only requires one camera and one QR code beacon to achieve high-precision 3D positioning;
Smart Images

Figure CN117351085B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of visual positioning technology, specifically relating to a single beacon visual positioning method based on feature matching. Background Technology
[0002] Visual positioning has gained widespread attention in the Internet of Things (IoT) field, finding broad application in areas requiring precise location services, such as virtual reality, augmented reality, and mobile robotics. Simultaneously, cameras have become widely embedded visual sensors in various mobile devices, making mobile device-based visual positioning feasible. Based on the different scenarios considered in current research, visual positioning can be broadly categorized into two types. The first type, known as Simultaneous Localization and Mapping (SLAM), involves reconstructing the instantaneous position of a computing device in an unknown environment using real-time video. However, SLAM requires significant computing power and has high system construction costs. The second type, known as localization in known environments, pre-deploys visual beacons in the system, such as fast-response codes (QR codes), color rings, and visible light sources with geometric contour information. By capturing beacon images with a camera and combining image features with spatial geometry, spatial localization of the target is achieved, resulting in lower system costs and shorter response times.
[0003] In recent years, QR code-based positioning and navigation technology has developed rapidly. As a graphical encoding scheme, QR codes can carry specific location information through a specific encoding pattern. This information can be directly decoded and read by smart devices. Furthermore, beacons only need to be generated through ordinary printing and require only a small amount of light to be clearly captured by a camera, making system deployment extremely convenient. Therefore, QR code-based visual positioning has received widespread attention from academia and industry. Currently, QR code positioning has been applied in fields such as robot positioning and station addressing, fully demonstrating its advantages such as low cost and anti-interference. However, the positioning accuracy of QR code positioning schemes in real-world scenarios is relatively low. Most existing applications do not have stringent accuracy requirements, and achieving higher positioning accuracy in current research requires combining multiple beacons to provide a large amount of visual information or integrating other sensors to provide additional information for positioning assistance. Therefore, achieving interference-resistant precision positioning in high-precision, complex environments with single-beacon deployment systems still faces severe challenges, including the challenge of the number of visual beacons and the dynamic environmental challenges of beacon occlusion.
[0004] QR code-based visual positioning primarily utilizes beacon visual information captured by cameras. Its positioning implementation can be broadly categorized into two types: one directly acquires the location information stored in the QR code encoding, i.e., by capturing an image with a camera and decoding it with a device to obtain the beacon's location, and then using this location as the target's current position. However, it can be observed that within a reasonable spatial range, cameras can capture and decode beacon images, resulting in low positional accuracy that cannot meet the demands of high-precision location services. Reference 1 (J.Yan, J.Lee, S.Zlatanova, A.A.Diakite, and H.K., “Navigation networkderivation for QR code-based indoor pedestrian path planning,” Trans.GIS, vol.26, no.3, pp.1240–1255, Apr.2022.) deploys QR codes on walls and ceilings for scanning and positioning, but the accuracy only reaches the meter level.
[0005] Another type utilizes the spatial structure of QR code beacons. After capturing the image, it combines geometric information such as feature points and plane equations, and uses the transformation relationship between spatial geometry theory and spatial coordinate systems to determine the target's position and orientation. This type of positioning method fully utilizes the visual information provided by the beacon itself, greatly improving positioning accuracy compared to the former. However, it also requires the camera to capture clear images, placing additional demands on the imaging and image stabilization performance of the equipment. The improved positioning accuracy also indicates that this type of method requires a higher amount of visual information than the former, thus facing the challenge of the number of beacons. In reference 2 (H.Lv, L.Feng, A.Yang, B.Lin, H.Huang, and S.Chen, “Two dimensional code-based indoor positioning system with feature graphics,” IEEE Photon.J., vol.11, no.1, pp.1–15, 2018), the authors designed a large beacon based on four QR codes to achieve centimeter-level accuracy. However, due to the high similarity among the four QR codes, the system risks matching failures, leading to positioning errors. Reference 3 (G. Pan, AH Liang, J. Liu, M. Liu, and EX Wang, “3-D positioning system based QR code and monocular vision,” in 2020 5th International Conference on Robotics and Automation Engineering (ICRAE), 2020, pp. 54–58) proposes a positioning method requiring two QR codes. This method captures and extracts the feature corner points of two beacons and uses the perspective n-point (PnP) method to obtain the camera pose. While simple and easy to implement, this method still fails to overcome the limitation of multiple beacons in the system, and positioning still fails when the image is blurry or when some beacons cannot be recognized. Therefore, reliable and high-precision visual positioning based on a single beacon still requires further research.
[0006] In summary, existing research on visual positioning using QR codes still faces challenges related to the number and reliability of beacons. On the one hand, the information carried by a single beacon is insufficient to support high-precision positioning; on the other hand, noise in the image itself and system interference can affect positioning performance. Therefore, it is necessary to study high-precision visual positioning technology based on single beacons. Summary of the Invention
[0007] To address the aforementioned problems, this invention proposes a single-beacon visible light positioning algorithm based on feature matching. A QR code is selected as a spatial beacon. For a single QR code beacon captured by the camera, the point-type visual information it provides is combined with the feature matching method based on triangular structure to solve the mapping relationship between feature points and projections. The 3D position and orientation of the camera are solved by combining spatial coordinate system transformation and single-view geometry.
[0008] This invention provides a single beacon visible light localization method based on feature matching, comprising the following steps:
[0009] Step 1: Construct a projection model with a single QR code as a visual beacon;
[0010] The system model includes a QR code visual beacon and a camera device for photographing the beacon. The beacon contains three feature points and a coded pattern. A QR code visual beacon is affixed to a positioning point, and a monocular camera is used to photograph the beacon. The camera captures the image of the visual beacon based on a traditional imaging model, and the coded pattern and feature points that make up the beacon are fully presented in the image within the field of view.
[0011] By scanning and recognizing the QR code captured in the image, the ID corresponding to the beacon can be obtained directly, and the coordinates of the feature points in the world coordinate system can be obtained. Combined with feature matching, the mapping relationship between the feature points and their corresponding projections can be solved.
[0012] Step 2: Solve for the coordinates of the feature points in the camera frame;
[0013] To obtain the pixel coordinates of the projection of each feature point of the beacon in the captured image, firstly, the coordinates of each feature point projection in the image coordinate system are calculated by combining the camera intrinsic parameter matrix. Then, the camera coordinates of the feature points are obtained based on the linear relationship between the image coordinates of the feature point projection and the coordinates of the feature points in the camera coordinate system.
[0014] Step 3: Spatial Normal Vector Estimation:
[0015] The three feature points A, B, and C of the beacon form a right-angled triangle. Starting from the feature points corresponding to the right angle, a beacon plane vector is constructed. The camera coordinates of the spatial normal vector are then calculated using the cross product in vector space operations.
[0016] Step 4: Camera attitude calculation:
[0017] First, the transformation relationship between spatial vectors in the world coordinate system and the camera coordinate system is derived. Then, the vector formed by the beacon feature points and the spatial normal vector obtained in step three together form a vector group. The camera pose matrix is then solved using the aforementioned transformation relationship.
[0018] Step 5: Determine the camera position:
[0019] By combining the fixed transformation relationship between spatial points in the world and camera coordinate systems, the position vector of the camera, i.e., its position in the camera spatial coordinate system, can be solved.
[0020]
[0021] Among them, P w and P c These are the coordinates of a point P in space in the world coordinate system and the camera coordinate system, respectively.
[0022] Substituting any feature point into P, then according to the above formula, P is known. w P c and Solve Obtain the camera position.
[0023] In step two, the coordinates of the feature points in the camera coordinate system and the image coordinates of the feature point projections have a linear relationship, as shown below:
[0024] (X c ,Y c Z c ) T =k(x i ,y i f) T
[0025] Among them, (x i ,y i (X) represents the image coordinates of the feature point projection, f is the camera's focal length, k is the linear scaling factor, and (X) represents the image coordinates of the feature point projection. c ,Y c Z c () represents the camera coordinates of the feature point;
[0026] The linear scaling factor k for each feature point is calculated as follows:
[0027] Suppose there are three feature points A, B, and C in the QR code visual beacon, and the corresponding linear scaling coefficients are k1, k2, and k3, respectively. Construct a spatial vector using each pair of these three feature points. and Obtain the vector magnitude of the spatial vector. and Based on the constancy of the vector magnitude in different coordinate systems, the following system of three quadratic equations in the camera coordinate system of the feature points is constructed:
[0028]
[0029] in, The image coordinates of the projections of the three feature points are given; the scaling coefficients corresponding to each of the three feature points are obtained by solving the system of equations.
[0030] Step three includes: calculating the camera coordinates of the spatial normal vector. as follows:
[0031]
[0032] in, and Representing vectors respectively and The three-dimensional coordinates in the camera coordinate system.
[0033] Step four includes:
[0034] Step 401: Derive the transformation relationship of spatial vectors in the world-camera coordinate system;
[0035] Let the camera coordinate system be represented as O. c -X c Y c Z c Let V w and V c Represent any non-zero space vector The coordinates in the world coordinate system and the camera coordinate system are:
[0036]
[0037] in, Let X be the rotation matrix, representing the camera coordinate system relative to the world coordinate system along the X-axis. c Axis, Y c Axis and Z c Rotational transformation of the axis, let θ and ψ are the Euler angles for the corresponding rotations along the three axes; the rotation matrix is further expressed as:
[0038]
[0039] Among them, R X express Around X c The rotation matrix of the axis, R Y express Around Y c The rotation matrix of the axis, R Z express Around Z c The rotation matrices for the axes are as follows:
[0040]
[0041] Step 402: The vector formed by the beacon feature points and the spatial vector obtained in step 3 together form a vector group, and the camera's attitude matrix is derived and solved by step 401.
[0042]
[0043] The three-dimensional coordinates of the two vectors AB and AC of the three feature points of the beacon in the world coordinate system are: and The three-dimensional coordinates in the camera coordinate system are: and Let the world coordinates be the spatial normal vectors; solve the camera's pose matrix using the above formula.
[0044] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0045] (1) The single beacon visual positioning method based on feature matching of the present invention reduces the dependence on the number of beacons and only requires one camera and one QR code beacon to achieve high-precision 3D positioning;
[0046] (2) The single beacon visual positioning method based on feature matching of the present invention can solve the position and attitude of the camera by using only three feature points in the beacon and the encoded information carried by the beacon itself, without the need for additional sensing or other auxiliary information;
[0047] (3) The single beacon visual positioning method based on feature matching of the present invention has strong robustness to the inherent image noise and other signal interference of the system, and can achieve accurate positioning even when the beacon is photographed at a distance. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of a visual positioning system constructed according to the present invention;
[0049] Figure 2 This is a schematic diagram of the beacon projection and spatial coordinate system transformation model of the present invention;
[0050] Figure 3 This is a flowchart illustrating the single beacon visual localization method based on feature matching of the present invention.
[0051] Figure 4 This is a comparison chart of the accuracy of this invention with other positioning algorithms under different image noise conditions;
[0052] Figure 5 This is a comparison chart of the accuracy of this invention with other positioning algorithms under different beacon sizes;
[0053] Figure 6 This is a comparison chart of the CDF curves of this invention and other positioning algorithms. Detailed Implementation
[0054] To enable those skilled in the art to more clearly understand and implement the present invention, the technical solutions of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings and specific examples.
[0055] This invention proposes a single-beacon visual localization method based on feature matching, and the corresponding system is as follows: Figure 1 As shown, the system projection model and spatial coordinate system are as follows: Figure 2 As shown, the overall positioning process is as follows: Figure 3 As shown. For a single QR code visual beacon captured by the camera, the mapping relationship between the feature points and their projections is solved using a feature matching method based on triangular structure, combined with the visual information of the feature points provided by the beacon. The 3D position and orientation of the camera are then solved by combining spatial coordinate system transformation and single-view geometry.
[0056] The method of this invention is as follows: First, an effective matching mechanism is proposed to match the feature points of the captured QR beacon with their projections on the camera image plane. Then, based on the geometric relationship between the feature points and their projections, the coordinates of the feature points in the camera coordinate system are calculated. Furthermore, a singular solution elimination scheme is proposed to effectively eliminate erroneous solutions estimated in this step. Next, the coordinates of the spatial normal vector are solved based on the vector plane formed by the feature points. Finally, the user's pose and position are estimated based on linear algebra and spatial geometry. Simulation results show that this invention outperforms similar algorithms in terms of positioning accuracy and robustness to noise, maintaining positioning accuracy within the expected range of 10 cm or less.
[0057] like Figure 3 As shown, the single beacon visual positioning method of the present invention specifically includes five steps, which are described below.
[0058] Step 1: Construct a projection model for the beacon.
[0059] like Figure 1As shown, the visual positioning system model of this invention includes a QR code visual beacon and a camera device for capturing images of the beacon. The camera device is a monocular camera, such as a smartphone camera. The beacon is affixed to a positioning point. Within the field of view of the camera device, the coded pattern and feature points that make up the beacon can be fully presented in the image. The camera captures the image of the visual beacon based on a traditional imaging model. The coded portion of the QR code visual beacon is presented in the image as a dot array, and the feature points are presented as corresponding projections in the image. In this embodiment of the invention, the beacon uses a QR code, which includes an coded portion and a positioning portion. The pixel at the center of the positioning portion is used as a feature point. By scanning and recognizing the QR code, the ID corresponding to the beacon and the coordinates of the feature points in the world coordinate system can be directly obtained. The mapping relationship between the feature points and their corresponding projections is matched by combining the triangular structure of the feature points. The ID of the beacon contains the coordinates of each feature point in the world coordinate system.
[0060] The model contains four spatial coordinate systems that can be transformed into each other. The system's projection model is as follows: Figure 2 As shown, four independent coordinate systems are established in the projection model, including the pixel coordinate system (PCS) established on the image plane. p -u p v p Image coordinate system (ICS) i -x i y i The camera coordinate system (CCS) is established based on the camera lens. c -X c Y c Z c and World Coordinate System (WCS) w -X w Y w Z w In PCS, ICS, and CCS, the coordinate axis u p x i and X c Parallel to each other, v p y i and Y c They are also parallel to each other. The camera's focal length f is equal to the two center points O. i and O c The distance between two points, therefore the z-coordinate of the image plane in CCS is represented as z c =f.
[0061] Step 2: Solve for the coordinates of the feature point projection in the camera frame. The specific steps are as follows (201-203):
[0062] Step 201: Based on the pixel coordinates of the projected feature points obtained initially in the projection model, and combined with the camera intrinsic parameter matrix, solve for the image physical coordinates of the projected points, as follows:
[0063]
[0064] Where (u,v) are the pixel coordinates of the feature point projected onto the image. Combining the camera's internal parameters, the image coordinates of the projected points can be directly obtained through the transformation from the pixel coordinate system to the image coordinate system. dx and dy are the camera's internal parameters, representing the physical size of the pixel. u0 and v0 represent the pixel coordinate centers in the horizontal and vertical directions of the image, respectively. This constructs a complete coordinate transformation relationship, obtains the physical coordinates of the image from the image pixels, and further combines feature matching to obtain the correspondence between the feature points and the projected points. In the next step, the camera coordinates of the feature point projection are further solved.
[0065] Step 202: Solve for the 3D coordinates of the feature points using the inherent linear relationship between the feature points and the projection points in the camera system of the camera imaging model. The calculation is as follows:
[0066] (X c ,Y c Z c ) T =k(x i ,y i f) T
[0067] Depend on Figure 2 As can be seen from the imaging principle, there is a linear relationship between the spatial coordinates of beacon feature points under CCS and the coordinates of projected points under ICS. Here, f is the focal length of the mobile phone, a constant that remains unchanged, (x... i ,y i (X) represents the physical coordinates of the projection point in the ICS image. In the camera imaging principle, the projection point and the feature point are collinear through the camera center and the Z-axis. This linear relationship can be expressed as shown in the above formula, where (X) c ,Y c Z c Let A, B, and C represent the three-dimensional coordinates of the feature points in the camera frame. The linear scaling factor k can be directly solved using this formula and the known coordinate system. Let A, B, and C represent three feature points in the beacon, and the correspondence between the projection points and feature points has been determined through feature matching in step one. Then k i (i=1,2,3) represent the proportional coefficients corresponding to the three feature points respectively.
[0068] Step 203: Combining the known spatial coordinates of the three feature points in WCS from Step 1, construct a spatial vector and directly obtain its magnitude. Based on the constancy of the vector magnitude in different coordinate systems, construct a system of three quadratic equations in the camera coordinate system of the feature points:
[0069]
[0070] in, and These are the beacon plane vectors formed by pairwise pairs of the three feature points; their corresponding magnitudes have been obtained through decoding, and the scaling coefficients k for each of the three feature points can be solved by solving the system of equations. i (i = 1, 2, 3).
[0071] Step 204: After solving the system of three quadratic equations in the above steps, two sets of coefficient solutions that satisfy the equation conditions are obtained. Substituting the coefficients into the coordinate expressions of feature points A, B, and C in the CCS system, two sets of feature point coordinates can be obtained. They both conform to the above system of equations based on vector magnitude, which means that ambiguous solutions are generated. One set of coordinates represents an incorrect QR code plane and needs to be eliminated. This is due to the imaging principle that the same image can still be obtained under the same camera in different planes. By combining the proportional coefficient constraint in the imaging model and the visual difference of beacon images at different positions in the projection model to eliminate ambiguous solutions, the camera system coordinate information of the feature points is finally obtained.
[0072] Step 3, spatial normal vector estimation, includes the following steps 301 and 302.
[0073] Step 301: Combining the camera coordinate information of the feature points obtained in Step 2, construct the beacon plane vector starting from the vertices corresponding to the right angles of the feature points forming a right-angled triangle structure. The normal vector is perpendicular to the plane containing the beacon, so it must be perpendicular to the vector formed by the feature points. Therefore, the coordinates can be directly solved by the cross product of the vectors, and the camera coordinates of the spatial normal vector can be directly solved by the cross product operation of the vector space.
[0074]
[0075] in, This represents the coordinates of the normal vector in space under the CCS. and Representing vectors respectively and The camera coordinates in the camera coordinate system are given. Substituting these coordinates into the above formula, the camera coordinates of the normal vector can be directly solved.
[0076] Step 302: Normalize the obtained normal vector. Unit normal vector under the beacon plane in the world system A correspondence is formed, and the coordinates of the two can be expressed by a fixed CCS and WCS transformation relationship.
[0077] Step 4, Camera Attitude Determination, includes the following steps 401 and 402:
[0078] Step 401: Derive the transformation relationship of spatial vectors in the world-camera coordinate system:
[0079]
[0080] in, V is a rotation matrix that represents the rotational transformations between coordinate systems along the X, Y, and Z axes, and thus characterizes the camera's 3D pose in the world coordinate system; w and V c Let V be the coordinates of any non-zero spatial vector V in the world coordinate system and the camera coordinate system, respectively.
[0081] A rotation matrix can be decomposed into the product of three sub-rotation matrices, as shown below:
[0082]
[0083] Among them, R X Indicates surrounding X c The rotation matrix of the axis, R Y Indicates surrounding Y c The rotation matrix of the axis, R Z Indicates revolving around Z c The rotation matrices of the axes are as follows:
[0084]
[0085]
[0086]
[0087] θ and ψ represent the camera coordinate system along the X-axis, respectively. c Axis, Y c Axis and Z c The Euler angles for axis rotation need to be solved separately, but can be derived from the rotation matrix expression:
[0088]
[0089] Step 402: The vector formed by the beacon feature points and the spatial normal vector obtained in step 3 together form a vector group, and the camera's attitude matrix is derived and solved by step 401.
[0090]
[0091] Combining the decomposition form of the rotation matrix in step 401, the transformation relationship of spatial vectors in CCS and WCS can be rewritten as follows:
[0092]
[0093] Since both the left and right matrices are known, the Euler angles can be solved separately by substituting them. θ, ψ, and the corresponding sub-rotation matrices, and the rotation matrices can be solved directly. That is, the spatial orientation of the camera.
[0094] Step 5: Determine the camera position.
[0095] By combining the fixed transformation relationship between spatial points in the world coordinate system and the camera coordinate system, the position vector of the camera, that is, the position of the camera in the world coordinate system, can be solved.
[0096]
[0097] Among them, P w and P c These are the coordinates of a point P in space in the world coordinate system and the camera coordinate system, respectively. is the rotation matrix, representing the three-dimensional pose of the camera in the world coordinate system. This is the translation vector in coordinate transformation, representing the actual position of the camera. The coordinates and rotation matrices of the feature points in both the world and camera frames are known; the camera position can be directly solved by substituting the coordinate information of any feature point. However, it should be noted that the attitude matrix directly affects the solution of the position vector. If there is an error in the attitude matrix, it will further affect the accuracy of the position solution. Therefore, this invention proposes a position solution scheme based on spatial basis vectors, which can solve for the position vector independently of the attitude matrix.
[0098] For any nonzero vector in CCS Each of these vectors can be linearly expressed by the other three non-coplanar vectors, i.e., the spatial basis vectors. Therefore, if we choose vectors under the camera frame of reference (CCS)... As a spatial basis, vectors It can be represented as follows:
[0099]
[0100] Where m i (i = 1, 2, 3) represents the basis coefficients, which can be written in matrix form as follows:
[0101]
[0102] in For vectors Camera coordinates, For vectors Camera coordinates, For vectors The camera coordinates.
[0103] Given the coordinates in the vector CCS coordinate system and the coordinates of the basis, the expression coefficient m corresponding to the basis can be directly calculated using the above formula. i (i = 1, 2, 3). A vector is constructed using the camera optical center O and the QR code feature points A. For example, its coordinates under CCS It can be represented as
[0104]
[0105] The coordinates of each vector are known, q i (i = 1, 2, 3) is for targeting The coefficients of a vector expressed by its basis vectors can be directly obtained through matrix operations. It's also worth noting that although CCS and WCS are different coordinate systems, under the same basis, the coefficients of the same vector expressed by its basis vectors must be the same. Therefore, in the world coordinate system WCS, the coefficients of a vector expressed by its basis vectors are... World coordinates The corresponding output coefficient is still q. i (i=1,2,3), that is:
[0106]
[0107] Therefore, the solution can be obtained. Coordinates in WCS system The optical center, i.e., the spatial coordinates O of the camera in the WCS, can then be determined. W as follows:
[0108]
[0109] Thus, the camera's coordinates in the world frame have been obtained, meaning that the camera's complete position and orientation have been determined through the above steps.
[0110] This invention uses a camera simulation model on the MATLAB simulation platform to simulate beacon capture and camera position calculation. The simulation considers a 9-square-meter space with the QR code beacon at its center. Furthermore, to simulate potential pixel errors during image capture, Gaussian white noise with a mean of 0 and a variance of 10 pixels is added to the image. Unless otherwise stated, all key camera parameters are from a Huawei Nova 6 smartphone. The invention's performance is compared with two classic visual positioning methods, PnP and V-BC (a stereo camera-based spatial positioning algorithm), under the same parameter conditions. The method described in this invention is abbreviated as V-FTQ in the figure. Figure 4 and Figure 5 These represent different beacon sizes D and different noise variances S. 2 Below is a comparison of the positioning accuracy of this invention with other algorithms; the horizontal axis in the figure corresponds to the changed target parameters, and the vertical axis represents the positioning error of different positioning algorithms under the current parameters. Under the same conditions, the positioning accuracy of this invention is superior to the compared algorithms, and it has stronger robustness to noise.
[0111] like Figure 4 As shown, the localization accuracy of the three methods is compared at different image noise levels ranging from 0 to 20 pixels. The solid and dashed lines correspond to different beacon sizes D. Figure 4 The horizontal axis represents image noise in pixels, and the vertical axis represents the average positioning error in cm. The beacon size D is also in cm. Results show that the accuracy of the proposed method decreases with increasing noise. In fact, the projection of image noise onto the image plane has a certain degree of deviation, leading to deviations in the initial pixel coordinates and affecting the determination of feature point coordinates in the PCS coordinate system. This is the fundamental source of error; the positioning error is entirely attributable to unavoidable noise. Furthermore, the proposed method outperforms other algorithms under all noise conditions. Even when noise reaches its maximum, the positioning error of the proposed method is still less than 10 cm, while the error of the comparative algorithms exceeds 40 cm. When there is no noise, the errors of all three algorithms are zero, indicating that the positioning error is entirely caused by noise. In summary, Figure 4 This demonstrates that the present invention has better robustness to noise.
[0112] Figure 5 The positioning accuracy of the present invention and the comparison algorithm is shown when the beacon size is changed from 10cm to 30cm. Figure 5 The horizontal axis represents the beacon size in cm, the vertical axis represents the average positioning error in cm, and the noise variance S. 2 The unit is pixels. The positioning error of all algorithms decreases as the beacon size increases. This is because a larger beacon size has larger coordinate values, reducing the impact of pixel coordinate offsets caused by image noise on these values, thus improving positioning accuracy. In the comparison, this invention exhibits optimal performance under fixed noise conditions. In summary, increasing the beacon size helps resist image noise, thereby reducing positioning error. Furthermore, the positioning performance of this invention is superior to other positioning algorithms at different sizes.
[0113] Figure 6 The cumulative distribution function (CDF) curves of the three algorithms under different image noise levels are shown. Figure 6The horizontal axis represents the positioning error, in cm. This invention consistently outperforms other methods across all noise levels. In particular, when the noise variance is set to 10 pixels, V-FTQ achieves a positioning error of less than 10 cm for approximately 90% of the samples. The performance improvement of this invention stems from its use of a projection principle for position estimation, which remains stable even in the presence of local noise and has a much smaller maximum error than other algorithms.
[0114] In summary, by implementing a feature-matching-based single-beacon visual positioning method according to an embodiment of the present invention, a positioning system is constructed using only a monocular camera and a QR code. Combining single-view geometric theory with a camera imaging model, centimeter-level high-precision 3D positioning is achieved. Simulation results show that the present invention has strong robustness to image noise and can guarantee positioning accuracy within 10cm. Under the same system modeling conditions, it outperforms similar algorithms and is suitable for practical applications in public places such as underground car factories, industrial workshops, and shopping malls.
[0115] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A single beacon visual localization method based on feature matching, characterized in that, Includes the following steps: Step 1: Construct a projection model with a single QR code as a visual beacon; A QR code visual beacon is affixed to the positioning point. The beacon contains three feature points and a coded pattern. The beacon is photographed using a monocular camera to obtain an image of it, which shows the coded pattern and feature point projections. The ID corresponding to the beacon is obtained by recognizing the QR code, and the coordinates of the beacon's feature points in the world coordinate system are obtained. The mapping relationship between the feature points and their corresponding projections is matched. Step 2: Calculate the coordinates of the feature points in the camera coordinate system; To obtain the pixel coordinates of the projection of each feature point of the beacon in the captured image, firstly, the coordinates of each feature point projection in the image coordinate system are calculated by combining the camera intrinsic parameter matrix. Then, the camera coordinates of the feature points are obtained based on the linear relationship between the image coordinates of the feature point projection and the coordinates of the feature points in the camera coordinate system. Step 3: Estimate the coordinates of the spatial normal vector in the camera coordinate system; The three feature points A, B, and C of the beacon form a right-angled triangle. Starting from the feature points corresponding to the right angle, a beacon plane vector is constructed. The camera coordinates of the spatial normal vector are then calculated using the cross product in vector space operations. Step 4: Solve for the camera pose; First, the transformation relationship between spatial vectors in the world coordinate system and the camera coordinate system is derived. Then, the vector formed by the beacon feature points and the spatial normal vector obtained in step three together form a vector group. The camera pose matrix is then solved using the aforementioned transformation relationship. Step 5: Using the fixed transformation relationship between the spatial points in the world coordinate system and the camera coordinate system, solve for the position of the camera in the world coordinate system. as follows: Among them, P w and P c These are the coordinates of a point P in space in the world coordinate system and the camera coordinate system, respectively. Substituting any feature point into P, then according to the above formula, P is known. w P c and Solve Obtain the camera position.
2. The method according to claim 1, characterized in that, In step two, the coordinates of the feature points in the camera coordinate system and the image coordinates of the feature point projections have a linear relationship, as shown below: (X c ,Y c ,Z c ) T =k(x i ,y i ,f) T Among them, (x i ,y i (X) represents the image coordinates of the feature point projection, f is the camera's focal length, k is the linear scaling factor, and (X) represents the image coordinates of the feature point projection. c ,Y c Z c () represents the camera coordinates of the feature point; The linear scaling factor k for each feature point is calculated as follows: Suppose there are three feature points A, B, and C in the QR code visual beacon, and the corresponding linear scaling coefficients are k1, k2, and k3, respectively. Construct a spatial vector using each pair of these three feature points. and Obtain the vector magnitude of the spatial vector. and Based on the constancy of the vector magnitude in different coordinate systems, the following system of three quadratic equations in the camera coordinate system of the feature points is constructed: in, The image coordinates of the projections of the three feature points are given; the scaling coefficients corresponding to each of the three feature points are obtained by solving the system of equations.
3. The method according to claim 2, characterized in that, Step two, after solving the system of three quadratic equations, combines the proportionality coefficient constraint in the imaging model with the visual differences in beacon images at different positions in the projection model to eliminate ambiguous solutions, and finally obtains the camera coordinates of the feature points.
4. The method according to claim 1, characterized in that, Step three includes: calculating the camera coordinates of the spatial normal vector. as follows: in, and Representing vectors respectively and The three-dimensional coordinates in the camera coordinate system.
5. The method according to claim 1, characterized in that, In step four, the transformation relationship of the derived spatial vector in the world-camera coordinate system is as follows: Let the camera coordinate system be represented as O. c -X c Y c Z c Let V w and V c Represent any non-zero space vector The coordinates in the world coordinate system and the camera coordinate system are: in, Let X be the rotation matrix, representing the camera coordinate system relative to the world coordinate system along the X-axis. c Axis, Y c Axis and Z c Rotational transformation of the axis, let θ and ψ are the Euler angles for the corresponding rotations along the three axes; the rotation matrix is further expressed as: Among them, R X express Around X c The rotation matrix of the axis, R Y express Around Y c The rotation matrix of the axis, R Z express Around Z c The rotation matrices for the axes are as follows:
6. The method according to claim 1 or 5, characterized in that, In step four, the camera's pose matrix is solved as follows: Suppose two vectors for the three feature points of the beacon. and In the world coordinate system, the three-dimensional coordinates are and The three-dimensional coordinates in the camera coordinate system are: and Then the following relationship exists: in, The world coordinates of the spatial normal vector; Let be the rotation matrix of the camera coordinate system relative to the world coordinate system, which is also the camera's pose matrix; solve using the above formula.
7. The method according to claim 1, characterized in that, Step five, which involves solving for the camera position based on the spatial basis vectors, includes: Suppose two vectors for the three feature points of the beacon. and The three-dimensional coordinates in the camera coordinate system are: and choose As a spatial basis, any non-zero vector in the camera coordinate system It is expressed as follows: Where m i (i = 1, 2, 3) represents the basis coefficients, which can be written in matrix form as follows: Among them, X c ,Y c Z c For vectors Camera coordinates, For vectors Camera coordinates, For vectors Camera coordinates, For vectors The camera coordinates; In vector Given the camera coordinates and spatial basis, the basis representation coefficient m is calculated using the above formula. i (i = 1, 2, 3); Select any feature point and the camera optical center to form a vector. The basis representation coefficients of the vector are calculated in the manner described above. Under the same set of basis vectors, the coefficients of the same vector represented by the basis vectors in different coordinate systems must be the same. Therefore, the world coordinates of the vector formed by the selected feature point and the camera optical center are calculated based on the coordinates of the selected feature point, the spatial basis, and the basis representation coefficients, and then the world coordinates of the camera optical center are obtained.
Citation Information
Patent Citations
Two-dimensional code and laser radar fusion positioning method and device for industrial robot
CN115774265A
Visible light communication assisted single light source perspective round line indoor positioning method
CN116182870A