Image occlusion detection method and device

By combining Laplace variance, TOP-K grayscale ratio, information entropy and regional analysis algorithms, the detection order can be flexibly adjusted, which solves the misjudgment problem of image occlusion detection in light-sensitive and nighttime environments in the existing technology, and achieves highly accurate and robust image occlusion detection.

CN120783057AActive Publication Date: 2025-10-14SUZHOU YIJI INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511198333.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-10-14
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

Existing image occlusion detection methods based on the proportion of grayscale pixels in a single frame fail in light-sensitive and nighttime environments, have a high misjudgment rate, poor robustness, and are difficult to adapt to lighting changes and scene switching.

Method used

A combination of Laplace variance algorithm, TOP-K grayscale ratio algorithm, information entropy algorithm and regional analysis algorithm is adopted. By flexibly adjusting the detection order and integrating multiple image occlusion detection algorithms, it is determined in turn whether the image is occluded.

Benefits of technology

It improves the accuracy and adaptability of image occlusion detection, reduces the misjudgment rate, can cope with complex and dynamic occlusion scenes, and avoids misjudgment caused by a single feature.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120783057A_ABST
    Figure CN120783057A_ABST
Patent Text Reader

Abstract

The invention provides an image occlusion detection method and device, and the method comprises the steps: obtaining an image occlusion detection algorithm call parameter, and determining the detection sequence of a plurality of image occlusion detection algorithms according to the image occlusion detection algorithm call parameter, the image occlusion detection algorithms including a Laplace variance algorithm, a TOP-K gray scale ratio algorithm, an information entropy algorithm and a region analysis algorithm; acquiring a to-be-detected image, and based on the detection sequence, sequentially adopting multiple image occlusion detection algorithms to judge whether the to-be-detected image is occluded, and when the previous adjacent detection algorithm judges that the to-be-detected image is occluded, continuing to execute the judgment of the next detection algorithm on the to-be-detected image; and when the previous adjacent detection algorithm judges that the to-be-detected image is not shielded, stopping executing the judgment of the remaining detection algorithms on the to-be-detected image, and directly determining that the to-be-detected image is not shielded. According to the method and the device, the detection sequence of the detection algorithm can be flexibly adjusted, so that whether the to-be-detected image is shielded or not can be quickly and accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image detection, and in particular to an image occlusion detection method and device. Background Art

[0002] Camera occlusion detection is a key technology for ensuring the reliable operation of vision systems. It aims to identify in real time whether the lens is blocked by foreign objects, causing imaging failure. Current mainstream methods rely on the statistical analysis of the grayscale ratio of pixels in a single grayscale image. This method calculates the proportion of dark (or bright) pixels in the image that are below (or above) a fixed threshold. If this exceeds the preset value, occlusion is considered.

[0003] However, this approach has significant limitations:

[0004] (1) Single features and high misjudgment rate: It is difficult to distinguish real occlusions (such as stains) from large dark areas in normal scenes (such as shadows and dark objects) based solely on the global grayscale ratio, which can easily lead to false positives. At the same time, it is insensitive to local or complex texture occlusions and is prone to missed positives.

[0005] (2) Complete failure at night: Normal images at night are generally dark, and the proportion of dark pixels is bound to be very high. This method will generally misjudge them as occlusions and cannot adapt to low-light environments.

[0006] (3) Poor robustness: It relies on a fixed threshold and is difficult to adapt to lighting changes and scene switching; it lacks the use of temporal information and is sensitive to instantaneous interference.

[0007] To sum up, the existing method based on the proportion of single-frame grayscale pixels has a single principle and is sensitive to light, especially in serious failure in nighttime environments, and has insufficient accuracy and adaptability. Therefore, the existing technology lacks an image occlusion detection method and device that can flexibly adjust the detection order of the detection algorithm to integrate multiple image occlusion detection algorithms to quickly and accurately detect whether the image to be detected is occluded. Summary of the Invention

[0008] Based on this, it is necessary to provide an image occlusion detection method and device that can flexibly adjust the detection order of the detection algorithm to integrate multiple image occlusion detection algorithms and quickly and accurately detect whether the image to be detected is occluded in order to address the above technical problems.

[0009] In a first aspect, the present invention provides an image occlusion detection method, the method comprising:

[0010] Get the image occlusion detection algorithm calling parameters;

[0011] Determine the detection order of multiple image occlusion detection algorithms based on the image occlusion detection algorithm call parameters. The image occlusion detection algorithms include the Laplace variance algorithm, the TOP-K grayscale ratio algorithm, the information entropy algorithm, and the regional analysis algorithm.

[0012] Obtain the image to be detected, and based on the detection order, use multiple image occlusion detection algorithms in sequence to determine whether the image to be detected is occluded;

[0013] When the adjacent previous image occlusion detection algorithm determines that the image to be detected is occluded, the next image occlusion detection algorithm is continued to judge the image to be detected;

[0014] When the adjacent previous image occlusion detection algorithm determines that the image to be detected is not occluded, the execution of the remaining image occlusion detection algorithms on the image to be detected is terminated, and it is directly determined that the image to be detected is not occluded.

