Binocular camera target positioning and distance measuring method and system based on feature point matching

Through the method of feature point matching and geometric transformation, the SURF and RANSAC algorithms are used to solve the problems of real-time and positioning accuracy of binocular cameras in the assembly of tracks of space solar power stations, and the accurate positioning and distance calculation of the target object are achieved.

CN120374718APending Publication Date: 2025-07-25CHINA UNIV OF GEOSCIENCES (WUHAN) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510206808.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing binocular camera ranging algorithm is difficult to meet real-time requirements during the orbit assembly of space solar power plants, and it is impossible to accurately locate the position of the target object in the image, resulting in the inability to complete subsequent calculations.

Method used

A method based on feature point matching is adopted, and feature point matching and geometric transformation is used to determine the boundaries and parallax of the target object, and the distance from the target object to be calculated based on the distance measurement principle of the binocular camera.

Benefits of technology

It improves the real-time and accuracy of spatial target positioning and distance measurement, and can achieve accurate positioning and distance calculation of targets in a space environment with simple light changes, meeting the real-time measurement needs of power station assembly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374718A_ABST
    Figure CN120374718A_ABST
Patent Text Reader

Abstract

The invention discloses a binocular camera target positioning and ranging method and system based on feature point matching, and relates to the field of space target positioning and ranging, and the method mainly comprises the steps: carrying out the SURF feature point matching of a left image and a right image with a template image, estimating the transformation from the template image to the left and right camera images by using an RANSAC algorithm, determining the boundary of a target object, and obtaining the parallax of the left and right cameras while completing the positioning of the target; and calculating the distance between the target object and the baseline of the binocular camera, thereby realizing real-time target positioning and distance calculation. By implementing the binocular camera target positioning and distance measuring method and system based on feature point matching provided by the invention, the real-time performance and precision of space target positioning and distance measuring can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of space target positioning and ranging, and more specifically, to a binocular camera target positioning and ranging method and system based on feature point matching. Background Art

[0002] A space solar power station is a power system that converts solar energy into electrical energy in space and transmits it to the ground. It has advantages such as being unaffected by the atmosphere, seasons, and day-night changes, and can provide continuous and stable clean energy. It is one of the strategic choices to solve future energy and environmental problems. Given the immaturity of related technologies, a series of preliminary preparations need to be made for the space solar power station. Among them, the research on sensors related to the solar power station is very crucial. The on-orbit assembly and construction simulation involves modeling, simulation, and control of various sensors, and is an important module for constructing a simulation platform. The binocular camera ranging module is an important part of it, which plays an important role in calculating the distance between the target object and the power station and displaying the true position between the target and the power station.

[0003] The binocular camera ranging algorithm is based on the principle of triangulation and calculates the object distance through parallax, with relatively high accuracy, especially reaching the micron level in close-range measurements. It has no restrictions on the type of obstacles and does not require pre-identification and classification. It can directly measure the distance, reducing the processing cost for non-standard obstacles. As a passive ranging method, it does not require an active light source and can be used in various environments, avoiding complex problems caused by the active light source. At the same time, the binocular camera ranging has good flexibility and adaptability, can adapt to different working environments and measurement objects, has relatively low requirements for hardware, low cost, and is easy to install.

[0004] In the scenario of on-orbit assembly of the power station, the assembly system has strong requirements for the real-time performance of the algorithm. Under the condition that the assembly error is allowed, the binocular camera module should be able to meet the requirements of real-time measurement by the camera. At the same time, the module is also required to be able to locate the position of the target object in the image to calculate the distance from the target position to the connection point position of the power station, rather than just the distance to the binocular camera.

[0005] The distance detection of the binocular camera depends on the binocular camera matching algorithm. The main ones are the Bidirectional Matching (BM) algorithm, the Semi-Global Block Matching (SGBM) algorithm, and the Graph Cuts (GC) algorithm.

[0006] In binocular vision matching algorithms, the BM algorithm is fast in calculation speed and easy to implement. However, it is sensitive to light and noise, and its accuracy is limited in complex scenarios. The SGBM algorithm improves the matching accuracy through multi-directional cost aggregation, takes into account the computational efficiency to a certain extent, and can be used in scenarios with real-time requirements. However, its computational complexity is relatively high, and its robustness to special cases needs to be strengthened. The GC algorithm considers global information and can obtain a high-precision disparity map, but its computational complexity is extremely high, and it is difficult to meet the requirements when dealing with high-resolution images or scenarios with high real-time requirements.

