Image feature extraction method, device, equipment and storage medium

The difference matrix and eigenvector are generated by spatial differential transformation of the image, which solves the problems of insufficient local information and large computational complexity of the ORB algorithm and achieves more efficient feature extraction.

CN114519795BActive Publication Date: 2025-10-14BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011299726.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-18
Publication Date
2025-10-14
Estimated Expiration
2040-11-18

AI Technical Summary

Technical Problem

The existing ORB feature extraction algorithm has the problems of insufficient local information and large amount of calculation, which leads to excessive consumption of computing resources.

Method used

By obtaining the difference between the pixels of the image and the surrounding pixels, a difference matrix is ​​generated, and vectorization and binarization are performed to extract the eigenvector of the image.

Benefits of technology

It improves the comprehensiveness of feature extraction information, reduces computational complexity, reduces computational workload, saves computational resources, and improves feature extraction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114519795B_ABST
    Figure CN114519795B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of image processing, and discloses an image feature extraction method, device, equipment and storage medium. The method comprises: acquiring an image to be extracted; determining a pixel value difference result of each pixel and at least one surrounding pixel based on the image to generate a difference matrix; performing vectorization processing on the difference matrix to generate a difference vector; and performing binaryzation processing on the difference vector to generate a feature vector corresponding to the image. Through the above technical solution, the feature of the image is extracted by using image spatial domain difference transformation, the calculation complexity and amount of feature extraction are reduced, and the information comprehensiveness and efficiency of feature extraction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to a method, apparatus, device and storage medium for extracting image features. Background Art

[0002] Currently, image-based object detection and recognition technologies are widely used across various industries, such as image-based search in internet search and e-commerce, copyright protection for image works, sensitive image filtering on social platforms, license plate recognition in transportation systems, and lesion identification in the medical field. Image feature extraction is an essential step in these image-based business processes.

[0003] The current mainstream image feature extraction method is the ORB (Oriented FAST and Rotated BRIEF) feature extraction algorithm. The basic idea of ​​this algorithm is to find key points in the image and create feature vectors to identify objects in the image. Its main process is: using image pyramid technology to construct images of multiple scales of an image; on each scale image, using the FAST (Features from Accelerated Segments Test) algorithm to locate key points (feature points) in the corresponding scale image; then using the rBRIEF (Rotation-Aware Binary Robust Independent Elementary Features) algorithm to create a 256-bit feature vector for each key point. The feature vectors of these key points are the features extracted from the image.

[0004] The main problems with the ORB algorithm are: (1) the feature vectors of the extracted key points only contain local information of the image, but not the overall information; (2) the feature extraction process is computationally intensive, and the large number of key point features leads to a large computational load in the subsequent feature matching process, which requires more computing resources. Summary of the Invention