[0015] Optionally, the TOP-K grayscale ratio algorithm includes:

[0016] Converting the image to be detected into a first grayscale image, and converting the first grayscale image into a corresponding first grayscale histogram;

[0017] Sort the grayscale values ​​corresponding to the first grayscale histogram according to the frequency of occurrence, and extract the K grayscale values ​​with the highest frequency of occurrence as the first target grayscale values;

[0018] Calculate the total number of pixels in the image to be detected, and take the ratio of the sum of the occurrence frequencies of each first target grayscale value to the total number of pixels as the occlusion ratio;

[0019] The occlusion ratio is compared with the preset grayscale ratio threshold to determine whether the image to be detected is occluded.

[0020] Optionally, after calculating the total number of pixels of the image to be detected and taking the ratio of the sum of the occurrence frequencies of each first target grayscale value to the total number of pixels as the occlusion ratio, the method further includes:

[0021] Calculating a brightness factor of the first grayscale image;

[0022] Adjust the preset grayscale ratio threshold based on the brightness factor, low brightness factor threshold, and high brightness factor threshold.

[0023] Optionally, adjusting the preset grayscale ratio threshold according to the brightness factor, the low brightness factor threshold, and the high brightness factor threshold includes:

[0024] When the brightness factor is less than the low brightness factor threshold, adjusting the preset grayscale ratio threshold to the first preset grayscale ratio threshold;

[0025] When the brightness factor is greater than the high brightness factor threshold, the preset grayscale ratio threshold is adjusted to a second preset grayscale ratio threshold;

[0026] The first preset grayscale ratio threshold is smaller than the second preset grayscale ratio threshold.

[0027] Optionally, the information entropy algorithm includes:

[0028] Converting the image to be detected into a second grayscale image, and converting the second grayscale image into a corresponding second grayscale histogram;

[0029] Sort the grayscale values ​​corresponding to the second grayscale histogram according to the frequency of occurrence, and extract the K grayscale values ​​with the highest frequency of occurrence as the second target grayscale values;

[0030] Calculating the probability of each second target grayscale value based on the occurrence frequency of each second target grayscale value and the sum of the occurrence frequencies of each second target grayscale value;

[0031] According to the frequency of the second target grayscale value, the information entropy of the K second target grayscale values ​​is calculated, wherein the calculation formula of the information entropy of the K second target grayscale values ​​is:

[0032]

[0033] in, is the second target grayscale value, The second target gray value probability;

[0034] Whether the image to be detected is blocked is determined based on a preset information entropy threshold and the information entropy of the K second target grayscale values.

[0035] Optionally, the regional analysis algorithm includes:

[0036] The image to be detected is converted into a third grayscale image, and the center of mass O of the third grayscale image is calculated by the grayscale weighted centroid method, and O is used as the center of the circle according to the radius of the concentric ring. Equal gradient increasing method division concentric ring regions ,in, As the core ring, For the edge ring;

[0037] For each concentric ring area Execution: Use the Sobel operator to calculate the gradient amplitude of each pixel in the concentric ring area ; According to the gradient amplitude of each pixel point in the concentric ring area , construct the gradient-weighted third grayscale histogram; normalize the third grayscale histogram to obtain the probability distribution , calculate the concentric ring area The information entropy of the third gray image, wherein the calculation formula is: , ;

[0038] If , and , it is determined that the image to be detected is not blocked;

[0039] If and , it is determined that the image to be detected is locally blocked;

[0040] If and , the slope of the entropy change curve is calculated ; when , it is determined that the image to be detected is centrally concentrated overall blocked; when , it is determined that the image to be detected is uniformly dispersed overall blocked;

[0041] Wherein, is a normal texture entropy threshold; is a non-blocking tolerance; is a decay threshold; is an overall blocking tolerance; is a slope threshold; is the information entropy of the core ring; is the information entropy of the edge ring; is the radius of the core ring, the value of which is 1 / 10 to 1 / 6 of the short side of the third gray image; is the radius of the edge ring.

[0042] Optionally, the concentric ring radius , wherein, , , respectively, the width and height of the third gray image, is the total number of ring domains, and .

[0043] Optionally, according to the gradient amplitude of each pixel point in the concentric ring region , a gradient-weighted third gray histogram is constructed, comprising:

[0044] Grouping the pixels in the concentric ring region by gray level;

[0045] According to the gradient amplitude of each pixel point in the concentric ring region , the weight value of the gray level is calculated using the calculation formula: , wherein, is the pixel Gray value.

[0046] Optionally, after acquiring the image to be detected, the method further includes:

[0047] Calculate the brightness factor of the image to be detected;

[0048] When the brightness factor is less than the low brightness factor threshold, CLAHE contrast enhancement is performed on the image to be detected to improve details.

[0049] In a second aspect, the present invention provides an image occlusion detection device, which includes: a parameter configuration module, an algorithm sorting module and an image detection module; wherein,