[0007] In recent years, with the development of deep learning algorithms, there have also been binocular distance detection algorithms based on deep learning in binocular matching algorithms. However, deep learning algorithms not only require datasets for training, but also have a large amount of calculation during the prediction process, poor real-time performance, and it is difficult to guarantee the reliability of the model, which is unacceptable in the on-orbit assembly of space stations.

[0008] On the other hand, most binocular vision matching algorithms pursue to restore the three-dimensional depth information of the entire image, rather than focusing on the measurement of the distance of the target object, which also limits the detection speed of the algorithm. At the same time, the position of the target object in the image cannot be located in the binocular vision matching algorithm, so the subsequent calculation of the distance information of the target object required by the application scenario cannot be performed.

[0009] In summary, due to different usage scenarios, most binocular vision matching algorithms have redundant calculations, making it difficult for the algorithms to meet the real-time requirements of on-orbit assembly in power stations, and lacking a target positioning method, unable to complete subsequent calculations. Summary of the Invention

[0010] The purpose of the present invention is to provide a binocular camera target positioning and ranging method and system based on feature point matching, which can improve the real-time performance and accuracy of space target positioning and ranging.

[0011] The present invention provides a binocular camera target positioning and ranging method based on feature point matching, including the following steps: S1: According to the left camera image, the right camera image, and the target feature image, using the Speeded Up Robust Features (SURF) algorithm, obtain the left image matching feature points and the right image matching feature points; S2: According to the left image matching feature points, the right image matching feature points, and the target feature image, using the Random Sample Consensus (RANSAC) algorithm, obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image; S3: According to the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, obtain the disparity between the left and right images and the distance from the target object to the binocular camera.

[0012] Further, step S1 specifically includes: S11: converting the left camera image, the right camera image, and the target feature image into grayscale images to obtain a left camera grayscale image, a right camera grayscale image, and a target grayscale image; S12: according to the left camera grayscale image, the right camera grayscale image, and the target grayscale image, using the Speeded Up Robust Features (SURF) algorithm to extract SURF feature operators to obtain a left image feature descriptor, a right image feature descriptor, and a target feature descriptor; S13: respectively performing feature point matching between the left image feature descriptor and the right image feature descriptor with the target feature descriptor to obtain left image matching feature points and right image matching feature points.

[0013] Further, step S2 specifically includes: S21: according to the left image matching feature points and the right image matching feature points, using the Random Sample Consensus (RANSAC) algorithm to respectively estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images to obtain a left image transformation matrix and a right image transformation matrix; S22: reading the target boundary of the target feature image to obtain boundary vertex coordinates; S23: according to the boundary vertex coordinates, using the left image transformation matrix and the right image transformation matrix, transforming the vertices of the boundary box into the left and right camera grayscale images to obtain left image target vertices and right image target vertices; S24: according to the left image target vertices and the right image target vertices, obtaining the distance from the target vertices to the left boundary of the left image and the distance from the target vertices to the left boundary of the right image.

[0014] Further, step S3 specifically includes: according to the distance from the target vertices to the left boundary of the left image and the distance from the target vertices to the left boundary of the right image, obtaining the disparity between the left and right images and the distance from the target object to the binocular camera, as shown in the formula: , , where, is the distance from the target object to the binocular camera, is the distance between the projection centers of the two cameras, is the focal length of the camera, is the distance from the target vertices to the left boundary of the left image, is the distance from the target vertices to the left boundary of the right image, is the disparity between the left and right images.

[0015] The present invention also provides a binocular camera target positioning and ranging system, which includes the following modules: a feature matching module configured to: obtain left-image matching feature points and right-image matching feature points according to a left camera image, a right camera image, and a target feature image by using the Speeded Up Robust Features (SURF) algorithm; a target point transformation module configured to: obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image according to the left-image matching feature points, the right-image matching feature points, and the target feature image by using the Random Sample Consensus (RANSAC) algorithm; a distance calculation module configured to: obtain the disparity between the left and right images and the distance from the target object to the binocular camera according to the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image.

