Image feature extraction methods, devices, electronic equipment and storage media

By using a method based on the absolute difference in gray levels between image pixels and gradient calculation, candidate feature regions of the image are screened out, which improves the speed and accuracy of image feature point extraction and solves the problem of high computational cost of the Shi-Tomasi algorithm.

CN117876228BActive Publication Date: 2025-10-28ZHUHAI MOJIE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311671039.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2025-10-28
Estimated Expiration
2043-12-06

AI Technical Summary

Technical Problem

The existing Shi-Tomasi algorithm is computationally intensive and time-consuming when extracting image feature points, resulting in low extraction efficiency.

Method used

Feature points are initially screened based on the absolute difference in gray levels between pixels in the image to be extracted. The initially screened feature points are then dilated to obtain candidate feature regions. Feature points are extracted based on the pixel gradients of the candidate feature regions, and regions with relatively strong textures are selected for gradient calculation.

Benefits of technology

It reduces the computational cost of image feature point extraction and improves the speed and accuracy of feature point extraction, especially the efficiency of feature point extraction in areas with strong texture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117876228B_ABST
    Figure CN117876228B_ABST
Patent Text Reader

Abstract

This application provides an image feature extraction method, apparatus, electronic device, and computer-readable storage medium. The image feature extraction method includes: acquiring an image to be extracted; extracting feature points based on the absolute difference in gray levels between pixels in the image to be extracted, obtaining preliminary screening feature points of the image to be extracted; performing dilation processing based on the preliminary screening feature points to obtain candidate feature regions of the image to be extracted; and extracting feature points based on the pixel gradients of the candidate feature regions to obtain target feature points of the image to be extracted. This application can reduce the computational load required for extracting image feature points and improve the extraction speed of image feature points.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, specifically to an image feature extraction method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] In the field of image processing, image features provide rich information about an image. Feature point extraction (such as corner points, edge endpoints, and extreme points) is a fundamental part of computer vision, providing data support for specific applications in image matching, object recognition, target tracking, and 3D reconstruction. Feature extraction algorithms for targets include SIFT (Scale-invariant feature transform), SURF (Speeded Up Robust Features), FAST (Features From Accelerated Segment Test), Harris algorithm, and Shi-Tomasi algorithm.

[0003] To improve the accuracy of feature point extraction, the Shi-Tomasi algorithm is often used. However, since the Shi-Tomasi algorithm needs to calculate the gradient of the gray level of the pixels in the entire image extraction area in the horizontal and vertical directions, the algorithm has a large amount of computation and the extraction of image feature points takes a long time. Summary of the Invention

[0004] This application provides an image feature extraction method, apparatus, electronic device, and computer-readable storage medium, which can reduce the amount of computation required to extract image feature points and improve the extraction speed of image feature points.

[0005] In a first aspect, this application provides an image feature extraction method, the method comprising:

[0006] Obtain the image to be extracted;

[0007] Feature points are extracted based on the absolute difference in gray levels between pixels in the image to be extracted, and the initial screening feature points of the image to be extracted are obtained.

[0008] Based on the initial screening feature points, dilation processing is performed to obtain the candidate feature regions of the image to be extracted;

[0009] Feature points are extracted based on the pixel gradients of the candidate feature regions to obtain the target feature points of the image to be extracted.

[0010] In some embodiments, the step of extracting feature points based on the absolute difference in gray levels between pixels in the image to be extracted, to obtain preliminary screening feature points of the image to be extracted, includes:

[0011] The pixels of the image to be extracted are traversed, and the currently traversed pixel is taken as the pixel to be determined.

[0012] The initial surrounding pixels of the pixel to be determined are obtained from each pixel of the image to be extracted, thus obtaining the first set of surrounding pixels of the pixel to be determined;

[0013] From the first set of surrounding pixels, determine each target surrounding pixel of the pixel to be determined, and obtain the second set of surrounding pixels of the pixel to be determined;

[0014] If the absolute difference between the gray value of each of the target's surrounding pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the target's surrounding pixels is taken as the first target pixel.

[0015] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0016] In some embodiments, the step of obtaining preliminary screening feature points of the image to be extracted based on the pixels to be determined if the number of the first target pixels in the second set of surrounding pixels is greater than a first preset number threshold includes:

[0017] If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel.

[0018] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0019] In some embodiments, the step of obtaining preliminary screening feature points of the image to be extracted based on the pixels to be determined, if the number of the first target pixels in the second set of surrounding pixels is greater than a first preset threshold and the number of the second target pixels in the first set of surrounding pixels is greater than a second preset threshold, includes:

[0020] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the pixel to be determined is taken as a candidate pixel.

[0021] If there are other candidate pixels within a preset distance range of the pixel to be determined, then the pixel with the largest pixel response value is selected from the pixel to be determined and the other candidate pixels as the initial screening feature point of the image to be extracted.

[0022] In some embodiments, the dilation process based on the initially screened feature points to obtain candidate feature regions of the image to be extracted includes:

[0023] Get the preset expansion element;

[0024] Determine the target pixel region of the initial screening feature points;

[0025] The region of pixels occupied by the dilated element within the target pixel region is obtained as the candidate feature region.

[0026] In some embodiments, the step of extracting feature points based on the pixel gradient of the candidate feature region to obtain the target feature points of the image to be extracted includes:

[0027] Obtain the gradient map of the candidate feature region, wherein the gradient map includes the gradient of each pixel point within the candidate feature region;

[0028] The candidate feature region is traversed, and the window response value of the currently traversed candidate pixel is obtained according to the gradient map.

[0029] If the window response value is greater than a preset response value threshold, then the currently traversed candidate pixel is taken as the target feature point.

[0030] In some embodiments, obtaining the window response value of the currently traversed candidate pixels based on the gradient map includes:

[0031] Obtain the covariance matrix of the gradient map, wherein the covariance matrix includes a first eigenvalue and a second eigenvalue;

[0032] The minimum value between the first feature value and the second feature value is obtained as the window response value of the candidate pixel point currently being traversed.

[0033] Secondly, this application provides an image feature extraction device, the image feature extraction device comprising:

[0034] The acquisition unit is used to acquire the image to be extracted;

[0035] The first extraction unit is used to extract feature points based on the absolute difference in gray levels between pixels in the image to be extracted, and to obtain the initial screening feature points of the image to be extracted.