[0050] Parameter configuration module, used to obtain the image occlusion detection algorithm calling parameters;

[0051] The algorithm sorting module is connected to the parameter configuration module and is used to call parameters according to the image occlusion detection algorithm and determine the detection order of multiple image occlusion detection algorithms. Among them, the image occlusion detection algorithms include Laplace variance algorithm, TOP-K grayscale ratio algorithm, information entropy algorithm and regional analysis algorithm;

[0052] The image detection module is connected to the algorithm sorting module, and is used to obtain the image to be detected, and based on the detection order, sequentially use multiple image occlusion detection algorithms to determine whether the image to be detected is occluded. When the adjacent previous image occlusion detection algorithm determines that the image to be detected is occluded, the next image occlusion detection algorithm is continued to be executed to determine the image to be detected; when the adjacent previous image occlusion detection algorithm determines that the image to be detected is not occluded, the execution of the remaining image occlusion detection algorithms on the image to be detected is terminated, and it is directly determined that the image to be detected is not occluded.

[0053] The image occlusion detection method and device provided by the present invention first obtain the calling parameters of the image occlusion detection algorithm, and determine the detection order of multiple image occlusion detection algorithms based on the parameters, wherein the image occlusion detection algorithms include the Laplace variance algorithm, the TOP-K grayscale ratio algorithm, the information entropy algorithm and the regional analysis algorithm; then obtain the image to be detected, and based on the detection order, sequentially use multiple image occlusion detection algorithms to determine whether the image to be detected is occluded, wherein when the adjacent previous detection algorithm determines that the image to be detected is occluded, the next detection algorithm continues to execute the judgment of the image to be detected; when the adjacent previous detection algorithm determines that the image to be detected is not occluded, the remaining detection algorithms are terminated to directly determine that the image to be detected is not occluded. The method and device of the present invention can flexibly adjust the detection order of the detection algorithms to integrate multiple image occlusion detection algorithms to quickly and accurately detect whether the image to be detected is occluded. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A schematic diagram of a flow chart of the image occlusion detection method provided by the present invention;

[0055] Figure 2 A schematic diagram of a flow chart of the TOP-K grayscale ratio algorithm in the image occlusion detection method provided by the present invention;

[0056] Figure 3 A schematic diagram of a flow chart of the information entropy algorithm in the image occlusion detection method provided by the present invention;

[0057] Figure 4 A schematic diagram of a circuit module structure of the image occlusion detection device provided by the present invention;

[0058] Figure 5 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0060] like Figure 1 As shown, the present invention provides an image occlusion detection method, the method comprising:

[0061] Step S11: Obtaining image occlusion detection algorithm calling parameters;

[0062] The image occlusion detection algorithm call parameters are pre-set by those skilled in the art and may include parameters corresponding to various image occlusion detection algorithms, such as interpretation power parameters and stability parameters. These interpretation power parameters and stability parameters may be pre-set by those skilled in the art or derived from a large model, and are not limited here. It should be understood that interpretation power refers to the image occlusion detection algorithm's ability to understand and analyze an image, while stability refers to the degree to which the image occlusion detection algorithm consistently outputs the correct result when determining whether an image is occluded.

[0063] Step S12: determining a detection order of multiple image occlusion detection algorithms according to image occlusion detection algorithm call parameters, wherein the image occlusion detection algorithms include a Laplace variance algorithm, a TOP-K grayscale ratio algorithm, an information entropy algorithm, and a regional analysis algorithm;

[0064] In the present invention, the Laplace variance algorithm is the Laplace variance algorithm in the prior art, which will not be described in detail here.

[0065] Alternatively, as Figure 2 As shown, the TOP-K grayscale ratio algorithm in the present invention includes:

[0066] Step S21: converting the image to be detected into a first grayscale image, and converting the first grayscale image into a corresponding first grayscale histogram;

[0067] Alternatively, use cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) in OpenCV (a cross-platform computer vision and machine learning software library released under the Apache 2.0 license (open source)) to convert the image to be detected into a first grayscale image. cv2.cvtColor is an OpenCV function that performs color space conversion. The first argument is the input image to be detected, and the second argument is a color conversion code. cv2.COLOR_BGR2GRAY indicates conversion from the BGR color space to the grayscale color space.

[0068] Optionally, to convert the first grayscale image into a corresponding first grayscale histogram, you can use cv2.calcHist([gray_image], [0], None,

[256] , [0,256]) in OpenCV. Here, gray_image is the first grayscale image; [0] indicates the 0th grayscale channel; None is usually missing, indicating that the default window size and position are used to calculate the histogram;

[256] indicates that a histogram with a length of 256 is created, with grayscale values ​​ranging from 0 to 255; and [0,256] indicates the range of grayscale values.

[0069] Of course, those skilled in the art may also use other methods to convert the image to be detected into a first grayscale image, and convert the first grayscale image into a corresponding first grayscale histogram, which is not limited here.

[0070] Step S22: sorting the grayscale values ​​corresponding to the first grayscale histogram according to the frequency of occurrence, and extracting the K grayscale values ​​with the highest frequency of occurrence as the first target grayscale values;