[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, apparatus, device and storage medium for extracting image features.

[0006] In a first aspect, the present disclosure provides a method for extracting image features, comprising:

[0007] Obtain an image to be feature extracted;

[0008] Based on the image, determining a difference result of a pixel value between each pixel and at least one surrounding pixel, and generating a difference matrix;

[0009] Performing vectorization processing on the difference matrix to generate a difference vector;

[0010] Binarization is performed on the differential vector to generate a feature vector corresponding to the image.

[0011] In some embodiments, determining a pixel value difference result between each pixel and at least one surrounding pixel based on the image to generate a difference matrix includes:

[0012] Based on a preset image size, scaling the image;

[0013] Based on the image after scaling processing, a pixel value difference result between each pixel and at least one surrounding pixel is determined to generate the difference matrix.

[0014] In some embodiments, determining a pixel value difference result between each pixel and at least one surrounding pixel based on the image after scaling processing, and generating a difference matrix includes:

[0015] Based on a preset grayscale level, performing grayscale processing on the image after the scaling processing;

[0016] Based on the grayscale processed image, a pixel value difference result between each pixel and at least one surrounding pixel is determined to generate the difference matrix.

[0017] In some embodiments, determining a pixel value difference result between each pixel and at least one surrounding pixel based on the image to generate a difference matrix includes:

[0018] Based on the image, adjacent diagonal pixels in a diagonal direction of each pixel are determined, and pixel difference values ​​between each pixel and the corresponding diagonal pixel are determined to generate the difference matrix.

[0019] In some embodiments, determining a pixel value difference result between each pixel and at least one surrounding pixel based on the image to generate a difference matrix includes:

[0020] Based on the image, determining at least two diagonal pixels located in a diagonal direction of each of the pixels;

[0021] respectively determining pixel differences between each pixel and corresponding diagonal pixels, and generating a plurality of intermediate matrices, wherein the number of the intermediate matrices is the same as the number of the diagonal pixels;

[0022] The multiple intermediate matrices are fused to generate the difference matrix.

[0023] In some embodiments, binarizing the difference vector to generate a feature vector corresponding to the image includes:

[0024] Determining a binarization threshold based on a statistical result of the difference vector;

[0025] The differential vector is binarized based on the binarization threshold to generate a feature vector corresponding to the image.

[0026] In some embodiments, the statistical result includes an average value, a median value, or a mathematical expectation value of each vector element in the differential vector.

[0027] In a second aspect, the present disclosure provides an image feature extraction device, the device comprising:

[0028] An image acquisition module, used to acquire an image to be feature extracted;

[0029] a difference matrix generation module, configured to determine, based on the image, a difference result of a pixel value between each pixel and at least one surrounding pixel, and generate a difference matrix;

[0030] A differential vector generation module, configured to perform vectorization processing on the differential matrix to generate a differential vector;

[0031] The feature vector generating module is used to perform binarization processing on the differential vector to generate a feature vector corresponding to the image.

[0032] In some embodiments, the difference matrix generation module is specifically configured to:

[0033] Based on a preset image size, scaling the image;

[0034] Based on the image after scaling, a difference result of pixel values ​​between each pixel and at least one surrounding pixel is determined to generate the difference matrix.

[0035] In some embodiments, the difference matrix generation module is specifically configured to:

[0036] After scaling the image based on the preset image size, grayscale processing is performed on the scaled image based on a preset grayscale level;

[0037] Based on the grayscale processed image, a pixel value difference result between each pixel and at least one surrounding pixel is determined to generate the difference matrix.

[0038] In some embodiments, the difference matrix generation module is further specifically configured to:

[0039] Based on the image, adjacent diagonal pixels in a diagonal direction of each pixel are determined, and pixel difference values ​​between each pixel and the corresponding diagonal pixel are determined to generate the difference matrix.

[0040] In some embodiments, the difference matrix generation module is further specifically configured to:

[0041] Based on the image, determining at least two diagonal pixels located in a diagonal direction of each of the pixels;

[0042] respectively determining pixel differences between each pixel and corresponding diagonal pixels, and generating a plurality of intermediate matrices, wherein the number of the intermediate matrices is the same as the number of the diagonal pixels;

[0043] The multiple intermediate matrices are fused to generate the difference matrix.

[0044] In some embodiments, the feature vector generation module is specifically configured to:

[0045] Determining a binarization threshold based on a statistical result of the difference vector;

[0046] The differential vector is binarized based on the binarization threshold to generate a feature vector corresponding to the image.

[0047] In some embodiments, the statistical result includes an average value, a median value, or a mathematical expectation value of each vector element in the differential vector.

[0048] In a third aspect, the present disclosure provides an electronic device, comprising:

[0049] one or more processors;

[0050] a storage device for storing one or more programs,

[0051] When the one or more programs are executed by the one or more processors, the one or more processors implement any embodiment of the above-mentioned image feature extraction method.

[0052] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any embodiment of the above-mentioned method for extracting image features.

[0053] The technical solution provided by the disclosed embodiment obtains an image from which features are to be extracted; based on the image, determines the difference between the pixel values ​​of each pixel and at least one surrounding pixel to generate a difference matrix; vectorizes the difference matrix to generate a difference vector; and binarizes the difference vector to generate a feature vector corresponding to the image. This method utilizes spatial domain differential transformation of the image to extract image features, so that the extracted features contain both global and local information of the image, improving the comprehensiveness of the extracted features. Furthermore, differential processing greatly reduces the computational complexity of feature extraction, reducing the amount of extraction calculations. The resulting feature vector can also reduce the amount of calculations in the subsequent feature matching process, saving computing resources and improving feature extraction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0055] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0056] Figure 1 is a flow chart of a method for extracting image features provided by an embodiment of the present disclosure;