[0036] The dilation unit is used to perform dilation processing based on the initial screening feature points to obtain the candidate feature regions of the image to be extracted.

[0037] The second extraction unit is used to extract feature points based on the pixel gradient of the candidate feature region to obtain the target feature points of the image to be extracted.

[0038] In some embodiments, the first extraction unit is specifically used for:

[0039] The pixels of the image to be extracted are traversed, and the currently traversed pixel is taken as the pixel to be determined.

[0040] The initial surrounding pixels of the pixel to be determined are obtained from each pixel of the image to be extracted, thus obtaining the first set of surrounding pixels of the pixel to be determined;

[0041] From the first set of surrounding pixels, determine each target surrounding pixel of the pixel to be determined, and obtain the second set of surrounding pixels of the pixel to be determined;

[0042] If the absolute difference between the gray value of each of the target's surrounding pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the target's surrounding pixels is taken as the first target pixel.

[0043] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0044] In some embodiments, the first extraction unit is specifically used for:

[0045] If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel.

[0046] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0047] In some embodiments, the first extraction unit is specifically used for:

[0048] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the pixel to be determined is taken as a candidate pixel.

[0049] If there are other candidate pixels within a preset distance range of the pixel to be determined, then the pixel with the largest pixel response value is selected from the pixel to be determined and the other candidate pixels as the initial screening feature point of the image to be extracted.

[0050] In some embodiments, the expansion unit is specifically used for:

[0051] Get the preset expansion element;

[0052] Determine the target pixel region of the initial screening feature points;

[0053] The region of pixels occupied by the dilated element within the target pixel region is obtained as the candidate feature region.

[0054] In some embodiments, the second extraction unit is specifically used for:

[0055] Obtain the gradient map of the candidate feature region, wherein the gradient map includes the gradient of each pixel point within the candidate feature region;

[0056] The candidate feature region is traversed, and the window response value of the currently traversed candidate pixel is obtained according to the gradient map.

[0057] If the window response value is greater than a preset response value threshold, then the currently traversed candidate pixel is taken as the target feature point.

[0058] In some embodiments, the second extraction unit is specifically used for:

[0059] Obtain the covariance matrix of the gradient map, wherein the covariance matrix includes a first eigenvalue and a second eigenvalue;

[0060] The minimum value between the first feature value and the second feature value is obtained as the window response value of the candidate pixel point currently being traversed.

[0061] Thirdly, this application also provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer program, and the processor executes any of the image feature extraction methods provided in this application when it calls the computer program in the memory.

[0062] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the image feature extraction method described above.

[0063] In this application, firstly, feature points are extracted based on the absolute difference in gray levels between pixels in the image to be extracted, resulting in preliminary screening of feature points. Then, dilation is performed on these preliminary feature points to obtain candidate feature regions, which can pre-select regions with relatively strong textures throughout the image. Target feature points are then extracted based on the pixel gradients of these candidate feature regions, allowing for the extraction of true target feature points through gradient calculation in regions with relatively strong textures. Thus, when extracting feature points from the entire image, regions with relatively strong textures can be pre-selected for feature point extraction, eliminating the need to calculate the gradient across the entire image and then iterate through each pixel window to calculate its feature response value, saving the gradient calculation workload in regions with weak textures and improving the speed of image feature point extraction. Secondly, since feature point extraction utilizes the pixel gradients of candidate feature regions, which reflect the gray-level changes of pixels, the gray-level changes of pixels can be fully utilized to extract potential feature points, improving the accuracy of feature point extraction. Attached Figure Description

[0064] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0065] Figure 1 This is a schematic block diagram of the structure of an electronic device provided in an embodiment of this application;

[0066] Figure 2 This is a schematic flowchart of an image feature extraction method provided in an embodiment of this application;

[0067] Figure 3 This is an illustrative diagram illustrating the initial surrounding pixels of the pixel to be determined provided in an embodiment of this application;

[0068] Figure 4 This is an illustrative diagram illustrating the initial screening feature point dilation process provided in the embodiments of this application;

[0069] Figure 5 This is a schematic flowchart of an embodiment of step 204 provided in this application;

[0070] Figure 6This is a schematic diagram of an embodiment of the image feature extraction device provided in this application. Detailed Implementation

[0071] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0072] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0073] In the description of the embodiments of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0074] To enable any person skilled in the art to implement and use this application, the following description is provided. In this description, details are set forth for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other instances, well-known processes will not be described in detail to avoid obscuring the description of the embodiments of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in the embodiments of this application.

[0075] This application provides an image feature extraction method, apparatus, electronic device, and computer-readable storage medium. The image feature extraction apparatus can be integrated into an electronic device.

[0076] The execution subject of the image feature extraction method in this application embodiment can be the image feature extraction device provided in this application embodiment, or an electronic device integrating the image feature extraction device. The image feature extraction device can be implemented in hardware or software.

[0077] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0078] Figure 1 This is a schematic block diagram of the structure of an electronic device provided in an embodiment of this application.

[0079] like Figure 1 As shown, the electronic device 100 includes a processor 101 and a memory 102, which are connected by a bus 103, such as an I2C (Inter-integrated Circuit) bus.

[0080] Specifically, processor 101 provides computing and control capabilities to support the operation of the entire electronic device 100. Processor 101 can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, the general-purpose processor can be a microprocessor or any conventional processor.

[0081] Specifically, the memory 102 can be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a portable hard drive, etc.

[0082] Those skilled in the art will understand that Figure 1 The structures shown are merely block diagrams of some structures related to the embodiments of this application and do not constitute a limitation on the electronic devices to which the embodiments of this application are applied. Specific electronic devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.

[0083] The processor 101 is configured to run a computer program stored in the memory 102, and implement any of the image feature extraction methods provided in the embodiments of this application when executing the computer program. For example, the processor 101 is configured to run a computer program stored in the memory 102, and can implement the following steps when executing the computer program:

[0084] The process involves: acquiring an image to be extracted; extracting feature points based on the absolute difference in gray levels between pixels in the image to be extracted to obtain preliminary feature points; performing dilation processing on the preliminary feature points to obtain candidate feature regions of the image to be extracted; and extracting feature points based on the pixel gradients of the candidate feature regions to obtain target feature points of the image to be extracted.

[0085] In some embodiments, the processor 101 is configured to run a computer program stored in the memory 102, and when executing the computer program, it may perform the following steps:

[0086] The process involves iterating through each pixel of the image to be extracted, and designating the currently traversed pixel as the pixel to be determined. Initial surrounding pixels of the pixel to be determined are obtained from each pixel of the image to be extracted, resulting in a first set of surrounding pixels for the pixel to be determined. Target surrounding pixels of the pixel to be determined are determined from the first set of surrounding pixels, resulting in a second set of surrounding pixels for the pixel to be determined. If the absolute difference between the grayscale value of each target surrounding pixel and the grayscale value of the pixel to be determined is greater than a preset difference threshold, then each target surrounding pixel is designated as a first target pixel. If the number of first target pixels in the second set of surrounding pixels is greater than a first preset number threshold, then preliminary feature points of the image to be extracted are obtained based on the pixels to be determined.

[0087] In some embodiments, the processor 101 is configured to run a computer program stored in the memory 102, and when executing the computer program, it may perform the following steps:

[0088] If the absolute difference between the gray value of each initial peripheral pixel and the gray value of the pixel to be determined is greater than a preset difference threshold, then each initial peripheral pixel is taken as a second target pixel; if the number of the first target pixels in the set of the second peripheral pixels is greater than a first preset number threshold, and the number of the second target pixels in the set of the first peripheral pixels is greater than a second preset number threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixel to be determined.

[0089] In some embodiments, the processor 101 is configured to run a computer program stored in the memory 102, and when executing the computer program, it may perform the following steps:

[0090] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the pixel to be determined is taken as a candidate pixel; if there are other candidate pixels within a preset distance range of the pixel to be determined, then the pixel with the largest pixel response value is selected from the pixel to be determined and the other candidate pixels as the initial screening feature point of the image to be extracted.

[0091] In some embodiments, the processor 101 is configured to run a computer program stored in the memory 102, and when executing the computer program, it may perform the following steps:

[0092] Obtain a preset dilation element; determine the target pixel region of the initial screening feature points; obtain the pixel region occupied by the dilation element within the target pixel region, as the candidate feature region.

[0093] The processor 101 is used to run a computer program stored in the memory 102, and when executing the computer program, it can perform the following steps:

[0094] Obtain the gradient map of the candidate feature region, wherein the gradient map includes the gradient of each pixel in the candidate feature region; traverse each pixel in the candidate feature region, and obtain the window response value of the currently traversed candidate pixel according to the gradient map; if the window response value is greater than a preset response value threshold, then the currently traversed candidate pixel is taken as the target feature point.

[0095] In some embodiments, the processor 101 is configured to run a computer program stored in the memory 102, and when executing the computer program, it may perform the following steps:

[0096] Obtain the covariance matrix of the gradient map, wherein the covariance matrix includes a first eigenvalue and a second eigenvalue; obtain the minimum value between the first eigenvalue and the second eigenvalue, and use it as the window response value of the candidate pixel point currently being traversed.

[0097] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the electronic device described above can be referred to the corresponding process in the following image feature extraction method embodiments, and will not be repeated here.

[0098] The following will be based on Figure 1Taking the electronic device shown as the execution subject of the image feature extraction method as an example, the image feature extraction method provided in this application embodiment will be described in detail. For simplicity and ease of description, the execution subject will be omitted in subsequent method embodiments. It should be noted that... Figure 1 The scenarios described are only used to explain the image feature extraction method provided in the embodiments of this application, but do not constitute a limitation on the application scenarios of the image feature extraction method provided in the embodiments of this application.

[0099] Please see Figure 2 , Figure 2 This is a schematic flowchart of an image feature extraction method provided in an embodiment of this application. The image feature extraction method includes steps 201 to 204, wherein:

[0100] 201. Obtain the image to be extracted.

[0101] The image to be extracted refers to the image from which feature points (such as corner points, edge endpoints, extreme points, etc.) need to be extracted.

[0102] In step 201, there are multiple ways to obtain the image to be extracted, including, for example:

[0103] (1) In practical applications, electronic devices can integrate a camera in hardware, and the video frames or images captured in real time by the camera can be used as images to be extracted.

[0104] (2) Electronic devices can also establish a network connection with a camera and, based on this network connection, acquire video frames or images captured in real time by the camera online as images to be extracted. For example, in an object recognition scenario, a camera can be deployed above the object placement area to capture video frames or images of the object placement area in real time. The electronic device establishes a network connection with the camera above the object placement area and, based on this network connection, acquires the video frames or images of the object placement area captured by the camera above the object placement area online as images to be extracted.

[0105] (3) Electronic devices can also read images captured by cameras from storage media containing images captured by cameras (including cameras integrated into electronic devices, stand-alone cameras, or cameras from other devices) as images to be extracted.

[0106] (4) Electronic devices can also read the pre-processed image from the relevant storage medium that stores the pre-processed image (such as the binarized image obtained after binarizing the captured image) and use it as the image to be extracted.

[0107] The method of obtaining the image to be extracted here is only an example and is not limited to this.

[0108] 202. Based on the absolute difference in gray levels between pixels in the image to be extracted, feature points are extracted to obtain the initial screening feature points of the image to be extracted.

[0109] In this embodiment, the absolute difference between the gray values ​​of two pixels refers to the absolute value of the difference between their gray values.

[0110] Among them, the initial screening of feature points refers to the feature points obtained by extracting feature points based on the absolute difference in gray levels between pixels.

[0111] Here, the pixels to be determined refer to each pixel in the image to be extracted. For example, the 1st, 2nd, 3rd... pixels in the image to be extracted can be used as pixels to be determined.

[0112] Here, initial peripheral pixels refer to pixels in the image to be extracted whose distances from the pixel to be determined conform to a preset distance relationship. In some embodiments, initial peripheral pixels can be pixels on a circle with the pixel to be determined as the center and a preset radius; for example, such as... Figure 3 As shown in (a), pixels that are 3 pixels away from the pixel to be determined (i.e., a circle is drawn with the pixel to be determined P as the center and a radius of 3 pixels, resulting in 16 pixels on the circle, as shown in (a)). Figure 3 Pixels 1, 2, 3..., 16 shown in (a) are used as the initial surrounding pixels of the pixel to be determined. In some embodiments, the initial surrounding pixels can be pixels on the sides of a rectangle centered on the pixel to be determined (such as a rectangle centered on the pixel to be determined with its sides at a distance equal to a preset length from the pixel to be determined); for example, ... Figure 3 As shown in (b) in the figure, Figure 3 In (b) of the diagram, each square represents one pixel. Assuming the pixel to be determined is P, we can define each pixel on the side of a rectangle centered on pixel P (e.g., a rectangle centered on pixel P with sides at a distance of 2 pixels from P). Figure 3 Pixels 1, 2, ..., 16 in (b) are used as initial surrounding pixels.