[0071] In step S22 , the value of K can be flexibly set according to actual needs, for example: K=30, which is not limited here.

[0072] Step S23: Calculate the total number of pixels in the image to be detected, and take the ratio of the total frequency of occurrence of each first target gray value to the total number of pixels as the occlusion ratio;

[0073] Step S24: Compare the occlusion ratio with a preset grayscale ratio threshold to determine whether the image to be detected is occluded.

[0074] Specifically, the occlusion ratio can be calculated as follows:

[0075]

[0076] in, is the first target grayscale value, is the first target grayscale value probability; is the width of the first grayscale image, is the height of the first grayscale image.

[0077] When an image is occluded, the grayscale distribution becomes more concentrated, and the K most frequently occurring grayscale values ​​occupy more pixel area. This approach not only effectively determines whether an image is occluded, but also reduces the amount of analysis and calculation, improving its efficiency.

[0078] In low-brightness images, the grayscale distribution will shift significantly to the left (towards the dark area), and the grayscale value of the occluded area will often become darker. Therefore, if the traditional fixed threshold is used for judgment, it may lead to the misjudgment of the low-contrast area as occlusion. The dynamic brightness factor solves this problem by adjusting the preset grayscale ratio threshold. Specifically, a lower brightness factor (when the image is darker as a whole) will relax the occlusion judgment standard, because in a low-brightness image, the grayscale value change of the occluded area may not be obvious. A higher brightness factor (when the image is brighter as a whole) maintains a strict occlusion judgment standard, because in an image with higher brightness, the grayscale change of the occluded area is more easily perceived. Therefore, after step S23, the method may also include:

[0079] Step S25: calculating the brightness factor of the first grayscale image;

[0080] The brightness factor of the first grayscale image can be calculated by using the existing technology mean_gray / 255.0. The brightness factor is in the range of [0, 1], indicating the brightness of the first grayscale image.

[0081] Step S26: adjusting the preset grayscale ratio threshold according to the brightness factor, the low brightness factor threshold, and the high brightness factor threshold.

[0082] Optionally, step S26 specifically includes:

[0083] Step S261: When the brightness factor is less than the low brightness factor threshold, adjusting the preset grayscale ratio threshold to the first preset grayscale ratio threshold;

[0084] Step S262: When the brightness factor is greater than the high brightness factor threshold, the preset grayscale ratio threshold is adjusted to a second preset grayscale ratio threshold;

[0085] The first preset grayscale ratio threshold is smaller than the second preset grayscale ratio threshold.

[0086] Optionally, the low brightness factor threshold is 0.3, the high brightness factor threshold is 0.8, the first preset grayscale ratio threshold is 0.6, and the second preset grayscale ratio threshold is 0.85. It should be noted that when the brightness factor is greater than the low brightness factor threshold and less than the high brightness factor threshold, it indicates that the first grayscale image is at normal brightness. In this case, the preset grayscale ratio threshold does not need to be adjusted and can be set to 0.75. Of course, those skilled in the art can also flexibly set the thresholds according to actual needs, and this is not limited here.

[0087] Alternatively, as Figure 3 As shown, the information entropy algorithm in the present invention includes:

[0088] Step S31: converting the image to be detected into a second grayscale image, and converting the second grayscale image into a corresponding second grayscale histogram;

[0089] The description of step S31 may refer to the description of step S21 and will not be repeated here.

[0090] Step S32: sorting the grayscale values ​​corresponding to the second grayscale histogram according to the frequency of occurrence, and extracting the K grayscale values ​​with the highest frequency of occurrence as the second target grayscale values;

[0091] Step S33: Calculating the probability of each second target grayscale value based on the occurrence frequency of each second target grayscale value and the sum of the occurrence frequencies of each second target grayscale value;

[0092] Step S34: Calculate the information entropy of the K second target grayscale values ​​according to the frequency of the second target grayscale value, wherein the calculation formula of the information entropy of the K second target grayscale values ​​is:

[0093]

[0094] in, is the second target grayscale value, The second target gray value probability;

[0095] Step S35: Determine whether the image to be detected is blocked based on a preset information entropy threshold and the information entropy of the K second target grayscale values.

[0096] Optionally, the regional analysis algorithm in the present invention specifically includes:

[0097] Step S41: Convert the image to be detected into a third grayscale image, calculate the center of mass O of the third grayscale image by grayscale weighted centroid method, and take O as the center of the circle, according to the radius of the concentric ring Equal gradient increasing method division concentric ring regions ,in, As the core ring, For the edge ring;

[0098] The method used to convert the image to be detected into the third grayscale image in step S41 can refer to the method used to convert the image to be detected into the first grayscale image in step S21, and will not be repeated here. The grayscale weighted centroid method can adopt the grayscale weighted centroid method in the prior art, and will not be repeated here.

