An image feature extraction method, system and medium
By constructing an image pyramid and using Gamma correction to enhance image details, the problem of insufficient feature point extraction in robot visual localization is solved, achieving efficient feature point matching and pose estimation, and improving the robot's localization and navigation capabilities in unknown environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AVIC HUADONG OPTOELECTRONICS (SHANGHAI) CO LTD
- Filing Date
- 2023-05-12
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, large image distortion and poor feature point matching occur during robot vision localization, especially in poor lighting conditions, which leads to insufficient feature point extraction, affecting feature matching and pose estimation, and thus affecting the progress of the work.
By constructing an image pyramid to ensure feature scale invariance, calculating image contrast and filtering out image patches with texture, using Gamma correction to enhance image details, extracting FAST corner points and filtering them, and generating feature points.
It improves the accuracy and efficiency of image feature point extraction, enhances the robot's localization and navigation capabilities in unknown environments, and improves the system's robustness and work efficiency.
Smart Images

Figure CN116740375B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and more specifically, relates to an image feature extraction method, system, and medium. Background Technology
[0002] Robots are automated mechanical devices that can be commanded by humans, run pre-programmed sequences, or act according to principles established using artificial intelligence. Their task is to assist or replace human workers in jobs such as manufacturing, construction, or hazardous work. However, current robot vision localization processes often suffer from problems like large image distortion and poor feature point matching. The number and distribution of extracted feature points significantly impact the overall system performance. When the camera is in poor lighting conditions, the loss of detail in the image makes it difficult for the system to extract enough effective feature points, hindering correct feature matching and pose estimation between image frames. This can lead to tracking loss and a series of problems, hindering the smooth progress of the task.
[0003] To address the aforementioned issues, corresponding improvements have been made. For example, Chinese Patent Application No. CN201811580063.3, published on June 30, 2020, discloses a method, apparatus, robot, and computer-readable storage medium for feature extraction from robot visual images. The method includes: acquiring image data through a vision sensor pre-installed on the robot, and acquiring angular velocity data through an inertial sensor pre-installed on the robot; calculating the relative pose between frames in the image data based on the angular velocity data; extracting each feature point from the first frame of the image data; calculating the projection position of each feature point in the k-th frame in the k+1-th frame based on the relative pose between the k-th and k+1-th frames; searching for each feature point at the projection position in the k+1-th frame, and performing synchronous localization and mapping based on the searched feature points. The drawback of this patent is that although it can remove feature points from dynamic objects, its overall efficiency is slow.
[0004] For example, Chinese patent application CN201811301160.4, published on March 8, 2019, discloses an image processing method, an image processing device, and a storage medium. The image processing method includes: acquiring a detection box in an input image; extracting the detection box image based on the detection box, where the detection box is obtained by detecting the target to be processed; extracting image features from the detection box image; determining multiple points to be predicted in the input image and their coordinates; converting the coordinate vector composed of the coordinates of the multiple points to be predicted to obtain coordinate features of the multiple points to be predicted; obtaining a mixed feature of the input image based on the image features and coordinate features; and determining whether the points to be predicted in the input image are key points based on the mixed feature of the input image. The drawback of this patent is that although it can effectively improve the accuracy of pose estimation in multi-person scenes, its overall robustness is poor. Summary of the Invention
[0005] 1. The problem to be solved
[0006] To address the problems of poor accuracy and complex operation in existing image feature point extraction methods, this invention provides an image feature extraction method, system, and medium. The method of this invention ensures the invariance of feature scale by constructing an image pyramid; subsequently, it selects images with texture based on contrast and performs image detail enhancement operations to make image feature points more prominent. The entire method is simple to operate, efficient, and improves the image feature point extraction effect, thereby improving image registration and ensuring the image-based localization and navigation performance of robots. The system of this invention is simple to construct, with stable and non-interfering operation between modules, exhibiting high robustness.
[0007] 2. Technical Solution
[0008] To solve the above problems, the present invention adopts the following technical solution.
[0009] An image feature extraction method includes the following steps:
[0010] S1: Acquire the image, process the image into grayscale, and then construct an image pyramid;
[0011] S2: Calculate the contrast of the image;
[0012] S3: If the image contrast meets the requirements, proceed directly to the next step; if the image contrast does not meet the requirements, perform image enhancement processing on the image.
[0013] S4: Extract FAST corner points from the image;
[0014] S5: Filter FAST corner points and select FAST corner points with high influence as feature points based on the threshold.
[0015] S6: Output feature points.
[0016] Furthermore, step S2 specifically includes the following steps:
[0017] S21: Calculate the gray-level co-occurrence matrix of the image;
[0018] S22: Divide the image into blocks to form several image blocks;
[0019] S23: Calculate the contrast of each image patch.
[0020] Furthermore, in step S21, the image grayscale level is reduced to 8 levels, and then the grayscale co-occurrence matrix is calculated.
[0021] Furthermore, in step S3, Gamma correction is applied to images that do not meet the requirements for image enhancement. Gamma correction includes first obtaining a mask image and then calculating the gamma value based on the mask image.
[0022] Furthermore, obtaining the mask image includes the following steps:
[0023] S31: Select a Gaussian kernel, the value of which is the same as the size of the image patch;
[0024] S32: Scan each pixel in the image block using a Gaussian kernel;
[0025] S33: Replace the value of the center pixel of the Gaussian kernel with the weighted average gray level determined by the Gaussian kernel, and output the value to the mask;
[0026] S34: Finally, the mask image is obtained.
[0027] Furthermore, in step S5, FAST corner points are filtered using a quadtree.
[0028] A system employing an image feature extraction method as described in any of the preceding claims, comprising:
[0029] Acquisition module: Acquires images;
[0030] Image pyramid building module: used to process images in grayscale and build image pyramids;
[0031] Contrast calculation module: Used to calculate the contrast of an image and output the results;
[0032] Image enhancement processing module: Used to perform enhancement processing on images that do not meet contrast requirements;
[0033] Feature point generation module: Extracts FAST corner points from the image and filters them to generate the feature points of the final image;
[0034] Output module: Outputs the final generated feature points.
[0035] A computer-readable storage medium storing a computer program that, when executed by a processor, implements an image feature extraction method as described in any of the preceding claims.
[0036] 3. Beneficial effects
[0037] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0038] (1) Before extracting feature points, the present invention first performs grayscale processing on the image and then constructs an image pyramid to ensure the invariance of feature scale and provide accurate support for subsequent operations; then the image contrast is calculated; based on the contrast, images that do not meet the requirements are selected, that is, images with texture are selected, and image detail is improved to ensure that the image feature points are more prominent; finally, feature points are selected and output; the whole method is simple to operate, does not require complicated steps, and improves the image feature point extraction effect while working efficiently, thereby improving the image registration effect and ensuring the robot's image-based localization and navigation effect;
[0039] (2) This invention improves work efficiency by dividing the image into blocks and calculating the contrast of each block. It also increases the accuracy of contrast calculation and avoids large overall calculation errors. Based on the contrast, image blocks with texture are selected, and then the mask of each image is calculated using a Gaussian kernel. The gamma value is calculated based on the mask. The feature point extraction of the image details is enhanced by adaptive enhancement of Gamma correction, which increases the overall number of feature points extracted, thereby improving the feature point registration effect and the overall robustness. This is beneficial to improving the robot's ability to perceive unknown environments and enhancing the stability of its localization ability. Attached Figure Description
[0040] Figure 1 This is a schematic diagram of the overall process of the present invention. Detailed Implementation
[0041] The present invention will now be further described with reference to specific embodiments and accompanying drawings.
[0042] Example 1
[0043] like Figure 1 As shown, an image feature extraction method includes the following steps:
[0044] S1: Acquire the image, process it to grayscale, and then construct an image pyramid. In this step, it's important to note that when the robot's camera captures two image frames, the size of the object in the image changes as the distance between the camera and the object changes. Since the overall image size remains constant, the resolution of the object in the image changes. To avoid this problem, an image pyramid is constructed before extracting feature points to ensure scale invariance. Specifically, the image pyramid uses a set of images at various resolutions to represent the diversity of image scales. An image pyramid is a collection of images at different scales, which can be constructed by upsampling (increasing the resolution of the original image) or downsampling (reducing the resolution of the original image). The bottom layer of the pyramid is the original image, corresponding to level 0. Each level upwards involves scaling the image by a fixed factor to obtain images at different resolutions. Downsampling reduces the resolution of the original image and combines these images to construct the image pyramid. Since the Gaussian kernel is linear and does not introduce new noise points into the image, this step uses the Gaussian kernel to reduce the image resolution to construct the image pyramid.
[0045] S2: Calculate the image contrast. In this step, the image is divided into blocks, and the contrast is calculated for each block. Block division effectively improves work efficiency, as the calculation and processing speed of a single image block is significantly increased compared to the overall calculation, and the system requirements are relatively lower. Secondly, it increases the accuracy of contrast calculation, avoiding large overall calculation errors and further ensuring the accuracy of subsequent results. Specifically, S2 includes the following steps:
[0046] S21: Calculate the gray-level co-occurrence matrix of the image; in order to reduce the computational cost of image contrast, the image gray levels are reduced to 8 levels in this step before the gray-level co-occurrence matrix is calculated.
[0047] S22: Divide the image into blocks to form several image blocks; here the image can be divided into regions according to a certain pixel size, that is, a pixel threshold, for example, into image blocks of size 256*256; here the pixel threshold can be determined according to the actual situation, and this application does not make a specific limitation.
[0048] S23: Calculate the contrast of each image block. Since calculating the contrast of an image is common in the prior art and is not a core improvement of this application, the calculation of contrast can be done using the prior art. This step will not be described in detail here.
[0049] S3: If the image contrast meets the requirements, proceed directly to the next step; if the image contrast does not meet the requirements, perform image enhancement processing on the image; specifically, after calculating the contrast of each image block in step S23, compare the contrast of each image block with the threshold R. When the contrast of an image block is greater than R, it indicates that the image block has texture, and the image block is preserved; the threshold R here is an empirical value, which is adjusted according to different scenes, and is not specifically limited in this step.
[0050] Specifically, in this step, image enhancement processing is performed using Gamma correction on images that do not meet the requirements (i.e., image patches with texture). Gamma correction includes first obtaining a mask image and then calculating the gamma value based on the mask image. In this step, adaptive processing of the gamma value is used. Because cameras are very sensitive to light, image frames acquired from different angles may suffer from some detail loss (shallow texture) due to poor lighting conditions, resulting in the inability to extract features from these areas. Therefore, before extracting feature points, the algorithm first identifies image patches with texture through contrast, then enhances these image patches to improve the feature details of the image frames, and finally extracts feature points from the image. Sometimes, images may contain both excessively bright and excessively dark areas simultaneously. A single Gamma correction cannot achieve the desired effect. In such cases, it is necessary to dynamically adjust the grayscale value according to the different brightness distributions in the image to adapt to image frames acquired in different scenes. To determine the brightness of the image, and considering the relationship between the brightness of a pixel and its neighboring pixels, this application uses a Gaussian kernel obtained from sampling in a two-dimensional Gaussian distribution to perform a weighted average calculation on each pixel and its neighborhood in the input image, and outputs the result to the mask image. First, S31: Select a Gaussian kernel, the size of which is consistent with the image patch size (the size of the Gaussian kernel is selected based on the image patch size; for example, for a 256*256 image patch, the Gaussian kernel size is also 256*256); S32: Scan each pixel in the image patch using the Gaussian kernel; S33: Replace the value of the center pixel of the Gaussian kernel with the weighted average gray level determined by the Gaussian kernel, and output this value to the mask; S34: Finally, the mask image is obtained. The pixel values in the mask image reflect the brightness of the corresponding pixels in the original image: when the gray level of a pixel in the mask image is much higher than 128, it indicates that the pixel and its surrounding area are brighter; similarly, when the gray level of a pixel in the mask image is much lower than 128, it indicates that the pixel and its surrounding area are darker. After determining the mask image, the gamma value is calculated, and gamma correction is used to adjust the contrast of the image: gamma correction is a non-linear operation on the gray level of the input image, making the output gray level exponentially related to the input gray level. The horizontal axis represents the grayscale value of the image to be enhanced, and the vertical axis represents the grayscale value of the enhanced image. The curve above the solid line represents the input-output relationship when the γ value is less than 1, and the curve below the solid line represents the input-output relationship when the γ value is greater than 1. When the γ value is less than 1, the overall brightness of the image is increased, and the contrast in low-brightness areas is enhanced. When the γ value is greater than 1, the overall brightness of the image decreases, and the contrast in high-brightness areas is improved. Using this relationship, Gamma correction can improve the contrast of low-brightness or high-brightness images, sharpen image details, and thus enhance the gradient between feature points and surrounding points, making image feature points more prominent.
[0051] S4: Extract FAST corner points from the image;
[0052] S5: Use a quadtree to filter FAST corner points, and select the FAST corner points with the greatest influence as feature points based on the threshold. Specifically, in the process of filtering FAST corner points using the quadtree, the image is divided into Na image regions (Na is the minimum number of feature points required in the pre-set). One FAST corner point is selected as a feature point in each image region. When there are multiple FAST corner points in an image region, the FAST corner point with the largest threshold is selected as the feature point, as this FAST corner point has the greatest influence.
[0053] S6: Output feature points.
[0054] This invention first performs grayscale processing on the image and constructs an image pyramid before extracting feature points, ensuring the invariance of feature scale and providing accurate support for subsequent operations. Then, image contrast is calculated; images that do not meet the requirements (i.e., images with texture) are filtered out based on contrast and their details are enhanced to make the image feature points more prominent. Finally, feature points are filtered and output. The entire method is simple to operate, requiring no complex steps, and is efficient while improving the image feature point extraction effect, thereby improving the image registration effect and ensuring the robot's image-based localization and navigation performance. Furthermore, the adaptive image detail enhancement feature point extraction method based on Gamma correction increases the number of feature points extracted by the system, thereby improving the feature point registration effect, enhancing the system's robustness, and ultimately improving the robot's ability to perceive unknown environments and enhance the stability of its localization capabilities.
[0055] Example 2
[0056] A system employing an image feature extraction method as described in Embodiment 1 above includes:
[0057] Acquisition module: Acquires images;
[0058] Image pyramid building module: used to process images in grayscale and build image pyramids;
[0059] Contrast calculation module: Used to calculate the contrast of an image and output the results;
[0060] Image enhancement processing module: Used to perform enhancement processing on images that do not meet contrast requirements;
[0061] Feature point generation module: Extracts FAST corner points from the image and filters them to generate the feature points of the final image;
[0062] Output module: Outputs the final generated feature points.
[0063] The system first establishes an image pyramid to ensure scale invariance of feature points. Second, it divides the image into blocks, calculates the contrast of each block, and selects image blocks with texture based on contrast. Then, it uses a Gaussian kernel to calculate a mask for each image, calculates the gamma value based on the mask, and uses gamma correction to improve image details. Finally, it extracts feature points from the image. Adaptive gamma correction improves image contrast, enhances feature point extraction, and thus improves image registration, ensuring the robot's image-based localization and navigation performance. The entire system is simple to build, with stable and non-interfering operation between modules, exhibiting high robustness.
[0064] Example 3
[0065] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the image feature extraction method described in Embodiment 1. In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods, such as multiple units or components being combined, integrated into another system, or some features being ignored or not executed. Furthermore, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described above as separate components may or may not be physically separated; the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of this embodiment.
[0066] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0067] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. Alternatively, if the integrated unit of the present invention is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0068] The examples described herein are merely preferred embodiments of the invention and are not intended to limit the concept and scope of the invention. Any modifications and improvements made by those skilled in the art to the technical solutions of the invention without departing from the design concept of the invention should fall within the protection scope of the invention.
Claims
1. An image feature extraction method, characterized in that: Includes the following steps: S1: Acquire the image, process the image into grayscale, and then construct an image pyramid; S2: Calculate the contrast of the image; S3: If the image contrast meets the requirements, proceed directly to the next step; if the image contrast does not meet the requirements, perform image enhancement processing on the image; in step S3, Gamma correction is used to perform image enhancement processing on images that do not meet the requirements. Gamma correction includes first obtaining a mask image and then calculating the gamma value based on the mask image. S4: Extract FAST corner points from the image; S5: Filter FAST corner points and select FAST corner points with high influence as feature points based on the threshold. S6: Output feature points; Step S2 specifically includes the following steps: S21: Calculate the gray-level co-occurrence matrix of the image; S22: Divide the image into blocks to form several image blocks; S23: Calculate the contrast of each image patch.
2. The image feature extraction method according to claim 1, characterized in that: In step S21, the image gray level is reduced to 8 levels, and then the gray-level co-occurrence matrix is calculated.
3. The image feature extraction method according to claim 1, characterized in that: The acquisition of the mask image includes the following steps: S31: Select a Gaussian kernel, the value of which is the same as the size of the image patch; S32: Scan each pixel in the image block using a Gaussian kernel; S33: Replace the value of the center pixel of the Gaussian kernel with the weighted average gray level determined by the Gaussian kernel, and output the value to the mask; S34: Finally, the mask image is obtained.
4. The image feature extraction method according to claim 1, characterized in that: In step S5, FAST corner points are filtered using a quadtree method.
5. A system employing the image feature extraction method as described in any one of claims 1-4, characterized in that: include: Acquisition module: Acquires images; Image pyramid building module: used to process images in grayscale and build image pyramids; Contrast calculation module: Used to calculate the contrast of an image and output the results; Image enhancement processing module: Used to perform enhancement processing on images that do not meet contrast requirements; Feature point generation module: Extracts FAST corner points from the image and filters them to generate the feature points of the final image; Output module: Outputs the final generated feature points.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements an image feature extraction method according to any one of claims 1-4.