[0057] Figure 2 Schematic diagram of a process for generating a difference matrix and eigenvectors provided by an embodiment of the present disclosure;

[0058] Figure 3 is a flowchart of another method for extracting image features provided by an embodiment of the present disclosure;

[0059] Figure 4 1 is a schematic structural diagram of an image feature extraction device provided by an embodiment of the present disclosure;

[0060] Figure 5 It is a structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0061] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described in detail below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.

[0062] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0063] The image feature extraction method provided by the embodiments of the present disclosure is mainly applicable to the extraction of image features in image-based businesses, such as image search in Internet search or e-commerce, copyright protection of image works, sensitive image filtering in social platforms, license plate recognition in traffic systems, lesion identification in the medical field, and other businesses. It is particularly suitable for feature extraction of images with obvious spatial contrast information (obvious contrast difference between background and foreground). The image feature extraction method provided by the embodiments of the present disclosure can be performed by an image feature extraction device, which can be implemented by software and / or hardware. The device can be integrated into an electronic device with image processing capabilities, such as a mobile phone, a PDA, a tablet computer, a laptop computer, a desktop computer, or a server.

[0064] Figure 1 This is a flow chart of a method for extracting image features provided by an embodiment of the present disclosure. Figure 1 , the image feature extraction method specifically includes:

[0065] S110: Acquire an image from which features are to be extracted.

[0066] The image to be feature-extracted can be a color two-dimensional image or a grayscale two-dimensional image.

[0067] S120 . Based on the image, determine a pixel value difference result between each pixel and at least one surrounding pixel, and generate a difference matrix.

[0068] The disclosed embodiment performs differential processing on the image based on the idea of ​​spatial differential transformation of the image to extract global and local features in the image. In specific implementation, it is necessary to determine the pixel value difference between each pixel (target pixel) in the image and at least one pixel around it as the pixel value differential result of the corresponding pixel. In this way, except for at least one row above or below the image and at least one column on the left or right, each pixel corresponds to at least one pixel value differential result. The pixel value differential results obtained in the same way can constitute a matrix, and the differential matrix is ​​obtained based on at least one matrix (that is, the elements in the matrix are pixel value differential results).

[0069] The at least one surrounding pixel can be located in any of the horizontal, vertical, and diagonal directions relative to the corresponding target pixel. The horizontal, vertical, and diagonal directions correspond to the horizontal, vertical, and diagonal differencing methods, respectively. Furthermore, the number of rows or columns of the non-pixel value difference results depends on the differencing method. If adjacent pixel differences are used, the number is one row and one column; if differences span a single pixel, the number is two rows and two columns, and so on.

[0070] In some embodiments, based on the image, the pixel value difference result between each pixel and at least one surrounding pixel is determined, and the generation of the difference matrix includes: based on the image, the adjacent diagonal pixels in the diagonal direction of each pixel are determined, and the pixel difference between each pixel and the corresponding diagonal pixel is determined to generate the difference matrix. Considering that the diagonal difference can be integrated into the horizontal information and vertical information in the image, the present embodiment adopts the diagonal difference processing method, and its diagonal direction can be any direction of the upper right corner, the lower right corner, the upper left corner and the lower left corner. In addition, in order to obtain more comprehensive image feature information, the present embodiment adopts a neighboring pixel in the diagonal direction to calculate the pixel value difference result, where the pixels in the diagonal direction are called diagonal pixels. For specific implementation, see Figure 2 , for the acquired image 201( Figure 2 The example is grayscale, but it can also be color), and it is converted into a matrix 202 composed of pixel values; then, the matrix elements in the upper row and the right column of the matrix 202 are removed to obtain the lower left corner sub-matrix 203, and the upper right corner sub-matrix 204 can be obtained similarly; then, the corresponding pixels of the lower left corner matrix 203 and the upper right corner matrix 204 are subjected to difference processing to obtain the difference matrix 205.

