Lens dirt detection method and system
By performing image processing and blur analysis on the captured pictures, combined with the main color judgment function, the problem of dirty camera lens affecting the quality of video or picture is solved, effective judgment and decontamination are achieved, and the accuracy of monitoring results is improved.
Patent Information
- Application Number
- CN202210073042.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-01-21
AI Technical Summary
In remote monitoring technology, the camera's lens is easily affected by external dust and other dirty things, resulting in a decrease in the quality of the video or pictures taken, which in turn affects the monitoring results.
By performing image processing on the captured pictures, the main color of the picture is calculated, and the blurred degree value of the picture is obtained using Laplace variance calculation and regularization processing. Then, compare the blur degree value with the preset reference threshold, combine the main color judgment function, and finally determine whether the lens is dirty.
Effectively judge the degree of dirtyness of the lens and provide measurement standards for decontamination, thereby improving the quality of the video or pictures taken and ensuring the accuracy of monitoring results.
Smart Images

Figure CN114494176B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of shooting detection, and in particular to a lens dirtiness detection method and system. Background Art
[0002] At present, in the implementation of remote monitoring technology, it is necessary to use a camera to shoot video or pictures of the monitored object, and then process the obtained video or pictures to realize monitoring of the monitored object.
[0003] In the process of implementing the present application, the inventors discovered that the above-mentioned technology has at least the following problems: in the implementation of remote monitoring technology, the camera used for video and image shooting is generally directly exposed to the external environment, so that dust in the external environment can easily adhere to the lens of the camera and make the lens dirty, thereby affecting the quality of the captured video or picture, and further affecting the monitoring results. Summary of the invention
[0004] In order to reduce the impact of lens dirt on the quality of captured videos or pictures, the present application provides a lens dirt detection method and system.
[0005] In a first aspect, the present application provides a lens dirt detection method, which adopts the following technical solution:
[0006] A lens dirt detection method, comprising:
[0007] Performing image processing on the captured image to obtain all pixel values in the image, and calculating the primary color of the image based on the pixel values and a preset primary color extraction algorithm;
[0008] Performing Laplace variance operation on all pixel values in each of the images according to the main color of the image to obtain Laplace variance operation values, and performing normalization processing on the Laplace variance operation values to obtain blur degree values of the image; obtaining a reference threshold value according to the number of the images, a preset threshold function, a blur rate of the image obtained through pre-training, a maximum value of the Laplace variance operation, and a minimum value of the Laplace variance operation;
[0009] Comparing the blur level value with the reference threshold to obtain a comparison result, and obtaining a primary decision function according to the comparison result;
[0010] The final decision function is obtained by processing the primary decision function and the preset main color judgment function, and the final decision value for judging whether the shooting lens is dirty is obtained by calculating the picture of each main color through the final decision function.
[0011] By adopting the above technical solution, the Laplace variance operation is performed on the pixel values on the captured image, and then the operation result is normalized to obtain the blur degree value of the image. However, the computer cannot determine whether the image is blurry or not based on the calculated blur degree value of the image. A measurement standard for determining whether the image is blurry is required, and the calculated reference threshold can be used as this measurement standard. Further, a primary decision function can be obtained by comparing the blur degree value with the reference threshold. Since the blur degrees corresponding to images of different primary colors are different, the primary color judgment function needs to be added to the final decision function. Finally, the blur judgment of an image is performed through the final decision function. When the primary color of the image is known through the primary color judgment function, the blur degree of the image is further judged. Finally, the blur degree of the image reflects the degree of dirtiness of the lens, which makes it easy to decontaminate the lens according to the degree of dirtiness so as to reduce the influence of lens dirtiness on the quality of the captured video or image.
[0012] In a specific implementation scheme, the functional relationship between the Laplace variance calculation value and the blur level value is:
[0013] Blur degree value = (Laplacian variance operation value - Laplace variance operation minimum value) / (Laplacian variance operation maximum value - Laplace variance operation minimum value).
[0014] By adopting the above technical solution, after obtaining the Laplace variance calculation value, the Laplace variance calculation value is normalized, so as to facilitate improving the intuitiveness of the blur degree value used to reflect the blur degree of the image.
[0015] In a specific implementation scheme, the minimum value of the Laplace variance operation is the minimum value among several Laplace variance operation values obtained by pre-training and estimating the captured image; the maximum value of the Laplace variance operation is the maximum value among several Laplace variance operation values obtained by pre-training and estimating the captured image.
[0016] By adopting the above technical solution, the minimum value of the Laplace variance operation and the maximum value of the Laplace variance operation can be obtained through pre-image training, so as to facilitate the normalization of the Laplace variance operation value.
[0017] In a specific implementation manner, the function value of the primary decision function has two cases, including a first primary decision function value and a second primary decision function value.
[0018] By adopting the above technical solution, the primary decision function has only two cases, namely the first primary decision function value and the second primary decision function value. This makes it convenient to directly reflect whether the image is blurred or not through the first primary decision function value and the second primary decision function value.
[0019] In a specific implementation scheme, obtaining a primary decision function according to the comparison result includes:
[0020] When the comparison result is that the blur level value is greater than the reference threshold, the value of the primary decision function is a first primary decision function value;
[0021] When the comparison result is that the blur level value is not greater than the reference threshold, the value of the primary decision function is a second primary decision function value.
[0022] By adopting the above technical solution, whether the image is blurred is judged by comparing the blur degree value with the reference threshold, and the first primary decision function value and the second primary decision function value are used to intuitively indicate whether the image is blurred, thereby improving the intuitiveness of judging whether the image is blurred or not.
[0023] In a specific implementation manner, the dominant color determination function is used to calculate the dominant color of the image based on pixel values of the image.
[0024] By adopting the above technical solution, when the picture is in different primary colors, the parameters used to determine whether the picture is blurred are different, so it is necessary to first determine which primary color the picture is in, so as to facilitate selecting the parameters for determining whether the picture is blurred or not according to the primary color of the picture.
[0025] In a second aspect, the present application provides a lens dirt detection system, which adopts the following technical solution:
[0026] A lens dirt detection system, comprising:
[0027] The pixel value acquisition and primary color calculation module performs image processing on the captured image to obtain all pixel values in the image, and calculates the primary color of the image based on the pixel values and a preset primary color extraction algorithm;
[0028] A blur degree value acquisition module, performing Laplace variance operation on all pixel values in each of the pictures to obtain Laplace variance operation values, and performing normalization processing on the Laplace variance operation values according to the main color of the picture to obtain the blur degree value of the picture;
[0029] A reference threshold acquisition module, used to acquire a reference threshold according to the number of pictures, a preset threshold function, a picture blur rate obtained through pre-training, a maximum value of a Laplace variance operation, and a minimum value of a Laplace variance operation;
[0030] A primary decision function acquisition module, used for comparing the blur level value with the reference threshold to obtain a comparison result, and obtaining a primary decision function according to the comparison result;
[0031] The final decision value calculation module is used to obtain a final decision function by processing the primary decision function and a preset primary color judgment function, and to calculate the final decision value for judging whether the shooting lens is dirty by calculating the picture of each primary color through the final decision function.
[0032] By adopting the above technical solution, the Laplace variance operation is performed on the pixel values on the captured image, and the result of the operation is normalized to obtain the blur value of the image. However, the computer cannot determine whether the image is blurry or not based solely on the calculated blur value of the image. A measurement standard is required to determine whether the image is blurry, and the calculated reference threshold can be used as this measurement standard. Further, a primary decision function can be obtained by comparing the blur value with the reference threshold. Since the blur degrees corresponding to images of different primary colors are different, the primary color judgment function needs to be added to the final decision function. Finally, the blur judgment of an image is performed through the final decision function. When the primary color of the image is known through the primary color judgment function, the blur degree of the image is further judged. Finally, the blur degree of the image reflects the degree of dirtiness of the lens.
[0033] In a third aspect, the present application provides a computer device, which adopts the following technical solution: it includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute any one of the above-mentioned lens dirt detection methods.
[0034] By adopting the above technical solution, the Laplace variance operation is performed on the pixel values on the captured image, and the result of the operation is normalized to obtain the blur value of the image. However, the computer cannot determine whether the image is blurry or not based solely on the calculated blur value of the image. A measurement standard is required to determine whether the image is blurry, and the calculated reference threshold can be used as this measurement standard. Further, a primary decision function can be obtained by comparing the blur value with the reference threshold. Since the blur degrees corresponding to images of different primary colors are different, the primary color judgment function needs to be added to the final decision function. Finally, the blur judgment of an image is performed through the final decision function. When the primary color of the image is known through the primary color judgment function, the blur degree of the image is further judged. Finally, the blur degree of the image reflects the degree of dirtiness of the lens.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned lens dirt detection methods.
[0036] By adopting the above technical solution, the Laplace variance operation is performed on the pixel values on the captured image, and the result of the operation is normalized to obtain the blur value of the image. However, the computer cannot determine whether the image is blurry or not based solely on the calculated blur value of the image. A measurement standard is required to determine whether the image is blurry, and the calculated reference threshold can be used as this measurement standard. Further, a primary decision function can be obtained by comparing the blur value with the reference threshold. Since the blur degrees corresponding to images of different primary colors are different, the primary color judgment function needs to be added to the final decision function. Finally, the blur judgment of an image is performed through the final decision function. When the primary color of the image is known through the primary color judgment function, the blur degree of the image is further judged. Finally, the blur degree of the image reflects the degree of dirtiness of the lens.
[0037] In a fifth aspect, the present application provides an information data processing terminal, which adopts the following technical solution: executing any one of the above-mentioned lens dirt detection methods.
[0038] By adopting the above technical solution, the Laplace variance operation is performed on the pixel values on the captured image, and the result of the operation is normalized to obtain the blur value of the image. However, the computer cannot determine whether the image is blurry or not based solely on the calculated blur value of the image. A measurement standard is required to determine whether the image is blurry, and the calculated reference threshold can be used as this measurement standard. Further, a primary decision function can be obtained by comparing the blur value with the reference threshold. Since the blur degrees corresponding to images of different primary colors are different, the primary color judgment function needs to be added to the final decision function. Finally, the blur judgment of an image is performed through the final decision function. When the primary color of the image is known through the primary color judgment function, the blur degree of the image is further judged. Finally, the blur degree of the image reflects the degree of dirtiness of the lens.
[0039] In summary, the present application includes at least one of the following beneficial technical effects:
[0040] 1. Perform Laplace variance operation on the pixel values on the captured image, and then normalize the result of the operation to obtain the blur value of the image. However, the computer cannot determine whether the image is blurry or not based solely on the calculated blur value of the image. A measurement standard is required to determine whether the image is blurry, and the calculated reference threshold can be used as this measurement standard. Further, the primary decision function can be obtained by comparing the blur value with the reference threshold. Since the blur degrees corresponding to images of different primary colors are different, the primary color judgment function needs to be added to the final decision function. Finally, the blur judgment of an image is performed through the final decision function. When the primary color of the image is known through the primary color judgment function, the blur degree of the image is further judged. Finally, the blur degree of the image reflects the degree of dirtiness of the lens.
[0041] 2. Through the pre-image training, the minimum value of the Laplace variance operation and the maximum value of the Laplace variance operation can be obtained, so as to facilitate the normalization of the Laplace variance operation value.
[0042] 3. The primary decision function has only two cases: the first primary decision function value and the second primary decision function value. This makes it easy to directly reflect whether the image is blurred or not through the first primary decision function value and the second primary decision function value. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of a lens dirt detection method in Example 1 of the present application.
[0044] Figure 2 It is a structural block diagram of a lens dirt detection system in Example 2 of the present application.
[0045] Explanation of reference numerals: 100, pixel value acquisition and primary color calculation module; 200, blur value acquisition module; 300, reference threshold acquisition module; 400, primary decision function acquisition module; 500, final decision value calculation module. DETAILED DESCRIPTION
[0046] The following is combined with Figure 1-2 This application is described in further detail.
[0047] Example 1
[0048] Embodiment 1 of the present application discloses a method for detecting lens dirtiness. Figure 1 , the lens dirt detection method includes:
[0049] In this embodiment 1, pigs in a pigpen are monitored, and a camera for monitoring the pigs is set on the pigpen. Since the camera is generally directly exposed to the external environment (in the case where the camera is covered with a transparent dustproof protective shell, it is also considered that the camera is generally directly exposed to the external environment, because the dustproof protective shell will have the same adverse effect on the imaging quality when it is dirty and the lens of the camera directly exposed to the external environment will have the same adverse effect on the imaging quality when it is dirty), the camera lens is easily attached with dust and other dirt, and a dirty lens will make the captured pictures or videos blurry, so it is difficult to understand the situation of the pigs in the pigpen based on the blurry pictures and videos.
[0050] S100, performing image processing on the captured image to obtain all pixel values in the image, and calculating the dominant color of the image based on the pixel values and a preset dominant color extraction algorithm.
[0051] There are multiple pig pens in a pig farm, and a number of pigs are raised in each pig pen. In practice, a camera used to shoot pig pens takes a picture of each pig pen at a preset interval, so that a picture set of each pig pen can be obtained, and then the obtained picture set is trained.
[0052] The training process mainly includes:
[0053] S1. Classify the pictures in the picture set. The method for calculating the main color is to calculate the main color of each picture through MMCQ (picture theme color extraction algorithm), and then classify the pictures with the same main color into one category.
[0054] S2. Calculate the Laplace variance value of the image, group the images with the same main color into an image group, then obtain the pixel value of each image in each image group, and then calculate the Laplace variance of the pixel value of each image to obtain the Laplace variance value of each image.
[0055] S3. Calculate the maximum and minimum Laplace variance values of the images in each image group. Each image group has its corresponding maximum Laplace variance a and minimum Laplace variance b.
[0056] S4. In order to make the images of each main color in training as clear as possible, the size of the images under each main color is artificially set during training, and the image blur rate P of the image group of each main color can also be obtained through image training.
[0057] In the implementation, several pictures are extracted from the picture set corresponding to each pig pen by stratified sampling, and then all pixel values of each picture are obtained by image processing, and each pixel value includes RGB three primary color component values.
[0058] Then, all pixel values of each image are processed using the median segmentation method in MMCQ to obtain the primary color of the image. The primary color of the image includes the RGB color component values of the primary color of the image. The images with the same primary color are further grouped into an image group.
[0059] S200, performing Laplace variance operation on all pixel values in each image to obtain Laplace variance operation values, and performing normalization processing on the Laplace variance operation values according to the main color of the image to obtain a blur degree value of the image.
[0060] All pixel values of each image are combined into a pixel matrix, such as [(1,2,3), (1,3,4), ...], and then the pixel matrix of each image in each image group is calculated by the Laplace variance algorithm function, so that the Laplace variance operation value F (x) of each image can be obtained, and then the Laplace variance operation value F (x) of a group of images is sorted in order from small to large, and the Laplace variance operation maximum value a and the Laplace variance operation minimum value b are obtained by sorting. In order to intuitively see the degree of blur of the image, it is necessary to further normalize the Laplace variance operation value F (x) of each image. After normalizing the Laplace variance operation value F (x), the blur degree value g (a, b, x) of the image can be obtained, and the relationship between g (a, b, x) and the Laplace variance operation value F (x) and the Laplace variance operation maximum value a and the Laplace variance operation minimum value b is as follows:
[0061] g(a,b,x)=[F(x)-b] / [ab].
[0062] S300, obtaining a reference threshold value according to the number of pictures, a preset threshold function, a picture blur rate obtained through pre-training, a maximum value of a Laplace variance operation, and a minimum value of a Laplace variance operation.
[0063] It is difficult for a computer to identify whether the corresponding image is blurred only by the blur value g(a, b, x) of the above image, so a standard is needed to measure whether the image is blurred; the functional relationship between the Laplace variance operation value F(x), the number of image groups of a main color N, the maximum Laplace variance operation a, the minimum Laplace variance operation b and the image blur rate P can be obtained by combining the results of image training and historical data: P=I( ); It should be noted that is the jth image, and t is the benchmark threshold used as a measurement standard.
[0064] Under the premise of knowing the main color of a group of pictures, combined with the results of picture training, we can get P, N, a and b; under the premise of knowing P, N, a and b, combined with P=I( ), the value of the reference threshold t corresponding to a cluster of images of a main color can be known; the value of the reference threshold t corresponding to each main color can be calculated through the above steps.
[0065] S400, comparing the fuzziness level value and the reference threshold to obtain a comparison result, and obtaining a primary decision function according to the comparison result.
[0066] In the implementation, after obtaining the value of the reference threshold t through step S300, the blur value g (a, b, x) of a main color image is compared with the corresponding reference threshold t. If the blur value g (a, b, x) is greater than the corresponding reference threshold t, it means that the image is a blurry image; if the blur value g (a, b, x) is not greater than the corresponding reference threshold t, it means that the image is a clear image; in order to conveniently represent the result of the comparison between g (a, b, x) and the corresponding reference threshold t, the primary decision function d (x) is used to characterize the comparison result. The primary decision function d (x) has only two value conditions, including: a first primary decision function value and a second primary decision function value. In the implementation, in order to facilitate the computer to process the first primary decision function value and the second primary decision function value, the value of the first primary decision function is set to 1, and the value of the first primary decision function is set to 0; the relationship between the primary decision function d (x) and g (a, b, x) and the reference threshold t is as follows:
[0067] S500, obtaining a final decision function by processing the primary decision function and the preset primary color judgment function, and calculating the picture of each primary color by the final decision function to obtain a final decision value for judging whether the shooting lens is dirty.
[0068] The d(x) obtained through step S400 refers to the judgment result of whether the image of a group of pictures with a main color is blurred, and the above d(x) is only a judgment of whether a picture in a time period (under a main color) is blurred or not. Therefore, the judgment result of using only d(x) as the judgment standard of whether the picture is blurred or not is accidental.
[0069] In order to solve the problem of chance, it is necessary to combine all the pictures under one main color to make a judgment. For this purpose, the final decision function is introduced. (x), and The relationship between (x) and d(x) is as follows: (x)= (x)d( );
[0070] It should be noted that c represents a certain primary color; is the main color judgment function corresponding to the median segmentation method, and when judging whether a main color image is blurred or not, the main color corresponding to The value is 1, and the corresponding values of other primary colors are The value is 0; the main color judgment function is used to exclude the influence of other main colors on the image blur judgment when making blur judgment on an image under a main color; x represents the pixel matrix composed of all pixel values in an image, s represents the size of the image; d ( ) represents the judgment result of whether a picture under a main color c is blurred or not, d ( ) has only two values of 0 and 1, and when a group of pictures are in one main color, the corresponding The value is 1. Further, if the image of this main color is judged to be clear through the primary decision function, then d ( ) is 0, then The final decision value of (x) is also 0; if the image of this primary color is judged to be blurred by the primary decision function, then d ( ) is not 0, then (x) The final decision value is also not 0.
[0071] When the final decision value is 0, it means that the pictures under various main colors are clear. If the pictures are clear, it can indirectly reflect that the camera lens is not dirty and can be used normally;
[0072] When the final decision value is not 0, it means that the pictures under each main color are blurred. If the pictures are blurred, it can indirectly reflect that the camera lens is dirty and needs to be cleaned.
[0073] Figure 1 FIG. 1 is a flow chart of a lens dirt detection method in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0074] Example 2
[0075] Embodiment 2 of the present application discloses a lens dirt detection system. Figure 2 , the lens dirt detection system includes:
[0076] The pixel value acquisition and main color calculation module 100 is used to perform image processing on the captured image to obtain all pixel values in the image, and calculate the main color of the image based on the pixel values and a preset main color extraction algorithm;
[0077] The blur degree value acquisition module 200 is used to perform Laplace variance operation on all pixel values in each picture to obtain a Laplace variance operation value F, and to perform normalization processing on the Laplace variance operation value according to the main color of the picture to obtain a blur degree value g of the picture;
[0078] A reference threshold acquisition module 300 is used to acquire a reference threshold t according to the number of pictures, a preset threshold function I, a picture blur rate obtained through pre-training, a maximum value of a Laplace variance operation, and a minimum value of a Laplace variance operation;
[0079] A primary decision function acquisition module 400 is used to compare the blur level value g with the reference threshold t to obtain a comparison result, and obtain a primary decision function d according to the comparison result;
[0080] The final decision value calculation module 500 is used to obtain a final decision function by processing a primary decision function and a preset primary color judgment function, and to calculate the final decision value for judging whether the shooting lens is dirty by using the final decision function for each primary color image.
[0081] Example 3
[0082] In this embodiment 3, a computer device is disclosed, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned lens dirt detection method. The steps of the lens dirt detection method here may be the steps of the lens dirt detection method in each of the above-mentioned embodiments.
[0083] Example 4
[0084] In this embodiment 4, a computer-readable storage medium is disclosed, which stores a computer program that can be loaded by a processor and execute a lens dirt detection method such as the above-mentioned one. The computer-readable storage medium includes, for example: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0085] Example 5
[0086] In this embodiment 5, an information data processing terminal is disclosed, and the information data processing terminal can execute the above-mentioned lens dirt detection method.
[0087] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.
Claims
1. A lens dirt detection method, characterized in that: include: Performing image processing on the captured image to obtain all pixel values in the image, and calculating the primary color of the image based on the pixel values and a preset primary color extraction algorithm; Performing Laplace variance operation on all pixel values in each of the images according to the main color of the image to obtain Laplace variance operation values, and performing normalization processing on the Laplace variance operation values to obtain a blur degree value of the image; Obtaining a reference threshold value according to the number of the images, a preset threshold function, a blur rate of the images obtained through pre-training, a maximum value of the Laplace variance operation, and a minimum value of the Laplace variance operation; Comparing the blur level value with the reference threshold to obtain a comparison result, and obtaining a primary decision function according to the comparison result; A final decision function is obtained by processing the primary decision function and the preset primary color judgment function, and a final decision value for judging whether the shooting lens is dirty is obtained by calculating the picture of each primary color through the final decision function; The functional relationship between the Laplace variance calculation value and the blur level value is: Blur degree value = (Laplacian variance operation value - Laplace variance operation minimum value) / (Laplacian variance operation maximum value - Laplace variance operation minimum value); The minimum value of the Laplace variance operation is the minimum value of a plurality of Laplace variance operation values obtained by pre-training and estimating the captured image; The maximum value of the Laplace variance operation is the maximum value of a plurality of Laplace variance operation values obtained by pre-training and estimating the captured image; The functional relationship between the Laplace variance operation value F(x), the number of image groups of a main color N, the maximum Laplace variance operation value a, the minimum Laplace variance operation value b and the image blur rate P is: P=I( ); It should be noted that is the jth image, and t is the benchmark threshold used as a measurement standard; Compare the blur value of a main color image with the corresponding reference threshold. If the blur value is greater than the corresponding reference threshold, it means that the image is a blurry image. If the blur value is not greater than the corresponding reference threshold, it means that the image is a clear image; It is convenient to express the result of comparing the blur degree value with the corresponding reference threshold value, and use the primary decision function to characterize the comparison result; The primary decision function has only two value conditions, including: a first primary decision function value and a second primary decision function value, and the primary decision function is obtained according to the comparison result, including: When the comparison result is that the blur level value is greater than the reference threshold, the value of the primary decision function is a first primary decision function value; When the comparison result is that the blur level value is not greater than the reference threshold, the value of the primary decision function is a second primary decision function value.
2. The lens dirt detection method according to claim 1, characterized in that: The main color judgment function is used to exclude the influence of other main colors on the blur judgment of the picture when performing blur judgment on a picture under one main color.
3. A lens dirt detection system, used to execute the lens dirt detection method according to claim 1, characterized in that: include: A pixel value acquisition and primary color calculation module (100), used to perform image processing on a captured image to acquire all pixel values in the image, and calculate the primary color of the image based on the pixel values and a preset primary color extraction algorithm; A blur degree value acquisition module (200) is used to perform Laplace variance operation on all pixel values in each of the images according to the main color of the image to obtain Laplace variance operation values, and perform normalization processing on the Laplace variance operation values to obtain the blur degree value of the image; A reference threshold acquisition module (300) is used to acquire a reference threshold based on the number of images, a preset threshold function, a blur ratio of images obtained through pre-training, a maximum value of a Laplace variance operation, and a minimum value of a Laplace variance operation; A primary decision function acquisition module (400) is used to compare the blur level value with the reference threshold to obtain a comparison result, and obtain a primary decision function according to the comparison result; The final decision value calculation module (500) is used to obtain a final decision function by processing the primary decision function and a preset primary color judgment function, and to calculate the final decision value for judging whether the shooting lens is dirty by using the final decision function for each primary color image.
4. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the computer program of the lens dirt detection method as described in any one of claims 1 to 2.
5. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the computer program of the lens dirt detection method according to any one of claims 1 to 2.
6. An information data processing terminal, characterized in that: The information data processing terminal executes a computer program of the lens dirt detection method according to any one of claims 1 to 2.
Citation Information
Patent Citations
ROI (Region of Interest) laplace algorithm-based image quality evaluation method under monitored video
CN108122231A
Video image blurred screen detection method and device, computer equipment and storage medium
CN109996063A