A method and device for detecting a lens occluder
By grayscale, similarity calculation and edge detection of the images acquired by the lens, the existing lens occlusion detection methods have solved the problems of large calculation volume, high false alarm rate and high complexity, and efficient and reliable occlusion object detection is achieved.
Patent Information
- Application Number
- CN202210687776.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-06-17
AI Technical Summary
The existing lens occlusion detection methods have problems such as large calculation volume, high false alarm rate, high complexity and long time consumption, and are especially not suitable for low-power projects.
By acquiring the series of images collected by the lens, greyscale processing is performed, a preset number of images is extracted for similarity calculation, duplicate images are deleted, edge detection and binarization are performed, and the number of pixels is counted to determine the occlusion position.
It reduces the amount of calculation, improves the real-time and reliability of detection, simplifies the operation process, reduces the requirements for computing power, and can accurately detect the position of the obstructed object.
Smart Images

Figure CN114998283B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and particularly relates to a method and device for detecting lens occlusions. Background Art
[0002] Currently, due to assembly errors of camera lenses, some objects partially occlude the lenses, or occlusions are caused by stains, etc., and there will be some foreign objects affecting the images, which brings inconvenience to the subsequent processing of the images. It is necessary to detect the positions of these foreign objects.
[0003] In the prior art regarding lens occlusion detection, there are background modeling methods based on video streams, methods based on the size of moving regions, and detection methods based on the characteristics of occluding objects. Among them, the background modeling method based on video streams cannot ensure obtaining an accurate background image, has a relatively large computational amount, and its results often have large errors and a high false alarm rate. The method based on the size of the moving region can only detect occlusions with a very large shooting range of the lens and cannot accurately detect each occlusion. The detection method based on the characteristics of occluding objects has a high complexity, a large memory occupancy, and a high time consumption, and is not suitable for use in low-power projects. Summary of the Invention
[0004] Therefore, the present invention provides a method and device for detecting lens occlusions to fully or partially solve the problems in the background art.
[0005] To achieve the above object, the present invention provides the following technical solution: A method for detecting lens occlusions, comprising:
[0006] Obtaining a series of images collected by a lens for occlusion detection, and performing grayscale processing on the series of images;
[0007] For the series of images after grayscale processing, extracting a preset number of detection images at a preset interval;
[0008] Calculating the image similarity between every two of the extracted detection images, and deleting duplicate images with the image similarity within a preset range;
[0009] Performing edge detection on the remaining detection images after deleting duplicate images, and performing a pixel-by-pixel "AND" operation on each of the remaining detection images after edge detection to obtain a single image R of pixel-by-pixel "AND";
[0010] Performing edge detection on image R to obtain image Rc, and performing binarization processing on image Rc to obtain a binarized image Q;
[0011] Counting the number of pixels with pixel values equal to a preset value in each column of image Q, comparing to obtain the column where the maximum number of pixels is located. If the number of pixels in the column where the maximum value is located exceeds a preset threshold, it is determined that the column where the maximum value is located is the occlusion position.
[0012] As a preferred solution of the lens occlusion detection method, in the grayscale processing process, the average value of the three channels of the corresponding pixels of the series of images in BGR mode is used as the pixel value of the grayscale image.
[0013] As a preferred solution of the lens occlusion detection method, if the number of detected images is 1 after deleting the duplicate images with image similarity within a preset range, the acquisition, grayscale processing, extraction, and image similarity detection of the series of images are repeated until the number of detected images is greater than 1 after deleting the duplicate images with image similarity within a preset range.
[0014] As a preferred solution of the lens occlusion detection method, the edge detection methods include vertical gradient edge detection, horizontal gradient edge detection, or comprehensive gradient edge detection combining horizontal and vertical directions.
[0015] As a preferred solution of the lens occlusion detection method, in the pixel "AND" operation process, the pixel values of two sets of detection images of the same size are compared. If the pixel values are not both 0, the larger pixel value is taken; otherwise, 0 is taken.
[0016] The present invention also provides a lens occlusion detection device, including:
[0017] An image acquisition module, configured to acquire a series of images collected by a lens for occlusion detection;
[0018] A grayscale processing module, configured to perform grayscale processing on the series of images;
[0019] An image extraction module, configured to extract a preset number of detection images from the series of images after grayscale processing at a preset interval;
[0020] A repeated processing module, configured to calculate the image similarity between the extracted detection images pairwise and delete the duplicate images with image similarity within a preset range;
[0021] A first edge detection module, configured to perform edge detection on the remaining detection images after deleting the duplicate images;
[0022] An image fusion module, configured to perform a pixel "AND" operation on the remaining detection images after edge detection one by one to obtain a single pixel "AND" image R;
[0023] A second edge detection module, configured to perform edge detection on image R to obtain image Rc;
[0024] A binarization processing module, configured to perform binarization processing on image Rc to obtain a binarized image Q;
[0025] The occlusion detection module is used to count the number of pixels with pixel values equal to a preset value in each column of the image Q, compare to obtain the column where the maximum number of pixels is located. If the number of pixels in the column where the maximum value is located exceeds a preset threshold, it is determined that the column where the maximum value is located is the occlusion position.
[0026] As an optimal solution of the lens occluder detection device, in the grayscale processing module, the average value of the three channels of the corresponding pixels of the series of images in BGR mode is used as the pixel value of the grayscale image.
[0027] As an optimal solution of the lens occluder detection device, in the repeated processing module, if the number of detected images is 1 after deleting the repeated images with image similarity within a preset range, the acquisition, grayscaling, extraction, and image similarity detection of the series of images are repeated until the number of detected images is greater than 1 after deleting the repeated images with image similarity within a preset range.
[0028] As an optimal solution of the lens occluder detection device, in the first edge detection module and the second edge detection module, the edge detection methods include vertical gradient edge detection, horizontal gradient edge detection, or combined horizontal and vertical comprehensive gradient edge detection.
[0029] As an optimal solution of the lens occluder detection device, in the image fusion module, when performing a pixel "AND" operation, the pixel values of two sets of detection images of the same size are compared. If the pixel values are both non-zero, the larger pixel value is taken; otherwise, 0 is taken.
[0030] The present invention has the following advantages: By acquiring a series of images collected by a lens for occluder detection, performing grayscale processing on the series of images; for the series of images after grayscale processing, extracting a preset number of detection images at a preset interval; calculating the image similarity between the extracted detection images pairwise, and deleting duplicate images with the image similarity within a preset range; performing edge detection on the remaining detection images after deleting duplicate images, and performing a pixel-by-pixel "AND" operation on the remaining detection images after edge detection one by one to obtain a single pixel-by-pixel "AND" image R; performing edge detection on image R to obtain image Rc, and performing binarization processing on image Rc to obtain a binarized image Q; counting the number of pixels with pixel values equal to a preset value in each column of image Q, comparing to obtain the column where the maximum number of pixels is located, and if the number of pixels in the column where the maximum value is located exceeds a preset threshold, determining the column where the maximum value is located as the occlusion position. The present invention uses an image processing method that does not require a large amount of labeled data, does not involve complex feature extraction and model training steps, reduces the computational amount while ensuring accuracy, greatly reduces the requirement for computing power, and has high real-time performance; the present invention does not involve background modeling, has no requirement for reference images, evenly selects images from the image sequence, the method is simple and easy to operate, and has higher accessibility; the present invention can remove the interference of image noise by extracting edge information, has higher reliability, and performs secondary edge detection to highlight the features of occluding objects in different frames, making the result more accurate and reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only exemplary, and for those of ordinary skill in the art, without creative efforts, other implementation drawings can be obtained based on the provided drawings.
[0032] Figure 1 Schematic flowchart of the lens occluder detection method provided in Embodiment 1 of the present invention;
[0033] Figure 2 Practical effect diagram of the lens occluder detection method provided in Embodiment 1 of the present invention;
[0034] Figure 3 Schematic diagram of the architecture of the lens occluder detection device provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] The following specific embodiments illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.
[0036] In the related art, the general process of the background modeling method based on a video stream is as follows: First, background modeling is performed, and the difference between the background image and the current frame image is compared to determine whether the lens is blocked. Specifically, the information entropy of the background image and the current frame image can be compared to determine whether the lens is blocked; or the gray-level histogram of the background image and the current frame image can be compared to determine whether the lens is blocked. However, in some actual scenarios, it is not easy to obtain the background image. If the background modeling method is used, it cannot be guaranteed that an accurate background image can be obtained, and the calculation amount is relatively large, and the result often has a large error and a high false alarm rate.
[0037] In the related art, it is determined whether there is occlusion based on the size of the moving area or the pixel ratio. The principle is as follows: First, a reference frame is determined, and the moving area in the image is judged by calculating the difference between other frames and the reference frame. A reference image is found multiple times and the moving area is calculated. When the moving area is smaller than a certain threshold, it is determined that occlusion occurs. This method judges the moving change area in the image by comparing the differences between different images, compares multiple such moving areas, and when the moving area is smaller than a certain threshold, it is determined that the lens is blocked. This method can only detect occlusions where the shooting range of the lens is very large and cannot accurately detect each occlusion.
[0038] In the related art, for the detection method based on the characteristics of the occluding object, a large number of occlusion pictures are required to train an occlusion detection model. When an image is input, the result of whether there is occlusion is directly given. This method often requires a large amount of occlusion data to train an accurate model, and its method complexity is high, the memory occupation ratio is large, and the time consumption is high, which is not suitable for use in low-power projects.
[0039] In view of this, the present invention provides the following specific technical solutions, which do not involve background modeling and can avoid the defects of the background modeling method; solve the problem of poor detection accuracy of the method based on the size of the moving area; and at the same time do not involve deep learning models and do not have the defects of the detection method based on the characteristics of the occluding object.
[0040] Embodiment 1
[0041] See Figure 1 , the embodiment of the present invention provides a method for detecting a lens occluding object, including the following steps:
[0042] S1. Obtain a series of images collected by a lens for occluder detection, and perform grayscale processing on the series of images;
[0043] S2. For the series of images after grayscale processing, extract a preset number of detection images at a preset interval;
[0044] S3. Calculate the image similarity between the extracted detection images pairwise, and delete the duplicate images with the image similarity within a preset range;
[0045] S4. Perform edge detection on the remaining detection images after deleting the duplicate images, and perform a pixel-by-pixel "AND" operation on the remaining detection images after edge detection one by one to obtain a single image R obtained by pixel-by-pixel "AND";
[0046] S5. Perform edge detection on image R to obtain image Rc, and perform binarization processing on image Rc to obtain a binarized image Q;
[0047] S6. Count the number of pixels with pixel values equal to a preset value in each column of image Q, compare to obtain the column where the maximum number of pixels is located. If the number of pixels in the column where the maximum value is located exceeds a preset threshold, determine the column where the maximum value is located as the occlusion position.
[0048] In this embodiment, in the grayscale processing process, the average value of the three channels of the corresponding pixels of the series of images in BGR mode is used as the pixel value of the grayscale image. Grayscale processing is a common technique in visual image processing. Generally, a three-channel BGR image is converted into a single-channel image. The main process is to use the average value of the three channels of the corresponding pixels as the pixel value of the grayscale image, that is In addition, other related methods can also be used, such as Gamma correction grayscale, maximum grayscale, and Gamma correction grayscale.
[0049] In this embodiment, if the number of detection images is 1 after deleting the duplicate images with the image similarity within a preset range, repeat the acquisition, grayscale processing, extraction, and image similarity detection of the series of images until the number of detection images is greater than 1 after deleting the duplicate images with the image similarity within a preset range.
[0050] Specifically, assume that the total number of the collected series of images is N, and one detection image is taken every n images, and a total of M images are taken; then, for the M grayscale images, calculate their similarities pairwise. If the image similarity is within a preset range, it can be determined that the captured content is repeated, and the images with repeated captured content are deleted, leaving P images. If P is equal to 1, repeat steps S1, S2, and S3. Among them, there are related techniques for calculating image similarity, such as Euclidean distance, cosine distance, Hamming distance, etc.
[0051] In this embodiment, the edge detection methods include vertical gradient edge detection, horizontal gradient edge detection, or combined horizontal and vertical comprehensive gradient edge detection.
[0052] Specifically, depending on the application scenario, vertical gradient edge detection, horizontal gradient edge detection, or combined horizontal and vertical comprehensive gradient edge detection can be performed on the remaining P images. By performing gradient processing on the images and extracting edge information, interference from image noise can be removed, and the reliability is higher. Among them, there are related technologies for gradient edge detection itself. Discontinuous gray values in the image will generate edges. Image edge detection is a boundary-based image segmentation method, such as the watershed algorithm, which usually segments the gradient image of the original image. The gradient actually also reflects the edge information of the image. Image edges are generally detected using the first and second derivatives of the image.
[0053] In this embodiment, during the pixel "AND" operation, the pixel values of two sets of detection images of the same size are compared. If the pixel values are both non-zero, the larger pixel value is taken; otherwise, 0 is taken.
[0054] Specifically, for the P images after edge detection, the pixel "AND" operation is performed on each image one by one. The specific steps of the pixel "AND" operation are as follows: For two detection images of the same size, compare the pixel values at the corresponding positions. If both pixel values are non-zero, take the larger of the two; otherwise, take 0. Finally, an image R obtained by the bitwise "AND" operation is obtained.
[0055] Perform the edge detection described in step S4 on image R again to obtain image Rc to enhance the edge features; perform binarization processing on image Rc. Set a threshold th1. Assign a value of 255 to those greater than the threshold th1 and 0 to those less than th1 to obtain the binarized image Q. For image Q, set a threshold th2. Count the number of pixels with a pixel value equal to 255 in each column, find the column where the maximum value is located, and when the number of pixels is greater than the threshold, the column where it is located is the position of the occlusion edge. Thus, the occlusion can be detected, and the position of the occluding object can be accurately determined.
[0056] See Figure 2 , Figure 2 In, A is the original image collected. It can be seen that there is an influence of the baffle on the left side of the figure, resulting in image blurring, which affects the subsequent image processing. It is necessary to detect the position of the baffle and then remove the baffle from the image. Figure B is the image Q obtained after processing by this technical solution. The largest vertical white bar in image Q is the approximate position of the baffle. However, it can also be seen that there are other columns in the figure with white vertical bars. To find the accurate position of the baffle, count the number of non-zero pixels in each column, take the column where the maximum number is located, and when the number of non-zero pixels in this column is greater than the preset threshold, it is considered that the baffle is in this column.
[0057] In summary, the present invention obtains a series of images collected by a lens for occluder detection, grayscales the series of images; for the grayscaled series of images, extracts a preset number of detection images at a preset interval; calculates the image similarity between the extracted detection images in pairs, and deletes duplicate images with the image similarity within a preset range; performs edge detection on the remaining detection images after deleting duplicate images, and performs a pixel-by-pixel "AND" operation on each of the remaining detection images after edge detection to obtain a single pixel-by-pixel "AND" image R; performs edge detection on image R to obtain image Rc, and performs binarization on image Rc to obtain a binarized image Q; counts the number of pixels with pixel values equal to a preset value in each column of image Q, compares to obtain the column where the maximum number of pixels is located, and if the number of pixels in the column where the maximum value is located exceeds a preset threshold, determines that the column where the maximum value is located is the occlusion position. The present invention uses an image processing method that does not require a large amount of labeled data, does not involve complex feature extraction and model training steps, reduces the computational amount while ensuring accuracy, greatly reduces the requirement for computing power, and has high real-time performance; the present invention does not involve background modeling, has no requirement for reference images, evenly samples images from the image sequence, the method is simple and easy to operate, and has higher accessibility; the present invention can remove the interference of image noise by extracting edge information, has higher reliability, and performs secondary edge detection to highlight the features of occluding objects in different frames, making the result more accurate and reliable.
[0058] It should be noted that the method of the embodiments of the present disclosure can be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied to a distributed scenario, and completed by multiple devices cooperating with each other. In such a distributed scenario, one of the multiple devices can only execute one or more steps of the method of the embodiments of the present disclosure, and these multiple devices will interact with each other to complete the described method.
[0059] It should be noted that some embodiments of the present disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the above embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0060] Embodiment 2
[0061] See Figure 3 , Embodiment 2 of the present invention further provides a lens occluder detection device, including:
[0062] An image acquisition module 1 for acquiring a series of images captured by a lens for occluder detection;
[0063] A grayscale processing module 2 for performing grayscale processing on the series of images;
[0064] An image extraction module 3 for extracting a preset number of detection images from the series of images after grayscale processing at a preset interval;
[0065] A repeated processing module 4 for calculating the image similarity between pairs of the extracted detection images and deleting the duplicate images with the image similarity within a preset range;
[0066] A first edge detection module 5 for performing edge detection on the remaining detection images after deleting the duplicate images;
[0067] An image fusion module 6 for performing a pixel-by-pixel "AND" operation on the remaining detection images after edge detection one by one to obtain a single image R with pixel-by-pixel "AND";
[0068] A second edge detection module 7 for performing edge detection on image R to obtain image Rc;
[0069] A binarization processing module 8 for performing binarization processing on image Rc to obtain a binarized image Q;
[0070] An occlusion detection module 9 for counting the number of pixels with pixel values equal to a preset value in each column of image Q, comparing to obtain the column where the maximum number of pixels is located, and if the number of pixels in the column where the maximum value is located exceeds a preset threshold, determining the column where the maximum value is located as the occlusion position.
[0071] In this embodiment, in the grayscale processing module 2, the average value of the three channels of the corresponding pixels of the series of images in BGR mode is used as the pixel value of the grayscale image.
[0072] In this embodiment, in the repeated processing module 4, if the number of detection images is 1 after deleting the duplicate images with the image similarity within a preset range, the acquisition, grayscale processing, extraction, and image similarity detection of the series of images are repeated until the number of detection images is greater than 1 after deleting the duplicate images with the image similarity within a preset range.
[0073] In this embodiment, in the first edge detection module 5 and the second edge detection module 7, the edge detection methods include vertical gradient edge detection, horizontal gradient edge detection, or comprehensive gradient edge detection combining horizontal and vertical directions.
[0074] In this embodiment, in the image fusion module 6, when performing the pixel-by-pixel "AND" operation, the pixel values of two groups of detection images of the same size are compared. If the pixel values are both non-zero, the larger pixel value is taken, otherwise 0 is taken.
[0075] It should be noted that, regarding the information interaction, execution process, etc. among the modules of the above device, since they are based on the same concept as the method embodiment in Embodiment 1 of this application, the technical effects brought by them are the same as those of the method embodiment of this application. For the specific content, reference can be made to the description in the method embodiment shown above in this application, and details will not be elaborated here.
[0076] Embodiment 3
[0077] Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, in which program codes for a lens occluder detection method are stored, and the program codes include instructions for executing the lens occluder detection method in Embodiment 1 or any possible implementation manner thereof.
[0078] The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrating one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.
[0079] Embodiment 4
[0080] Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;
[0081] The processor and the memory complete communication with each other through a bus; the memory stores program instructions executable by the processor, and the processor can execute the lens occluder detection method in Embodiment 1 or any possible implementation manner thereof by invoking the program instructions.
[0082] Specifically, the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading software codes stored in the memory. The memory can be integrated in the processor or can exist independently outside the processor.
[0083] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.).
[0084] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented with program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. Thus, the present invention is not limited to any specific combination of hardware and software.
[0085] Although the present invention has been described in detail above with general descriptions and specific embodiments, based on the present invention, some modifications or improvements can be made, which are obvious to those skilled in the art. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection required by the present invention.
Claims
1. A method for detecting a lens occluder, characterized in that, Including: Obtain a series of images collected by a lens for occluder detection, and perform grayscale processing on the series of images; For the series of images after grayscale processing, extract a preset number of detection images at a preset interval; Calculate the image similarity between the extracted detection images in pairs, and delete the duplicate images with the image similarity within a preset range; Perform edge detection on the remaining detection images after deleting the duplicate images, and perform a pixel-wise "AND" operation on the remaining detection images after edge detection one by one to obtain a single pixel-wise "AND" image R; during the pixel-wise "AND" operation, compare the pixel values of two sets of detection images of the same size. If the pixel values are both non-zero, take the larger pixel value, otherwise take 0; Perform edge detection on image R to obtain image Rc, and perform binarization processing on image Rc to obtain a binarized image Q; Count the number of pixels with pixel values equal to a preset value in each column of image Q, compare to obtain the column where the maximum number of pixels is located. If the number of pixels in the column where the maximum value is located exceeds a preset threshold, determine that the column where the maximum value is located is the occlusion position.
2. The method for detecting a lens occlusion object according to claim 1, wherein During the grayscale processing, use the average value of the three channels of the corresponding pixels of the series of images in BGR mode as the pixel value of the grayscale image.
3. The method for detecting a lens occluder according to claim 1, wherein If the number of detection images is 1 after deleting the duplicate images with the image similarity within a preset range, repeat the acquisition, grayscale processing, extraction, and image similarity detection of the series of images until the number of detection images is greater than 1 after deleting the duplicate images with the image similarity within a preset range.
4. The method for detecting a lens occluder according to claim 1, wherein, The methods of edge detection include vertical gradient edge detection, horizontal gradient edge detection, or combined horizontal and vertical comprehensive gradient edge detection.
5. A lens occluder detection device, characterized in that, Including: An image acquisition module for obtaining a series of images collected by a lens for occluder detection; A grayscale processing module for performing grayscale processing on the series of images; An image extraction module for extracting a preset number of detection images at a preset interval from the series of images after grayscale processing; A duplicate processing module for calculating the image similarity between the extracted detection images in pairs and deleting the duplicate images with the image similarity within a preset range; A first edge detection module for performing edge detection on the remaining detection images after deleting the duplicate images; An image fusion module for performing a pixel-wise "AND" operation on the remaining detection images after edge detection one by one to obtain a single pixel-wise "AND" image R; in the image fusion module, during the pixel-wise "AND" operation, compare the pixel values of two sets of detection images of the same size. If the pixel values are both non-zero, take the larger pixel value, otherwise take 0; A second edge detection module for performing edge detection on image R to obtain image Rc; A binarization processing module for performing binarization processing on image Rc to obtain a binarized image Q; An occlusion detection module for counting the number of pixels with pixel values equal to a preset value in each column of image Q, comparing to obtain the column where the maximum number of pixels is located. If the number of pixels in the column where the maximum value is located exceeds a preset threshold, determine that the column where the maximum value is located is the occlusion position.
6. The lens obscuration detection device according to claim 5, wherein In the grayscale processing module, use the average value of the three channels of the corresponding pixels of the series of images in BGR mode as the pixel value of the grayscale image.
7. The lens occluder detection device according to claim 5, characterized in that, In the repeated processing module, if the number of detected images is 1 after deleting the repeated images with image similarity within a preset range, the acquisition, grayscale conversion, extraction, and image similarity detection of the series of images are repeated until the number of detected images is greater than 1 after deleting the repeated images with image similarity within a preset range.
8. The lens shielding detection device according to claim 5, wherein In the first edge detection module and the second edge detection module, the edge detection methods include vertical gradient edge detection, horizontal gradient edge detection, or combined horizontal and vertical comprehensive gradient edge detection.
Citation Information
Patent Citations
Commodity hotspot detection method, device and equipment based on monitoring video
CN111401269A
Detection device and detection method for detecting yarn hairiness indexes by using linear array digital camera
CN112730407A