[0016] Further, the feature matching module is specifically configured to: convert the left camera image, the right camera image, and the target feature image into grayscale images to obtain a left camera grayscale image, a right camera grayscale image, and a target grayscale image; extract SURF feature operators according to the left camera grayscale image, the right camera grayscale image, and the target grayscale image by using the SURF algorithm to obtain a left-image feature descriptor, a right-image feature descriptor, and a target feature descriptor; perform feature point matching on the left-image feature descriptor and the right-image feature descriptor with the target feature descriptor respectively to obtain left-image matching feature points and right-image matching feature points.

[0017] Further, the target point transformation module is specifically configured to: respectively estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images according to the left-image matching feature points and the right-image matching feature points by using the RANSAC algorithm to obtain a left-image transformation matrix and a right-image transformation matrix; read the target boundary of the target feature image to obtain the boundary vertex coordinates; transform the vertices of the bounding box into the left and right camera grayscale images according to the boundary vertex coordinates by using the left-image transformation matrix and the right-image transformation matrix to obtain left-image target vertices and right-image target vertices; obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image according to the left-image target vertices and the right-image target vertices.

[0018] Further, the distance calculation module is specifically configured to: obtain the disparity between the left and right images and the distance from the target object to the binocular camera according to the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, as shown in the formula: , , where, is the distance from the target object to the binocular camera, is the distance between the projection centers of the two cameras, is the focal length of the camera, is the distance from the target vertex to the left boundary of the left image, is the distance from the target vertex to the left boundary of the right image, is the disparity between the left and right images.

[0019] The present invention also provides a computer program product, including a computer program which, when executed by a processor, implements the steps of the above-mentioned binocular camera target positioning and ranging method based on feature point matching.

[0020] Implementing the binocular camera target positioning and ranging method and system based on feature point matching provided by the present invention has the following beneficial effects: The present invention first converts the image into a grayscale image, and uses the SURF feature algorithm to find the feature points that remain stable under changes such as scale, rotation, and illumination in the image; compares and matches the feature description information of the left image and the right image respectively with the feature description information of the template image; during the matching process, filters out accurate and unique matching results according to specific rules and conditions, and removes those matches that may have errors or be unreliable; through such operations, finally determines the feature points in the left image and the right image that correspond to the template image, and these corresponding points reflect the similar feature position relationships between different images; performs geometric transformation estimation and positioning; uses the corresponding feature points obtained from the previous matching to analyze and estimate the geometric transformation relationship from the template image to the left image and the right image; this geometric transformation can cover various changes such as rotation, scaling, and translation that may occur in the plane of the image; in order to ensure the accuracy of the transformation relationship, the algorithm uses the RANSAC method to exclude the interference points caused by mis-matching, so as to obtain a more accurate and reliable geometric transformation relationship; based on this accurate transformation relationship, determines the new positions of the boundaries of the template image after transformation in the left image and the right image; finally, calculates the distance from the target object to the binocular camera according to the displacement of the target object in the left and right images of the image and the binocular ranging principle; thereby improving the real-time performance and accuracy of spatial target positioning and ranging. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention will be further described below in conjunction with the drawings and embodiments. In the drawings: Figure 1 is the flowchart of the binocular camera target positioning and ranging method based on feature point matching provided by the present invention; Figure 2 is the algorithm flowchart of the binocular camera target positioning and ranging method based on feature point matching provided by the present invention; Figure 3 is the schematic diagram of the measurement principle of the binocular camera provided by the present invention; Figure 4 is the schematic diagram of the positioning effect of the sliding matching algorithm provided by the present invention; Figure 5 It is the matching result diagram of the binocular camera target positioning and ranging method based on feature point matching provided by the present invention; Figure 6 It is the matching effect diagram of the left vision camera and the template provided by the present invention; Figure 7 It is the detection effect diagram provided by the present invention at different distances. Specific Embodiment