[0071] In some embodiments, based on the image, the pixel value difference result between each pixel and at least one surrounding pixel is determined, and the generation of the difference matrix includes: based on the image, determining at least two diagonal pixels in the diagonal direction of each pixel; respectively determining the pixel difference between each pixel and the corresponding diagonal pixels, generating multiple intermediate matrices, the number of intermediate matrices being consistent with the number of diagonal pixels; fusing multiple intermediate matrices to generate a difference matrix. In order to further enrich the extracted features, this embodiment further adds a method of performing differential calculation across pixels on the basis of performing differential calculation using an adjacent diagonal pixel. Then, for each pixel (target pixel) in the image, determine a neighboring diagonal pixel in its diagonal direction, and the neighboring diagonal pixels of the neighboring diagonal pixel in the same diagonal direction (i.e., the diagonal pixels across the target pixel), and so on, to obtain multiple diagonal pixels corresponding to the target pixel. Then, the pixel value difference between the target pixel and each diagonal pixel is calculated to obtain multiple intermediate matrices. That is, the pixel value difference between the target pixel and the adjacent diagonal pixels is calculated to obtain an intermediate matrix whose element is the difference result; the pixel value difference between the target pixel and the diagonal pixels across the pixel is calculated to obtain another intermediate matrix whose element is the difference result, and so on. Finally, partial matrices of multiple intermediate matrices can be upsampled or downsampled to unify the matrix size, and then the processed intermediate matrices are fused by weighted addition, multiplication, or division of the corresponding pixels to obtain the final difference matrix.

[0072] S130. Perform vectorization processing on the difference matrix to generate a difference vector.

[0073] In related technologies, the extracted image features are in the form of multi-dimensional matrices, which take up a lot of space and have slow calculation speed. In this embodiment, in order to further improve the calculation speed, the difference matrix is ​​converted into a 1*n or n*1 vector to obtain a difference vector.

[0074] S140 , performing binarization processing on the differential vector to generate a feature vector corresponding to the image.

[0075] The difference vector is binarized to obtain a feature vector whose elements are either 0 or 1, also known as a hash vector or a binarized vector. This feature vector can then be used to quickly calculate the Hamming distance, further reducing the computational effort and improving the speed of subsequent feature matching. The binarization threshold for this binarization can be an empirical threshold or a threshold derived from the elements in the difference vector.

[0076] It should be noted that the execution order of S130 and S140 is not limited here, S130 can be executed before S140, or S130 can be executed in parallel with S140. Figure 2 , for ease of display, Figure 2In the example, the order of S130 and S140 is reversed, and the difference matrix 205 is first binarized to obtain a binarized matrix 206 , which is then vectorized into a eigenvector 207 .

[0077] The above-mentioned technical solution of the embodiment of the present disclosure obtains an image to be feature-extracted; based on the image, determines the difference between the pixel values ​​of each pixel and at least one surrounding pixel to generate a difference matrix; vectorizes the difference matrix to generate a difference vector; and binarizes the difference vector to generate a feature vector corresponding to the image. This achieves the extraction of image features using spatial domain differential transformation of the image, so that the extracted features contain both global and local information of the image, improving the comprehensiveness of the information extracted from the features. Furthermore, differential processing greatly reduces the computational complexity of feature extraction, reducing the amount of extraction calculations. The resulting feature vector can also reduce the amount of calculations in the subsequent feature matching process, saving computing resources and improving feature extraction efficiency.

[0078] Figure 3 This is a flow chart of another method for extracting image features provided by an embodiment of the present disclosure. It further optimizes the step of "determining the pixel value difference between each pixel and at least one surrounding pixel based on the image to generate a difference matrix" and combines it with the step of obtaining the difference matrix by diagonal difference. On this basis, it is also possible to further optimize the step of "binarizing the difference vector to generate the feature vector corresponding to the image". The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. See Figure 3 , the image feature extraction method includes:

[0079] S310: Acquire an image from which features are to be extracted.

[0080] S320: Scaling the image based on a preset image size.

[0081] Among them, the preset image size is a pre-set image size, which can be expressed as the number of pixels in the row and column directions of the image. The preset image size is obtained by combining the computing speed and feature extraction accuracy. It is generally smaller than the original image size, which can reduce the number of pixels involved in feature extraction, thereby further reducing the amount of calculation. For example, when the differential method is to select a neighboring pixel in the diagonal direction for differential calculation, the preset image size can be determined to be 9*9. If the differential method is to select multiple diagonal pixels for differential calculation, then the preset image size should be larger than 9*9 to ensure the effectiveness of feature extraction.

[0082] In the related ORB feature extraction technology, the number of key points extracted from each image is not uniform, resulting in the size of the extracted features corresponding to each image being non-uniform, making it impossible to use a uniform storage space size to store the features. Based on this, in the embodiment of the present disclosure, the obtained image is first generalized in image size before performing differential processing. During specific implementation, the obtained image is scaled so that the size of the resulting image is consistent with the preset image size. In this way, on the one hand, the image size can be unified, the amount of calculation can be reduced, and the storage space occupied by the extracted features can be ensured to be consistent; on the other hand, the image scaling process can integrate the global information in the entire image and further enrich the global features in the extracted features.

[0083] S330 : performing grayscale processing on the scaled image based on a preset grayscale level.

[0084] The preset grayscale level is a pre-set grayscale range, which is obtained by combining calculation speed and feature extraction accuracy. It is generally less than 256 levels, which can further reduce the amount of calculation. For example, the preset grayscale level is determined to be 64 levels.

[0085] Considering that the image to be extracted is often a color image, and color images have multiple color channels, extracting features from multiple color channels will not only result in a large amount of computation but also produce redundant information. In order to integrate the image information of each channel of the color image, further enrich the global information of the extracted features, and further reduce the amount of computation, the scaled image is grayscaled in this embodiment, and the grayscale value range after grayscale processing is within a preset grayscale level. The size of the image after grayscale processing remains the preset image size, such as 9*9.

[0086] S340. Based on the grayscale processed image, determine the adjacent diagonal pixels in the diagonal direction of each pixel, and determine the pixel difference between each pixel and the corresponding diagonal pixel to generate a difference matrix.

[0087] Taking the preset image size of 9*9 as an example, the difference matrix obtained in this way is 8*8.

[0088] S350: Perform vectorization processing on the difference matrix to generate a difference vector.

[0089] The above 8*8 difference matrix is ​​vectorized to obtain a 64*1 difference vector.

[0090] S360: Determine a binarization threshold based on the statistical results of the differential vector.

[0091] In the embodiments of the present disclosure, the binarization corresponds to the differential vector of the extracted features, so the binarization threshold can be determined based on the statistical results of the differential vector. In some embodiments, the statistical results include the average value, median value, or mathematical expectation value of each vector element in the differential vector.

[0092] S370 , binarizing the difference vector based on a binarization threshold to generate a feature vector corresponding to the image.

[0093] For example, if the binarization threshold is the average value of the difference vector, the value of each vector element in the difference vector is compared with the average value. If the element value is equal to or greater than the average value, the element value of the corresponding vector element is reset to 1; if the element value is less than the average value, the element value of the corresponding vector element is reset to 0. In this way, a 64-dimensional hash vector is obtained, which serves as the spatial domain feature of the acquired image.