[0099] Step S42: For each concentric ring area Execution: Use the Sobel operator to calculate the gradient amplitude of each pixel in the concentric ring area ; According to the gradient amplitude of each pixel point in the concentric ring area , construct the gradient-weighted third grayscale histogram; normalize the third grayscale histogram to obtain the probability distribution , calculate the concentric ring area The information entropy of is calculated as follows: , ;

[0100] Step S43: If 、 and , make sure that the image to be detected is not blocked;

[0101] Step S44: If and , determine that the image to be detected is partially blocked;

[0102] Step S45: If and , calculate the slope of the entropy change curve ;when When , it is determined that the image to be detected is occluded by the central concentrated type as a whole; when When , it is determined that the image to be detected is completely blocked by uniform diffusion;

[0103] in, is the normal texture entropy threshold; There is no occlusion tolerance; is the attenuation threshold; is the overall occlusion tolerance; Slope threshold; is the information entropy of the core ring; is the information entropy of the edge ring; is the radius of the core ring, The value of is 1 / 10 to 1 / 6 of the short side of the third grayscale image; is the radius of the edge ring.

[0104] in, , is the adjustment coefficient, , is the bit depth; , , ; , Those skilled in the art can flexibly set it according to actual needs, and it is not limited here.

[0105] Optionally, the concentric ring radius ,in, , 、 are the width and height of the third grayscale image respectively, is the total number of rings, and .

[0106] Optionally, in step S42, the gradient amplitude of each pixel point in the concentric ring area is , construct the gradient-weighted third grayscale histogram, including:

[0107] Concentric ring area The pixels within are grouped by gray level;

[0108] According to the gradient amplitude of each pixel in the concentric ring area , using the calculation formula: , calculate the gray level The weight value of Pixels Gray value.

[0109] For example, if the concentric ring area There are 3 pixels with gray value = 100, and the gradient values ​​are 1.2, 0.8, and 1.0 respectively. Then the gray level =100 weight value W(100)=1.2+0.8+1.0=3.0.

[0110] It should be noted that step S25 , step S26 , step S261 , step S262 and steps S41 to S45 are not shown in the figure.

[0111] Step S13: Acquire the image to be detected, and based on the detection order, use multiple image occlusion detection algorithms in sequence to determine whether the image to be detected is occluded;

[0112] In addition, after acquiring the image to be detected, the method of the present invention further includes:

[0113] Calculate the brightness factor of the image to be detected;

[0114] When the brightness factor is less than the low brightness factor threshold, CLAHE contrast enhancement is performed on the image to be detected to improve details.

[0115] CLAHE is a technique used in computer vision and image processing for image enhancement. It avoids the noise enhancement problem that can be caused by traditional histogram equalization through local processing and contrast limitation. It divides the image into small blocks for histogram equalization and smoothes discontinuities between blocks using a clone fill technique, while limiting local contrast to preserve image details.

[0116] Step S14: When the previous image occlusion detection algorithm determines that the image to be detected is occluded, the next image occlusion detection algorithm is continued to perform the judgment on the image to be detected;

[0117] Step S15: When the adjacent previous image occlusion detection algorithm determines that the image to be detected is not occluded, the execution of the remaining image occlusion detection algorithms on the image to be detected is terminated, and it is directly determined that the image to be detected is not occluded.

[0118] The image occlusion detection method provided by the present invention reduces the misjudgment rate by sorting multiple image occlusion detection algorithms and cross-validating their output results. It can cope with complex, dynamic, and diverse occlusion scenarios (such as nighttime, motion blur, and single color), and avoids relying entirely on a certain feature to cause misjudgment.

[0119] The image occlusion detection method of the present invention first obtains the calling parameters of the image occlusion detection algorithm, and determines the detection order of multiple image occlusion detection algorithms based on the parameters, wherein the image occlusion detection algorithms include the Laplace variance algorithm, the TOP-K grayscale ratio algorithm, the information entropy algorithm and the regional analysis algorithm; then, obtains the image to be detected, and based on the detection order, sequentially uses multiple image occlusion detection algorithms to determine whether the image to be detected is occluded, wherein when the adjacent previous detection algorithm determines that the image to be detected is occluded, the next detection algorithm continues to execute the judgment of the image to be detected; when the adjacent previous detection algorithm determines that the image to be detected is not occluded, the remaining detection algorithms are terminated to directly determine that the image to be detected is not occluded. The method of the present invention can flexibly adjust the detection order of the detection algorithm to integrate multiple image occlusion detection algorithms and quickly and accurately detect whether the image to be detected is occluded.

[0120] Based on the same inventive concept, embodiments of the present invention also provide an image occlusion detection device for implementing the aforementioned method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following embodiments of the image occlusion detection device can be found in the above-described limitations of the image occlusion detection method and will not be further elaborated here.

[0121] like Figure 4 As shown, the present application provides an image occlusion detection device, which comprises a parameter configuration module 41, an algorithm sorting module 42 and an image detection module 43; wherein,

[0122] The parameter configuration module 41 is configured to obtain image occlusion detection algorithm calling parameters;