[0113] The first set of surrounding pixels refers to the set of all initial surrounding pixels of the pixel to be determined.

[0114] Here, the second target pixel refers to an initial surrounding pixel whose absolute difference between its corresponding grayscale value and the grayscale value of the pixel to be judged is greater than a preset difference threshold. For example, ... Figure 3As shown in (a), assuming that the gray value of pixel P is 255, the gray value of the initial surrounding pixel 1 is 100, and the preset difference threshold is 100, since the absolute difference in gray value between the initial surrounding pixel 1 and the pixel to be determined P (i.e., 255-100=155) is greater than the preset difference threshold (i.e. 100), the initial surrounding pixel 1 can be used as the second target pixel.

[0115] Here, the target's surrounding pixels refer to the initial surrounding pixels located directly above, below, to the left, or to the right of the pixel to be determined. For example, such as Figure 3 As shown in (a), the initial surrounding pixels directly above, directly below, directly to the left, and directly to the right of the pixel P to be determined are pixel 1, pixel 5, pixel 9, and pixel 13, respectively.

[0116] The second set of surrounding pixels refers to the set of all target surrounding pixels of the pixel to be determined.

[0117] Here, the first target pixel refers to an initial surrounding pixel whose absolute difference between its corresponding grayscale value and the grayscale value of the pixel to be judged is greater than a preset difference threshold. For example, ... Figure 3 As shown in (a), the gray values ​​of pixels 1, 5, 9, and 13 surrounding the target are 100, 90, 80, and 200, respectively. Since the absolute gray value difference between pixel 1 and the pixel to be determined (i.e., 255-100=155), the absolute gray value difference between pixel 5 and the pixel to be determined (i.e., 255-90=165), and the absolute gray value difference between pixel 9 and the pixel to be determined (i.e., 255-80=175) are all greater than the preset difference threshold (i.e., 100), pixels 1, 5, and 9 surrounding the target can be used as the first target pixel.

[0118] To increase the probability that the initially screened feature points are potential target feature points, this embodiment applies the following three judgment conditions to detect the initially screened feature points from the entire image to be extracted:

[0119] Condition ①: The number of first target pixels in the second surrounding pixel set of the pixel to be determined is greater than the first preset number threshold.

[0120] For example, assuming the first preset quantity threshold is 3, refer to Figure 3In (a), among the target surrounding pixels 1, 5, 9, and 13 of the pixel to be determined, 4 pixels are first target pixels, so the number of first target pixels is greater than the first preset number threshold (i.e., 3). Since the number of first target pixels in the second surrounding pixel set of the pixel to be determined is greater than the first preset number threshold, it proves that the pixel grayscale difference in the vertical or horizontal direction of the pixel to be determined is larger, that is, the probability that the pixel to be determined is a feature point (such as a corner point) is greater. Therefore, when condition ① is met, using the pixel to be determined as the initial screening feature point can increase the probability that the initial screening feature point is a potential target feature point, thereby reducing the number of feature regions that need to be used for gradient calculation to a certain extent and improving the feature point extraction speed.

[0121] Condition ②: The number of second target pixels in the first set of surrounding pixels of the pixel to be determined is greater than the second preset threshold.

[0122] For example, assuming the second preset quantity threshold is 9, refer to Figure 3 In (a), if 10 consecutive pixels among the initial surrounding pixels 1, 2, ..., 16 of the pixel to be determined are second target pixels, then the number of first target pixels is greater than the second preset threshold (i.e., 9). Since the number of second target pixels in the first surrounding pixel set of the pixel to be determined is greater than the second preset threshold, it proves that the grayscale difference between the pixel to be determined and the initial surrounding pixels is large, that is, the probability that the pixel to be determined is a feature point (such as a corner point) is greater. Therefore, when condition ② is met, using the pixel to be determined as the initial screening feature point can increase the probability that the initial screening feature point is a potential target feature point, thereby reducing the number of feature regions that need to be used for gradient calculation to a certain extent and improving the feature point extraction speed.

[0123] Here, the values ​​of the second preset quantity threshold and the first preset quantity threshold are only for distance, and are not limited to this. The specific values ​​of the second preset quantity threshold and the first preset quantity threshold can be set according to the actual business scenario requirements.

[0124] Condition ③: If the pixel to be determined is a candidate pixel and there are other candidate pixels within a preset distance range of the pixel to be determined, select the pixel with the largest pixel response value from the pixel to be determined and other candidate pixels as the initial screening feature point.

[0125] There are multiple ways to determine the pixel to be judged as a candidate pixel in condition ③. For example, they include the following: <1> , <2> and <3> Several situations:

[0126] <1> In some embodiments, when the initial screening feature points are conditions ② and ③, the pixel to be determined can be used as a candidate pixel if it meets condition ②; for example, refer to Figure 3 In step (a) of step 2023D, there are 10 consecutive pixels among the initial surrounding pixels 1, 2, ..., 16 of the pixel to be determined P that are the second target pixels. That is, the number of second target pixels is greater than the second preset number threshold (such as 9). Therefore, condition ② is met, and the pixel to be determined P can be used as a candidate pixel.

[0127] <2> In some embodiments, when the initial screening feature points are conditions ① and ③, the pixel to be determined can be used as a candidate pixel if it meets condition ①. For example, refer to Figure 3 In (a), it is assumed that among the target surrounding pixels 1, 5, 9, and 13 of the pixel to be determined, there are 4 pixels that are the first target pixels, that is, the number of first target pixels is greater than the first preset number threshold (such as 3), which satisfies condition ①, and the pixel to be determined P can be used as a candidate pixel.