[0094] It should be noted that S320 and S330 can be executed one by one, or all of them can be executed as described in the above technical solution. If only S320 is executed, then S340 is changed to "based on the image after scaling, determine the adjacent diagonal pixels in the diagonal direction of each pixel, and determine the pixel difference between each pixel and the corresponding diagonal pixel to generate a differential matrix"; if only S330 is executed, then S330 is changed to "based on the preset grayscale, grayscale the image". If both S320 and S330 are executed, S330 can also be executed first and then S330. In the above technical solution, S330 is executed first and then S330 to ensure that the scaling processing object of S330 is a color image, so that the image information of each color channel can be integrated during the scaling process to retain more comprehensive global features for subsequent processing. For the diagonal difference processing in S340, it can also be replaced with the above Figure 1 The method of performing differential calculation on multiple diagonal pixels (including adjacent diagonal pixels and diagonal pixels across pixels) in the corresponding technical solution.

[0095] The above technical solution of the embodiment of the present disclosure performs scaling processing on the image based on the preset image size. It realizes the generalization processing of image size. First, it ensures that all images can unify the image size, thereby ensuring that the size of the feature vector finally extracted from each image is consistent, and the feature vector can be stored in the same size of storage space; second, the scaling processing of the image can fuse the image information from the perspective of the entire image, further ensuring that the extracted feature vector contains the global features of the image; third, it can reduce the number of pixels involved in the calculation, further reducing the amount of calculation. The scaled image is grayscaled based on the preset grayscale. It realizes the grayscale and grayscale degradation of color images, can fuse the image information of multiple color channels, further enrich the global features in the feature vector, and further reduce the amount of data involved in the calculation, thereby further reducing the amount of calculation.

[0096] Figure 4 Schematic diagram of the structure of an image feature extraction device provided by an embodiment of the present disclosure. Figure 4 , the device specifically includes:

[0097] An image acquisition module 410 is used to acquire an image to be feature extracted;

[0098] A difference matrix generation module 420 is configured to determine, based on the image, a difference result between the pixel values ​​of each pixel and at least one surrounding pixel, and generate a difference matrix;

[0099] A difference vector generation module 430 is used to perform vectorization processing on the difference matrix to generate a difference vector;

[0100] The feature vector generating module 440 is used to perform binarization processing on the difference vector to generate a feature vector corresponding to the image.

[0101] In some embodiments, the difference matrix generation module 420 is specifically configured to:

[0102] Scale the image based on the preset image size;

[0103] Based on the scaled image, a difference result of the pixel value between each pixel and at least one surrounding pixel is determined to generate a difference matrix.

[0104] In some embodiments, the difference matrix generation module 420 is specifically configured to:

[0105] After scaling the image based on a preset image size, grayscale processing is performed on the scaled image based on a preset grayscale level;

[0106] Based on the grayscale processed image, the pixel value difference result between each pixel and at least one surrounding pixel is determined to generate a difference matrix.

[0107] In some embodiments, the difference matrix generating module 420 is further specific for:

[0108] determining, based on the image, adjacent diagonal pixels in a diagonal direction of each pixel, and determining pixel difference values of each pixel and the corresponding diagonal pixels, to generate the difference matrix.

[0109] In some embodiments, the difference matrix generating module 420 is further specific for:

[0110] determining, based on the image, at least two diagonal pixels in a diagonal direction of each pixel;

[0111] determining, respectively, pixel difference values of each pixel and the corresponding diagonal pixels, to generate a plurality of intermediate matrices, the number of intermediate matrices being consistent with the number of diagonal pixels;

[0112] fusing the plurality of intermediate matrices to generate the difference matrix.

[0113] In some embodiments, the feature vector generating module 440 is specific for:

[0114] determining a binary threshold based on the statistical result of the difference vector;

[0115] performing binary processing on the difference vector based on the binary threshold, to generate the feature vector corresponding to the image.

[0116] In some embodiments, the statistical result includes an average value, a median value or a mathematical expectation value of each vector element in the difference vector.

[0117] The image feature extraction device provided by the embodiments of the present disclosure realizes the extraction of the features of the image by using the image spatial domain difference transformation, so that the extracted features contain both the global information and the local information of the image, and the information comprehensiveness of the extracted features is improved. Moreover, the difference processing greatly reduces the calculation complexity of the feature extraction, reduces the calculation amount of the extraction, and finally the obtained feature vector can also reduce the calculation amount in the subsequent feature matching process, saves the calculation resources, and improves the feature extraction efficiency.