[0123] The algorithm sorting module 42 is connected with the parameter configuration module 41 and is configured to determine the detection order of multiple image occlusion detection algorithms according to the image occlusion detection algorithm calling parameters, wherein the image occlusion detection algorithms include Laplacian variance algorithm, TOP-K gray scale proportion algorithm, information entropy algorithm and region analysis algorithm;

[0124] The image detection module 43 is connected with the algorithm sorting module 42 and is configured to obtain a to-be-detected image, and sequentially uses multiple image occlusion detection algorithms to judge whether the to-be-detected image is occluded based on the detection order, wherein when the adjacent previous image occlusion detection algorithm judges that the to-be-detected image is occluded, the next image occlusion detection algorithm is executed to judge the to-be-detected image; when the adjacent previous image occlusion detection algorithm judges that the to-be-detected image is not occluded, the execution of the remaining image occlusion detection algorithms to judge the to-be-detected image is terminated, and it is directly determined that the to-be-detected image is not occluded.

[0125] Optionally, the TOP-K gray scale proportion algorithm comprises:

[0126] The to-be-detected image is converted into a first gray scale image, and the first gray scale image is converted into a corresponding first gray scale histogram;

[0127] The gray scale values corresponding to the first gray scale histogram are sorted according to the occurrence frequency, and the K gray scale values with the highest occurrence frequency are extracted as first target gray scale values;

[0128] The total number of pixels of the to-be-detected image is calculated, and the ratio of the sum of the occurrence frequencies of the first target gray scale values to the total number of pixels is taken as an occlusion proportion;

[0129] The occlusion proportion is compared with a preset gray scale proportion threshold value to determine whether the to-be-detected image is occluded.

[0130] Optionally, after the total number of pixels of the to-be-detected image is calculated, and the ratio of the sum of the occurrence frequencies of the first target gray scale values to the total number of pixels is taken as an occlusion proportion, the method further comprises:

[0131] The brightness factor of the first gray scale image is calculated;

[0132] The preset gray scale proportion threshold value is adjusted according to the brightness factor, a low brightness factor threshold value and a high brightness factor threshold value.

[0133] Optionally, adjusting the preset grayscale ratio threshold according to the brightness factor, the low brightness factor threshold, and the high brightness factor threshold includes:

[0134] When the brightness factor is less than the low brightness factor threshold, adjusting the preset grayscale ratio threshold to the first preset grayscale ratio threshold;

[0135] When the brightness factor is greater than the high brightness factor threshold, the preset grayscale ratio threshold is adjusted to a second preset grayscale ratio threshold;

[0136] The first preset grayscale ratio threshold is smaller than the second preset grayscale ratio threshold.

[0137] Optionally, the information entropy algorithm includes:

[0138] Converting the image to be detected into a second grayscale image, and converting the second grayscale image into a corresponding second grayscale histogram;

[0139] Sort the grayscale values ​​corresponding to the second grayscale histogram according to the frequency of occurrence, and extract the K grayscale values ​​with the highest frequency of occurrence as the second target grayscale values;

[0140] Calculating the probability of each second target grayscale value based on the occurrence frequency of each second target grayscale value and the sum of the occurrence frequencies of each second target grayscale value;

[0141] According to the frequency of the second target grayscale value, the information entropy of the K second target grayscale values ​​is calculated, wherein the calculation formula of the information entropy of the K second target grayscale values ​​is:

[0142]

[0143] in, is the second target grayscale value, The second target gray value probability;

[0144] Whether the image to be detected is blocked is determined based on a preset information entropy threshold and the information entropy of the K second target grayscale values.

[0145] Optionally, the regional analysis algorithm includes:

[0146] The image to be detected is converted into a third grayscale image, and the center of mass O of the third grayscale image is calculated by the grayscale weighted centroid method, and O is used as the center of the circle according to the radius of the concentric ring. Equal gradient increasing method division concentric ring regions ,in, As the core ring, For the edge ring;

[0147] For each concentric ring area Perform: the Sobel operator is used to calculate the gradient amplitude of each pixel point in the concentric ring region ; according to the gradient amplitude of each pixel point in the concentric ring region , a third gradient weighted gray histogram is constructed; the third gray histogram is normalized to obtain a probability distribution , the information entropy of the concentric ring region is calculated, wherein the calculation formula is: , ;

[0148] If , and , it is determined that the image to be detected is not blocked;

[0149] If and , it is determined that the image to be detected is locally blocked;

[0150] If and , the slope of the entropy change curve is calculated ; when , it is determined that the image to be detected is centrally concentrated overall blocked; when , it is determined that the image to be detected is uniformly dispersed overall blocked;

[0151] Wherein, is a normal texture entropy threshold; is a non-blocking tolerance; is a decay threshold; is an overall blocking tolerance; is a slope threshold; is the information entropy of the core ring; is the information entropy of the edge ring; is the radius of the core ring, the value of which is 1 / 10 to 1 / 6 of the short side of the third gray image; is the radius of the edge ring.

[0152] Optionally, the concentric ring radius , wherein, , , respectively, the width and height of the third gray image, is the total number of ring domains, and .

