Positioning method, device and storage medium applied to known environment
By establishing a world coordinate system in known environments and matching feature points using preset threshold ranges, the robustness and accuracy of the drone positioning method are solved, and high-precision and reliable positioning in known environments are achieved.
Patent Information
- Application Number
- CN202510187355.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-02-20
AI Technical Summary
The existing drone positioning methods have problems such as insufficient robustness and low positioning accuracy in known environments, especially in repeated scenes or similar scene environments, which are prone to incorrect matching, resulting in deviations in position information.
By establishing a world coordinate system in a known environment, selecting fixed and unchanging feature points, matching feature points using the initial position of the monocular camera and the preset threshold range, calculating the current position of the drone, and extracting feature points using deep learning models or edge detection methods.
It improves the positioning accuracy and robustness of the drone in known environments, ensures reliability and accuracy when feature points change, and reduces the impact of environmental changes.
Smart Images

Figure CN120125658B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spatial positioning technology, and in particular to a positioning method, device and storage medium applied to a known environment. Background Art
[0002] Drones include unmanned aerial vehicles (UAVs) and AGVs. When performing tasks, they need to perform real-time positioning, that is, to determine their own posture in real time, that is, to determine their own position and posture. One existing positioning method is to set a camera on the drone and determine the drone's posture based on the images taken by the camera in real time. However, when applied in certain industrial scenarios, existing positioning methods have defects such as insufficient robustness and low positioning accuracy. For example, in some environments with repeated or similar scenes, the images taken by the camera at different positions are highly similar. When extracting feature points from the image and matching the feature points with the position points in the actual environment, mismatching is prone to occur, resulting in errors in the world coordinates of the feature points, which in turn leads to deviations in the drone's posture information calculated based on the feature points. Summary of the Invention
[0003] The purpose of the present invention is to provide a positioning method, device and storage medium for use in a known environment, which have high positioning accuracy, strong robustness, simplicity and reliability.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] The present invention provides a positioning method applied to a known environment, comprising:
[0006] Step 101, obtaining the world coordinates of each first feature point in a known environment;
[0007] Step 102: Acquire a first image captured by the monocular camera at the current moment;
[0008] Step 103: extract a second feature point from the first image and obtain second pixel coordinates of the second feature point, where the second pixel coordinates are actual measured values of the pixel coordinates of the second feature point in the first image; the second feature point is a two-dimensional projection point of the first feature point in the first image;
[0009] Step 104: Calculate a first pixel coordinate of the first feature point based on the pose of the monocular camera at the last moment and the world coordinates of the first feature point; the first pixel coordinate is a theoretically calculated value of the pixel coordinate of the first feature point imaged at the pose of the monocular camera at the last moment; the initial pose of the monocular camera is a known pose;
[0010] Step 105: Match the second feature point with the first feature point based on the second pixel coordinate of the second feature point, the first pixel coordinate of the first feature point, and a preset threshold range to obtain a plurality of matching pairs, each of which includes a second feature point and a first feature point;
[0011] Step 106: Calculate the pose of the monocular camera at the current moment based on the second pixel coordinates of the second feature points of the plurality of matching pairs and the world coordinates of the first feature point;
[0012] Step 107, repeat steps 102-106.
[0013] Optionally, the first feature point in step 104 is a first feature point located within a first range corresponding to the posture of the monocular camera at a previous moment, and different postures of the monocular camera correspond to different first ranges.
[0014] Optionally, in step 103, extracting the second feature points in the first image specifically includes: extracting the second feature points in the first image using a deep learning model.
[0015] Optionally, the training method of the deep learning model includes:
[0016] Step 201: shoot a video of the known environment, extract the video frame by frame using a frame extraction technique, annotate the second feature points in each extracted frame using image annotation software and generate corresponding labels, and divide the annotated data set into a training set, a validation set, and a test set;
[0017] Step 202: Determine the architecture, number of layers, number of neurons, and connection method of the deep learning model to obtain a deep learning model;
[0018] Step 203: training the deep learning model using the training set, adjusting the parameters of the deep learning model using a backpropagation algorithm to minimize a loss function, and optimizing the parameters of the deep learning model using an optimization algorithm to ensure that the deep learning model converges and does not overfit;
[0019] Step 204: Use the validation set to evaluate the performance of the model. The deep learning model is evaluated by accuracy, precision, recall, and F1 score. Based on the evaluation results, the deep learning model is tuned by adjusting hyperparameters, modifying the model structure, or using regularization methods.
[0020] Optionally, in step 103, extracting second feature points from the first image specifically includes:
[0021] Step 301: grayscale the first image.
[0022] Step 302: performing smoothing on the grayscaled first image.
[0023] Step 303: performing edge detection on the smoothed first image using an edge detection method to obtain an edge image;
[0024] Step 304: performing Hough transform on the edge image to extract edge segments;
[0025] Step 305: extract the second feature point based on the edge segment.
[0026] Optionally, when the second feature point is a corner point, extracting the second feature point based on the edge segment in step 305 specifically includes:
[0027] An intersection point of the edge line segments is extracted, where the intersection point is the second feature point.
[0028] Optionally, when there is a square pillar in the known environment, the first feature point includes a right-angle point of the square pillar;
[0029] Alternatively, when a cylindrical pillar exists in the known environment, the first feature point includes a center point of a cross section of the cylindrical pillar.
[0030] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any one of the methods described above.
[0031] The present invention also provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of any one of the methods described above.
[0032] In the technical solution of the present invention, for the scenario in which a drone performs a task in a known environment, a world coordinate system is established for the known environment, fixed points in the known environment are selected as feature points, and the position and posture of the monocular camera on the drone are initialized each time a task is performed, thereby making the initial position and posture of the monocular camera known. A preset threshold range is pre-set based on the movement speed of the drone and the shooting frequency of the monocular camera. After capturing a first image at the current moment, when determining the feature points in the real environment corresponding to the feature points in the first image, the position and posture of the monocular camera at the previous moment and the feature points that the monocular camera can capture in this position are used as references, and the preset threshold range is used to constrain the obtained correspondence, so that the obtained correspondence is reliable. Moreover, using this method, even when there are a small number of available feature points in the known environment, the position and posture of the monocular camera can be accurately calculated, and the positioning will not be affected by changes in other objects in the known environment other than the feature points, resulting in high robustness and positioning accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a schematic diagram of a flow chart of a positioning method applied to a known environment;
[0034] Figure 2 A schematic diagram of a perspective view of a known environment;
[0035] Figure 3 A schematic diagram of a first image captured by a monocular camera;
[0036] Figure 4 A schematic diagram of marking a second feature point in a first image;
[0037] Figure 5 A schematic diagram of matching the second feature point with the first feature point;
[0038] Figure 6 This is a schematic diagram of extracting second feature points based on edge segments on a first image. DETAILED DESCRIPTION
[0039] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatuses or methods consistent with certain aspects of the present invention.
[0040] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be described in detail below. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other implementations obtained by ordinary technicians in this field without making any creative work are within the scope of protection of the present invention.
[0041] The following embodiments are described with reference to the accompanying drawings. The embodiments described below do not limit the invention as set forth in the claims. Furthermore, the entire contents of the configurations shown in the following embodiments are not necessarily required to serve as solutions to the invention as set forth in the claims.
[0042] See also Figure 1 The present invention provides a positioning method for a known environment. From a program perspective, the execution subject of the process can be a program installed on a server or a positioning device; from a hardware perspective, the execution subject of the process can be a positioning device or a server, specifically a positioning device installed on a drone, a computer, or a drone control platform. Figure 1 As shown, the method may include the following steps:
[0043] Step 101: Obtain the world coordinates of each first feature point in a known environment.
[0044] When performing certain tasks, the drone navigates within a known environment. This means that certain objects in the environment are fixed and their positions can be measured in advance. A custom world coordinate origin can then be created to establish the world coordinate system for the real environment. Some fixed points in the real environment are selected as feature points, which are referred to as first feature points. The world coordinates of each first feature point can be obtained through measurement. Figure 2 , Figure 2 Consider a known environment where a drone navigates within channel 1. Channel 1 is flanked by columns, which are typically fixed. The right-angled points where the columns meet the ground can be selected as first feature points. For ease of understanding, some first feature points are labeled, such as A, B, C, and D. After selecting a point in the real environment as the origin of the world coordinate system, the world coordinates of each right-angled point, or first feature point, can be measured. The world coordinates of each first feature point are obtained and stored for easy reference in subsequent steps.
[0045] Step 102: Acquire a first image captured by a monocular camera at a current moment.
[0046] A monocular camera is installed on a drone. During flight, the camera captures the surrounding environment at a certain frequency. The captured images are called first images. After the monocular camera captures the first images, the execution entity obtains the first images. In other words, the monocular camera transmits the first images to the execution entity.
[0047] Step 103: extract a second feature point from the first image and obtain second pixel coordinates of the second feature point, where the second pixel coordinates are actual measured values of the pixel coordinates of the second feature point in the first image; the second feature point is a two-dimensional projection point of the first feature point in the first image.
[0048] After the execution subject obtains the first image captured by the monocular camera at the current moment, it processes the first image and extracts the second feature point in the first image. After the monocular camera captures the image, the first feature point in the real environment will be imaged in the first image. Here, the image of the first feature point in the first image is called the second feature point. The second feature point is the two-dimensional projection point of the first feature point in the first image. Figure 3 , Figure 3 The first image is captured by a monocular camera at a certain pose. The right-angled points of the pillars in the first image are referred to as second feature points. For ease of understanding, some second feature points are labeled, such as second feature points a, b, and c. After acquiring the first image, the execution entity extracts the second feature points. After analyzing the first image and the second feature points, the second pixel coordinates of the second feature points are obtained, that is, the actual measured values of the pixel coordinates of the second feature points in the first image.
[0049] Step 104: Calculate a first pixel coordinate of the first feature point based on the pose of the monocular camera at the previous moment and the world coordinates of the first feature point. The first pixel coordinate is a theoretically calculated value of the pixel coordinate of the first feature point imaged at the pose of the monocular camera at the previous moment. The initial pose of the monocular camera is a known pose.
[0050] The initial pose of the monocular camera is known. Each time a drone performs a mission, it undergoes initialization. This involves placing the drone in a specific location and adjusting the monocular camera to a specific pose. The initial pose of the monocular camera can be obtained through pre-measurement or directly set. At the beginning of each mission, the monocular camera is initialized to its initial pose. For ease of understanding, let's use the moment immediately following the initial pose as an example. In this case, the monocular camera's pose at the previous moment is the initial pose and is known. The first pixel coordinates of the first feature point can be calculated based on the monocular camera's pose at the previous moment and the world coordinates of the first feature point. The monocular camera's previous pose creates a pixel coordinate system. Theoretically, the pixel coordinates obtained by converting the first feature point in the real environment to this pixel coordinate system are the first pixel coordinates. The first pixel coordinates can be calculated based on the monocular camera's physical parameters, the world coordinates of the first feature point, and the monocular camera's pose.
[0051] After defining the world coordinate origin of the real environment, the world coordinates of each first feature point in the real environment can be obtained by pre-measurement, and the initial position of the monocular camera can be obtained. The initial position of the monocular camera can be pre-set or pre-measured. The first pixel coordinates (u exp_x ,v exp_y The specific calculation process is as follows:
[0052] First, convert the world coordinates of the first feature point into the camera coordinates in the camera coordinate system. Calculate using the following formula:
[0053]
[0054] Among them, [X c Y c Z c ] T is the camera coordinate of the first feature point in the monocular camera coordinate system, X w Y w Z w ] T is the world coordinate of the first feature point; R is the rotation matrix, which is used to describe the rotation of the monocular camera, and T is the translation matrix, which is used to describe the position of the monocular camera in the world coordinate system. The two form a 3×4 matrix, which is the initial pose of the camera. When obtaining the initial pose T of the monocular camera init-x ,T init-y ,T init-z ,R init-x ,R init-y ,R init-z ), we can get the matrix R and matrix T.
[0055] Secondly, normalize the camera coordinates of the first feature point:
[0056]
[0057] Here P c It can be regarded as a two-dimensional homogeneous coordinate, called normalized coordinate, and the pixel coordinate is regarded as the result of quantitative measurement of points on the normalized plane.
[0058] Again, according to the distortion parameters of the monocular camera, the points on the normalized plane are corrected for radial distortion and tangential distortion:
[0059]
[0060] Finally, the corrected point is projected onto the pixel plane through the intrinsic parameter matrix to obtain the first pixel coordinate (u exp_x ,v exp_y ).
[0061]
[0062] Step 105 : Match the second feature point and the first feature point based on the second pixel coordinate of the second feature point, the first pixel coordinate of the first feature point, and a preset threshold range to obtain a plurality of matching pairs, each of which includes a second feature point and a first feature point.
[0063] The preset threshold range can be set based on the movement speed and shooting frequency of the monocular camera. Based on the second pixel coordinates and the first pixel coordinates, the position difference between the second feature point and the first feature point can be obtained. If the position difference is within the preset threshold range, the second feature point and the first feature point are matched as a matching pair, and the second feature point is the two-dimensional projection point of the first feature point on the first image.
[0064] See also Figure 5 , Figure 5 This is a schematic diagram of matching the second feature point with the first feature point. Figure 5 For a first image, there is a second feature point in the first image. After the first feature point is theoretically calculated to obtain the first pixel coordinate, the first feature point is also marked on the first image at the position of the first pixel coordinate, and the result is Figure 5 . Figure 5 The two points on the connecting line are points that meet the preset threshold range, and the two points on the connecting line form a matching pair. The second feature point a matches the first feature point A, the second feature point b matches the first feature point B, and the second feature point c matches the first feature point C.
[0065] In some cases, in addition to meeting a preset threshold, a matching condition can be added during matching. Specifically, only the first feature point with the smallest position difference from the second feature point and meeting the preset threshold will be considered a matching pair. It should be noted that once a second feature point successfully matches a first feature point, it will not be included in the matching process again.
[0066] Specifically, if a second feature point and a first feature point satisfy the following formula, the second feature point and the first feature point are matched as a matching pair.
[0067]
[0068] in, is the preset threshold, is the second pixel coordinate, is the first pixel coordinate.
[0069] That is, when the second pixel coordinate is subtracted from the first pixel coordinate [u cap_x ,v cap_y ] is less than the set threshold u threshold ,v threshold ), it can be determined that the second feature point is the two-dimensional projection point of the first feature point on the first image.
[0070] Step 106 : Calculate the pose of the monocular camera at the current moment based on the second pixel coordinates of the second feature points of the plurality of matching pairs and the world coordinates of the first feature point.
[0071] The current monocular camera pose can be calculated when there are four or more matching pairs whose feature points are coplanar but not colinear—that is, at least three of the four feature point groups are not colinear. Specifically, the solvePnP algorithm can be used to calculate the current monocular camera pose. Since the monocular camera is mounted on a drone, its pose has a well-defined mapping relationship with the drone's pose, allowing the drone's current pose to be determined.
[0072] Step 107, repeat steps 102-106.
[0073] When the next moment arrives, it becomes the current moment, and the current moment in step 106 becomes the previous moment. This means the monocular camera's pose at the previous moment has already been calculated and is known. By executing steps 102-106 at each moment, the monocular camera's pose can be obtained in real time. The "previous pose in step 102" is the initial pose only during the first calculation, having been pre-measured or set. In subsequent calculations, the pose obtained from the previous calculation is used.
[0074] This method targets scenarios where a drone performs a mission within a known environment. It establishes a world coordinate system for the known environment, selects fixed points within the known environment as feature points, and initializes the initial pose of the drone's monocular camera each time a mission is performed, thereby making the initial pose of the monocular camera known. A preset threshold range is pre-set based on the drone's movement speed and the monocular camera's shooting frequency. After capturing a first image at the current moment, when determining the feature points in the real environment corresponding to the feature points in the first image, the pose of the monocular camera at the previous moment and the feature points that the monocular camera can capture in that pose are used as references. Constrained by the preset threshold range, the resulting correspondence is reliable. Furthermore, using this method, the pose of the monocular camera can be accurately calculated even when there are a small number of available feature points in the known environment. Positioning is not affected by changes in objects other than the feature points within the known environment, resulting in high robustness and positioning accuracy.
[0075] Optionally, the first feature point in step 104 is a first feature point located within a first range corresponding to the posture of the monocular camera at a previous moment, and different postures of the monocular camera correspond to different first ranges.
[0076] When calculating the first pixel coordinates of the first feature point, the calculation can be performed for all first feature points in the known environment, or only for the first feature points within the first range, to obtain the first pixel coordinates of the first feature point within the first range. The first range can be a range determined based on the field of view of a monocular camera, for example, the field of view of a monocular camera, or a range appropriately expanded from the edge of the field of view of a monocular camera. Figure 2 , assuming Figure 2 Each object in the image is within a certain field of view of the monocular camera. Although point C is blocked by pillar 2, point C is still a first feature point within the first range. The monocular camera's pose and the first feature points within the monocular camera's field of view have a defined mapping relationship. Mapping relationships between different poses and the first range can be established in advance and then directly retrieved when determining the first range. Alternatively, real-time calculations can be performed based on the pose and physical parameters of the monocular camera to determine the first range.
[0077] The method of calculating only the first feature point within the first range can reduce the amount of calculation.
[0078] Optionally, in step 103, extracting the second feature points in the first image specifically includes: extracting the second feature points in the first image using a deep learning model.
[0079] Optionally, the training method of the deep learning model includes:
[0080] Step 201: shoot a video of the known environment, extract the video frame by frame using frame extraction technology, use image annotation software to annotate the second feature points in each extracted frame and generate corresponding labels, and divide the annotated data set into a training set, a validation set, and a test set.
[0081] See also Figure 4 After annotating the second feature points e and f, the generated label is the coordinates (x, y) of the second feature point. A 10*10 pixel rectangular box is generated in the image centered around the annotated second feature point, transforming the detection of the second feature point into the detection of a small object rectangular box. After annotation, the annotated images are divided into training, validation, and test sets.
[0082] Step 202: Determine the architecture, number of layers, number of neurons, and connection method of the deep learning model to obtain a deep learning model.
[0083] Step 203: Use the training set to train the deep learning model, adjust the parameters of the deep learning model through a back propagation algorithm to minimize the loss function, and optimize the parameters of the deep learning model through an optimization algorithm to ensure that the deep learning model converges and does not overfit.
[0084] Step 204: Use the validation set to evaluate the performance of the model. The deep learning model is evaluated by accuracy, precision, recall, and F1 score. Based on the evaluation results, the deep learning model is tuned by adjusting hyperparameters, modifying the model structure, or using regularization methods.
[0085] At this point, the deep learning model training is completed and can be used to extract the second feature point.
[0086] Of course, step 205 can also be added to evaluate the performance of the deep learning model using a test set, analyze the model's prediction results, and calculate various performance indicators to determine the actual effect of the deep learning model. After determining the actual effect of the deep learning model, the deep learning model can be put into use.
[0087] Of course, during the application process of the model, step 206 can be added to continuously monitor the performance of the deep learning model in the application environment, detect signs of degradation or performance decline of the deep learning model, and perform necessary updates and maintenance.
[0088] Optionally, in step 103, extracting second feature points from the first image specifically includes:
[0089] Step 301: grayscale the first image.
[0090] Grayscale processing is performed on the first image to convert the color first image into a grayscale image G(x, y).
[0091] Step 302: Smoothing the grayscaled first image.
[0092] Specifically, the grayscale image G(x, y) can be smoothed using a Gaussian smoothing method or other methods to reduce noise interference. Here, the Gaussian smoothing method is used as an example for description:
[0093] A two-dimensional Gaussian filter is used to perform convolution operation on the grayscale image to obtain a smoothed image, namely the filtered image G f (x, y):
[0094]
[0095] in, σ is the standard deviation of the Gaussian function.
[0096] Step 303: Use an edge detection method to perform edge detection on the smoothed first image to obtain an edge image.
[0097] First, calculate the gradient magnitude M(x, y) and direction θ(x, y) of the filtered image.
[0098]
[0099] Among them, G x (x, y) and G y (x, y) are the gradients of the filtered image in the x and y directions respectively.
[0100] Then non-maximum suppression is performed on the gradient magnitude.
[0101] Finally, through double threshold detection and edge connection, the edge image E = (x, y) is obtained.
[0102] Step 304: Perform Hough transform on the edge image to extract edge segments.
[0103] A Hough transform is performed on the edge image E = (x, y), mapping edge points in the image space to the Hough parameter space. Through random sampling and detecting edge point endpoints, each edge point is converted to ρ and θ in the Hough parameter space using polar coordinates. By randomly sampling and accumulating ρ and θ, edge segments in the image are found through voting and thresholding. The Cartesian coordinates of the two endpoints of each edge segment (x1, y1) and (x2, y2) are obtained. These are then converted to polar coordinates (ρ, θ), and segments with similar polar coordinate information are merged to reduce interference. In polar coordinates, the equation of a line can be expressed as ρ = xcosθ + ysinθ, where ρ is the perpendicular distance from the origin to the line and θ is the angle between the line and the positive x-axis.
[0104] Step 305: extract the second feature point based on the edge segment.
[0105] After extracting edge segments, second feature points are extracted based on the extracted edge segments. For example, if the second feature point is the center of a circle, the extracted edge segment is a circle, and the second feature point can be obtained by extracting the center of the circle. If the second feature point is a corner, after extracting edge segments, the second feature point can be obtained by calculating the intersection of the edge segments.
[0106] Optionally, when the second feature point is a corner point, extracting the second feature point based on the edge segment in step 305 specifically includes:
[0107] An intersection point of the edge line segments is extracted, where the intersection point is the second feature point.
[0108] See also Figure 6 , Figure 6 The second feature point in is a right-angle point. The edge segments extracted by Hough transform are straight line segments, such as straight line segments l1, l2, l3, and l4. By simultaneously solving the straight line equations and calculating the intersection of the straight line segments, the second feature point can be obtained. The intersection of the straight line segments here can refer to the intersection of the straight line segments or the extension of the straight line segments.
[0109] For example, by calculating the intersection of the straight line segment l1 and the straight line segment l2, the intersection of the straight line segment l3 and the straight line segment l4, etc., the second feature points a, b, etc. can be obtained, thereby extracting each second feature point in the first image.
[0110] Optionally, when a square pillar exists in the known environment, the first feature point includes a right-angle point of the square pillar.
[0111] See also Figure 2 ,When there is a square column in a known environment, the four right angle points where the square column intersects with the ground are selected as the first feature points.
[0112] Alternatively, when a cylindrical pillar exists in the known environment, the first feature point includes a center point of a cross section of the cylindrical pillar.
[0113] Of course, other easily identifiable points in a known environment may also be selected as first feature points, such as corner points of polygons, center points of screws or nuts used to fix the fan, and the center point of the fan.
[0114] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any one of the methods described above.
[0115] The present invention also provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of any one of the methods described above when the computer program / instruction is executed by a processor.
Claims
1. A positioning method applied to a known environment, characterized in that: include: Step 101, obtaining the world coordinates of each first feature point in a known environment; Step 102: Acquire a first image captured by the monocular camera at the current moment; Step 103: extract a second feature point in the first image and obtain second pixel coordinates of the second feature point, where the second pixel coordinates are actual measured values of the pixel coordinates of the second feature point in the first image; The second feature point is a two-dimensional projection point of the first feature point in the first image; Step 104: Calculate a first pixel coordinate of the first feature point based on the pose of the monocular camera at the last moment and the world coordinates of the first feature point; the first pixel coordinate is a theoretically calculated value of the pixel coordinate of the first feature point imaged at the pose of the monocular camera at the last moment; the initial pose of the monocular camera is a known pose; Step 105: Match the second feature point with the first feature point based on the second pixel coordinate of the second feature point, the first pixel coordinate of the first feature point, and a preset threshold range to obtain a plurality of matching pairs, each of which includes a second feature point and a first feature point; Step 106: Calculate the pose of the monocular camera at the current moment based on the second pixel coordinates of the second feature points of the plurality of matching pairs and the world coordinates of the first feature point; Step 107, repeat steps 102-106.
2. The positioning method for a known environment according to claim 1, wherein: The first feature point in step 104 is a first feature point located within a first range corresponding to the position and posture of the monocular camera at the previous moment, and different positions and postures of the monocular camera correspond to different first ranges.
3. The positioning method for a known environment according to claim 1, wherein: In step 103, extracting the second feature points in the first image specifically includes: extracting the second feature points in the first image using a deep learning model.
4. The positioning method for a known environment according to claim 3, wherein: The training method of the deep learning model includes: Step 201: shoot a video of the known environment, extract the video frame by frame using a frame extraction technique, annotate the second feature points in each extracted frame using image annotation software and generate corresponding labels, and divide the annotated data set into a training set, a validation set, and a test set; Step 202: Determine the architecture, number of layers, number of neurons, and connection method of the deep learning model to obtain a deep learning model; Step 203: training the deep learning model using the training set, adjusting the parameters of the deep learning model using a backpropagation algorithm to minimize a loss function, and optimizing the parameters of the deep learning model using an optimization algorithm to ensure that the deep learning model converges and does not overfit; Step 204: Use the validation set to evaluate the performance of the model. The deep learning model is evaluated by accuracy, precision, recall, and F1 score. Based on the evaluation results, the deep learning model is tuned by adjusting hyperparameters, modifying the model structure, or using regularization methods.
5. The positioning method for a known environment according to claim 1, wherein: In step 103, extracting the second feature point from the first image specifically includes: Step 301: grayscale the first image. Step 302: smoothing the first image after grayscale processing; Step 303: performing edge detection on the smoothed first image using an edge detection method to obtain an edge image; Step 304: performing Hough transform on the edge image to extract edge segments; Step 305: Extract the second feature point based on the edge segment.
6. The positioning method applied to a known environment according to claim 5, characterized in that: When the second feature point is a corner point, extracting the second feature point based on the edge segment in step 305 specifically includes: An intersection point of the edge line segments is extracted, where the intersection point is the second feature point.
7. The positioning method for a known environment according to claim 1, wherein: When there is a square pillar in the known environment, the first feature point includes a right angle point of the square pillar; Alternatively, when a cylindrical pillar exists in the known environment, the first feature point includes a center point of a cross section of the cylindrical pillar.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Monocular camera pose estimation method and system
CN113256711A
Box workpiece pose measurement method based on point features
CN116091603A