Dual-threshold ORB feature detection method
Through the dual-threshold ORB feature detection method, the number of FAST feature point detection is reduced, the problem of low operation efficiency of ORB-SLAM on embedded devices is solved, and the basic function of implementing ORB-SLAM in embedded DSP is realized.
Patent Information
- Application Number
- CN202411327707.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-03
AI Technical Summary
When the existing ORB-SLAM technology uses small thresholds to extract FAST feature points during feature point uniformization, the CPU computing power consumption is too large and cannot run on the vehicle-mounted embedded device.
The dual-threshold ORB feature detection method is adopted to construct an image pyramid, divide the image into cells, and set the first and second detection thresholds to generate a subset of feature points, and use the quad-tree algorithm to perform uniform screening to reduce the number of FAST detection times.
The number of feature point detection times is greatly reduced, and the efficiency is improved by 40-50%, allowing ORB-SLAM to fully realize basic functions in embedded DSP, improving the practicality of the solution.
Smart Images

Figure CN119251518A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a dual-threshold ORB feature detection method. Background Art
[0002] SLAM (Simultaneous Localization and Mapping) technology is widely used in robot positioning and navigation, VR / AR, drones, unmanned driving and other fields. Sensor-based SLAM is mainly divided into laser SLAM and visual SLAM (VSLAM for short). The advantage of VSLAM over laser SLAM is that it can perceive rich texture information.
[0003] Among various VSLAMs, ORB-SLAM (Oriented FAST and Rotated BRIEF SLAM) is highly praised for its faster feature extraction and better robustness. In addition to considering the original scale invariance and rotation invariance of ORB features, feature extraction of ORB-SLAM also needs to consider the homogenization of feature points. At present, when using a small threshold to extract FAST feature points in the feature point homogenization method of ORB-SLAM, the amount of calculation is very large. Taking a 1280x800 image and a 35x35 grid as an example, 792 FAST detections are required, which will greatly consume the computing power of the CPU, resulting in the inability to run on vehicle embedded devices. Summary of the invention
[0004] The present invention provides a dual-threshold ORB feature detection method, which aims to solve the defects in the prior art and greatly reduce the detection times of FAST, so that the basic functions of ORB-SLAM can be fully realized in the embedded DSP, thereby improving the practicability of the solution.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] The present invention provides a dual-threshold ORB feature detection method, comprising:
[0007] Step 1: construct an image pyramid, and calculate the number of feature points to be extracted for each layer in the image pyramid according to the total number of layers of the image pyramid and the total number of feature points to be extracted;
[0008] Step 2, dividing each layer into a preset number of cells;
[0009] Step 3, determining the boundary coordinates of each cell in each layer;
[0010] Step 4: Set a first detection threshold and a second detection threshold, and use the first detection threshold to perform FAST feature point detection on each layer. The obtained feature point set is the first feature point set of the corresponding layer, and the first detection threshold is lower than the second detection threshold;
[0011] Step 5: Generate corresponding primary subsets and secondary subsets according to the first feature point set and the second detection threshold;
[0012] Step 6: Generate a complete set of feature points of the corresponding layer according to the first-level subset and the second-level subset;
[0013] Step 7: uniformly screening the feature points in the entire feature point set of the corresponding layer using a preset algorithm until the number of feature points reaches the total number of feature points of the corresponding layer.
[0014] Specifically, the step 2 includes:
[0015] Step 201, setting the width and height of the cell to initial values;
[0016] Step 202, determining the first number of cells and the second number of cells in the horizontal and vertical directions of the image respectively according to the initial value;
[0017] Step 203: Determine the number of horizontal cells and the number of vertical cells in the horizontal and vertical directions of the image according to the first number of cells and the second number of cells.
[0018] Specifically, the first number of cells Nx=[W / C'], the second number of cells Ny=[H / C'], wherein W and H are the horizontal and vertical resolutions of the corresponding layer, respectively, and [] represents a rounding operation.
[0019] Specifically, the number of horizontal cells Cx=ceil(W / Nx), and the number of vertical cells Cy=ceil(H / Ny), wherein ceil represents a floating point number rounded upwards.
[0020] Specifically, step 3 includes: determining the boundary coordinates of each cell according to a first preset formula, wherein the first preset formula includes:
[0021] X(ij)s=i*Cx, X(ij)e=(i+1)Cx;
[0022] Y(ij)s=j*Cy, Y(ij)e=(j+1)Cy;
[0023] Among them, 0≤i<Nx, 0≤j<Ny, X(ij)e<W, Y(ij)e<H.
[0024] Specifically, the step 5 includes:
[0025] Step 501, traverse each cell in the corresponding layer, obtain the feature points of the first feature point set located in the currently traversed cell, and generate the corresponding first-level subset;
[0026] Step 502: Generate a corresponding secondary subset for all feature points in the primary subset whose responsiveness is greater than or equal to the second detection threshold.
[0027] Specifically, step 6 includes: determining whether the number of the secondary subsets is greater than zero, if so, importing the secondary subsets into the full set of feature points of the corresponding layer, otherwise, importing the primary subsets into the full set of feature points of the corresponding layer.
[0028] Specifically, the preset algorithm is a quadtree algorithm.
[0029] The beneficial effects of the present invention are as follows: the present invention divides each layer into cells by constructing an image pyramid, sets two detection thresholds at the same time, obtains a feature point set by a lower detection threshold, and then generates a feature point subset of each cell, and compares it with a higher detection threshold, thereby determining the composition of the full set of feature points, and finally performs homogenization processing on the feature points. Under the condition of ensuring the homogenization of the feature points, the present invention greatly reduces the number of detections of FAST, and improves the efficiency by 40-50% compared with the solution in the prior art, so that it can fully realize the basic functions of ORB-SLAM in an embedded DSP, and improves the practicality of the solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flow chart of the dual-threshold ORB feature detection method of the present invention. DETAILED DESCRIPTION
[0031] The following specifically describes the embodiments of the present invention in conjunction with the accompanying drawings, which are only for reference and illustration and do not constitute a limitation on the scope of patent protection of the present invention.
[0032] In the process described in the specification, claims or drawings of the present invention, the serial numbers of each step (such as step 10, 20, etc.) are included. The serial numbers are only used to distinguish the steps, and the serial numbers themselves do not represent any execution order. It should be noted that the descriptions such as "first" and "second" in this article are only used to distinguish the description objects, etc., and do not represent the order of precedence, nor do they mean that "first", "second", etc. are different types.
[0033] like Figure 1 As shown, this proposal provides a dual-threshold ORB feature detection method, including:
[0034] Step 1: Build an image pyramid and calculate the number of feature points N that need to be extracted for each layer in the image pyramid based on the total number of layers of the image pyramid and the total number of feature points NUM to be extracted. k .
[0035] In specific implementation, the total number NUM of feature points to be extracted may vary according to different scenarios, and generally needs to be configured based on empirical values.
[0036] The number of feature points N that need to be extracted for each layer k They are not evenly distributed, but rather present a decreasing pattern. For example, the number of feature points that need to be extracted from the layer with the highest resolution (layer 1) is 100, and the number of feature points that need to be extracted from the layer with the lowest and highest resolution (layer k) is 20.
[0037] Step 2: Divide each layer into a preset number of cells.
[0038] In this proposal, step 2 includes:
[0039] Step 201: Set the width and height of the cell to initial values C'.
[0040] In specific implementation, the initial value C' is an empirical value, which needs to ensure that the cell can perform a certain number of FAST feature point detections.
[0041] Step 202: Determine the first number of cells and the second number of cells in the horizontal and vertical directions of the image respectively according to the initial value C'.
[0042] In this proposal, the first number of cells Nx = [W / C'], and the second number of cells Ny = [H / C'], where W and H are the horizontal and vertical resolutions of the corresponding layer, respectively, and [] represents a rounding operation.
[0043] Step 203: Determine the number of horizontal cells and the number of vertical cells in the horizontal and vertical directions of the image according to the first number of cells and the second number of cells.
[0044] In this proposal, the number of horizontal cells Cx=ceil(W / Nx), and the number of vertical cells Cy=ceil(H / Ny), where ceil represents a floating point number rounded up.
[0045] Step 3: Determine the boundary coordinates of each cell Cell(ij) in each layer.
[0046] In this proposal, the cell numbers are represented by a two-dimensional array (ij), where i represents the horizontal number and j represents the vertical number. It is easy to understand that i = 0, 1, 2...Cx-1, j = 0, 1, 2...Cy-1.
[0047] The boundary coordinates of each cell Cell(ij) are represented by the pixel coordinates of the upper left corner and the lower right corner, expressed as (X(ij)s,Y(ij)s,X(ij)e,Y(ij)e), where X(ij)s,Y(ij)s represent the starting coordinates and X(ij)e,Y(ij)e represent the ending coordinates.
[0048] In this proposal, the step 3 includes: determining the boundary coordinates of each cell Cell(ij) according to a first preset formula, wherein the first preset formula includes:
[0049] X(ij)s=i*Cx, X(ij)e=(i+1)Cx;
[0050] Y(ij)s=j*Cy, Y(ij)e=(j+1)Cy;
[0051] Among them, 0≤i<Nx, 0≤j<Ny, X(ij)e<W, Y(ij)e<H.
[0052] Step 4: Set the first detection threshold T 1 , the second detection threshold T 2 and use the first detection threshold T 1 Perform FAST feature point detection on each layer, and the obtained feature point set is the first feature point set V of the corresponding layer. 1k , the first detection threshold T 1 Below the second detection threshold T 2 .
[0053] It is easy to understand that the first detection threshold T 1 The detected feature points include the second detection threshold T 2 Detected feature points.
[0054] The first detection threshold T 1 , the second detection threshold T 2 The values may vary depending on the scenario and are generally configured based on experience.
[0055] In this proposal, FAST feature point detection needs to be performed on each layer separately, so that each layer has a corresponding first feature point set. For example, FAST feature point detection is performed on layer 1 to obtain the first feature point set V 11 , perform FAST feature point detection on layer 2 and obtain the first feature point set V 12 , and so on.
[0056] Step 5: Based on the first feature point set V 1k And the second detection threshold T2 Generate the corresponding first-level subset V 1k (ij), secondary subset V 2k (ij).
[0057] In this proposal, step 5 includes:
[0058] Step 501: traverse each cell Cell(ij) in the corresponding layer to obtain the first feature point set V 1k The feature points in the currently traversed cell generate the corresponding first-level subset V 1k (ij).
[0059] For example, for the cell Cell(22) of layer 1, from the first feature point set V 11 Extract the feature points in the cell Cell(22) and generate the corresponding first-level subset V 11 (twenty two).
[0060] The primary subset V 11 The x and y coordinates of the feature points in (ij) simultaneously satisfy: x>X(ij)s, y>Y(ij)s, x≤X(ij)e, y≤Y(ij)e.
[0061] Step 502: the first-level subset V 1k (ij) The response S is greater than or equal to the second detection threshold T 2 All feature points generate the corresponding secondary subset V 2k (ij).
[0062] In this proposal, the responsiveness S of a feature point describes the degree of discrimination of the feature point.
[0063] Step 6: According to the first-level subset V 1k (ij), secondary subset V 2k (ij) Generate the complete set of feature points V of the corresponding layer k (all).
[0064] In this proposal, step 6 includes: determining the secondary subset V 2k Is the number of (ij) greater than zero? If so, the secondary subset V 2k (ij) Import the complete set of feature points V into the corresponding layer k (all), otherwise the first-level subset V 1k (ij) Import the complete set of feature points V into the corresponding layer k (all).
[0065] Step 7: Use a preset algorithm to calculate the complete set of feature points V of the corresponding layer. kThe feature points in (all) are uniformly screened until the number of feature points reaches the total number of feature points N of the corresponding layer. k .
[0066] In this proposal, the preset algorithm is a quadtree algorithm.
[0067] The above disclosure is only a preferred embodiment of the present invention, which cannot be used to limit the scope of protection of the present invention. Therefore, equivalent changes made according to the scope of the patent application of the present invention are still within the scope covered by the present invention.
Claims
1. A dual-threshold ORB feature detection method, characterized in that: include: Step 1: construct an image pyramid, and calculate the number of feature points to be extracted for each layer in the image pyramid according to the total number of layers of the image pyramid and the total number of feature points to be extracted; Step 2, dividing each layer into a preset number of cells; Step 3, determining the boundary coordinates of each cell in each layer; Step 4: Set a first detection threshold and a second detection threshold, and use the first detection threshold to perform FAST feature point detection on each layer. The obtained feature point set is the first feature point set of the corresponding layer, and the first detection threshold is lower than the second detection threshold; Step 5: Generate corresponding primary subsets and secondary subsets according to the first feature point set and the second detection threshold; Step 6: Generate a complete set of feature points of the corresponding layer according to the first-level subset and the second-level subset; Step 7: uniformly screening the feature points in the entire feature point set of the corresponding layer using a preset algorithm until the number of feature points reaches the total number of feature points of the corresponding layer.
2. The dual-threshold ORB feature detection method according to claim 1, characterized in that: The step 2 comprises: Step 201, setting the width and height of the cell to initial values; Step 202, determining the first number of cells and the second number of cells in the horizontal and vertical directions of the image respectively according to the initial value; Step 203: Determine the number of horizontal cells and the number of vertical cells in the horizontal and vertical directions of the image according to the first number of cells and the second number of cells.
3. The dual-threshold ORB feature detection method according to claim 2, characterized in that: The first number of cells Nx=[W / C'], the second number of cells Ny=[H / C'], wherein W and H are the horizontal and vertical resolutions of the corresponding layer respectively, and [] represents a rounding operation.
4. The dual-threshold ORB feature detection method according to claim 3, characterized in that: The number of horizontal cells Cx=ceil(W / Nx), and the number of vertical cells Cy=ceil(H / Ny), wherein ceil represents a floating point number rounded upwards.
5. The dual-threshold ORB feature detection method according to claim 4, characterized in that: The step 3 includes: determining the boundary coordinates of each cell according to a first preset formula, wherein the first preset formula includes: X(ij)s=i*Cx, X(ij)e=(i+1)Cx; Y(ij)s=j*Cy, Y(ij)e=(j+1)Cy; Among them, 0≤i<Nx, 0≤j<Ny, X(ij)e<W, Y(ij)e<H.
6. The dual-threshold ORB feature detection method according to claim 5, characterized in that: The step 5 comprises: Step 501, traverse each cell in the corresponding layer, obtain the feature points of the first feature point set located in the currently traversed cell, and generate the corresponding first-level subset; Step 502: Generate a corresponding secondary subset for all feature points in the primary subset whose responsiveness is greater than or equal to the second detection threshold.
7. The dual-threshold ORB feature detection method according to claim 6, characterized in that: The step 6 comprises: determining whether the number of the secondary subsets is greater than zero, if so, importing the secondary subsets into the full set of feature points of the corresponding layer, otherwise, importing the primary subsets into the full set of feature points of the corresponding layer.
8. The dual-threshold ORB feature detection method according to claim 7, characterized in that: The preset algorithm is a quadtree algorithm.