[0153] Optionally, according to the gradient amplitude of each pixel point in the concentric ring region , a third gradient weighted gray histogram is constructed, including:

[0154] The concentric ring region Pixels within the inner region are grouped by gray scale level;

[0155] According to the gradient amplitude of each pixel point in the concentric ring region , the gray scale weight value is calculated by the calculation formula: , wherein, is the gray value of the pixel .

[0156] Optionally, the image detection module 43 is further configured to: calculate a brightness factor of the to-be-detected image; and perform CLAHE contrast enhancement to improve details on the to-be-detected image when the brightness factor is less than a low brightness factor threshold.

[0157] The image occlusion detection device of the present application, the parameter configuration module obtains the image occlusion detection algorithm calling parameter; the algorithm sorting module determines the detection order of a plurality of image occlusion detection algorithms according to the image occlusion detection algorithm calling parameter, wherein the image occlusion detection algorithm includes Laplacian variance algorithm, TOP-K gray scale proportion algorithm, information entropy algorithm and region analysis algorithm; the image detection module obtains the to-be-detected image, and based on the detection order, a plurality of image occlusion detection algorithms are used in turn to judge whether the to-be-detected image is occluded, wherein when the adjacent previous image occlusion detection algorithm judges that the to-be-detected image is occluded, the judgment of the to-be-detected image by the next image occlusion detection algorithm is continued; when the adjacent previous image occlusion detection algorithm judges that the to-be-detected image is not occluded, the judgment of the to-be-detected image by the remaining image occlusion detection algorithm is terminated, and it is directly determined that the to-be-detected image is not occluded. The device of the present application can flexibly adjust the detection order of the detection algorithm to quickly and accurately detect whether the to-be-detected image is occluded.

[0158] It should be noted that the plurality of in the present application includes two and more.

[0159] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow indication, these steps are not necessarily executed in sequence according to the arrow indication. Unless explicitly stated herein, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0160] Each module in each device of the present invention may be implemented in whole or in part by software, hardware, or a combination thereof. Each of the modules may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0161] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. 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 the computer program in the non-volatile storage medium. The database of the computer device is used to store data required or generated for executing the above-mentioned image occlusion detection method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an image occlusion detection method is implemented.

[0162] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, memory, a communication interface, a display screen, and an input device connected via a system bus. 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 and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal via wired or wireless communication. The wireless communication can be achieved via Wi-Fi, a mobile cellular network, NFC (near-field communication), or other technologies. When executed by the processor, the computer program implements an image occlusion detection method. The display screen of the computer device can be a liquid crystal display or an electronic ink display. The input device of the computer device can be a touch layer covering the display screen, or keys, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse.

[0163] Those skilled in the art will understand that Figure 5 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention 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.

[0164] In one embodiment, a computer device is 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.

[0165] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0166] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0167] 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 the present invention are all information and data authorized by the user or fully authorized by all parties.

[0168] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, database, or other media used in the embodiments provided herein 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 can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). 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, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, and the like.

[0169] 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.

[0170] The above-described embodiments merely represent several implementation methods of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. An image occlusion detection method, characterized in that: The method comprises: Get the image occlusion detection algorithm calling parameters; Determine the detection order of multiple image occlusion detection algorithms based on the image occlusion detection algorithm call parameters. The image occlusion detection algorithms include the Laplace variance algorithm, the TOP-K grayscale ratio algorithm, the information entropy algorithm, and the regional analysis algorithm. Obtain the image to be detected, and based on the detection order, use multiple image occlusion detection algorithms in sequence to determine whether the image to be detected is occluded; When the adjacent previous image occlusion detection algorithm determines that the image to be detected is occluded, the next image occlusion detection algorithm is continued to judge the image to be detected; When the adjacent previous image occlusion detection algorithm determines that the image to be detected is not occluded, the execution of the remaining image occlusion detection algorithms on the image to be detected is terminated, and it is directly determined that the image to be detected is not occluded.

2. The method according to claim 1, characterized in that The TOP-K grayscale ratio algorithm includes: Converting the image to be detected into a first grayscale image, and converting the first grayscale image into a corresponding first grayscale histogram; Sort the grayscale values ​​corresponding to the first grayscale histogram according to the frequency of occurrence, and extract the K grayscale values ​​with the highest frequency of occurrence as the first target grayscale values; Calculate the total number of pixels in the image to be detected, and take the ratio of the sum of the occurrence frequencies of each first target grayscale value to the total number of pixels as the occlusion ratio; The occlusion ratio is compared with the preset grayscale ratio threshold to determine whether the image to be detected is occluded.

3. The method according to claim 2, characterized in that After calculating the total number of pixels of the image to be detected and taking the ratio of the sum of the occurrence frequencies of each first target grayscale value to the total number of pixels as the occlusion ratio, the method further includes: Calculating a brightness factor of the first grayscale image; Adjust the preset grayscale ratio threshold based on the brightness factor, low brightness factor threshold, and high brightness factor threshold.