[0022] For a clearer understanding of the technical features, objectives, and effects of the present invention, the specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0023] Figure 1 It shows a schematic diagram of the binocular camera target positioning and ranging method based on feature point matching in this embodiment. In this embodiment, the binocular camera target positioning and ranging method based on feature point matching includes the following steps: S1: According to the left camera image, the right camera image, and the target feature image, use the Speeded Up Robust Features (SURF) algorithm to obtain the left image matching feature points and the right image matching feature points; As an exemplary embodiment, in step S1, the left and right images are respectively subjected to SURF feature point matching with the template image, that is, the target feature image; specifically, first, feature detection and extraction are performed to find feature points; the image is first converted into a grayscale image, and then the SURF feature algorithm is used to find the feature points in the image that remain stable under changes in scale, rotation, illumination, etc.; secondly, the feature description information of the left image and the right image is compared and matched with the feature description information of the template image; during the matching process, accurate and unique matching results are selected according to specific rules and conditions, and those possible errors or unreliable matches are removed; through such operations, the feature points corresponding to the template image in the left image and the right image are finally determined, and these corresponding points reflect the similar feature position relationships between different images; It should be noted that regarding SURF feature detection, Speeded Up SURF is a local feature descriptor used in computer vision. Its feature detection is mainly based on spot detection in images, and uses integral images to accelerate calculations. Integral images can quickly calculate the sum of pixel grayscale values in a rectangular area of an image. Subsequently, the determinant of the Hessian matrix is calculated for each pixel to determine whether it is a potential feature point. The Hessian determinant can reflect local curvature changes, and its value is larger in the spot area. Possible feature points are screened by thresholds. For example, in images containing object contours and textures, points where edges and textures change drastically are more likely to be detected as feature points. In order to ensure the detection effect at different scales, SURF detects feature points at different scales by constructing a scale space, using a structure similar to a Gaussian pyramid, and using a box filter to approximate a Gaussian filter to increase the speed of the algorithm. The detection and description methods at different scale layers are similar, and feature structures of different sizes can be detected. Fine textures can be detected at small scales, and large features such as the overall contour of an object can be detected at large scales. When the feature pyramid is established, SURF will search for key points. It compares the box filter result of the current point with the three The points in the 2D neighborhood are compared to determine whether the current point is a maximum. Subsequently, the maximum point will be considered as the feature point of the current local area. At the same time, points smaller than a given threshold will be removed. For the detected feature points, SURF will construct a feature descriptor to describe the local image information around it. Based on the circular area around the feature point, it is partitioned and the statistical features of each sub-area are calculated, such as the Haar-like wavelet response. The horizontal and vertical responses are combined into a vector as a feature descriptor. This descriptor has certain rotation and illumination invariance and can accurately match the feature points under different image transformations. Finally, when matching feature points, SURF adds the positive and negative information of the feature points to the feature vector to speed up the search. This is because two points can only match when the signs are the same, which saves the time of numerical comparison. SURF has a fast calculation speed, thanks to technologies such as integral images and box filters, which is much faster than early algorithms such as SIFT. It is also robust and has good adaptability to image rotation, scale changes, illumination changes, and a certain degree of affine transformation. For example, the features of the same object or the rotated image under different illumination can still be effectively detected and matched. In an exemplary embodiment, step S1 specifically includes: S11: converting the left camera image, the right camera image and the target feature image into grayscale images to obtain a left camera grayscale image, a right camera grayscale image and a target grayscale image; S12: Extract SURF feature operators using the Speeded Up Robust Features (SURF) algorithm based on the left camera grayscale image, the right camera grayscale image, and the target grayscale image, to obtain a left image feature descriptor, a right image feature descriptor, and a target feature descriptor; As an exemplary embodiment, in step S12, detect SURF feature points for the left and right camera images and the target grayscale image respectively, and calculate the corresponding feature points; S13: Perform feature point matching between the left image feature descriptor and the right image feature descriptor with the target feature descriptor respectively, to obtain left image matching feature points and right image matching feature points; As an exemplary embodiment, in step S13, match the feature descriptors of the left and right camera grayscale images with the target grayscale image respectively, and use the maximum ratio algorithm to determine a unique matching object for each successfully matched feature point; S2: Based on the left image matching feature points, the right image matching feature points, and the target feature image, use the Random Sample Consensus (RANSAC) algorithm to obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image; As an exemplary embodiment, in step S2, use the RANSAC algorithm to estimate the transformation from the template image to the left and right camera images, determine the boundary of the target object, and obtain the disparity between the left and right cameras while completing the positioning of the target; specifically, perform geometric transformation estimation and positioning; use the corresponding feature points obtained from the previous matching to analyze and estimate the geometric transformation relationship from the template image to the left image and the right image; this geometric transformation can cover various changes such as rotation, scaling, and translation that may occur to the image in the plane; to ensure the accuracy of the transformation relationship, adopt the RANSAC method to exclude the interference points caused by incorrect matches, so as to obtain a more accurate and reliable geometric transformation relationship; based on this accurate transformation relationship, determine the new positions of the boundaries of the template image after transformation in the left image and the right image; It should be noted that the Random Sample Consensus (RANSAC) algorithm is an iterative method for estimating the parameters of a mathematical model from a dataset containing outliers; its basic idea is to estimate the model by randomly selecting a subset of the dataset, and then use this model to test the other data in the dataset to see if they conform to this model. The points that conform are considered inliers, and the points that do not conform are considered outliers; through multiple iterations, find the model that contains the most inliers, and the parameters of this model are considered to be the best fit for the data; in the scenario of image similarity transformation estimation, the similarity transformation includes rotation, scaling, and translation; the similarity transformation formula for a two-dimensional plane is:

[0024] Among them, is the original point coordinate, is the point coordinate after change, is the scaling factor, is the rotation angle; the initial estimate of the image similarity transformation parameters is calculated by substituting the randomly matched point coordinates into the above formula; for the points not participating in the estimation, the RANSAC algorithm will use the estimated parameters to calculate the estimated positions of the template points in the left and right cameras. If the error between the estimated position and the true position can meet the requirements, the point will be marked as an inlier; finally, through iterative update, under the set conditions, the optimal estimation model is found; In an exemplary embodiment, step S2 specifically includes: S21: According to the left image matching feature points and the right image matching feature points, use the random sample consensus algorithm to respectively estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images, and obtain the left image transformation matrix and the right image transformation matrix; As an exemplary embodiment, in step S21, use the RANSAC algorithm to respectively estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images to obtain a transformation matrix; S22: Read the target boundary of the target feature image to obtain the boundary vertex coordinates; S23: According to the boundary vertex coordinates, use the left image transformation matrix and the right image transformation matrix to transform the vertices of the bounding box into the left and right camera grayscale images, and obtain the left image target vertices and the right image target vertices; As an exemplary embodiment, in step S23, determine the vertices of the bounding box according to the size of the target image, and use the previously obtained transformation matrix to transform the vertices of the bounding box into the left and right camera grayscale images to obtain the vertex coordinates of the target in the left and right images, and then determine the target position; S24: According to the left image target vertices and the right image target vertices, obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image; As an exemplary embodiment, in step S24, calculate the distances from the upper left corner vertex to the left boundaries of the left and right camera grayscale images according to the vertex coordinates of the target, and obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image; S3: According to the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, obtain the disparity between the left and right images and the distance from the target object to the binocular camera; In an exemplary embodiment, step S3 specifically includes: obtaining the disparity between the left and right images and the distance from the target object to the binocular camera according to the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, as shown in the formula: , , where, is the distance from the target object to the binocular camera, is the distance between the projection centers of the two cameras, is the focal length of the camera, is the distance from the target vertex to the left boundary of the left image, is the distance from the target vertex to the left boundary of the right image, is the disparity between the left and right images; It should be noted that binocular camera ranging is a method for determining the object distance based on the disparity principle and the triangulation principle; among them, the disparity principle is specifically as follows: a binocular camera consists of two cameras with different positions, and their optical axes are parallel or nearly parallel; when observing an object, due to the different positions of the two cameras, the positions of the object on the imaging planes of the two cameras will be different; this is like our human eyes looking at an object. Because the positions of the left and right eyes are different, the positions of the object seen will have slight differences; for example, if we stretch a finger in front of our eyes and observe it with the left and right eyes respectively, we will clearly find that the position of the finger relative to the distant background is different in the left and right eyes; It should be noted that according to the triangulation relationship, assuming that the optical centers of the two cameras are the left camera optical center and the right camera optical center respectively, the distance between them is the baseline length; the object forms an image point on the imaging plane of the left camera and also has a corresponding image point on the imaging plane of the right camera; according to the principle of similar triangles, assuming that the distance from the object to the camera plane is a specific value, the disparity on the imaging plane is represented by the difference in the abscissas of the object on the imaging planes of the left and right cameras, and at the same time, the focal length of the imaging plane is known; based on these conditions, the ranging formula can be derived; as Figure 3 shown is a schematic diagram of the binocular camera measurement principle; the distance between the two camera projection centers is , called the baseline; any point in space and the imaging points of the left and right cameras are and respectively; according to the principle that light travels in a straight line, it can be obtained that point should be located at the intersection of the straight line and the straight line ; from this, the disparity between the left and right images can be obtained:

[0025] Imaging point P L P R The distance between them is:

[0026] According to the similarity theory of triangles, it can be obtained that:

[0027]

[0028] As shown in formula (3.4), the depth of the parallax can be obtained according to the focal length and baseline distance of the camera.

[0029] In one embodiment, the binocular camera target positioning and ranging method based on feature point matching relies on the SURF feature point matching algorithm and the geometric transformation positioning method to perform binocular matching and ranging according to the detected target template, including the following steps: First, perform feature detection and extraction to find feature points; first convert the image into a grayscale image, and then use the SURF feature algorithm to find the feature points in the image that remain stable under changes such as scale, rotation, and illumination; Secondly, compare and match the feature description information of the left image and the right image with the feature description information of the template image; during the matching process, filter out accurate and unique matching results according to specific rules and conditions, and remove those matches that may have errors or be unreliable; through such operations, finally determine the feature points in the left image and the right image that correspond to the template image, and these corresponding points reflect the similar feature position relationship between different images; Thirdly, perform geometric transformation estimation and positioning. Use the corresponding feature points obtained from the previous matching to analyze and estimate the geometric transformation relationship from the template image to the left image and the right image; this geometric transformation can cover various changes such as rotation, scaling, and translation that may occur in the plane of the image; to ensure the accuracy of the transformation relationship, the algorithm uses the RANSAC method to exclude the interference points caused by mis-matching, so as to obtain a more accurate and reliable geometric transformation relationship; based on this accurate transformation relationship, determine the new positions of the boundaries of the template image after transformation in the left image and the right image; Finally, calculate the distance from the target object to the binocular camera according to the displacement of the target object in the left and right images of the image and the binocular ranging principle.

[0030] In one embodiment, a binocular camera target positioning and ranging method based on feature point matching is implemented in a scene in which the environment in space is relatively simple but the illumination may change greatly and the target object is known, and can complete the positioning and ranging of the target; it mainly includes: firstly matching the left and right images with the template image by SURF feature points, then using the RANSAC algorithm to estimate the transformation from the template image to the left and right camera images, determining the boundary of the target object, completing the positioning of the target and obtaining the parallax of the left and right cameras; finally, calculating the distance between the target object and the baseline of the binocular camera; by utilizing the known prior conditions of the target and the fast features of SURF, real-time target positioning and distance calculation are realized; in a standard 24-frame camera, the effect of current frame detection can be achieved.

[0031] In one embodiment, if Figure 2 The figure shows an algorithm flow chart of a binocular camera target positioning and ranging method based on feature point matching; the binocular camera target positioning and ranging method based on feature point matching includes the following steps: The algorithm first obtains the image data of the left and right cameras and the feature image of the detection target; Convert these images into grayscale images to obtain three grayscale images; Detect SURF feature points on the left and right camera images and the target grayscale image respectively and calculate the corresponding feature points; The algorithm will match the feature descriptors of the left and right camera grayscale images with the target grayscale image respectively, and use the maximum ratio algorithm to determine a unique matching object for each successfully matched feature point; Use the RANSAC algorithm to estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images, and obtain a transformation matrix; Determine the vertices of the bounding box according to the size of the target image, and use the previously obtained transformation matrix to transform the vertices of the bounding box into the left and right camera grayscale images to obtain the vertex coordinates of the target in the left and right images, and then determine the target position; According to the vertex coordinates of the target, the distance from the upper left vertex to the left edge of the left and right camera grayscale images is calculated to obtain the formula (3.1) and Then the disparity of the left and right images can be calculated ; Calculate the depth of the target according to formula (3.4).

[0032] In one embodiment, the binocular camera target positioning and ranging method based on feature point matching is implemented in the following manner, as shown in Table 1, the left half of the table is the implementation code of the sliding matching algorithm, and the right half of the table is the implementation code of the algorithm of the present invention; Table 1: Comparison table of implementation codes of sliding matching algorithm and the algorithm of the present invention