[0118] The image feature extraction device provided by the embodiments of the present disclosure can execute the image feature extraction method provided by any of the embodiments of the present disclosure, and has the corresponding function modules and beneficial effects of executing the method.

[0119] It should be noted that, in the embodiments of the image feature extraction device described above, each module included is only divided according to the function logic, but is not limited to the above division, as long as the corresponding function can be realized. In addition, the specific names of each function module are only for the convenience of mutual differentiation, and are not used to limit the protection scope of the present disclosure.

[0120] Figure 5 is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. Referring to Figure 5 The electronic device 500 provided by the embodiment of the present disclosure includes one or more processors 520, and a storage device 510 configured to store one or more programs. When the one or more programs are executed by the one or more processors 520, the one or more processors 520 implement the image feature extraction method provided by the embodiment of the present disclosure, which includes the following steps.

[0121] Obtaining an image to be extracted;

[0122] Based on the image, determining a pixel value difference result of each pixel and at least one surrounding pixel to generate a difference matrix;

[0123] Vectorizing the difference matrix to generate a difference vector;

[0124] Binaryzation processing the difference vector to generate a feature vector corresponding to the image.

[0125] Of course, those skilled in the art can understand that the processor 520 can also implement the technical solutions of the image feature extraction method provided by any embodiment of the present disclosure.

[0126] Figure 5 The electronic device 500 displayed is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.

[0127] As shown in Figure 5 The electronic device 500 is in the form of a general computing device. The components of the electronic device 500 can include, but are not limited to, one or more processors 520, a storage device 510, and a bus 550 connecting different system components, including the storage device 510 and the processor 520.

[0128] The bus 550 represents one or more of several types of bus structures, including a memory bus or bus controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, industry standard architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video electronics standards association (VESA) local bus, and peripheral component interconnect (PCI) bus.

[0129] The electronic device 500 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 500, including volatile and non-volatile media, removable and non-removable media.

[0130] The storage device 510 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 511 and / or cache memory 512. The electronic device 500 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 513 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 Not shown, often called a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 550 via one or more data medium interfaces. Storage device 510 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present disclosure.

[0131] A program / utility 514 having a set (at least one) of program modules 515 may be stored, for example, in a storage device 510. Such program modules 515 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 515 generally implement the functions and / or methods of any of the embodiments described herein.

[0132] The electronic device 500 may also communicate with one or more external devices 560 (e.g., a keyboard, a pointing device, a display 570, etc.), one or more devices that enable a user to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output interface (I / O interface) 530. Furthermore, the electronic device 500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 540. Figure 5 As shown, the network adapter 540 communicates with other modules of the electronic device 500 via the bus 550. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0133] The embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to perform an image feature extraction method, the method comprising:

[0134] obtaining an image to be extracted;

[0135] based on the image, determining a pixel value difference result of each pixel and at least one surrounding pixel to generate a difference matrix;

[0136] performing vectorization processing on the difference matrix to generate a difference vector;

[0137] performing binarization processing on the difference vector to generate a feature vector corresponding to the image.

[0138] Of course, the storage medium comprising computer executable instructions provided by the embodiment of the present disclosure is not limited to the method operations described above, and can also perform related operations in the image feature extraction method provided by any embodiment of the present disclosure.

[0139] The computer storage medium of the embodiment of the present disclosure can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus.

[0140] The computer readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, in which a computer readable program code is carried. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus.

[0141] The computer readable media on which the program code can be carried by any suitable medium, including but not limited to wireless, wired, optical fiber cable, RF, and the like, or any suitable combination of the foregoing.

[0142] Computer program code for carrying out operations of the present disclosure can be written in any suitable programming language including object oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0143] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in this specification and the appended claims, the terms "a," "one," and "the" include both singular and plural referents unless the context clearly dictates otherwise. The term "and / or" includes any and all combinations of one or more of the associated listed items. The term "includes" or "comprising" means "consisting at least in part of" and term "consisting of means "consisting exactly of" where the recited steps or components are the only active ones, and "comprising" means "consisting at least in part of" where the recited steps or components are not the only ones and other not specified steps or components that serve the same, equivalent, or similar purpose are alternative.

