Image local fuzzy region detection method and device, equipment, medium and product
By dividing the image into sub-images and performing mirror filling, extracting high-frequency energy values and texture entropy, calculating sensitivity and weight coefficients, and fusing eigenvalues to screen out blurred areas, the detection reliability problem of deep learning methods in unknown distortion scenarios is solved, and efficient blurred area detection is achieved.
Patent Information
- Application Number
- CN202511096459.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-09-19
AI Technical Summary
Existing deep learning-based image blurred area detection methods have poor detection reliability under unknown distortion types and are difficult to adapt to unknown distortion types.
The original image is divided into multiple sub-images and mirrored and filled. The high-frequency energy value and texture entropy of each sub-image are extracted, the global mean and standard deviation are calculated, the energy sensitivity and entropy sensitivity are obtained, and the eigenvalues are fused through the weight coefficient to filter out the local fuzzy area.
By analyzing the statistical laws of the image itself, the detection reliability in unknown distortion scenes is significantly improved, the dependence on training data is eliminated, and blurred areas can be accurately judged.
Smart Images

Figure CN120673016A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital image processing, and in particular to a method, device, equipment, medium and product for detecting local blurred areas in an image. Background Art
[0002] In practical application scenarios such as industrial inspection, autonomous driving, and medical imaging, image blur area detection plays a vital role.
[0003] The detection of blurred areas in images is usually done using a detection method based on deep learning.
[0004] Although deep learning-based detection methods can automatically learn effective feature representations from data and handle various types of blur in complex scenarios, the generalization of the model is limited by the distribution of training data, making it difficult to adapt to unknown distortion types, resulting in poor reliability of detection results. Summary of the Invention
[0005] The purpose of this application is to provide a method, device, equipment, medium and product for detecting local blurred areas in an image, which can improve the reliability of local blurred area detection.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a method for detecting local blurred areas in an image, the method comprising:
[0008] Divide the original image into multiple sub-images and fill the insufficient border parts with mirror images;
[0009] Extract high-frequency energy value and texture entropy of each sub-image;
[0010] Calculate the global mean of the high-frequency energy value of the original image according to the high-frequency energy value of each sub-image;
[0011] Calculate the global mean and global standard deviation of the texture entropy of the original image based on the texture entropy of each sub-image;
[0012] The energy sensitivity of each sub-image is calculated based on the global average of the high-frequency energy value of each sub-image and the high-frequency energy value of the original image;
[0013] The entropy sensitivity of each sub-image is calculated based on the texture entropy of each sub-image, the global mean value and the global standard deviation of the texture entropy of the original image;
[0014] Obtaining an energy weight coefficient and an entropy weight coefficient for each sub-image according to the energy sensitivity and entropy sensitivity of each sub-image;
[0015] Normalize the high-frequency energy value and texture entropy of each sub-image separately;
[0016] The normalized high-frequency energy value and texture entropy of each sub-image are fused according to the energy weight coefficient and the entropy weight coefficient to obtain the fusion feature value of each sub-image;
[0017] Acquire a target sub-image whose fusion feature value is greater than a threshold;
[0018] The target sub-image is marked in the original image, where the target sub-image is a local blurred area in the original image.
[0019] In a second aspect, the present application provides a device for detecting local blurred areas of an image, the device comprising:
[0020] The division module is used to divide the original image into multiple sub-images and fill the insufficient border parts with mirror images;
[0021] An extraction module, used to extract the high-frequency energy value and texture entropy of each sub-image;
[0022] A first calculation module is used to calculate the global mean of the high-frequency energy value of the original image according to the high-frequency energy value of each sub-image;
[0023] The second calculation module is used to calculate the global mean and global standard deviation of the texture entropy of the original image according to the texture entropy of each sub-image;
[0024] A third calculation module is used to calculate the energy sensitivity of each sub-image according to the global average of the high-frequency energy value of each sub-image and the high-frequency energy value of the original image;
[0025] a fourth calculation module, configured to calculate the entropy sensitivity of each sub-image based on the texture entropy of each sub-image and the global mean and global standard deviation of the texture entropy of the original image;
[0026] A first acquisition module is used to acquire an energy weight coefficient and an entropy weight coefficient of each sub-image according to the energy sensitivity and entropy sensitivity of each sub-image;
[0027] Normalization module, used to normalize the high-frequency energy value and texture entropy of each sub-image;
[0028] The second acquisition module is used to fuse the normalized high-frequency energy value and texture entropy of each sub-image according to the energy weight coefficient and the entropy weight coefficient to obtain a fusion feature value of each sub-image;
[0029] A third acquisition module is used to obtain a target sub-image whose fusion feature value is greater than a threshold;
[0030] The marking module is used to mark the target sub-image in the original image, where the target sub-image is a local blurred area in the original image.
[0031] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0032] This application provides a method, apparatus, device, medium, and product for detecting local blurred areas in an image. The method includes: The method first divides the original image into sub-images and mirrors and fills the boundaries, providing uniform basic units for analysis without requiring pre-learning. The method then extracts the sub-images' inherent high-frequency energy (reflecting detail richness and high-frequency attenuation in blurred areas) and texture entropy (reflecting texture complexity and entropy decrease in blurred areas). These features are derived from the image's inherent pixel regularity and do not require deep learning models to learn from training data, thus completely eliminating the need for training data. To accurately identify blurred areas, the method calculates the global mean of high-frequency energy and texture entropy, along with their standard deviation, to establish a reference standard. The method then derives the energy sensitivity and entropy sensitivity of the sub-images, thereby quantifying the degree of deviation between local features and global features. This analysis framework, based on the image's inherent statistical regularity, does not pre-set rules for specific distortion types and can naturally adapt to unknown blurred scenes. Finally, the method determines weight coefficients based on the sensitivity, fuses the normalized high-frequency energy and texture entropy to obtain feature values, and uses a threshold to filter out the target sub-images and mark them as blurred areas. The entire process relies on the objective features and statistical laws of the image to complete detection, effectively solving the problem of insufficient generalization of deep learning methods and significantly improving the detection reliability in unknown distortion scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 is a flowchart of a method for detecting local blurred areas of an image according to an exemplary embodiment;
[0035] Figure 2 is a schematic diagram of a DCT high frequency region according to an exemplary embodiment;
[0036] Figure 3 is a histogram of LBP values of a clear sub-image according to an exemplary embodiment;
[0037] Figure 4 is a histogram of LBP values of a blurred sub-image according to an exemplary embodiment;
[0038] Figure 5 is a schematic diagram of an original image according to an exemplary embodiment;
[0039] Figure 6 According to an exemplary embodiment Figure 5 Schematic diagram of the blurred area in the original image;
[0040] Figure 7 A schematic diagram of the functional modules of a device for detecting local blurred areas in an image provided by an embodiment of the present application;
[0041] Figure 8 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0043] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0044] Image local blur detection has a wide range of applications in multiple fields. In photography, it can help photographers accurately detect local blur in photos caused by various reasons, allowing for targeted repair or adjustment. In security monitoring, it can quickly identify partially obscured or blurred areas in the surveillance image due to special circumstances, assisting in determining whether there are abnormal behaviors. In medical imaging, it helps doctors accurately locate local blur in X-ray, CT, and other images that may be caused by pathological changes or equipment problems, thus avoiding misdiagnosis. In industrial testing, it can detect local blur in product surface images to promptly identify production defects. It can also diagnose equipment failures through local blur in equipment operation images, ensuring the smooth progress of the production process.
[0045] The commonly used methods for detecting blurred areas in images mainly include traditional methods based on gradient operators (such as Sobel and Laplacian), detection methods based on deep learning, and detection methods based on frequency domain features or texture features.
[0046] When performing detection based on the gradient operator method, its calculation speed is fast and suitable for real-time processing, but it is sensitive to noise and the threshold also needs to be manually adjusted. If the image is distorted or the color change is small, it is easily affected by edge distortion, resulting in false detection.
[0047] Detection methods based on deep learning can automatically learn the most effective feature representation from data and can handle various types of blur in complex scenarios. However, they rely on a large amount of labeled data, and the generalization of the model is limited by the distribution of training data, making it difficult to adapt to unknown distortion types.
[0048] Detection methods based on frequency domain features or texture features have low computational complexity, clear physical meaning, and are easy to debug. However, simple frequency domain or texture feature detection is insensitive to low-frequency blur and is easily affected by noise.
[0049] The above detection methods have certain shortcomings in terms of algorithm complexity, data cost, sensitivity to noise, and sensitivity to low-frequency blur. How to achieve accurate detection of blurred areas in distorted images without relying on pre-trained models and effectively integrate the frequency domain energy attenuation characteristics and texture complexity change characteristics to improve detection reliability is a problem that needs to be solved at present.
[0050] Figure 1 FIG. 1 is a flow chart of a method for detecting local blurred areas of an image according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps S101-S1011:
[0051] In step S101 , the original image is divided into a plurality of sub-images, and the insufficient border portions are filled with mirror images.
[0052] This step, called image segmentation preprocessing, divides the original image into multiple sub-images. This allows for a more detailed analysis of local features. Because blurry areas in an image may only exist locally, segmentation can transform a global problem into a local one, facilitating independent feature extraction and analysis of each local area, improving detection accuracy and efficiency.
[0053] When detecting locally blurred areas in an image, image distortion significantly impacts the detection results. However, image distortion can be unevenly distributed across the entire image. By dividing the image into multiple sub-images, each sub-image is relatively small, which reduces the impact of distortion within each sub-image. This reduces the degree of distortion within the local area relative to the overall image, making it easier to analyze and process. For example, in an image with barrel distortion due to lens distortion, the degree of barrel distortion within each sub-image after segmentation is less than that of the overall image. This eliminates the effect of distortion on local features and facilitates more accurate detection of blurred areas.
[0054] In order to reduce the impact of image distortion on the detection results, in the present disclosure, the image is divided into blocks to divide the original image into multiple sub-images, and the insufficient boundary parts are mirrored and filled.
[0055] Specifically, a fixed-size window, for example, 40×40 pixels, is used. Starting from the upper left corner of the image, the window is slid across the image from left to right and from top to bottom, dividing the image into non-overlapping sub-images (overlapping is also possible as needed). If the width or height of the image is not an integer multiple of 40, then portions smaller than 40×40 pixels will appear at the right and bottom borders of the image.
[0056] For the right and bottom borders of the image that are less than 40×40 pixels in size, they are supplemented by mirroring. Taking the right border as an example, assuming that the width of the last sub-image in the horizontal direction is less than 40 pixels, then the rightmost column of pixels of the sub-image is copied and expanded to the right in a mirrored manner until the width of the sub-image reaches 40 pixels. The same is true in the vertical direction. If the height of the last sub-image in the vertical direction is less than 40 pixels, the bottom row of pixels is mirrored downward to make its height reach 40 pixels. For the lower right corner, if it is insufficient in both the horizontal and vertical directions, it is filled by mirroring in the horizontal and vertical directions respectively.
[0057] After segmentation, the degree of distortion within each sub-image is reduced relative to the overall image. This is because the sub-images are smaller, and the local impact and extent of distortion are relatively limited. Furthermore, mirror padding provides more complete contextual information for processing boundary sub-images, which helps to mitigate the interference of distortion on local feature extraction in boundary regions.
[0058] In step S102 , the high-frequency energy value and texture entropy of each sub-image are extracted.
[0059] In the frequency domain, energy distribution can reflect the frequency characteristics of an image. Blur typically causes a decrease in high-frequency information and a relative increase in low-frequency information. By analyzing the frequency domain energy distribution, we can capture the frequency variation caused by blur, providing a basis for detecting blurred areas. Texture entropy is a characteristic metric used to describe the complexity and randomness of image textures. In blurred areas, the texture generally becomes smoother, while the detail and complexity of the texture decrease. By calculating the texture entropy of a sub-image, we can quantify this texture variation, thereby detecting blurred areas from a textural perspective.
[0060] In one embodiment, the above step of extracting the high-frequency energy value of each sub-image includes performing the following sub-steps A1-A3 on each sub-image:
[0061] A1. Perform discrete cosine transform on the current sub-image to obtain a transformation image.
[0062] The Discrete Cosine Transform (DCT) is a mathematical transformation method that converts time-domain or spatial-domain signals into the frequency domain. It converts an image from the spatial domain to the frequency domain, decomposing the image information into components of different frequencies. These components contain different image characteristics. For example, low-frequency components typically correspond to the overall brightness and general outline of the image, while high-frequency components correspond to image details, edges, and texture.
[0063] For the current sub-image, consider it as a two-dimensional matrix composed of pixel values. DCT decomposes the current sub-image into a combination of a series of cosine functions of different frequencies.
[0064] After the DCT operation, a transform graph is generated. Each element in this transform graph corresponds to the DCT coefficient at a different frequency, and each element corresponds to the DCT coefficient of a pixel. The upper left corner of the transform graph typically contains low-frequency information of the image, representing the overall brightness and general outline of the image; while the lower right corner mainly contains high-frequency information related to image details, edges, and texture.
[0065] A2. Obtain the high-frequency image region corresponding to the high-frequency component in the transformation image.
[0066] In the resulting transform map, high-frequency components are the coefficients corresponding to rapidly changing parts of the image. Edges, textures, and details in an image have drastic changes in pixel values, and after the DCT transform, these changes are reflected in the high-frequency components of the transform map.
[0067] To identify high-frequency image regions, we need to segment them based on the frequency distribution characteristics of the transform image. Generally, we can distinguish high-frequency from low-frequency components by setting a threshold. For example, we can determine a frequency value as the threshold based on experience or prior knowledge of the image. Image regions corresponding to coefficients with frequencies above this threshold are considered high-frequency image regions.
[0068] Another common method is to roughly divide the high-frequency area according to the position of the transformation image. Usually, the lower right corner of the transformation image corresponds to the high-frequency component, so the lower right corner of the transformation image can be directly taken as the high-frequency image area, that is, Figure 2 As shown, the lower right 1 / 4 area (the area selected by the white rectangular box in the figure) is cut out as the high-frequency image area, wherein the white mark is the high-frequency area in the selected sub-image.
[0069] A3. Calculate the energy value of the high-frequency image region. The energy value of the high-frequency image region is the high-frequency energy value.
[0070] The energy value of the high-frequency image region is an indicator used to measure the importance and characteristics of the region. It can be obtained by summing the squares of the DCT coefficients corresponding to each pixel in the high-frequency image region, as shown in the following formula:
[0071] E DCT =∑ a,b∈Ω |C (a,b) | 2 ;
[0072] Among them, Ω represents the high frequency region, C (a,b) Represents the DCT coefficient of the pixel point with the horizontal coordinate a and the vertical coordinate b.
[0073] The reason for this calculation is that in the frequency domain, the square of the coefficient is proportional to the energy carried by the frequency component. By summing the squares of all the coefficients in the high-frequency region, we can get a value that reflects the overall energy of the high-frequency image region.
[0074] This energy value is the high-frequency energy value. It reflects the richness of detail and edge information in the image. A high high-frequency energy value indicates that the image contains more details and edges and is relatively complex. Conversely, a low high-frequency energy value indicates that the image is relatively smooth and has fewer details and edges. In image analysis, processing, and recognition tasks, high-frequency energy value is a very important feature parameter that can help distinguish different images or perform operations such as image classification and detection.
[0075] In one embodiment, extracting the texture entropy of each sub-image includes performing the following sub-steps B1-B3 on each sub-image:
[0076] B1. Obtain the texture feature value of each pixel in the current sub-image.
[0077] For example, a local binary pattern may be used to obtain the texture feature value of each pixel in the current sub-image.
[0078] Local Binary Pattern (LBP): For each pixel in the current sub-image, a neighborhood is selected with it as the center. Typically, a circular neighborhood with a radius of 1 and containing 8 neighboring pixels is used. The grayscale values of the pixels in the neighborhood are compared with the grayscale value of the central pixel. If the grayscale value of the neighboring pixel is greater than or equal to the grayscale value of the central pixel, it is recorded as 1, otherwise it is recorded as 0. These binary values are connected in a certain order (such as clockwise or counterclockwise) to form a binary code. This binary code is converted into a decimal number as the LBP value of the pixel. By calculating the LBP value for all pixels in the current sub-image, the texture feature value of the current sub-image can be obtained.
[0079] B2. Obtain the histogram of the current sub-image based on the texture feature value.
[0080] For the texture eigenvalues calculated for the current sub-image, a histogram is generated. The histogram counts the frequency of occurrence of different texture eigenvalues and reflects the probability distribution of the texture eigenvalues of the current sub-image.
[0081] Continuing with the above example, for the current sub-image, the frequency of all possible LBP values in the current sub-image is counted to form a histogram of the current sub-image. The horizontal axis of the histogram represents the LBP value, and the vertical axis represents the frequency of occurrence of that LBP value in the current sub-image. If the frequency of a certain LBP value in the histogram is high, it indicates that the current sub-image contains a large number of uniform regions (i.e., regions in the image with gentle grayscale changes and high local consistency). If the overall distribution of the histogram is relatively uniform, it indicates that the texture within the current sub-image is relatively complex.
[0082] Take the texture feature value as an example, LBP value, Figure 3 The following is a histogram of the LBP value of the clear sub-image: Figure 4 Shown is a histogram of the LBP values of the blurred sub-image.
[0083] B3. Obtain the texture entropy of the current sub-image according to the histogram.
[0084] In one embodiment, the above step B3 obtains the texture entropy of the current sub-image according to the histogram, including the following sub-steps B31-B32:
[0085] B31. Normalize the histogram.
[0086] After obtaining the histogram of the current sub-image, continue with the above example:
[0087] When performing histogram normalization, the frequency of each LBP value in the histogram can be divided by the sum of the frequencies of all LBP values to obtain the normalized probability of the LBP value corresponding to each LBP value. In this way, the frequency of each LBP value in the histogram is converted into a probability, achieving histogram normalization.
[0088] B32. Obtain the texture entropy of the current sub-image according to the normalized histogram.
[0089] Texture entropy is an indicator to measure information uncertainty. In texture analysis, the larger the texture entropy, the more complex and disordered the texture; the smaller the texture entropy, the more regular and simple the texture.
[0090] The calculation formula for the texture entropy of the current sub-image is:
[0091]
[0092] Among them, p nis the normalized probability of the nth LBP value in the current sub-image, and N is the number of LBP value types in the current sub-image.
[0093] In step S103 , a global mean of the high-frequency energy values of the original image is calculated according to the high-frequency energy values of each sub-image.
[0094] Specifically, the global mean of the high-frequency energy value of the original image is calculated using the following formula:
[0095]
[0096] Among them, mean_E DCT Represents the global mean of the high-frequency energy value of the original image, M represents the number of sub-images, (E DCT ) i Represents the high-frequency energy value of the i-th sub-image.
[0097] In step S104, the global mean and global standard deviation of the texture entropy of the original image are calculated according to the texture entropy of each sub-image.
[0098] Specifically, the global mean of the texture entropy of the original image is calculated using the following formula:
[0099]
[0100] The global standard deviation of the texture entropy of the original image is calculated using the following formula:
[0101]
[0102] Among them, mean_H LBP Represents the global mean of the texture entropy of the original image, M represents the number of sub-images, (H LBP ) i Indicates the texture entropy of the i-th sub-image, std_H LBP Represents the global standard deviation of the texture entropy of the original image.
[0103] In step S105 , the energy sensitivity of each sub-image is calculated according to the high-frequency energy value of each sub-image and the global average of the high-frequency energy value of the original image.
[0104] The energy sensitivity of each sub-image is calculated using the following formula:
[0105]
[0106] Among them, energy sensitivity mainly indicates the attenuation degree of high-frequency energy of the sub-image, (S e ) i represents the energy sensitivity of the i-th sub-image, (E DCT ) iRepresents the high-frequency energy value of the i-th sub-image, mean_E DCT It represents the global mean of the high-frequency energy values of the original image. k represents the steepness coefficient of the sigmoid curve, which can control the width of the blurred area. It is generally set to 10. c represents the energy attenuation threshold. When c = 0.6, the high-frequency energy loss exceeds 60%, and the human eye can clearly feel the blur of the image.
[0107] In step S106 , the entropy sensitivity of each sub-image is calculated according to the texture entropy of each sub-image and the global mean and global standard deviation of the texture entropy of the original image.
[0108] The entropy sensitivity of each sub-image is calculated using the following formula:
[0109]
[0110] Among them, (S t ) i represents the entropy sensitivity of the i-th sub-image, λ represents the response strength coefficient, which can control the response strength of the sensitivity function, generally taking 5, σ represents the adaptive threshold coefficient, which is used to adjust the strictness of the adaptive threshold. When the texture entropy H of the sub-image LBP Lower than mean_H LBP -σ×std_H LBP , then the area is considered to be blurred, (H LBP ) i Represents the texture entropy of the i-th sub-image, mean_H LBP Indicates the global mean of the texture entropy of the original image, std_H LBP Represents the global standard deviation of the texture entropy of the original image.
[0111] In step S107 , an energy weight coefficient and an entropy weight coefficient of each sub-image are obtained according to the energy sensitivity and entropy sensitivity of each sub-image.
[0112] The energy weight coefficient of each sub-image is obtained by the following formula:
[0113]
[0114] The entropy weight coefficient of each sub-image is obtained by the following formula:
[0115]
[0116] Among them, α i represents the energy weight coefficient of the i-th sub-image, (S e ) i represents the energy sensitivity of the i-th sub-image, (S t ) i represents the entropy sensitivity of the i-th sub-image, βi Represents the entropy weight coefficient of the i-th sub-image.
[0117] In step S108 , the high-frequency energy value and texture entropy of each sub-image are normalized respectively.
[0118] High-frequency energy primarily reflects the energy distribution of an image in the frequency domain and can capture global image features, such as smoothness and low-frequency information. Texture entropy, on the other hand, focuses on describing local texture features and is more sensitive to details such as edges and corners of objects in the image.
[0119] High-frequency energy or texture entropy alone may not fully and accurately describe blurred areas in an image. Fusion of high-frequency energy and texture entropy can leverage their combined strengths to more comprehensively describe image features and enhance the ability to express image content. For example, high-frequency energy is sensitive to frequency variations caused by blur but may be insensitive to changes in some texture details. Texture entropy, on the other hand, is sensitive to texture variations but may not accurately capture frequency variations. Fusion allows for a more comprehensive description of image blur.
[0120] Since high-frequency energy values and texture entropy may have different dimensions and value ranges, they need to be normalized separately before fusing them. Normalization can unify these eigenvalues into the range [0, 1], allowing different eigenvalues to be compared and combined at the same scale, thus avoiding the influence of certain features on the results due to data scale differences.
[0121] Specifically, when normalizing the high-frequency energy value of each sub-image, the minimum high-frequency energy value and the maximum high-frequency energy value among the high-frequency energy values of all sub-images can be obtained; the high-frequency energy value of each sub-image is normalized according to the minimum high-frequency energy value and the maximum high-frequency energy value. The high-frequency energy value can be normalized using the following formula:
[0122]
[0123] in, Represents the normalized high-frequency energy value of the i-th sub-image, (E DCT ) i Represents the high-frequency energy value of the i-th sub-image, (E DCT ) max Represents the maximum high-frequency energy value among all sub-images’ high-frequency energy values, (E DCT ) min Indicates the minimum high-frequency energy value among all sub-images.
[0124] Specifically, when normalizing the texture entropy of each sub-image, the minimum texture entropy and the maximum texture entropy among the texture entropies of all sub-images can be obtained, and the texture entropy of each sub-image can be normalized according to the minimum texture entropy and the maximum texture entropy. The normalization of the high-frequency energy value can be performed by the following formula:
[0125]
[0126] in, represents the normalized texture entropy of the i-th sub-image, (H LBP ) i represents the texture entropy of the i-th sub-image, (H LBP ) min represents the minimum texture entropy among all sub-images, (H LBP ) max Represents the maximum texture entropy among the texture entropies of all sub-images.
[0127] In step S109 , the normalized high-frequency energy value and texture entropy of each sub-image are fused according to the energy weight coefficient and the entropy weight coefficient to obtain a fused feature value of each sub-image.
[0128] The fusion feature value of each sub-image is obtained by the following formula:
[0129]
[0130] Among them, F i represents the fusion feature value of the i-th sub-image, α i represents the energy weight coefficient of the i-th sub-image, β i represents the entropy weight coefficient of the i-th sub-image, represents the normalized high-frequency energy value of the i-th sub-image, Represents the normalized texture entropy of the i-th sub-image.
[0131] The DCT and LBP algorithms used in this disclosure have low computational complexity and high detection accuracy, and are suitable for real-time detection scenarios.
[0132] In step S1010 , a target sub-image having a fusion feature value greater than a threshold is obtained.
[0133] A threshold is set, which is obtained empirically or through analysis of a large number of sample images. By comparing the fused feature value of each sub-image in the probability map with the threshold, sub-images with fused feature values greater than the threshold are selected as target sub-images. These target sub-images are considered to be the parts of the image most likely to contain local blurred areas.
[0134] The threshold value in the present disclosure can be tested based on the experience during the detection process. For example, the detector can first set a threshold value to see whether the result after annotation is what the detector wants. If not, the threshold value can be further modified according to the annotation result until it meets the detector's requirements.
[0135] Furthermore, in the present disclosure, the threshold can also be a dynamic threshold. This dynamic threshold is reflected in the fact that different thresholds are used for different original images. For example, if the threshold is 30%, the probability of the top 30% of the probability map of one image after sorting is greater than 0.5, while the top 30% of the probability map of another image is greater than 0.65, thus demonstrating a dynamic threshold.
[0136] When screening the target sub-images, the fusion feature values of the sub-images may be sorted, and then the target sub-images greater than a threshold value in the probability map may be obtained based on the sorting result.
[0137] In this step, the area corresponding to the sub-image with a probability higher than a threshold may be determined as a fuzzy area.
[0138] In step S1011 , a target sub-image is marked in the original image, where the target sub-image is a local blurred area in the original image.
[0139] The detected target sub-image is annotated in the original image to visually indicate which parts of the image are locally blurred. This annotation can be done by framing the target sub-image with a rectangle, circle, or other graphic, or by highlighting it with different colors or brightness levels. This allows the user to clearly see the location and extent of the blurred area in the image, providing a clear basis for subsequent image processing or analysis.
[0140] like Figure 5 and Figure 6 As shown, Figure 5 For the original picture, Figure 6 The area in the rectangular box is Figure 5 The blurred area in the original image.
[0141] In one implementation, step S105 of marking the target sub-image in the original image includes the following sub-steps C1-C3:
[0142] C1. Generate a binary mask image of the target sub-image.
[0143] A binary mask is a special image whose pixel values are only two, usually 0 and 1 (or black and white). The process of generating a binary mask is generally based on a certain threshold segmentation algorithm. For the target sub-image, an appropriate threshold is first determined. Then, pixels in the target sub-image with a value greater than or equal to the threshold are set to 1 (or white), and pixels with a value less than the threshold are set to 0 (or black). In this way, the area of interest in the image (such as the area where the target sub-image is located) can be distinguished from the background area, forming a binary mask image. The binary mask can more clearly highlight the outline and position of the target sub-image.
[0144] C2. Obtain the outline of the binary mask image.
[0145] C3. Marking the outline of the binary mask image in the original image, wherein the area within the outline is the local blurred area in the original image.
[0146] In another implementation, step S105 of marking the target sub-image in the original image includes the following steps D1-D5:
[0147] D1. Fill the holes in the target sub-image to obtain a filled image.
[0148] In the target sub-image, there may be some "hole" areas caused by various reasons (such as occlusion by objects, noise from the image acquisition device, loss during data transmission, etc.). These hole areas are manifested as missing or abnormal pixel values in the image. The purpose of hole filling is to use a certain algorithm to fill these holes using the pixel information around the holes to make the target sub-image complete. Common hole filling algorithms calculate reasonable pixel values to fill the holes based on the grayscale values, texture and other features of the pixels around the holes. For example, in a binary image, if there is a white hole in a black area, the hole filling algorithm will fill the white hole with black, making the black area a continuous and complete area. After the hole filling process, the obtained filled image eliminates these holes, providing a higher quality image foundation for subsequent processing.
[0149] D2. De-noise the filled image to obtain a denoised image.
[0150] The padded image may still contain noise, which can be of various types, such as Gaussian noise and salt and pepper noise. Noise can interfere with the normal features of the image, affecting subsequent analysis and processing. The goal of denoising is to remove or attenuate this noise through various denoising algorithms. For example, Gaussian filtering is often used to denoise Gaussian noise. This method smoothes and attenuates the effects of noise by taking a weighted average of each pixel in the image and its neighboring pixels. For salt and pepper noise, median filtering is a common method. It replaces the value of each pixel with the median of its neighboring pixels, effectively removing noise points. After denoising, the resulting denoised image is clearer, and the true features in the image are more accurately presented, facilitating subsequent annotation operations.
[0151] D3. Generate a binary mask for the denoised image.
[0152] D4. Obtain the outline of the binary mask image.
[0153] D5. Mark the outline of the binary mask image in the original image, wherein the area within the outline is the local blurred area in the original image.
[0154] The present invention first divides the original image into sub-images and mirrors and fills the boundaries to provide a uniform basic unit for analysis without the need for pre-learning. It then extracts the sub-image's inherent high-frequency energy value (reflecting the richness of details, high-frequency attenuation in blurred areas) and texture entropy (reflecting texture complexity, and decreased entropy in blurred areas). These features are derived from the image's own pixel regularity and do not require learning from training data through a deep learning model, completely getting rid of dependence on training data. In order to accurately judge the blurred area, the solution establishes a reference standard by calculating the global mean of high-frequency energy, the global mean of texture entropy, and the standard deviation, and then derives the energy sensitivity and entropy sensitivity of the sub-image to quantify the degree of deviation between local features and global features. This analysis framework based on the image's own statistical laws does not preset rules for specific distortion types and can naturally adapt to unknown blurred scenes. Finally, the solution determines the weight coefficient based on the sensitivity, fuses the normalized high-frequency energy value and texture entropy to obtain the feature value, and filters out the target sub-image through the threshold and marks it as a blurred area. The entire process relies on the objective characteristics and statistical laws of the image to complete the detection, effectively solving the problem of insufficient generalization of deep learning methods and significantly improving the detection reliability in unknown distortion scenes.
[0155] Based on the same inventive concept, the present application also provides an apparatus for detecting local blurred areas in an image for implementing the aforementioned method for detecting local blurred areas in an image. The solution provided by this apparatus is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more embodiments of the apparatus for detecting local blurred areas in an image provided below can be found in the limitations of the method for detecting local blurred areas in an image, and will not be further elaborated here.
[0156] Figure 7 According to an exemplary embodiment, a device for detecting a local blurred area of an image is shown, and the device for detecting a local blurred area of an image includes:
[0157] The division module 11 is used to divide the original image into multiple sub-images and perform mirror filling on the insufficient border parts;
[0158] Extraction module 12, used to extract high-frequency energy value and texture entropy of each sub-image;
[0159] A first calculation module 13 is configured to calculate a global mean of the high-frequency energy values of the original image based on the high-frequency energy values of each sub-image;
[0160] A second calculation module 14 is configured to calculate a global mean and a global standard deviation of the texture entropy of the original image based on the texture entropy of each sub-image;
[0161] A third calculation module 15 is used to calculate the energy sensitivity of each sub-image based on the global average of the high-frequency energy value of each sub-image and the high-frequency energy value of the original image;
[0162] A fourth calculation module 16 is configured to calculate the entropy sensitivity of each sub-image based on the texture entropy of each sub-image and the global mean and global standard deviation of the texture entropy of the original image;
[0163] A first acquisition module 17 is configured to acquire an energy weight coefficient and an entropy weight coefficient of each sub-image according to the energy sensitivity and entropy sensitivity of each sub-image;
[0164] A normalization module 18 is used to normalize the high-frequency energy value and texture entropy of each sub-image;
[0165] The second acquisition module 19 is used to fuse the normalized high-frequency energy value and texture entropy of each sub-image according to the energy weight coefficient and the entropy weight coefficient to obtain a fusion feature value of each sub-image;
[0166] A third acquisition module 20 is used to obtain a target sub-image whose fusion feature value is greater than a threshold;
[0167] The marking module 21 is configured to mark the target sub-image in the original image, where the target sub-image is a local blurred area in the original image.
[0168] In one embodiment, the first calculation module 13 is specifically configured to:
[0169] The global mean of the high-frequency energy value of the original image is calculated using the following formula:
[0170]
[0171] Among them, mean_E DCT Represents the global mean of the high-frequency energy value of the original image, M represents the number of sub-images, (E DCT ) i Represents the high-frequency energy value of the i-th sub-image.
[0172] In one embodiment, the second calculation module 14 is specifically configured to:
[0173] The global mean of the texture entropy of the original image is calculated using the following formula:
[0174]
[0175] The global standard deviation of the texture entropy of the original image is calculated using the following formula:
[0176]
[0177] Among them, mean_H LBP Represents the global mean of the texture entropy of the original image, M represents the number of sub-images, (H LBP ) i Indicates the texture entropy of the i-th sub-image, std_H LBP Represents the global standard deviation of the texture entropy of the original image.
[0178] In one embodiment, the third calculation module 15 is specifically configured to:
[0179] The energy sensitivity of each sub-image is calculated using the following formula:
[0180]
[0181] Among them, (S e ) i represents the energy sensitivity of the i-th sub-image, (E DCT ) i Represents the high-frequency energy value of the i-th sub-image, mean_E DCT It represents the global mean of the high-frequency energy value of the original image, k represents the steepness coefficient of the sigmoid curve, and c represents the energy attenuation threshold.
[0182] In one embodiment, the fourth calculation module 16 is specifically configured to:
[0183] The entropy sensitivity of each sub-image is calculated using the following formula:
[0184]
[0185] Among them, (S t ) i represents the entropy sensitivity of the ith sub-image, λ represents the response strength coefficient, σ represents the adaptive threshold coefficient, (H LBP ) i Represents the texture entropy of the i-th sub-image, mean_H LBP Indicates the global mean of the texture entropy of the original image, std_H LBP Represents the global standard deviation of the texture entropy of the original image.
[0186] In one embodiment, the first acquisition module 17 is specifically configured to:
[0187] The energy weight coefficient of each sub-image is obtained by the following formula:
[0188]
[0189] The entropy weight coefficient of each sub-image is obtained by the following formula:
[0190]
[0191] Among them, α i represents the energy weight coefficient of the i-th sub-image, (S e ) i represents the energy sensitivity of the i-th sub-image, (S t ) i represents the entropy sensitivity of the i-th sub-image, β i Represents the entropy weight coefficient of the i-th sub-image.
[0192] In one embodiment, the normalization module 18 is specifically configured to:
[0193] Obtaining the minimum high-frequency energy value and the maximum high-frequency energy value among the high-frequency energy values of all sub-images;
[0194] Normalizing the high-frequency energy value of each sub-image according to the minimum high-frequency energy value and the maximum high-frequency energy value;
[0195] Obtain the minimum texture entropy and the maximum texture entropy among the texture entropies of all sub-images;
[0196] The texture entropy of each sub-image is normalized according to the minimum texture entropy and the maximum texture entropy.
[0197] In one embodiment, the second acquisition module 19 is specifically configured to:
[0198] The fusion feature value of each sub-image is obtained by the following formula:
[0199]
[0200] Among them, F i represents the fusion feature value of the i-th sub-image, α i represents the energy weight coefficient of the i-th sub-image, β i represents the entropy weight coefficient of the i-th sub-image, represents the normalized high-frequency energy value of the i-th sub-image, Represents the normalized texture entropy of the i-th sub-image.
[0201] In one embodiment, in terms of marking the target sub-image in the original image, the marking module 21 is specifically configured to:
[0202] generating a binary mask image of the target sub-image;
[0203] Obtaining the outline of the binary mask image;
[0204] The outline of the binary mask image is marked in the original image, wherein the area within the outline is the local blurred area in the original image.
[0205] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for detecting local blurred areas of an image is implemented.
[0206] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0207] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0208] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0209] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0210] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0211] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0212] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
[0213] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0214] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for detecting local blurred areas in an image, characterized in that: The method for detecting local blurred areas of an image comprises: Divide the original image into multiple sub-images and fill the insufficient border parts with mirror images; Extract high-frequency energy value and texture entropy of each sub-image; Calculate the global mean of the high-frequency energy value of the original image according to the high-frequency energy value of each sub-image; Calculate the global mean and global standard deviation of the texture entropy of the original image based on the texture entropy of each sub-image; The energy sensitivity of each sub-image is calculated based on the global average of the high-frequency energy value of each sub-image and the high-frequency energy value of the original image; The entropy sensitivity of each sub-image is calculated based on the texture entropy of each sub-image, the global mean value and the global standard deviation of the texture entropy of the original image; Obtaining an energy weight coefficient and an entropy weight coefficient for each sub-image according to the energy sensitivity and entropy sensitivity of each sub-image; Normalize the high-frequency energy value and texture entropy of each sub-image separately; The normalized high-frequency energy value and texture entropy of each sub-image are fused according to the energy weight coefficient and the entropy weight coefficient to obtain the fusion feature value of each sub-image; Obtain the target sub-image whose fusion feature value is greater than the threshold; A target sub-image is marked in the original image, where the target sub-image is a local blurred area in the original image.
2. The method for detecting local blurred areas of an image according to claim 1, wherein: Calculating the global mean of the high-frequency energy values of the original image according to the high-frequency energy values of each sub-image includes: The global mean of the high-frequency energy value of the original image is calculated using the following formula: Among them, mean_E DCT Represents the global mean of the high-frequency energy value of the original image, M represents the number of sub-images, (E DCT ) i Represents the high-frequency energy value of the i-th sub-image.
3. The method for detecting local blurred areas of an image according to claim 2, wherein: The step of calculating the global mean and global standard deviation of the texture entropy of the original image according to the texture entropy of each sub-image includes: The global mean of the texture entropy of the original image is calculated using the following formula: The global standard deviation of the texture entropy of the original image is calculated using the following formula: Among them, mean_H LBP Represents the global mean of the texture entropy of the original image, M represents the number of sub-images, (H LBP ) i Indicates the texture entropy of the i-th sub-image, std_H LBP Represents the global standard deviation of the texture entropy of the original image.
4. The method for detecting local blurred areas of an image according to claim 3, wherein: The step of calculating the energy sensitivity of each sub-image according to the global average of the high-frequency energy value of each sub-image and the high-frequency energy value of the original image includes: The energy sensitivity of each sub-image is calculated using the following formula: Among them, (S e ) i represents the energy sensitivity of the i-th sub-image, (E DCT ) i Represents the high-frequency energy value of the i-th sub-image, mean_E DCT It represents the global mean of the high-frequency energy value of the original image, k represents the steepness coefficient of the sigmoid curve, and c represents the energy attenuation threshold.
5. The method for detecting local blurred areas of an image according to claim 4, wherein: The step of calculating the entropy sensitivity of each sub-image according to the texture entropy of each sub-image and the global mean and global standard deviation of the texture entropy of the original image includes: The entropy sensitivity of each sub-image is calculated using the following formula: Among them, (S t ) i represents the entropy sensitivity of the ith sub-image, λ represents the response strength coefficient, σ represents the adaptive threshold coefficient, (H LBP ) i Represents the texture entropy of the i-th sub-image, mean_H LBP Indicates the global mean of the texture entropy of the original image, std_H LBP Represents the global standard deviation of the texture entropy of the original image.
6. The method for detecting local blurred areas of an image according to claim 5, wherein: The step of obtaining an energy weight coefficient and an entropy weight coefficient of each sub-image according to the energy sensitivity and entropy sensitivity of each sub-image includes: The energy weight coefficient of each sub-image is obtained by the following formula: The entropy weight coefficient of each sub-image is obtained by the following formula: Among them, α i represents the energy weight coefficient of the i-th sub-image, (S e ) i represents the energy sensitivity of the i-th sub-image, (S t ) i represents the entropy sensitivity of the i-th sub-image, β i Represents the entropy weight coefficient of the i-th sub-image.
7. The method according to claim 6, characterized in that Normalizing the high-frequency energy value and texture entropy of each sub-image separately includes: Obtaining the minimum high-frequency energy value and the maximum high-frequency energy value among the high-frequency energy values of all sub-images; Normalizing the high-frequency energy value of each sub-image according to the minimum high-frequency energy value and the maximum high-frequency energy value; Obtain the minimum texture entropy and the maximum texture entropy among the texture entropies of all sub-images; The texture entropy of each sub-image is normalized according to the minimum texture entropy and the maximum texture entropy.
8. The method for detecting local blurred areas of an image according to claim 7, wherein: The step of fusing the normalized high-frequency energy value and texture entropy of each sub-image according to the energy weight coefficient and the entropy weight coefficient to obtain the fused feature value of each sub-image includes: The fusion feature value of each sub-image is obtained by the following formula: Among them, F i represents the fusion feature value of the i-th sub-image, α i represents the energy weight coefficient of the i-th sub-image, β i represents the entropy weight coefficient of the i-th sub-image, represents the normalized high-frequency energy value of the i-th sub-image, Represents the normalized texture entropy of the i-th sub-image.
9. The method for detecting local blurred areas of an image according to claim 8, wherein: The step of marking the target sub-image in the original image includes: Generate a binary mask image of the target sub-image; Get the outline of the binary mask image; The outline of the binary mask image is marked in the original image, wherein the area within the outline is the local blurred area in the original image.
10. An image local blur area detection device, characterized in that: The device for detecting local blurred areas of an image comprises: The division module is used to divide the original image into multiple sub-images and fill the insufficient border parts with mirror images; An extraction module, used to extract the high-frequency energy value and texture entropy of each sub-image; A first calculation module is used to calculate the global mean of the high-frequency energy value of the original image according to the high-frequency energy value of each sub-image; The second calculation module is used to calculate the global mean and global standard deviation of the texture entropy of the original image according to the texture entropy of each sub-image; A third calculation module is used to calculate the energy sensitivity of each sub-image according to the global average of the high-frequency energy value of each sub-image and the high-frequency energy value of the original image; a fourth calculation module, configured to calculate the entropy sensitivity of each sub-image based on the texture entropy of each sub-image and the global mean and global standard deviation of the texture entropy of the original image; A first acquisition module is used to acquire an energy weight coefficient and an entropy weight coefficient of each sub-image according to the energy sensitivity and entropy sensitivity of each sub-image; Normalization module, used to normalize the high-frequency energy value and texture entropy of each sub-image; The second acquisition module is used to fuse the normalized high-frequency energy value and texture entropy of each sub-image according to the energy weight coefficient and the entropy weight coefficient to obtain a fusion feature value of each sub-image; A third acquisition module is used to obtain a target sub-image whose fusion feature value is greater than a threshold; The marking module is used to mark the target sub-image in the original image, where the target sub-image is a local blurred area in the original image.
Citation Information
Cited By
Corrugated board degumming detection method and system based on infrared thermal imaging
CN121437424A
Endoscope imaging method and system
CN121582617A