[0033] The matching results of the sliding matching algorithm and the algorithm of the present invention are respectively as Figure 4 and Figure 5 shown; the algorithm uses the CoppeliaSim simulation platform to obtain visual sensor data and uses Matlab to process the algorithm; the running efficiency is calculated by timing at the beginning and end of the algorithm respectively; as Figure 6 shown, the left camera image can be well matched with the template; as Figure 7 shown, the algorithm can detect the target object at different distances and calculate the corresponding position; as shown in Table 2, the measurement results and the running time of the algorithm can meet the measurement error requirements and the real-time calculation requirements of a 24-frame camera, that is, ; compared with other algorithms that can only complete depth measurement but cannot complete target detection, the algorithm of the present invention is far superior to them and can simultaneously complete the positioning of the target and the measurement of the distance, meeting the application requirements of the current scenario.

[0034] Table 2: Comparison table of measurement results and true values

[0035] This embodiment provides a binocular camera target positioning and ranging system, and the binocular camera target positioning and ranging system includes the following modules: a feature matching module configured to: obtain left image matching feature points and right image matching feature points according to the left camera image, the right camera image and the target feature image by using the accelerated robust feature algorithm; a target point transformation module configured to: obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image according to the left image matching feature points, the right image matching feature points and the target feature image by using the random sample consensus algorithm; a distance calculation module configured to: obtain the disparity between the left and right images and the distance from the target object to the binocular camera according to the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image.

[0036] Specifically, the feature matching module is specifically configured to: convert the left camera image, the right camera image, and the target feature image into grayscale images to obtain a left camera grayscale image, a right camera grayscale image, and a target grayscale image; according to the left camera grayscale image, the right camera grayscale image, and the target grayscale image, use the Speeded Up Robust Features (SURF) algorithm to extract SURF feature operators to obtain a left image feature descriptor, a right image feature descriptor, and a target feature descriptor; respectively perform feature point matching between the left image feature descriptor and the right image feature descriptor with the target feature descriptor to obtain left image matching feature points and right image matching feature points.

[0037] Specifically, the target point transformation module is specifically configured to: according to the left image matching feature points and the right image matching feature points, use the Random Sample Consensus (RANSAC) algorithm to respectively estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images to obtain a left image transformation matrix and a right image transformation matrix; read the target boundary of the target feature image to obtain boundary vertex coordinates; according to the boundary vertex coordinates, use the left image transformation matrix and the right image transformation matrix to transform the vertices of the bounding box into the left and right camera grayscale images to obtain left image target vertices and right image target vertices; according to the left image target vertices and the right image target vertices, obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image.

[0038] Specifically, the distance calculation module is specifically configured to: according to the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, obtain the disparity between the left and right images and the distance from the target object to the binocular camera, as shown in the formula: , , where, is the distance from the target object to the binocular camera, is the distance between the projection centers of the two cameras, is the focal length of the camera, is the distance from the target vertex to the left boundary of the left image, is the distance from the target vertex to the left boundary of the right image, is the disparity between the left and right images.

[0039] This embodiment provides a computer program product, including a computer program, which when executed by a processor implements the steps of the above-mentioned binocular camera target positioning and ranging method based on feature point matching.

[0040] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative rather than restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit of the present invention and the scope protected by the claims. All of these fall within the protection scope of the present invention.

Claims

1. A binocular camera target positioning and ranging method based on feature point matching, characterized in that It includes the following steps: S1: Based on the left camera image, the right camera image, and the target feature image, using the Speeded Up Robust Features (SURF) algorithm, obtain the left image matching feature points and the right image matching feature points; S2: Based on the left image matching feature points, the right image matching feature points, and the target feature image, using the Random Sample Consensus (RANSAC) algorithm, obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image; S3: Based on the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, obtain the disparity between the left and right images and the distance from the target object to the binocular camera.