[0128] <3> In some embodiments, when the initial screening feature points are conditions ①, ②, and ③, the pixel to be determined can be used as a candidate pixel if it meets conditions ① and ②; for example, refer to Figure 3 In step (a) of the above, in step 2026E, on the one hand, among the target surrounding pixels 1, 5, 9, and 13 of the pixel to be determined, there are 4 pixels that are first target pixels, that is, the number of first target pixels is greater than the first preset number threshold (e.g., 3), which satisfies condition ①; on the other hand, among the initial surrounding pixels 1, 2, ..., 16 of the pixel to be determined, there are 10 consecutive pixels that are second target pixels, then the number of first target pixels is greater than the second preset number threshold (i.e., 9), which satisfies condition ②; therefore, the pixel to be determined can be used as a candidate pixel.

[0129] Since there are other candidate pixels within the preset distance range of the pixel to be judged, it proves that multiple interest points have been detected in the adjacent and close positions. By selecting the pixel with the largest pixel response value as the initial screening feature point, non-maximum suppression is achieved for multiple adjacent interest points, thereby increasing the probability that the detected initial screening feature point is a feature point (such as a corner point). Therefore, using condition ③ to detect the initial screening feature point can increase the probability that the initial screening feature point is a potential target feature point, thereby reducing the number of feature regions that need to be calculated for gradient to a certain extent and improving the feature point extraction speed.

[0130] Depending on the conditions used to extract the initial feature points, there are various ways to determine the initial feature points in step 202. Examples include:

[0131] (1) If the pixel to be determined meets condition ①, the pixel to be determined is used as the initial screening feature point. At this time, step 202 may specifically include the following steps 2021A to 2025A:

[0132] 2021A. Traverse each pixel of the image to be extracted, and take the currently traversed pixel as the pixel to be determined.

[0133] 2022A. Obtain the initial surrounding pixels of the pixel to be determined from each pixel of the image to be extracted, and obtain the first surrounding pixel set of the pixel to be determined.

[0134] 2023A. Determine each target surrounding pixel of the pixel to be determined from the first surrounding pixel set to obtain the second surrounding pixel set of the pixel to be determined.

[0135] The target surrounding pixels are the initial surrounding pixels located directly above, directly below, directly to the left, or directly to the right of the pixel to be determined.

[0136] 2024A. If the absolute difference between the gray value of each of the target surrounding pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the target surrounding pixels is taken as the first target pixel.

[0137] 2025A. If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset number threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0138] (2) If the pixel to be determined meets condition ②, the pixel to be determined is used as the initial screening feature point. At this time, step 202 may specifically include the following steps 2021B to 2024B:

[0139] 2021B. Traverse each pixel of the image to be extracted, and take the currently traversed pixel as the pixel to be determined.

[0140] 2022B. Obtain the initial surrounding pixels of the pixel to be determined from each pixel of the image to be extracted, and obtain the first surrounding pixel set of the pixel to be determined.

[0141] 2023B. If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel.

[0142] 2024B. If the number of second target pixels in the first set of surrounding pixels is greater than the second preset number threshold, then the pixel to be determined is used as the initial screening feature point of the image to be extracted.

[0143] (3) If the pixel to be determined meets conditions ① and ②, the pixel to be determined is used as the initial screening feature point. At this time, step 202 may specifically include the following steps 2021C to 2026C:

[0144] 2021C. Traverse each pixel of the image to be extracted, and take the currently traversed pixel as the pixel to be determined.

[0145] 2022C. Obtain the initial surrounding pixels of the pixel to be determined from each pixel of the image to be extracted, and obtain the first surrounding pixel set of the pixel to be determined.

[0146] 2023C. Determine each target surrounding pixel of the pixel to be determined from the first surrounding pixel set to obtain the second surrounding pixel set of the pixel to be determined.

[0147] The target surrounding pixels are the initial surrounding pixels located directly above, directly below, directly to the left, or directly to the right of the pixel to be determined.

[0148] 2024C. If the absolute difference between the grayscale value of each of the target's surrounding pixels and the grayscale value of the pixel to be determined is greater than a preset difference threshold, then each of the target's surrounding pixels is taken as the first target pixel.

[0149] 2025C. If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel.

[0150] 2026C. If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset number threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset number threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0151] (4) If the pixel to be determined meets conditions ② and ③, the pixel to be determined is used as the initial screening feature point. At this time, step 202 may specifically include the following steps 2021D to 2025D:

[0152] 2021D. Traverse each pixel of the image to be extracted, and take the currently traversed pixel as the pixel to be determined.

[0153] 2022D. Obtain the initial surrounding pixels of the pixel to be determined from each pixel of the image to be extracted, and obtain the first surrounding pixel set of the pixel to be determined.

[0154] 2023D. If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel.

[0155] 2024D. If the number of second target pixels in the first set of surrounding pixels is greater than the second preset number threshold, then the pixel to be determined is taken as a candidate pixel.

[0156] 2025D. If there are other candidate pixels within the preset distance range of the pixel to be determined, then the pixel with the largest pixel response value is selected from the pixel to be determined and the other candidate pixels as the initial screening feature point of the image to be extracted.

[0157] (5) If the pixel to be determined meets conditions ①, ②, and ③, the pixel to be determined is used as the initial screening feature point. At this point, step 202 may specifically include the following steps 2021E to 2027E:

[0158] 2021E: Traverse each pixel of the image to be extracted, and take the currently traversed pixel as the pixel to be determined.

[0159] 2022E. Obtain the initial surrounding pixels of the pixel to be determined from each pixel of the image to be extracted, and obtain the first surrounding pixel set of the pixel to be determined.

[0160] 2023E. Determine each target surrounding pixel of the pixel to be determined from the first surrounding pixel set to obtain the second surrounding pixel set of the pixel to be determined.

[0161] The target surrounding pixels are the initial surrounding pixels located directly above, directly below, directly to the left, or directly to the right of the pixel to be determined.

[0162] 2024E. If the absolute difference between the gray value of each of the target surrounding pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the target surrounding pixels is taken as the first target pixel.

[0163] 2025E. If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel.

[0164] 2026E. If the number of the first target pixels in the second set of surrounding pixels is greater than a first preset number threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than a second preset number threshold, then the pixel to be determined is taken as a candidate pixel.

[0165] 2027E. If there are other candidate pixels within the preset distance range of the pixel to be determined, then the pixel with the largest pixel response value is selected from the pixel to be determined and the other candidate pixels as the initial screening feature point of the image to be extracted.

[0166] Similarly, for each pixel in the image to be extracted, steps 2021D to 2024D or steps 2021E to 2026E above can be used to determine whether the pixel is a candidate pixel; thus determining whether there are other candidate pixels within the preset distance range.