[0144] The preceding merely illustrates the principles of the disclosure. Various modifications and alterations to the described embodiments will be apparent to those skilled in the art in view of the teachings herein. The descriptions herein are thus not intended to be limited to the particular forms set forth herein; many of the details can vary therefrom without departing from the spirit or scope of the application as set forth in the following claims.

Claims

1. A method for extracting image features, characterized in that: include: Obtain an image to be feature extracted; Based on the image, determining a difference result of a pixel value between each pixel and at least one surrounding pixel, and generating a difference matrix; Performing vectorization processing on the difference matrix to generate a difference vector; Binarizing the difference vector to generate a feature vector corresponding to the image; The method of determining the difference between the pixel values ​​of each pixel and at least one surrounding pixel based on the image and generating a difference matrix includes: Determine, based on the image, at least two diagonal pixels located in a diagonal direction of each pixel, wherein the at least two diagonal pixels include an adjacent diagonal pixel in the diagonal direction of the pixel and adjacent diagonal pixels in the same diagonal direction of the adjacent diagonal pixel; respectively determining pixel differences between each pixel and corresponding diagonal pixels, and generating a plurality of intermediate matrices, wherein the number of the intermediate matrices is the same as the number of the diagonal pixels; The multiple intermediate matrices are fused to generate the difference matrix.

2. The method according to claim 1, characterized in that Determining a pixel value difference result between each pixel and at least one surrounding pixel based on the image to generate a difference matrix includes: Based on a preset image size, scaling the image; Based on the image after scaling, a difference result of pixel values ​​between each pixel and at least one surrounding pixel is determined to generate the difference matrix.

3. The method according to claim 2, characterized in that Determining a pixel value difference result between each pixel and at least one surrounding pixel based on the image after scaling processing to generate a difference matrix includes: Based on a preset grayscale level, performing grayscale processing on the image after the scaling processing; Based on the grayscale processed image, a pixel value difference result between each pixel and at least one surrounding pixel is determined to generate the difference matrix.

4. The method according to claim 1, wherein Determining a pixel value difference result between each pixel and at least one surrounding pixel based on the image to generate a difference matrix includes: Based on the image, adjacent diagonal pixels in a diagonal direction of each pixel are determined, and pixel difference values ​​between each pixel and the corresponding diagonal pixel are determined to generate the difference matrix.

5. The method according to claim 1, wherein The binarization processing of the difference vector to generate a feature vector corresponding to the image includes: Determining a binarization threshold based on a statistical result of the difference vector; The differential vector is binarized based on the binarization threshold to generate a feature vector corresponding to the image.

6. The method according to claim 5, characterized in that The statistical result includes the average value, median value or mathematical expectation value of each vector element in the differential vector.

7. An image feature extraction device, characterized in that: include: An image acquisition module, used to acquire an image to be feature extracted; a difference matrix generation module, configured to determine, based on the image, a difference result of a pixel value between each pixel and at least one surrounding pixel, and generate a difference matrix; A differential vector generation module, configured to perform vectorization processing on the differential matrix to generate a differential vector; a feature vector generating module, configured to perform binarization processing on the differential vector to generate a feature vector corresponding to the image; The difference matrix generation module is specifically configured to: determine, based on the image, at least two diagonal pixels located in a diagonal direction of each pixel, the at least two diagonal pixels including an adjacent diagonal pixel in the diagonal direction of the pixel and adjacent diagonal pixels in the same diagonal direction of the adjacent diagonal pixel; respectively determine a pixel difference between each pixel and corresponding diagonal pixels, and generate a plurality of intermediate matrices, wherein the number of the intermediate matrices is consistent with the number of the diagonal pixels; The multiple intermediate matrices are fused to generate the difference matrix.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image feature extraction method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the image feature extraction method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Content based general steganography analysis method of spatial-domain image

    CN106548445A

  • Similar image recognition method and computing equipment

    CN110909791A