2. The binocular camera target positioning and ranging method based on feature point matching according to claim 1, characterized in that, Step S1 specifically includes: S11: Convert the left camera image, the right camera image, and the target feature image into grayscale images to obtain the left camera grayscale image, the right camera grayscale image, and the target grayscale image; S12: Based on the left camera grayscale image, the right camera grayscale image, and the target grayscale image, use the SURF algorithm to extract SURF feature operators to obtain the left image feature descriptor, the right image feature descriptor, and the target feature descriptor; S13: Match the left image feature descriptor and the right image feature descriptor with the target feature descriptor respectively to obtain the left image matching feature points and the right image matching feature points.

3. The binocular camera target positioning and ranging method based on feature point matching according to claim 1, characterized in that Step S2 specifically includes: S21: Based on the left image matching feature points and the right image matching feature points, use the RANSAC algorithm to estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images respectively to obtain the left image transformation matrix and the right image transformation matrix; S22: Read the target boundary of the target feature image to obtain the boundary vertex coordinates; S23: Based on the boundary vertex coordinates, use the left image transformation matrix and the right image transformation matrix to transform the vertices of the bounding box into the left and right camera grayscale images to obtain the left image target vertex and the right image target vertex; S24: Based on the left image target vertex and the right image target vertex, obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image.

4. The binocular camera target positioning and ranging method based on feature point matching according to claim 1, wherein, Step S3 specifically includes: Based on the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, obtain the disparity between the left and right images and the distance from the target object to the binocular camera, as shown in the formula: , , Among them, is the distance from the target object to the binocular camera, is the distance between the projection centers of the two cameras, is the focal length of the camera, is the distance from the target vertex to the left boundary of the left image, is the distance from the target vertex to the left boundary of the right image, is the disparity between the left and right images.

5. A binocular camera target positioning and ranging system, characterized in that, The binocular camera target positioning and ranging system includes the following modules: The feature matching module is configured to: Based on the left camera image, the right camera image, and the target feature image, use the SURF algorithm to obtain the left image matching feature points and the right image matching feature points; The target point transformation module is configured to: Based on the left image matching feature points, the right image matching feature points, and the target feature image, use the RANSAC algorithm to obtain the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image; The distance calculation module is configured to: Based on the distance from the target vertex to the left boundary of the left image and the distance from the target vertex to the left boundary of the right image, obtain the disparity between the left and right images and the distance from the target object to the binocular camera.

6. The binocular camera target positioning and ranging system according to claim 5, characterized in that, The feature matching module is specifically configured to: Convert the left camera image, the right camera image, and the target feature image into grayscale images to obtain the left camera grayscale image, the right camera grayscale image, and the target grayscale image; According to the left camera grayscale image, the right camera grayscale image, and the target grayscale image, use the Speeded Up Robust Features (SURF) algorithm to extract SURF feature operators, obtaining the left image feature descriptor, the right image feature descriptor, and the target feature descriptor; Perform feature point matching on the left image feature descriptor and the right image feature descriptor with the target feature descriptor respectively to obtain the left image matching feature points and the right image matching feature points.

7. The binocular camera target positioning and ranging system according to claim 5, characterized in that, The target point transformation module is specifically configured as follows: According to the left image matching feature points and the right image matching feature points, use the Random Sample Consensus (RANSAC) algorithm to estimate the geometric transformation from the target grayscale image to the left and right camera grayscale images respectively, obtaining the left image transformation matrix and the right image transformation matrix; Read the target boundary of the target feature image to obtain the boundary vertex coordinates; According to the boundary vertex coordinates, use the left image transformation matrix and the right image transformation matrix to transform the vertices of the bounding box into the left and right camera grayscale images, obtaining the left image target vertices and the right image target vertices; According to the left image target vertices and the right image target vertices, obtain the distance from the target vertices to the left boundary of the left image and the distance from the target vertices to the left boundary of the right image.

8. The binocular camera target positioning and ranging system according to claim 5, characterized in that, The distance calculation module is specifically configured as follows: According to the distance from the target vertices to the left boundary of the left image and the distance from the target vertices to the left boundary of the right image, obtain the disparity between the left and right images and the distance from the target object to the binocular camera, as shown in the formula: , , Among them, is the distance from the target object to the binocular camera, is the distance between the projection centers of the two cameras, is the focal length of the camera, is the distance from the target vertex to the left boundary of the left image, is the distance from the target vertex to the left boundary of the right image, is the disparity between the left and right images.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the binocular camera target positioning and ranging method according to any one of claims 1-4 based on feature point matching.