[0167] For example, the pixel response value of the pixel to be determined can be calculated as follows: calculate the absolute difference between the grayscale value of the pixel to be determined and the grayscale values ​​of the initial surrounding pixels, and use the sum of the absolute differences between the grayscale value of the pixel to be determined and the grayscale values ​​of each of the initial surrounding pixels as the pixel response value of the pixel to be determined. For example, as... Figure 3 As shown in (a), the absolute differences between the grayscale value of the pixel to be determined P and the grayscale values ​​of pixels 1, 2, ..., 16 are X1, X2, ..., X16, respectively. Therefore, the pixel response value of the pixel to be determined is X1 + X2 + ... + X16. Similarly, the pixel response values ​​of other candidate pixels can be calculated.

[0168] 203. Based on the initial screening feature points, perform dilation processing to obtain the candidate feature regions of the image to be extracted.

[0169] For example, step 203 performs dilation processing on each initially screened feature point to obtain a candidate feature region, and step 204 extracts feature points from the candidate feature region corresponding to each initially screened feature point to obtain target feature points. Specifically, step 203 may include: obtaining a preset dilation element; determining the target pixel region of the initially screened feature point; and obtaining the pixel region occupied by the dilation element when its origin is located within each pixel of the target pixel region, as the candidate feature region.

[0170] For example, in some embodiments, structuring elements can be used to dilate the initially screened feature points. In this case, step 203 may specifically include: obtaining a preset structuring element; determining the target pixel region for each initially screened feature point; and using the pixel region occupied by the structuring element when it is located within the target pixel region of each initially screened feature point as the candidate feature region corresponding to each initially screened feature point, thereby obtaining one or more candidate feature regions of the image to be extracted. Here, the structuring element is a set of pixels with a known shape and size; for example, the structuring element can be a 3*5 pixel set.

[0171] For example, in some embodiments, a convolution kernel can be used to dilate the initially screened feature points. In this case, step 203 may specifically include: obtaining a preset convolution kernel; determining the target pixel region for each initially screened feature point; and using the pixel region occupied by the convolution kernel when its origin is located within the target pixel region of each initially screened feature point as the candidate feature region corresponding to each initially screened feature point, thereby obtaining one or more candidate feature regions of the image to be extracted. For example, as... Figure 4 As shown, for the initial screening feature point P, firstly, a 5*5 pixel region centered on the initial screening feature point P can be used as the target pixel region for the initial screening feature point P (e.g., ...). Figure 4 The region is shown as a 5x5 pixel area containing pixels 44, ..., 48, 57, ..., 61, 70, 71, P, 72, 73, 82, ..., 86, 95, ..., 99. Then, a 5x5 square (or a circle with a radius of 5, etc.) can be used to place the center point of a convolution kernel on each pixel within the target pixel area of ​​the initial feature point P (e.g., ...). Figure 4 As shown in (a) (taking the center point of the convolution kernel placed at pixel 95 as an example), Figure 4 As shown in (a), the pixel region covered by the 5*5 convolution kernel is the 5*5 pixel region of pixels 68, ..., 71, P, 80, ..., 84, 93, ..., 97, 106, ..., 110, 119, ..., 123; and so on. The center point of the 5*5 convolution kernel is placed on each pixel within the target pixel region of the initial screening feature point P, resulting in a 9*9 pixel region covered by the convolution kernel. This 9*9 pixel region is the candidate feature region of the initial screening feature point P, as shown in (a). Figure 4 As shown in (b) of the diagram.

[0172] 204. Based on the pixel gradient of the candidate feature region, feature points are extracted to obtain the target feature points of the image to be extracted.

[0173] Among them, the target feature point refers to the pixel point that is ultimately determined to be a real feature point in the image to be extracted.

[0174] Specifically, the candidate feature region can be regarded as a target image from which feature points need to be extracted. Based on the pixel gradient of each candidate feature region, the Harris corner detection algorithm or the Shi-Tomasi corner detection algorithm can be used to extract feature points from each candidate feature region to obtain the target feature points of each candidate feature region. In this way, the target feature points of all candidate feature regions are obtained, thus obtaining all the target feature points in the image to be extracted.

[0175] There are several ways to implement step 204, including, for example:

[0176] (1) Directly calculate the change in grayscale value of each pixel (x,y) in the candidate feature region, and determine whether each pixel (x,y) is a true feature point based on the change in grayscale value of each pixel (x,y). In step 204, for each pixel (x,y) in the candidate feature region, there is a corresponding window w(x,y) centered on that pixel (x,y), and the grayscale value of that pixel is I(x,y); the pixel is shifted (u,v) to obtain a new pixel (x+u,y+v), and the grayscale value of the new pixel is I(x+u,y+v). Therefore, the change in pixel grayscale value caused by the shift (u,v) of window w(x,y) is: The grayscale change of each pixel (x, y) in the candidate feature region can be calculated. Then, based on the grayscale change of each pixel (x, y) in the candidate feature region, it is determined whether the pixel is a true feature point, thus obtaining the target feature point of the image to be extracted. For example, when the grayscale change of pixel (x, y) indicates that the change is small in both the horizontal and vertical directions, pixel (x, y) is considered not a true feature point; when the grayscale change of pixel (x, y) indicates that the change is large in the horizontal direction or large in the vertical direction, pixel (x, y) is considered as the target feature point of the image to be extracted.

[0177] (2) To reduce the amount of data required to directly calculate the change in grayscale value, the grayscale change function E(u,v) is transformed and replaced with the covariance matrix M of the gradient map. The window response value of the pixel is calculated to determine whether the pixel is a true feature point. This avoids the problem of directly calculating the change in pixel grayscale value E(u,v), reducing the amount of data processing for feature points and improving the efficiency of feature point extraction. At this time, such as Figure 5 As shown, step 204 may specifically include the following steps 2041 to 2043:

[0178] 2041. Obtain the gradient map of the candidate feature region.

[0179] The gradient map includes the gradient of each pixel within the candidate feature region. Specifically, it can include the gradient value and gradient direction of each pixel (x, y) within the candidate feature region. For example, the gradient value at pixel (x, y) is:

[0180] For example, gradient maps of candidate feature regions can be computed using operators such as Sobel, Robinson, or Laplace.