4. The method according to claim 3, characterized in that The step of adjusting the preset grayscale ratio threshold according to the brightness factor, the low brightness factor threshold, and the high brightness factor threshold includes: When the brightness factor is less than the low brightness factor threshold, adjusting the preset grayscale ratio threshold to the first preset grayscale ratio threshold; When the brightness factor is greater than the high brightness factor threshold, the preset grayscale ratio threshold is adjusted to a second preset grayscale ratio threshold; The first preset grayscale ratio threshold is smaller than the second preset grayscale ratio threshold.

5. The method according to claim 1, wherein The information entropy algorithm includes: Converting the image to be detected into a second grayscale image, and converting the second grayscale image into a corresponding second grayscale histogram; Sort the grayscale values ​​corresponding to the second grayscale histogram according to the frequency of occurrence, and extract the K grayscale values ​​with the highest frequency of occurrence as the second target grayscale values; Calculating the probability of each second target grayscale value based on the occurrence frequency of each second target grayscale value and the sum of the occurrence frequencies of each second target grayscale value; According to the frequency of the second target grayscale value, the information entropy of the K second target grayscale values ​​is calculated, wherein the calculation formula of the information entropy of the K second target grayscale values ​​is: in, is the second target grayscale value, The second target gray value probability; Whether the image to be detected is blocked is determined based on a preset information entropy threshold and the information entropy of the K second target grayscale values.

6. The method according to claim 1, characterized in that The regional analysis algorithm includes: The image to be detected is converted into a third grayscale image, and the center of mass O of the third grayscale image is calculated by the grayscale weighted centroid method, and O is used as the center of the circle according to the radius of the concentric ring. Equal gradient increasing method division concentric ring regions ,in, As the core ring, For the edge ring; For each concentric ring area Execution: Use the Sobel operator to calculate the gradient amplitude of each pixel in the concentric ring area ; According to the gradient amplitude of each pixel point in the concentric ring area , construct the gradient-weighted third grayscale histogram; normalize the third grayscale histogram to obtain the probability distribution , calculate the concentric ring area The information entropy of is calculated as follows: , ; like 、 and , make sure that the image to be detected is not blocked; like and , determine that the image to be detected is partially blocked; like and , calculate the slope of the entropy change curve ;when When , it is determined that the image to be detected is occluded by the central concentrated type as a whole; when When , it is determined that the image to be detected is completely blocked by uniform diffusion; in, is the normal texture entropy threshold; There is no occlusion tolerance; is the attenuation threshold; is the overall occlusion tolerance; Slope threshold; is the information entropy of the core ring; is the information entropy of the edge ring; is the radius of the core ring, The value of is 1 / 10 to 1 / 6 of the short side of the third grayscale image; is the radius of the edge ring.

7. The method according to claim 6, characterized in that Concentric ring radius ,in, , 、 are the width and height of the third grayscale image respectively, is the total number of ring domains, and .

8. The method according to claim 6, characterized in that According to the gradient amplitude of each pixel point in the concentric ring area , construct the gradient-weighted third grayscale histogram, including: Concentric ring area The pixels within are grouped by gray level; According to the gradient amplitude of each pixel in the concentric ring area , using the calculation formula: , calculate the gray level The weight value of Pixels Gray value.

9. The method according to claim 1, characterized in that After acquiring the image to be detected, the method further includes: Calculate the brightness factor of the image to be detected; When the brightness factor is less than the low brightness factor threshold, CLAHE contrast enhancement is performed on the image to be detected to improve details.

10. An image occlusion detection device, characterized in that: The device includes: a parameter configuration module, an algorithm sorting module and an image detection module; wherein, Parameter configuration module, used to obtain the image occlusion detection algorithm calling parameters; The algorithm sorting module is connected to the parameter configuration module and is used to call parameters according to the image occlusion detection algorithm and determine the detection order of multiple image occlusion detection algorithms. Among them, the image occlusion detection algorithms include Laplace variance algorithm, TOP-K grayscale ratio algorithm, information entropy algorithm and regional analysis algorithm; The image detection module is connected to the algorithm sorting module, and is used to obtain the image to be detected, and based on the detection order, sequentially use multiple image occlusion detection algorithms to determine whether the image to be detected is occluded. When the adjacent previous image occlusion detection algorithm determines that the image to be detected is occluded, the next image occlusion detection algorithm is continued to be executed to determine the image to be detected; when the adjacent previous image occlusion detection algorithm determines that the image to be detected is not occluded, the execution of the remaining image occlusion detection algorithms on the image to be detected is terminated, and it is directly determined that the image to be detected is not occluded.

Citation Information

Patent Citations

  • Image local feature description method and device, computer equipment and storage medium

    CN111325216A

  • Cheek occlusion detection method and device and electronic equipment

    CN112651322A

  • Defect detection method and device with AOI and AI

    CN112763506A

  • Shielding detection algorithm based on lightweight neural network

    CN118865243A

  • Methods and Systems for Detecting Regions in Digital Images

    US20070206856A1