Image feature recognition method based on computer vision
By using adaptive bilateral filtering and grayscale histogram equalization preprocessing, combined with Gaussian pyramid and dynamic weight fusion methods, the problems of incomplete preprocessing and mismatch in multi-scale feature extraction in image feature recognition are solved, achieving higher recognition accuracy and robustness.
Patent Information
- Application Number
- CN202511660537.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-11-13
AI Technical Summary
Existing image feature recognition technologies suffer from problems such as incomplete preprocessing, mismatch in multi-scale feature extraction, and insufficient feature fusion in complex scenarios, resulting in insufficient reliability and accuracy of recognition results.
An adaptive bilateral filtering algorithm is used for image preprocessing, combined with gray-level histogram equalization. Multi-scale features are extracted through a Gaussian pyramid hierarchical structure, and feature recognition is performed through dynamic weight fusion and Euclidean distance adaptive matching threshold.
It effectively removes noise, enhances the accuracy of feature extraction, improves the collaborative representation ability of multi-scale features, reduces false matching and missed matching, and improves the accuracy and robustness of image feature recognition.
Smart Images

Figure CN121121383A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer vision, and in particular to an image feature recognition method based on computer vision. BACKGROUND
[0002] As the core research direction in the field of computer vision, the development history of image feature recognition technology can be traced back to the early traditional method based on artificial design features. This kind of method realizes target recognition by extracting the bottom layer visual features such as edges, textures and colors of images. In the preprocessing stage, Gaussian filter or mean filter with fixed parameters is often used to suppress noise. With the evolution of technology, in order to improve the adaptability to complex scenes, multi-scale feature extraction technology gradually rises. The Gaussian pyramid hierarchical structure is widely used because it can simulate the multi-scale characteristics of human visual system. The histogram of oriented gradients feature becomes one of the mainstream features because of its excellent representation ability of local texture information. In recent years, in order to further enhance the robustness of features, multi-feature fusion strategy has begun to attract attention. By combining local texture features with global contour features, the limitations of single features are made up. In the matching stage, the Euclidean distance, cosine similarity and other measurement methods are often used, and the matching results are judged by setting a fixed threshold.
[0003] Although the existing image feature recognition technology has been applied in many fields, there are still obvious deficiencies in actual complex scenes. In the preprocessing stage, the parameters such as kernel radius and gray difference threshold of traditional filtering algorithm are often set by experience or fixed value, which cannot be dynamically adjusted according to the gradient amplitude and gray distribution of local image region, resulting in incomplete noise removal in noise-intensive areas or excessive smoothing and loss of key features in detail-rich areas. In the multi-scale feature extraction process, the scale parameter of Gaussian pyramid and the size of feature extraction unit are often designed independently, without forming a linkage mechanism of scale-feature parameters, which easily causes the problem of mismatch between feature resolution of different scale layers and target size, affecting the collaborative representation ability of multi-scale features. In the feature fusion stage, the existing dynamic weight distribution often relies on a single indicator, without considering the inter-class discriminability and local information complexity of features, resulting in insufficient proportion of effective information in the fused features. In the matching stage, the setting of fixed threshold ignores the difference of feature distribution, which easily causes false matching or missed matching when the feature distance fluctuates greatly, reducing the reliability of recognition results. SUMMARY
[0004] The present application aims to overcome the above problems and provide an image feature recognition method based on computer vision. To achieve the above purpose, the present application adopts the following technical solutions:
[0005] An image feature recognition method based on computer vision, comprising the following steps:
[0006] S1: preprocessing the input image, removing image noise by an adaptive bilateral filtering algorithm, correcting image gray deviation by gray histogram equalization, obtaining a preprocessed image;
[0007] S2: multi-scale feature extraction on the preprocessed image, obtaining image local texture features and global contour features at different scales through a Gaussian pyramid hierarchical structure, the local texture features being direction gradient histogram features of each scale layer, and the global contour features being edge contour features of the top layer of the Gaussian pyramid;
[0008] S3: dynamic weight fusion of the local texture features and the global contour features, calculating a dynamic fusion weight based on feature response values and local complexity factors, performing weighted fusion on the local texture features and the global contour features, and then performing dimension reduction processing on the fused features through a principal component analysis algorithm to obtain a target feature set;
[0009] S4: matching the target feature set with reference features in a preset feature library, calculating the Euclidean distance between the target feature set and the reference features, determining an adaptive matching threshold based on the distribution characteristics of the Euclidean distance, determining a matching result through the adaptive matching threshold, and completing image feature recognition.
[0010] Further, in step S1, the filter kernel radius of the adaptive bilateral filtering algorithm is :
[0011] ;
[0012] The gray difference threshold of the adaptive bilateral filtering algorithm is :
[0013] ;
[0014] wherein, is the filter kernel radius, is the local region gradient amplitude centered on the pixel to be processed, is a preset maximum gradient amplitude, is a preset maximum filter kernel radius, floor is a down rounding function, is the gray difference threshold, is the maximum value of all local region gradient amplitudes in the image, is the minimum value of all local region gradient amplitudes in the image.
[0015] Further, in step S1, the gray scale histogram equalization comprises: dividing the input image into a plurality of non-overlapping sub-regions, calculating a gray scale probability density function for each sub-region, constructing a cumulative distribution function based on the probability density function, and mapping the original gray scale value of each sub-region to a target gray scale interval through the corresponding cumulative distribution function to obtain a pre-processed image after gray scale correction.
[0016] Further, in step S2, the Gaussian pyramid hierarchical structure comprises scale layers, the th scale layer has a Gaussian standard deviation , and the th scale layer has a Gaussian standard deviation
[0017] . ;
[0018] The cell unit size of the direction gradient histogram feature is ;
[0019] wherein, the th scale layer has a Gaussian standard deviation , the scale ratio coefficient is greater than 1, the scale layer number is , the initial Gaussian standard deviation of the bottom layer is , and the top layer of the Gaussian pyramid is the th scale layer; the cell unit side length is , the side length of the pre-processed image is , and the scaling ratio of the th scale layer relative to the bottom layer is .
[0020] Further, in step S2, the extraction of the local texture feature comprises: in the th scale layer, dividing the image into cell units with a size of , counting the gradient histogram of a preset number of directions for each cell unit, combining adjacent cell units into block units, performing normalization processing on the gradient histogram of the block units to obtain the direction gradient histogram feature of the th scale layer, and splicing the direction gradient histogram features of all scale layers to form the local texture feature , and the extraction of the global contour feature comprises: extracting an edge contour in the top layer of the Gaussian pyramid through an edge detection algorithm, and converting a pixel coordinate sequence of the edge contour into a contour feature vector with a fixed dimension through a contour descriptor algorithm, wherein the contour feature vector is the global contour feature .
[0021] Further, in step S3, the dynamic fusion weight is calculated as follows: calculating the inter-class variance of the local texture feature , and calculating the dynamic fusion weight as inter-class variance to obtain a local feature response value to calculate a global contour feature inter-class variance inter-class variance to obtain a global feature response value ,
[0022] a local complexity factor of the local texture feature is: ;
[0023] a local complexity factor of the global contour feature is: ;
[0024] the dynamic fusion weight is:
[0025] ;
[0026] ;
[0027] the fusion feature is:
[0028] ;
[0029] wherein the preset feature library contains class information of reference features, is a local feature response value, is an inter-class variance of the local texture feature, is an intra-class variance of the local texture feature, is a global feature response value, is an inter-class variance of the global contour feature, is an intra-class variance of the global contour feature; is a local complexity factor of the local texture feature, is a ratio of the number of edge pixels to the total number of pixels in the local texture feature map, is a texture entropy of the local texture feature map, is a local complexity factor of the global contour feature, is a ratio of the number of edge pixels to the total number of pixels in the global contour feature map, is a texture entropy of the global contour feature map; is a dynamic fusion weight of the local texture feature, is a dynamic fusion weight of the global contour feature; is a fusion feature, is a local texture feature, is a global contour feature.
[0030] Further, in step S3, when the principal component analysis algorithm is used to reduce the dimension of the fusion feature, the covariance matrix of the fusion feature is:
[0031] ;
[0032] wherein, is the covariance matrix, is the original dimension of the fusion feature, is the matrix form of the fusion feature, is the mean vector of the fusion feature; is the matrix transposition operation; the eigenvalue decomposition is performed on the covariance matrix to obtain the eigenvalue and the eigenvector, the eigenvalues are sorted in descending order; the principal components with the cumulative contribution rate greater than the preset contribution rate threshold are selected, the fusion feature is projected into the feature space formed by the selected principal components, and the reduced dimension feature is obtained.
[0033] Further, in step S4, the Euclidean distance is:
[0034] ;
[0035] The adaptive matching threshold is:
[0036] ;
[0037] wherein, is the Euclidean distance between the target feature set and the reference feature, is the feature dimension serial number, is the value of the target feature set in the th dimension, is the value of the reference feature in the th dimension; is the adaptive matching threshold, is the mean value of the Euclidean distance between the target feature set and all reference features in the preset feature library, is the standard deviation of the Euclidean distance, is the threshold adjustment coefficient; when the Euclidean distance is less than the adaptive matching threshold , it is determined that the target feature set matches the corresponding reference feature.
[0038] Further, in step S2, the construction of the Gaussian pyramid hierarchical structure includes: performing Gaussian blur processing on the preprocessed image to obtain a first layer sub-image; performing Gaussian blur processing on the first layer sub-image to obtain a second layer sub-image; and sequentially obtaining an th layer sub-image.
[0039] Further, in step S4, the construction of the preset feature library comprises: collecting a sample image, performing the operations of steps S1 to S3 on the sample image in sequence to obtain a sample feature set; and storing the sample feature set in association with sample category information to form the preset feature library.
[0040] The present application has the advantages of:
[0041] 1. The present application dynamically adjusts the filter kernel radius and the gray difference threshold through the adaptive bilateral filtering algorithm, and combines the gray histogram equalization to pre-process the input image, effectively removes image noise and corrects the gray deviation, avoids the edge blur or detail loss problem caused by the traditional fixed parameter filtering, provides high-quality pre-processed images for multi-scale feature extraction, and improves the accuracy of feature extraction.
[0042] 2. The present application links the Gaussian standard deviation of different scale layers and the cell unit size of the histogram of oriented gradients feature through the construction of the Gaussian pyramid hierarchical structure, extracts local texture features and global contour features, realizes the cooperative extraction of multi-scale features, enhances the adaptability of features to different size targets, avoids the sensitivity of single scale features to target size changes, and improves the representation ability of image features in complex scenes.
[0043] 3. The present application calculates a dynamic fusion weight based on the feature response value and the local complexity factor, weights and fuses the local texture features and the global contour features, and determines an adaptive matching threshold through the Euclidean distance distribution feature, realizes the weight distribution of optimized feature fusion, makes the features with high discrimination and rich information obtain higher weight, at the same time, improves the adaptability of the matching threshold to sample distribution, reduces the false matching or missed matching caused by the fixed threshold, and improves the accuracy and robustness of image feature recognition. BRIEF DESCRIPTION OF DRAWINGS
[0044] The accompanying drawings, which form a part of this application, are included to provide a further understanding of the application and are incorporated in and constitute a part of this application. The drawings illustrate embodiments of the present application and, together with the description, serve to explain the application. In the drawings:
[0045] In the drawings:
[0046] Figure 1 A flowchart of a computer vision-based image feature recognition method in embodiment 1.
[0047] Figure 2 A flowchart of an image pre-processing process in a computer vision-based image feature recognition in embodiment 1.
[0048] Figure 3 A flowchart of multi-scale feature extraction in a computer vision-based image feature recognition in embodiment 1.
[0049] Figure 4 A feature fusion and dimension reduction flowchart in the computer vision-based image feature recognition in embodiment 1.
[0050] Figure 5 A feature matching and recognition flowchart in the computer vision-based image feature recognition in embodiment 1. DETAILED DESCRIPTION
[0051] The application will be described in detail and specifically below through specific embodiments, so as to better understand the application, but the following embodiments do not limit the protection scope of the application.
[0052] Embodiment 1
[0053] As shown in the figure, a computer vision-based image feature recognition method comprises the following steps: Figures 1-5
[0054] S1: pre-processing the input image, removing image noise through an adaptive bilateral filtering algorithm, correcting image gray deviation through gray histogram equalization, and obtaining a pre-processed image;
[0055] S2: multi-scale feature extraction on the pre-processed image, obtaining image local texture features and global contour features at different scales through a Gaussian pyramid hierarchical structure, the local texture features being direction gradient histogram features of each scale layer, and the global contour features being edge contour features of the top layer of the Gaussian pyramid;
[0056] S3: dynamic weight fusion of the local texture features and the global contour features, calculating dynamic fusion weights based on feature response values and local complexity factors, and after weighted fusion of the local texture features and the global contour features, performing dimension reduction processing on the fused features through a principal component analysis algorithm, and obtaining a target feature set;
[0057] S4: matching the target feature set with reference features in a pre-set feature library, calculating the Euclidean distance between the target feature set and the reference features, determining an adaptive matching threshold based on the distribution characteristics of the Euclidean distance, determining the matching result through the adaptive matching threshold, and completing image feature recognition.
[0058] In specific embodiments, the image feature recognition process is realized through four stages of pre-processing, multi-scale feature extraction, dynamic weight fusion and matching in turn.
[0059] In the preprocessing stage, an adaptive bilateral filtering algorithm is used to remove image noise. The algorithm can dynamically adjust the filtering parameters according to the gradient amplitude of the local region of the image, avoiding the problem of incomplete denoising in noise-intensive areas or excessive smoothing in detail-rich areas caused by traditional fixed-parameter filtering. At the same time, the image gray scale deviation is corrected through gray scale histogram equalization, and the image contrast is enhanced, making the details in dark areas clearer and the gray scale distribution in bright areas more uniform, providing high-quality input images for feature extraction.
[0060] In the multi-scale feature extraction stage, different scale sub-images are generated using the Gaussian pyramid hierarchical structure. The direction gradient histogram features are extracted as local texture features in each scale layer to capture the local detail information of the target. The edge contour features are extracted as global contour features in the top layer of the pyramid to reflect the overall structure of the target. Through the combination of local and global features, the defects of single feature in representing complex targets are compensated.
[0061] In the dynamic weight fusion stage, the dynamic fusion weight is calculated based on the feature response value and the local complexity factor. The weight of the local texture and the global contour in the fused feature is adaptively adjusted according to the feature's own discrimination ability and the local information complexity, avoiding the problem of insufficient effective information caused by traditional fixed weight fusion. After fusion, the principal component analysis algorithm is used to reduce the dimension of the feature, retaining the main feature information while reducing the data dimension and the computational complexity in the matching stage.
[0062] In the matching stage, the Euclidean distance between the target feature set and the reference feature is calculated to measure the similarity, and an adaptive matching threshold is determined based on the distance distribution characteristics, avoiding false matching or missed matching caused by fixed threshold when the feature distance fluctuates, and improving the reliability of the recognition result.
[0063] Further, in step S1, the filter kernel radius of the adaptive bilateral filtering algorithm is :
[0064] ;
[0065] The gray scale difference threshold of the adaptive bilateral filtering algorithm is :
[0066] ;
[0067] wherein, is the filter kernel radius, is the gradient amplitude of the local region centered on the pixel to be processed, is the preset maximum gradient amplitude, is the preset maximum filter kernel radius, floor is the floor function, is the gray scale difference threshold, This represents the maximum gradient magnitude across all local regions in the image. It represents the minimum gradient magnitude of all local regions in the image.
[0068] In a specific embodiment, the adaptive bilateral filtering algorithm achieves accurate noise reduction by dynamically adjusting the filter kernel radius and the gray-level difference threshold. (Filter kernel radius) The calculation is based on the gradient magnitude in the local region. With maximum gradient magnitude Based on the ratio, combined with the maximum filter kernel radius The ratio is dynamically determined: when the gradient magnitude is large in a local area, the ratio is small, and the kernel radius is reduced to avoid over-smoothing and loss of detail; when the gradient magnitude is small, the ratio is large, and the kernel radius is increased to enhance the denoising effect. Gray-level difference threshold. The threshold is determined by one-quarter of the difference between the maximum and minimum gradient magnitudes of all local regions of the image, so that the threshold can adapt to the global gray-level distribution characteristics of the image. When the gray-level difference of the image is large, the threshold is increased to retain the edge features with obvious gray-level jumps; when the gray-level difference is small, the threshold is decreased to finely distinguish local gray-level changes and improve the clarity and feature integrity of the filtered image.
[0069] Further, in step S1, the grayscale histogram equalization includes: dividing the input image into multiple non-overlapping sub-regions, calculating the grayscale probability density function for each sub-region, constructing a cumulative distribution function based on the probability density function, and mapping the original grayscale values of each sub-region to the target grayscale range through the corresponding cumulative distribution function to obtain the grayscale corrected preprocessed image.
[0070] In a specific embodiment, gray-level histogram equalization achieves precise correction of gray-level deviations through region-based processing. After dividing the input image into multiple non-overlapping sub-regions, the gray-level probability density function and cumulative distribution function are independently calculated for each sub-region, allowing the gray-level mapping process to adapt to the gray-level distribution characteristics of local areas. Compared to global equalization, which can easily lead to reduced local contrast, region-based equalization can stretch the gray-level range in dark areas, enhancing the visibility of details in dark areas, and compress the gray-level range in bright areas, avoiding information loss due to overexposure. This results in a more uniform gray-level distribution and more moderate contrast in the corrected image, providing a more stable gray-level foundation for feature extraction.
[0071] Further, in step S2, the Gaussian pyramid layered structure includes The scale layer, the first Gaussian standard deviation of layer scale for:
[0072] ;
[0073] A cell unit size of the histogram of oriented gradient feature is: ;
[0074] wherein, is a Gaussian standard deviation of an i-th scale layer, is a scale ratio coefficient greater than 1, is a scale layer number, is an initial Gaussian standard deviation of a bottom layer, and a top layer of the Gaussian pyramid is an i-th scale layer; is a cell unit side length, is a side length of the image after pre-processing, is a scaling ratio of the i-th scale layer relative to the bottom layer. In specific embodiments, the Gaussian pyramid layered structure improves the multi-scale feature collaborative representation ability through the linkage design of the scale parameter and the feature extraction unit. The Gaussian standard deviation of the i-th scale layer increases according to an exponential law with the scale layer number , so that the blur degree of each scale layer gradually increases, generating multi-scale sub-images conforming to the human eye visual characteristics. The cell unit size of the histogram of oriented gradient feature
[0075] is linked with the scale layer scaling ratio, and decreases with the scale layer number , so as to ensure that a smaller cell unit is used in a high scale layer to avoid low feature resolution, and a larger cell unit is used in a low scale layer to avoid feature redundancy. Through the linkage of the scale parameter and the cell unit size, the feature resolution of different scale layers is matched with the target size under the corresponding scale, improving the adaptability of multi-scale features to different size targets. Further, in step S2, the extraction of the local texture feature includes: in the i-th scale layer, dividing the image into cell units with a size of , counting the histogram of gradients in a preset number of directions for each cell unit, combining adjacent cell units into block units, performing normalization processing on the histogram of gradients of the block units to obtain the histogram of oriented gradient feature of the i-th scale layer, and splicing the histogram of oriented gradient features of all scale layers to form the local texture feature .
[0076] Further, in step S2, the extraction of the local texture feature includes: in the i-th scale layer, dividing the image into cell units with a size of , counting the histogram of gradients in a preset number of directions for each cell unit, combining adjacent cell units into block units, performing normalization processing on the histogram of gradients of the block units to obtain the histogram of oriented gradient feature of the i-th scale layer, and splicing the histogram of oriented gradient features of all scale layers to form the local texture feature . Further, the extraction of the global contour feature includes: extracting an edge contour in the top layer of the Gaussian pyramid through an edge detection algorithm, and converting a pixel coordinate sequence of the edge contour into a fixed-dimension contour feature vector through a contour descriptor algorithm, wherein the contour feature vector is the global contour feature .
[0077] In specific embodiments, the local texture feature is achieved by splicing multi-scale direction gradient histogram features to comprehensively capture the details of the target. In each scale layer, the image is divided into cell units, the multi-direction gradient histogram is counted and the feature robustness is enhanced by block unit normalization, and the local texture feature formed by splicing the features of each scale layer can reflect the local texture changes of the target at different scales, and improve the representation ability of the details of the target surface. The global contour feature is achieved by vectorizing the edge contour of the top layer of the pyramid to depict the overall structure of the target. After multiple Gaussian blurring, the noise interference of the top layer image is small, and the edge contour is clearer. The pixel coordinate sequence is converted into a fixed dimension vector by the contour descriptor algorithm, which is convenient for fusion with the local texture feature. The combination of local texture and global contour features makes the features contain both detailed texture information and overall structure information of the target, improving the ability to distinguish complex morphological targets.
[0078] Further, in step S3, the dynamic fusion weight is calculated as follows: the inter-class variance and the intra-class variance of the local texture feature are calculated to obtain the local feature response value , the inter-class variance and the intra-class variance of the global contour feature are calculated to obtain the global feature response value ,
[0079] The local complexity factor of the local texture feature is: ;
[0080] The local complexity factor of the global contour feature is: ;
[0081] The dynamic fusion weight is:
[0082] ;
[0083] ;
[0084] The fusion feature is:
[0085] ;
[0086] Wherein, the preset feature library contains the category information of the reference feature, is the local feature response value, is the inter-class variance of the local texture feature, is the intra-class variance of the local texture feature, a global feature response value, an inter-class variance of a global contour feature, an intra-class variance of a global contour feature; a local complexity factor of a local texture feature, a ratio of the number of edge pixels to the total number of pixels in a local texture feature map, a texture entropy of a local texture feature map, a local complexity factor of a global contour feature, a ratio of the number of edge pixels to the total number of pixels in a global contour feature map, a texture entropy of a global contour feature map; a dynamic fusion weight of a local texture feature, a dynamic fusion weight of a global contour feature; a fused feature, a local texture feature, a global contour feature.
[0087] In specific embodiments, dynamic weight fusion realizes adaptive adjustment of the fusion weight by comprehensively considering the feature response value and the local complexity factor. The local feature response value and the global feature response value are calculated based on the ratio of the inter-class variance to the intra-class variance, and the greater the ratio, the stronger the feature's inter-class distinguishing ability and the higher the weight proportion; the local complexity factor and measures the local information complexity of the feature by the product of the edge pixel ratio and the texture entropy, and the higher the complexity, the richer the details contained in the feature and the higher the weight proportion. The dynamic fusion weight and is calculated based on the ratio of to , so that the weight of the local texture and the global contour in the fused feature dynamically changes with the feature's own distinguishing ability and information complexity, avoiding the problem that effective information is diluted in traditional fixed weight fusion, and improving the comprehensive representation ability of the fused feature to the target.
[0088] Further, in step S3, when the principal component analysis algorithm performs dimension reduction processing on the fused feature, the covariance matrix of the fused feature is:
[0089] ;
[0090] wherein, is the covariance matrix, is the original dimension of the fused feature, is the matrix form of the fused feature, is the mean vector of the fused feature. is a matrix transpose operation; the covariance matrix is subjected to eigenvalue decomposition to obtain eigenvalues and eigenvectors, the eigenvalues are sorted in descending order, and principal components with cumulative contribution rates greater than a preset contribution rate threshold are selected, the fusion features are projected to a feature space formed by the selected principal components to obtain reduced dimension features.
[0091] In specific embodiments, the principal component analysis algorithm realizes data simplification and key information retention by reducing the dimension of the fusion features. The calculation of the covariance matrix is based on the deviation of the fusion feature matrix and the mean vector , and reflects the correlation between each dimension of the features; the eigenvalues obtained by eigenvalue decomposition represent the variance contribution of each principal component, and after sorting in descending order, the principal components with cumulative contribution rates greater than a preset threshold are selected to ensure that the reduced dimension features retain the main information of the original features. Through dimension reduction, while reducing the feature dimension and reducing the computational amount in the matching stage, redundant information and noise interference in the features are removed, and the stability and matching efficiency of the features are improved.
[0092] Further, in step S4, the Euclidean distance is:
[0093] ;
[0094] The adaptive matching threshold is:
[0095] ;
[0096] wherein, is the Euclidean distance between the target feature set and the reference feature, is the feature dimension number, is the value of the target feature set in the th dimension, is the value of the reference feature in the th dimension; is the adaptive matching threshold, is the mean of the Euclidean distances between the target feature set and all reference features in the preset feature library, is the standard deviation of the Euclidean distance, is a threshold adjustment coefficient; when the Euclidean distance is less than the adaptive matching threshold , it is determined that the target feature set matches the corresponding reference feature.
[0097] In specific embodiments, the matching stage measures the feature similarity by the Euclidean distance. And based on the distance distribution characteristics, the adaptive matching threshold is determined to improve the matching accuracy. The Euclidean distance The similarity between the features is intuitively reflected by calculating the square sum of the difference between each dimension of the target feature set and the reference feature, and then taking the square root. The adaptive matching threshold is dynamically determined based on the mean distance, standard deviation, and adjustment coefficient. When the feature distance distribution is dispersed, the threshold is increased to avoid missed matching. When the distribution is concentrated, the threshold is reduced to avoid false matching. By using the adaptive threshold to determine the matching result, the defects of fixed threshold ignoring the difference in sample feature distribution are avoided, and the reliability of the recognition result is improved. The threshold is dynamically determined based on the mean distance, standard deviation, and adjustment coefficient. When the feature distance distribution is dispersed, the threshold is increased to avoid missed matching. When the distribution is concentrated, the threshold is reduced to avoid false matching. By using the adaptive threshold to determine the matching result, the defects of fixed threshold ignoring the difference in sample feature distribution are avoided, and the reliability of the recognition result is improved.
[0098] Further, in step S2, the construction of the Gaussian pyramid hierarchical structure includes: performing Gaussian blur processing on the preprocessed image to obtain a first layer of sub-images; performing Gaussian blur processing on the first layer of sub-images to obtain a second layer of sub-images; and sequentially obtaining a third layer of sub-images, a fourth layer of sub-images, and a fifth layer of sub-images.
[0099] In specific embodiments, the Gaussian pyramid hierarchical structure generates multi-scale sub-images through layer-by-layer Gaussian blur, providing a basis for multi-scale feature extraction. The first layer of sub-images is obtained by performing the first round of Gaussian blur on the preprocessed image, and the second layer of sub-images is obtained by performing Gaussian blur on the first layer of sub-images, and so on to the fifth layer, so that the size and blur degree of each layer of sub-images decrease gradually, simulating the visual effect when the human eye observes targets at different distances. Through the construction of multi-scale sub-images, the feature extraction can capture the features of targets of different sizes, improving the adaptability of the method to changes in target size.
[0100] Further, in step S4, the construction of the preset feature library includes: collecting sample images, performing the operations of steps S1 to S3 on the sample images in sequence to obtain a sample feature set, and storing the sample feature set in association with sample category information to form the preset feature library.
[0101] In specific embodiments, the preset feature library is constructed by standardizing the sample images, providing a reliable reference benchmark for feature matching. After collecting the sample images, the same pre-processing, multi-scale feature extraction, dynamic weight fusion, and dimension reduction process as the to-be-identified image are performed to obtain a standardized sample feature set; the sample feature set is stored in association with the sample category information to ensure that the target category can be quickly located according to the feature similarity during matching. The standardized preset feature library avoids the matching deviation caused by the inconsistency between the sample feature extraction process and the to-be-identified image, improving the consistency and accuracy of the recognition.
[0102] The above detailed description of the application is only as an example, and the application is not equal to the above described specific embodiments. Any equivalent modification and substitution of the application for those skilled in the art are also within the scope of the application. Therefore, equivalent transformation and modification made without departing from the spirit and scope of the application should be covered within the scope of the application.
Claims
1. A computer vision-based image feature recognition method, characterized by, Includes the following steps: S1: Preprocess the input image by removing image noise using an adaptive bilateral filtering algorithm and correcting image gray-level deviations using gray-level histogram equalization to obtain the preprocessed image; S2: Perform multi-scale feature extraction on the preprocessed image. Obtain local texture features and global contour features at different scales through the hierarchical structure of the Gaussian pyramid. The local texture features are the directional gradient histogram features of each scale layer, and the global contour features are the edge contour features of the top layer of the Gaussian pyramid. S3: Perform dynamic weighted fusion of local texture features and global contour features. Calculate dynamic fusion weights based on feature response values and local complexity factors. After weighted fusion of local texture features and global contour features, perform dimensionality reduction on the fused features using principal component analysis algorithm to obtain the target feature set. S4: Match the target feature set with the reference features in the preset feature library, calculate the Euclidean distance between the target feature set and the reference features, determine the adaptive matching threshold based on the distribution characteristics of the Euclidean distance, and determine the matching result through the adaptive matching threshold to complete image feature recognition.
2. The image feature recognition method based on computer vision according to claim 1, characterized in that, In step S1, the filter kernel radius of the adaptive bilateral filter algorithm is determined as follows: R = 2 * ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ; The gray difference threshold of the adaptive bilateral filtering algorithm Is: ; wherein, is a filter kernel radius, is a local region gradient magnitude centered at the pixel to be processed, is a preset maximum gradient magnitude, is a preset maximum filter kernel radius, floor is a floor function, is a gray difference threshold, is a maximum value of all local region gradient magnitudes in the image, is a minimum value of all local region gradient magnitudes in the image.
3. The computer vision-based image feature recognition method of claim 2, wherein, In step S1, the grayscale histogram equalization includes: dividing the input image into multiple non-overlapping sub-regions, calculating the grayscale probability density function for each sub-region, constructing a cumulative distribution function based on the probability density function, and mapping the original grayscale values of each sub-region to the target grayscale range through the corresponding cumulative distribution function to obtain the grayscale corrected preprocessed image.
4. The image feature recognition method based on computer vision according to claim 3, characterized in that, In step S2, the Gaussian pyramid hierarchy comprises scales, a first Gaussian standard deviation of the first scale scale layer is: ; The cell size of the histogram of oriented gradients feature is: in, For the first Gaussian standard deviation of each scale layer A scale factor greater than 1. This refers to the scale layer number. The initial Gaussian standard deviation of the bottom layer is given by the first Gaussian pyramid, and the top layer of the Gaussian pyramid is given by the second Gaussian standard deviation. Each scale layer; The side length of the cell unit. The side length of the preprocessed image. For the first The scaling ratio of each scale layer relative to the underlying layer.
5. The image feature recognition method based on computer vision according to claim 4, characterized in that, In step S2, the extraction of the local texture features includes: in the first... At each scale level, the image is divided into segments of size [size missing]. For each cell unit, a gradient histogram of a predetermined number of directions is generated. Adjacent cell units are combined into block units, and the gradient histograms of the block units are normalized to obtain the first... The directional gradient histogram features of each scale layer are concatenated to form local texture features. The extraction of the global contour features includes: extracting edge contours at the top of the Gaussian pyramid using an edge detection algorithm; and converting the pixel coordinate sequence of the edge contours into a fixed-dimensional contour feature vector using a contour descriptor algorithm. This contour feature vector is the global contour feature. .
6. The image feature recognition method based on computer vision according to claim 5, characterized in that, In step S3, the dynamic fusion weight is calculated as follows: the inter-class variance of the local texture feature is calculated , and the intra-class variance is calculated, to obtain the local feature response value , the inter-class variance of the global contour feature is calculated , and the intra-class variance is calculated, to obtain the global feature response value , The local complexity factor of the local texture feature is: ; The local complexity factor of the global contour feature is: ; The dynamic fusion weight is: ; ; The fusion feature is: ; The preset feature library contains category information for reference features. For local feature response values, For the inter-class variance of local texture features, For the intra-class variance of local texture features, This is the global characteristic response value. The inter-class variance of the global contour features. The intra-class variance of the global contour features; The local complexity factor for local texture features. This represents the ratio of the number of edge pixels to the total number of pixels in the local texture feature map. The texture entropy of the local texture feature map. The local complexity factor for the global contour features. This is the ratio of the number of edge pixels to the total number of pixels in the global contour feature map. The texture entropy of the global contour feature map; Dynamic fusion weights for local texture features. The dynamic fusion weights for global contour features; As a feature of fusion, For local texture features, This represents the global contour feature.
7. The image feature recognition method based on computer vision according to claim 6, characterized in that, In step S3, when the principal component analysis algorithm performs dimensionality reduction on the fused features, the covariance matrix of the fused features is: ; in, Let covariance matrix be the variance matrix. To fuse the original dimensions of features, For the matrix form of fused features, The mean vector of the fused features; For matrix transpose; for covariance matrix Eigenvalue decomposition is performed to obtain eigenvalues and eigenvectors. The eigenvalues are sorted from largest to smallest. Principal components with a cumulative contribution rate greater than a preset contribution rate threshold are selected. The fused features are projected onto the feature space formed by the selected principal components to obtain the dimensionality-reduced features.
8. The image feature recognition method based on computer vision according to claim 7, characterized in that, In step S4, the Euclidean distance for: ; The adaptive matching threshold is: ; in, Let Euclidean distance be the target feature set and the reference feature set. For feature dimension index, For the target feature set in the th Numerical values in dimensions For reference features in the first Numerical values in a dimension; For adaptive matching threshold, The mean Euclidean distance between the target feature set and all reference features in the preset feature library. The standard deviation of Euclidean distance. This is the threshold adjustment coefficient; when the Euclidean distance... Less than the adaptive matching threshold When the target feature set matches the corresponding reference feature, it is determined.
9. The image feature recognition method based on computer vision according to claim 8, characterized in that, In step S2, the construction of the Gaussian pyramid layer structure includes: performing Gaussian blur processing on the preprocessed image to obtain the first layer sub-image; performing Gaussian blur processing on the first layer sub-image to obtain the second layer sub-image; and so on, to obtain the third layer sub-image. Layered images.
10. The image feature recognition method based on computer vision according to claim 9, characterized in that, In step S4, the construction of the preset feature library includes: acquiring sample images, performing steps S1 to S3 sequentially on the sample images to obtain a sample feature set; and storing the sample feature set in association with sample category information to form a preset feature library.
Citation Information
Patent Citations
Pedestrian re-identification method based on weighted feature fusion
CN114639124A
PCB welding-free optical device positioning method
CN118823126A
Laser welding quality evaluation method
CN119313697A
Printing piece flaw detection method and system based on machine vision
CN120334236A
Cited By
Large hangar door operation area foreign matter detection method based on multi-scale feature fusion
CN121414762A
Foreign Object Detection Method for Large Hangar Door Operation Area Based on Multi-Scale Feature Fusion
CN121414762B
A welding robot positioning method and system based on visual feature matching
CN122391367A
A partial discharge detection and identification method and system based on PRPD pattern profile features
CN122412921A