[0181] 2042. Traverse each pixel in the candidate feature region and obtain the window response value of the currently traversed candidate pixel according to the gradient map.

[0182] Candidate pixels refer to pixels in the candidate feature region.

[0183] In some embodiments, the covariance matrix M of the gradient map can be calculated with reference to the Harris corner detection algorithm. Then, for the window corresponding to the candidate pixel currently being traversed, the result obtained by subtracting the determinant of the covariance matrix M from the trace of the covariance matrix M is used as the window response value of the candidate pixel currently being traversed.

[0184] In some embodiments, the covariance matrix M of the gradient map can be calculated with reference to the Shi-Tomasi corner detection algorithm. Then, for the window corresponding to the candidate pixel currently being traversed, the minimum value among the eigenvalues ​​of the covariance matrix M is used as the window response value of the candidate pixel currently being traversed. In this case, step 2042 may specifically include: obtaining the covariance matrix of the gradient map, wherein the covariance matrix includes a first eigenvalue and a second eigenvalue; obtaining the minimum value among the first eigenvalue and the second eigenvalue to use as the window response value of the candidate pixel currently being traversed. The first eigenvalue and the second eigenvalue are the change components of the pixel grayscale in two orthogonal directions (i.e., the horizontal direction and the vertical direction), respectively. For example, firstly, based on the gradient map of the candidate feature region (the gradient map includes the gradient Ix of the candidate pixel (x,y) in the horizontal direction and the gradient Iy in the vertical direction), the covariance matrix of the gradient is calculated to obtain a 2×2 matrix, which is used as the covariance matrix of the gradient map. Then, the covariance matrix Diagonalization is performed to convert it to: Where R is the rotation factor, which does not affect the variation components in the two orthogonal directions; λ1 and λ2 are the variation components in the two orthogonal directions; at this time, the variation components λ1 and λ2 in the two orthogonal directions can be used as the eigenvalues ​​of the covariance matrix M, thus obtaining the eigenvalues ​​of the covariance matrix M as λ1 and λ2 respectively; finally, the minimum value is obtained from the eigenvalues ​​λ1 and λ2 of the covariance matrix M, and used as the window response value of the candidate pixel point currently being traversed, thus obtaining the window response value R = min(λ1, λ2) of the candidate pixel point currently being traversed.

[0185] 2043. If the window response value is greater than the preset response value threshold, then the currently traversed candidate pixel point is taken as the target feature point.

[0186] For example, for a pixel (x, y) in a candidate feature region, if the window response value (e.g., R1) of pixel (x, y) is greater than a preset response value threshold (e.g., H), then pixel (x, y) in the candidate feature region is considered a target feature point. If the window response value (e.g., R1) of pixel (x, y) is less than or equal to the preset response value threshold (e.g., H), then pixel (x, y) in the candidate feature region is considered not a true feature point. The process continues to determine whether the next pixel in the candidate feature region is a target feature point, and so on, until all pixels in the candidate feature region have been determined, thus obtaining all target feature points contained in the candidate feature region. This process is repeated to determine all target feature points contained in each candidate feature region, thereby obtaining all target feature points in the image to be extracted.

[0187] As can be seen from the above, firstly, by first extracting feature points based on the absolute difference in gray levels between pixels in the image to be extracted, preliminary feature points are obtained. Then, dilation processing is performed based on the preliminary feature points to obtain candidate feature regions, which can pre-select areas with relatively strong texture in the entire image. By extracting feature points based on the pixel gradient of the candidate feature regions, the target feature points of the image to be extracted are obtained. The gradient calculation can be performed for areas with relatively strong texture to extract the true target feature points. Thus, when extracting feature points of the entire image, areas with relatively strong texture in the entire image can be pre-selected for feature point extraction, without having to calculate the gradient of the entire image and then traverse each pixel window to calculate its feature response value, saving the gradient calculation workload in areas with weak texture, thereby improving the speed of image feature point extraction. Secondly, since feature point extraction is performed using the pixel gradient of the candidate feature regions, the gray level changes of pixels can be fully utilized to extract potential feature points, improving the accuracy of feature point extraction.

[0188] Furthermore, to better implement the image feature extraction method in the embodiments of this application, an image feature extraction device is also provided in the embodiments of this application, such as... Figure 6 The diagram shown is a schematic representation of an embodiment of the image feature extraction device provided in this application. The image feature extraction device 600 includes:

[0189] Acquisition unit 601 is used to acquire the image to be extracted;

[0190] The first extraction unit 602 is used to extract feature points based on the absolute difference in gray levels between pixels in the image to be extracted, and to obtain the initial screening feature points of the image to be extracted.

[0191] The dilation unit 603 is used to perform dilation processing based on the initial screening feature points to obtain the candidate feature regions of the image to be extracted.

[0192] The second extraction unit 604 is used to extract feature points based on the pixel gradient of the candidate feature region to obtain the target feature points of the image to be extracted.

[0193] In some embodiments, the first extraction unit 602 is specifically used for:

[0194] The pixels of the image to be extracted are traversed, and the currently traversed pixel is taken as the pixel to be determined.

[0195] The initial surrounding pixels of the pixel to be determined are obtained from each pixel of the image to be extracted, thus obtaining the first set of surrounding pixels of the pixel to be determined;

[0196] From the first set of surrounding pixels, determine each target surrounding pixel of the pixel to be determined, and obtain the second set of surrounding pixels of the pixel to be determined;

[0197] If the absolute difference between the gray value of each of the target's surrounding pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the target's surrounding pixels is taken as the first target pixel.

[0198] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0199] In some embodiments, the first extraction unit 602 is specifically used for:

[0200] If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel.

[0201] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

[0202] In some embodiments, the first extraction unit 602 is specifically used for:

[0203] If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the pixel to be determined is taken as a candidate pixel.

[0204] If there are other candidate pixels within a preset distance range of the pixel to be determined, then the pixel with the largest pixel response value is selected from the pixel to be determined and the other candidate pixels as the initial screening feature point of the image to be extracted.

[0205] In some embodiments, the expansion unit 603 is specifically used for:

[0206] Get the preset expansion element;

[0207] Determine the target pixel region of the initial screening feature points;

[0208] The region of pixels occupied by the dilated element within the target pixel region is obtained as the candidate feature region.

[0209] In some embodiments, the second extraction unit 604 is specifically used for:

[0210] Obtain the gradient map of the candidate feature region, wherein the gradient map includes the gradient of each pixel point within the candidate feature region;

[0211] The candidate feature region is traversed, and the window response value of the currently traversed candidate pixel is obtained according to the gradient map.

[0212] If the window response value is greater than a preset response value threshold, then the currently traversed candidate pixel is taken as the target feature point.

[0213] In some embodiments, the second extraction unit 604 is specifically used for:

[0214] Obtain the covariance matrix of the gradient map, wherein the covariance matrix includes a first eigenvalue and a second eigenvalue;

[0215] The minimum value between the first feature value and the second feature value is obtained as the window response value of the candidate pixel point currently being traversed.

[0216] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous image feature extraction method embodiment, which will not be repeated here.

[0217] Those skilled in the art will understand that all or part of the steps in the above image feature extraction method can be accomplished by instructions, or by controlling related hardware through instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0218] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute any of the image feature extraction methods provided in embodiments of this application.

[0219] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0220] In the above embodiments of the image feature extraction device, computer-readable storage medium, and electronic device, the descriptions of each embodiment have different focuses. Parts not described in detail in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and beneficial effects of the image feature extraction device, computer-readable storage medium, electronic device, and their corresponding units described above can be referred to the description of the image feature extraction method in the above embodiments, and will not be repeated here.

[0221] The foregoing has provided a detailed description of an image feature extraction method, apparatus, electronic device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An image feature extraction method, characterized in that, The method includes: Obtain the image to be extracted; Feature points are extracted based on the absolute difference in gray levels between pixels in the image to be extracted, and the initial screening feature points of the image to be extracted are obtained. Based on the initial screening feature points, dilation processing is performed to obtain the candidate feature regions of the image to be extracted; Feature points are extracted based on the pixel gradient of the candidate feature region to obtain the target feature points of the image to be extracted. The step of extracting feature points based on the pixel gradient of the candidate feature region to obtain the target feature points of the image to be extracted includes: Obtain the gradient map of the candidate feature region, wherein the gradient map includes the gradient of each pixel point within the candidate feature region; The candidate feature region is traversed, and the window response value of the currently traversed candidate pixel is obtained according to the gradient map. If the window response value is greater than the preset response value threshold, then the currently traversed candidate pixel is taken as the target feature point; The step of obtaining the window response value of the currently traversed candidate pixels based on the gradient map includes: Obtain the covariance matrix of the gradient map, wherein the covariance matrix includes a first eigenvalue and a second eigenvalue; The minimum value between the first feature value and the second feature value is obtained as the window response value of the candidate pixel point currently being traversed, wherein the first feature value and the second feature value are determined based on the result of diagonalization transformation of the covariance matrix.

2. The image feature extraction method according to claim 1, characterized in that, The step of extracting feature points based on the absolute difference in gray levels between pixels in the image to be extracted, to obtain the initial screening feature points of the image to be extracted, includes: The pixels of the image to be extracted are traversed, and the currently traversed pixel is taken as the pixel to be determined. The initial surrounding pixels of the pixel to be determined are obtained from each pixel of the image to be extracted, thus obtaining the first set of surrounding pixels of the pixel to be determined; From the first set of surrounding pixels, determine each target surrounding pixel of the pixel to be determined, and obtain the second set of surrounding pixels of the pixel to be determined; If the absolute difference between the gray value of each of the target's surrounding pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the target's surrounding pixels is taken as the first target pixel. If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

3. The image feature extraction method according to claim 2, characterized in that, If the number of the first target pixels in the second set of surrounding pixels is greater than a first preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined, including: If the absolute difference between the gray value of each of the initial peripheral pixels and the gray value of the pixel to be determined is greater than a preset difference threshold, then each of the initial peripheral pixels is taken as the second target pixel. If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the initial screening feature points of the image to be extracted are obtained based on the pixels to be determined.

4. The image feature extraction method according to claim 3, characterized in that, If the number of the first target pixels in the second set of surrounding pixels is greater than a first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than a second preset threshold, then obtaining the initial screening feature points of the image to be extracted based on the pixels to be determined includes: If the number of the first target pixels in the second set of surrounding pixels is greater than the first preset threshold, and the number of the second target pixels in the first set of surrounding pixels is greater than the second preset threshold, then the pixel to be determined is taken as a candidate pixel. If there are other candidate pixels within a preset distance range of the pixel to be determined, then the pixel with the largest pixel response value is selected from the pixel to be determined and the other candidate pixels as the initial screening feature point of the image to be extracted.

5. The image feature extraction method according to claim 1, characterized in that, The process of dilation based on the initially screened feature points to obtain candidate feature regions of the image to be extracted includes: Get the preset expansion element; Determine the target pixel region of the initial screening feature points; The region of pixels occupied by the dilated element within the target pixel region is obtained as the candidate feature region.

6. An image feature extraction device, characterized in that, The image feature extraction device includes: The acquisition unit is used to acquire the image to be extracted; The first extraction unit is used to extract feature points based on the absolute difference in gray levels between pixels in the image to be extracted, and to obtain the initial screening feature points of the image to be extracted. The dilation unit is used to perform dilation processing based on the initial screening feature points to obtain the candidate feature regions of the image to be extracted. The second extraction unit is used to extract feature points based on the pixel gradient of the candidate feature region to obtain the target feature points of the image to be extracted. The second extraction unit is used to: obtain a gradient map of the candidate feature region, wherein the gradient map includes the gradient of each pixel in the candidate feature region; traverse each pixel in the candidate feature region, and obtain the window response value of the currently traversed candidate pixel according to the gradient map; if the window response value is greater than a preset response value threshold, then the currently traversed candidate pixel is taken as the target feature point. The second extraction unit is used to: obtain the covariance matrix of the gradient map, wherein the covariance matrix includes a first eigenvalue and a second eigenvalue; obtain the minimum value of the first eigenvalue and the second eigenvalue as the window response value of the candidate pixel point currently being traversed, wherein the first eigenvalue and the second eigenvalue are determined based on the result of diagonalization transformation of the covariance matrix.

7. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and the processor executes the image feature extraction method as described in any one of claims 1 to 5 when it invokes the computer program in the memory.

8. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the image feature extraction method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device of extracting features from image

    CN106056046A

  • Image feature candidate point extraction method and device, equipment and storage medium

    CN114972133A