CN114998283A - Lens blocking object detection method and device - Google Patents

Lens blocking object detection method and device Download PDF

Info

Publication number
CN114998283A
CN114998283A CN202210687776.XA CN202210687776A CN114998283A CN 114998283 A CN114998283 A CN 114998283A CN 202210687776 A CN202210687776 A CN 202210687776A CN 114998283 A CN114998283 A CN 114998283A
Authority
CN
China
Prior art keywords
images
image
detection
edge detection
lens
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210687776.XA
Other languages
Chinese (zh)
Inventor
龚克
刘青松
梁家恩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unisound Intelligent Technology Co Ltd
Original Assignee
Unisound Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Unisound Intelligent Technology Co Ltd filed Critical Unisound Intelligent Technology Co Ltd
Priority to CN202210687776.XA priority Critical patent/CN114998283A/en
Publication of CN114998283A publication Critical patent/CN114998283A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

A lens obstructer detection method and apparatus, this method is through obtaining the serial picture that the lens which carries on the obstructer detection gathers, process the gray scale to the serial picture; extracting a preset number of detection images at preset intervals, calculating image similarity pairwise, and deleting repeated images; performing edge detection on the residual detection images from which the repeated images are deleted, and performing AND operation on the residual detection images after the edge detection one by one to obtain a single AND image R; carrying out edge detection on the image R to obtain an image Rc, and carrying out binarization processing on the image Rc to obtain a binarized image Q; counting the number of pixels with pixel values equal to a preset value in each row of the image Q, comparing to obtain the row where the maximum value of the number of pixels is located, and if the number of pixels in the row where the maximum value is located exceeds a preset threshold value, judging that the row where the maximum value is located is a shielding position. The invention reduces the calculation amount while ensuring the precision and has high real-time performance; the method is simple and easy to operate, and has higher reliability.

Description

Lens blocking object detection method and device
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a method and a device for detecting a lens obstruction.
Background
At present, due to assembly errors of a camera lens, the lens is partially shielded by some objects, or due to shielding caused by dirt and the like, the image has the influence of some foreign matters, and the position of the foreign matters needs to be detected for the invariance brought by subsequent processing of the image.
In the prior art, regarding lens occlusion detection, there are a background modeling method based on a video stream, a method based on a size of a motion area, and a detection method based on characteristics of an occluding object. The background modeling method based on the video stream cannot guarantee that an accurate background image can be obtained, the calculated amount is large, the result often has large errors, and the false alarm rate is high. The method based on the size of the moving area can only detect the occlusion with a large lens shooting range, and can not accurately detect each occlusion. The detection method based on the characteristics of the shielding object has high complexity, large memory occupation ratio and high time consumption, and is not suitable for being applied to low-power-consumption projects.
Disclosure of Invention
Therefore, the invention provides a lens obstruction detection method and a lens obstruction detection device, which are used for completely or partially solving the problems in the background technology.
In order to achieve the above purpose, the invention provides the following technical scheme: a lens obstruction detection method comprises the following steps:
acquiring a series of images acquired by a lens for detecting a shielding object, and performing gray processing on the series of images;
extracting a preset number of detection images from the series of images subjected to the graying treatment according to a preset interval;
calculating image similarity of the extracted detection images pairwise, and deleting repeated images with the image similarity within a preset range;
performing edge detection on the residual detection images from which the repeated images are deleted, and performing AND operation on the residual detection images after the edge detection one by one to obtain a single AND image R;
carrying out edge detection on the image R to obtain an image Rc, and carrying out binarization processing on the image Rc to obtain a binarized image Q;
and counting the number of pixels with the pixel values equal to a preset value in each row of the image Q, comparing to obtain a row where the maximum value of the number of pixels is located, and if the number of the pixels in the row where the maximum value is located exceeds a preset threshold value, judging that the row where the maximum value is located is a shielding position.
As a preferred scheme of the lens blocking object detection method, in the graying processing process, the three-channel average value of the pixels corresponding to the series of images in the BGR mode is used as the pixel value of the grayscale image.
As a preferred scheme of the lens blocking object detection method, if the number of the detection images after deleting the repeated images with the image similarity within the preset range is 1, the acquisition, graying, extraction and image similarity detection of the series of images are repeatedly performed until the number of the detection images after deleting the repeated images with the image similarity within the preset range is greater than 1.
As a preferred scheme of the lens obstruction detection method, the edge detection mode includes longitudinal gradient edge detection, transverse gradient edge detection, or combined transverse and longitudinal gradient edge detection.
As a preferred scheme of the lens obstruction detection method, in the pixel AND operation process, pixel values of two groups of detection images with the same size are compared, if the pixel values are not 0, the larger value of the pixel values is taken, and otherwise, 0 is taken.
The present invention also provides a lens blocking object detection device, including:
the image acquisition module is used for acquiring a series of images acquired by the lens for detecting the shielding object;
the gray processing module is used for carrying out gray processing on the series of images;
the image extraction module is used for extracting a preset number of detection images from the series of images subjected to the graying processing according to a preset interval;
the repeated processing module is used for calculating the image similarity of the extracted detection images pairwise and deleting repeated images with the image similarity within a preset range;
the first edge detection module is used for carrying out edge detection on the residual detection images after the repeated images are deleted;
the image fusion module is used for performing pixel-by-pixel AND operation on the residual detection images after edge detection one by one to obtain a single pixel-by-pixel AND image R;
the second edge detection module is used for carrying out edge detection on the image R to obtain an image Rc;
the binarization processing module is used for carrying out binarization processing on the image Rc to obtain a binarized image Q;
and the shielding detection module is used for counting the number of pixels of which the pixel values are equal to the preset value in each row of the image Q, comparing to obtain the row in which the maximum value of the number of pixels is located, and judging that the row in which the maximum value is located is the shielding position if the number of the pixels of the row in which the maximum value is located exceeds a preset threshold value.
As a preferable embodiment of the lens blocking object detection device, in the grayscale processing module, a three-channel average value of pixels corresponding to the series of images in the BGR mode is used as a pixel value of the grayscale image.
As a preferred embodiment of the lens blocking object detection device, in the repeated processing module, if the number of the detection images after deleting the repeated images with the image similarity within the preset range is 1, the acquisition, graying, extraction and image similarity detection of the series of images are repeatedly performed until the number of the detection images after deleting the repeated images with the image similarity within the preset range is greater than 1.
As a preferred embodiment of the lens blocking object detection device, in the first edge detection module and the second edge detection module, the edge detection mode includes longitudinal gradient edge detection, transverse gradient edge detection, or combined transverse and longitudinal gradient edge detection.
As a preferred scheme of the lens obstruction detection device, in the image fusion module, when the and operation is performed according to pixels, pixel values of two groups of detection images with the same size are compared, if the pixel values are not 0, a larger value of the pixel values is selected, and otherwise, 0 is selected.
The invention has the following advantages: performing graying processing on a series of images acquired by a lens for detecting a shielding object; extracting a preset number of detection images from the series of images subjected to the graying treatment according to a preset interval; calculating image similarity of the extracted detection images pairwise, and deleting repeated images with the image similarity within a preset range; performing edge detection on the residual detection images after the repeated images are deleted, and performing AND operation on the residual detection images after the edge detection one by one to obtain a single AND-by-pixel image R; carrying out edge detection on the image R to obtain an image Rc, and carrying out binarization processing on the image Rc to obtain a binarized image Q; counting the number of pixels with pixel values equal to a preset value in each row of the image Q, comparing to obtain the row where the maximum value of the number of pixels is located, and if the number of pixels in the row where the maximum value is located exceeds a preset threshold value, judging that the row where the maximum value is located is a shielding position. According to the method, a large amount of marked data is not needed by using an image processing method, and complicated steps of feature extraction and model training are not needed, so that the accuracy is ensured, the calculation amount is reduced, the requirement on calculation power is greatly reduced, and the real-time performance is high; the method does not relate to background modeling, has no requirement on reference images, uniformly takes images from image sequences, is simple and easy to operate, and has higher accessibility; the invention can remove the interference of image noise by extracting the edge information, has higher reliability, performs secondary edge detection, highlights the characteristics of the shielding objects in different frames and ensures that the result is more accurate and reliable.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It should be apparent that the drawings in the following description are merely exemplary and that other implementation drawings may be derived from the drawings provided to one of ordinary skill in the art without inventive effort.
Fig. 1 is a schematic flow chart of a lens obstruction detection method provided in embodiment 1 of the present invention;
fig. 2 is a practical effect diagram of the lens obstruction detection method provided in embodiment 1 of the present invention;
fig. 3 is a schematic view of a lens obstruction detection device according to embodiment 2 of the present invention.
Detailed Description
The present invention is described in terms of particular embodiments, other advantages and features of the invention will become apparent to those skilled in the art from the following disclosure, and it is to be understood that the described embodiments are merely exemplary of the invention and that it is not intended to limit the invention to the particular embodiments disclosed. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
In the related art, the background modeling method based on video stream roughly comprises the following processes: firstly, background modeling is carried out, the difference between a background image and a current frame image is compared to determine whether a lens is shielded, and specifically, the information entropy of the background image and the current frame image can be compared to judge whether the lens is shielded; or comparing the gray level histograms of the background image and the current frame image to judge whether the lens is blocked. However, in some practical scenes, the background image is not easy to obtain, if a background modeling method is used, the accurate background image cannot be obtained, the calculated amount is large, the result often has large errors, and the false alarm rate is high.
In the related art, whether occlusion occurs is determined based on the size of a motion region or a pixel ratio. The principle is as follows: firstly, determining a reference frame, judging a motion area in an image by calculating the difference between other frames and the reference frame, finding a reference image for many times and calculating the motion area, and judging that occlusion occurs when the motion area is smaller than a certain threshold value. The method judges the movement change area in the image by comparing the difference between different images, compares a plurality of movement areas, and judges that the lens is blocked when the movement area is smaller than a certain threshold value.
In the related art, a detection method based on the characteristics of an occlusion object needs to use a large number of occlusion pictures to train an occlusion detection model, and after an image is input, the result of whether occlusion exists is directly given. The method usually needs a large amount of shielding data to train an accurate model, is high in complexity, large in memory occupation ratio and high in time consumption, and is not suitable for being applied to low-power-consumption projects.
In view of this, the invention provides the following specific technical scheme, which does not relate to background modeling and can avoid the defects of the background modeling method; the problem of poor detection accuracy based on a motion region size method is solved; meanwhile, a deep learning model is not involved, and the defect of a detection method based on the characteristics of the shielding object does not exist.
Example 1
Referring to fig. 1, an embodiment of the present invention provides a method for detecting a lens blocking object, including the following steps:
s1, acquiring a series of images collected by a lens for detecting the shielding object, and carrying out gray processing on the series of images;
s2, extracting a preset number of detection images from the series of grayed images according to a preset interval;
s3, calculating the image similarity of the extracted detection images pairwise, and deleting repeated images with the image similarity within a preset range;
s4, performing edge detection on the residual detection images after the duplicate images are deleted, and performing AND operation on the residual detection images after the edge detection one by one to obtain a single AND image R;
s5, carrying out edge detection on the image R to obtain an image Rc, and carrying out binarization processing on the image Rc to obtain a binarized image Q;
and S6, counting the number of pixels with the pixel values equal to the preset value in each row of the image Q, comparing to obtain the row where the maximum value of the number of pixels is located, and if the number of the pixels in the row where the maximum value is located exceeds a preset threshold value, judging that the row where the maximum value is located is the shielding position.
In this embodiment, in the graying process, the three-channel average value of the pixels corresponding to the series of images in the BGR mode is used as the pixel value of the grayscale image. Graying is a common technology in visual picture processing, generally, a three-channel BGR image is converted into a single-channel image, and the main process is to use the average value of three channels of corresponding pixels as the pixel value of a grayscale image, namely, the average value is used as the pixel value of the grayscale image
Figure BDA0003700339130000061
In addition, other related methods such as Gamma correction graying, maximum graying, and Gamma correction graying may also be employed.
In this embodiment, if the number of detected images after deleting the repeated images whose image similarity is within the preset range is 1, the acquisition, graying, extraction, and image similarity detection of the series of images are repeatedly performed until the number of detected images after deleting the repeated images whose image similarity is within the preset range is greater than 1.
Specifically, the total number of the collected series of images is set to be N, one detection image is taken every N images, and M images are taken in total; and then, calculating the similarity of the M gray level images in pairs, if the image similarity is within a preset range, judging that the shot contents are repeated, deleting the images with the repeated shot contents, leaving P images, and if P is equal to 1, repeating the steps S1, S2 and S3. Related technologies exist in image similarity calculation, such as Euclidean distance, cosine distance, Hamming distance and the like.
In this embodiment, the edge detection manner includes longitudinal gradient edge detection, transverse gradient edge detection, or combined transverse and longitudinal gradient edge detection.
Specifically, the remaining P images may be subjected to longitudinal gradient edge detection, or transverse gradient edge detection, or combined transverse and longitudinal gradient edge detection according to the application scenario. By carrying out gradient processing on the image and extracting edge information, the interference of image noise can be removed, and the reliability is higher. The gradient edge detection is based on a boundary image segmentation method, such as a watershed algorithm, which generally segments a gradient image of an original image, and the gradient is actually reflected image edge information. Image edges are typically detected using first and second derivatives of the image.
In this embodiment, in the pixel and operation process, the pixel values of two groups of detection images with the same size are compared, if the pixel values are not 0, the larger value of the pixel values is taken, otherwise, 0 is taken.
Specifically, the and operation according to pixels is performed on the P images after edge detection one by one, and the and operation according to pixels specifically comprises the following steps: comparing the pixel values of the corresponding positions of two detection pictures with the same size, if the two pixel values are not 0, taking the value of the two detection pictures as the larger value, otherwise, taking 0, and finally obtaining a bitwise AND image R.
Performing the edge detection in the step S4 on the image R to obtain an image Rc, so as to enhance the edge feature; and (3) carrying out binarization processing on the image Rc, setting a threshold th1, wherein the value greater than the threshold th1 is 255, and the value less than th1 is 0, so as to obtain a binarized image Q. For the image Q, a threshold th2 is set, the number of pixels with a pixel value equal to 255 in each column is counted, the column where the maximum value is located is found, and when the number of pixels is greater than the threshold, the located column is the position of the occlusion edge, so that occlusion can be detected, and the position of the occlusion object can be accurately determined.
Referring to fig. 2, a in fig. 2 is an acquired original image, and it can be seen that an image is blurred due to the influence of the shielding plate on the left side of the image, which affects the processing of subsequent images, the position of the shielding plate needs to be detected, and then the shielding plate in the image is removed. The graph B is the image Q processed by the present technical solution, the largest vertical white bar in the image Q is the approximate position of the shielding plate, but it can also be seen that other columns also have white vertical bars, in order to find the accurate position of the shielding plate, the number of pixels in each column that is not 0 is counted, the column where the largest number is located is taken, and when the number of pixels in the column that is not 0 is greater than the preset threshold, the shielding plate is considered to be in the column.
In summary, the present invention performs graying processing on a series of images acquired by a lens for detecting a blocking object; extracting a preset number of detection images from the series of images subjected to the graying treatment according to a preset interval; calculating image similarity of the extracted detection images pairwise, and deleting repeated images with the image similarity within a preset range; performing edge detection on the residual detection images from which the repeated images are deleted, and performing AND operation on the residual detection images after the edge detection one by one to obtain a single AND image R; carrying out edge detection on the image R to obtain an image Rc, and carrying out binarization processing on the image Rc to obtain a binarized image Q; counting the number of pixels with pixel values equal to a preset value in each row of the image Q, comparing to obtain the row where the maximum value of the number of pixels is located, and if the number of pixels in the row where the maximum value is located exceeds a preset threshold value, judging that the row where the maximum value is located is a shielding position. According to the method, a large amount of marked data is not needed by using an image processing method, and complicated steps of feature extraction and model training are not needed, so that the accuracy is ensured, the calculation amount is reduced, the requirement on calculation power is greatly reduced, and the real-time performance is high; the method does not relate to background modeling, has no requirement on reference images, uniformly takes images from image sequences, is simple and easy to operate, and has higher accessibility; the invention can remove the interference of image noise by extracting the edge information, has higher reliability, performs secondary edge detection, highlights the characteristics of the shielding objects in different frames and ensures that the result is more accurate and reliable.
It should be noted that the method of the embodiments of the present disclosure may be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In such a distributed scenario, one of the devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the devices may interact with each other to complete the method.
It should be noted that the above describes some embodiments of the disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Example 2
Referring to fig. 3, embodiment 2 of the present invention further provides a lens blocking object detection apparatus, including:
the image acquisition module 1 is used for acquiring a series of images acquired by a lens for detecting a shielding object;
the gray processing module 2 is used for carrying out gray processing on the series of images;
the image extraction module 3 is configured to extract a preset number of detection images from the series of grayed images according to a preset interval;
the repeated processing module 4 is used for calculating the image similarity of the extracted detection images pairwise and deleting the repeated images with the image similarity within a preset range;
a first edge detection module 5, configured to perform edge detection on the remaining detection images from which the duplicate images are deleted;
the image fusion module 6 is used for performing and operation on the residual detection images subjected to edge detection one by one according to pixels to obtain a single and image R;
the second edge detection module 7 is configured to perform edge detection on the image R to obtain an image Rc;
a binarization processing module 8, configured to perform binarization processing on the image Rc to obtain a binarized image Q;
and the shielding detection module 9 is configured to count the number of pixels of which the pixel values are equal to the preset value in each row of the image Q, compare the number of pixels to obtain a row in which the maximum value of the number of pixels is located, and determine that the row in which the maximum value is located is a shielding position if the number of pixels in the row in which the maximum value is located exceeds a preset threshold value.
In this embodiment, in the grayscale processing module 1, a three-channel average value of pixels corresponding to a series of images in the BGR mode is used as a pixel value of a grayscale image.
In this embodiment, in the repeated processing module 4, if the number of the detection images after deleting the repeated images with the image similarity within the preset range is 1, the acquisition, graying, extraction, and image similarity detection of the series of images are repeatedly performed until the number of the detection images after deleting the repeated images with the image similarity within the preset range is greater than 1.
In this embodiment, in the first edge detection module 5 and the second edge detection module 7, the edge detection manner includes longitudinal gradient edge detection, transverse gradient edge detection, or combined transverse and longitudinal gradient edge detection.
In this embodiment, in the image fusion module 6, when the and operation is performed according to the pixels, the pixel values of two groups of detection images with the same size are compared, if the pixel values are not 0, the larger value of the pixel values is taken, otherwise, 0 is taken.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules of the apparatus are based on the same concept as the method embodiment in embodiment 1 of the present application, the technical effect brought by the contents is the same as the method embodiment of the present application, and specific contents may refer to the description in the foregoing method embodiment of the present application, and are not described again here.
Example 3
Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, where a program code of a lens obstruction detection method is stored, where the program code includes an instruction for executing the lens obstruction detection method of embodiment 1 or any possible implementation manner thereof.
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, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Example 4
An embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, and the processor calls the program instructions to be able to execute the lens obstruction detection method of embodiment 1 or any possible implementation manner thereof.
Specifically, the processor may be implemented by hardware or software, and when implemented by hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated in the processor, located external to the processor, or stand-alone.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized in a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a memory device and executed by a computing device, and in some cases, the steps shown or described may be executed out of order, or separately as individual integrated circuit modules, or multiple modules or steps thereof may be implemented as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
Although the invention has been described in detail with respect to the general description and the specific embodiments, it will be apparent to those skilled in the art that modifications and improvements may be made based on the invention. Accordingly, it is intended that all such modifications and alterations be included within the scope of this invention as defined in the appended claims.

Claims (10)

1. A lens blocking object detection method is characterized by comprising the following steps:
acquiring a series of images acquired by a lens for detecting a shielding object, and carrying out gray processing on the series of images;
extracting a preset number of detection images from the series of images subjected to the graying treatment according to a preset interval;
calculating image similarity of the extracted detection images pairwise, and deleting repeated images with the image similarity within a preset range;
performing edge detection on the residual detection images from which the repeated images are deleted, and performing AND operation on the residual detection images after the edge detection one by one to obtain a single AND image R;
carrying out edge detection on the image R to obtain an image Rc, and carrying out binarization processing on the image Rc to obtain a binarized image Q;
counting the number of pixels with pixel values equal to a preset value in each row of the image Q, comparing to obtain the row where the maximum value of the number of pixels is located, and if the number of pixels in the row where the maximum value is located exceeds a preset threshold value, judging that the row where the maximum value is located is a shielding position.
2. The lens obstruction detection method according to claim 1, wherein in the graying processing procedure, a three-channel average value of corresponding pixels of the series of images in the BGR mode is used as a pixel value of a grayscale image.
3. The method for detecting the lens blockage according to claim 1, wherein if the number of the detection images after deleting the repeated images with the image similarity within the preset range is 1, the acquisition, the graying, the extraction and the image similarity detection of the series of images are repeatedly performed until the number of the detection images after deleting the repeated images with the image similarity within the preset range is more than 1.
4. The lens obstruction detection method according to claim 1, wherein the edge detection mode comprises longitudinal gradient edge detection, transverse gradient edge detection, or combined transverse and longitudinal gradient edge detection.
5. The method according to claim 1, wherein in the pixel and operation process, pixel values of two groups of detection images with the same size are compared, if the pixel values are not 0, the pixel value is taken as the larger value, otherwise, 0 is taken.
6. A lens blocking object detection device is characterized by comprising:
the image acquisition module is used for acquiring a series of images acquired by the lens for detecting the shielding object;
the gray processing module is used for carrying out gray processing on the series of images;
the image extraction module is used for extracting a preset number of detection images from the series of images subjected to the graying processing according to a preset interval;
the repeated processing module is used for calculating the image similarity of the extracted detection images pairwise and deleting repeated images with the image similarity within a preset range;
the first edge detection module is used for carrying out edge detection on the residual detection images after the repeated images are deleted;
the image fusion module is used for performing pixel-by-pixel AND operation on the residual detection images after edge detection one by one to obtain a single pixel-by-pixel AND image R;
the second edge detection module is used for carrying out edge detection on the image R to obtain an image Rc;
the binarization processing module is used for carrying out binarization processing on the image Rc to obtain a binarized image Q;
and the shielding detection module is used for counting the number of pixels with the pixel values equal to the preset value in each row of the image Q, comparing to obtain the row where the maximum value of the number of the pixels is located, and if the number of the pixels in the row where the maximum value is located exceeds a preset threshold value, judging that the row where the maximum value is located is the shielding position.
7. The device for detecting the lens blockage according to claim 6, wherein in the gray processing module, a three-channel average value of corresponding pixels of the series of images in the BGR mode is used as a pixel value of a gray image.
8. The lens blockage detection device according to claim 6, wherein in the repeated processing module, if the number of the detection images after deleting the repeated images with the image similarity within the preset range is 1, the acquisition, graying, extraction and image similarity detection of the series of images are repeated until the number of the detection images after deleting the repeated images with the image similarity within the preset range is more than 1.
9. The lens obstruction detection device according to claim 6, wherein in the first edge detection module and the second edge detection module, the edge detection manner includes longitudinal gradient edge detection, transverse gradient edge detection, or combined transverse and longitudinal gradient edge detection.
10. The device of claim 6, wherein in the image fusion module, when the image fusion module operates according to pixel and, pixel values of two sets of detection images with the same size are compared, and if the pixel values are not 0, a larger value of the pixel values is taken, otherwise, 0 is taken.
CN202210687776.XA 2022-06-17 2022-06-17 Lens blocking object detection method and device Pending CN114998283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210687776.XA CN114998283A (en) 2022-06-17 2022-06-17 Lens blocking object detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210687776.XA CN114998283A (en) 2022-06-17 2022-06-17 Lens blocking object detection method and device

Publications (1)

Publication Number Publication Date
CN114998283A true CN114998283A (en) 2022-09-02

Family

ID=83035669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210687776.XA Pending CN114998283A (en) 2022-06-17 2022-06-17 Lens blocking object detection method and device

Country Status (1)

Country Link
CN (1) CN114998283A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116697897A (en) * 2023-08-09 2023-09-05 钛玛科(北京)工业科技有限公司 Method and system for detecting position of shielding object

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116697897A (en) * 2023-08-09 2023-09-05 钛玛科(北京)工业科技有限公司 Method and system for detecting position of shielding object
CN116697897B (en) * 2023-08-09 2023-11-03 钛玛科(北京)工业科技有限公司 Method and system for detecting position of shielding object

Similar Documents

Publication Publication Date Title
CN109325954B (en) Image segmentation method and device and electronic equipment
CN110598558B (en) Crowd density estimation method, device, electronic equipment and medium
CN110189285B (en) Multi-frame image fusion method and device
US10068343B2 (en) Method and apparatus for recognizing moving target
CN109086734B (en) Method and device for positioning pupil image in human eye image
US10748023B2 (en) Region-of-interest detection apparatus, region-of-interest detection method, and recording medium
US20190156499A1 (en) Detection of humans in images using depth information
GB2501224A (en) Generating and comparing video signatures using sets of image features
CN111144337B (en) Fire detection method and device and terminal equipment
CN111192241B (en) Quality evaluation method and device for face image and computer storage medium
CN109447022B (en) Lens type identification method and device
CN113657434A (en) Human face and human body association method and system and computer readable storage medium
CN111967345B (en) Method for judging shielding state of camera in real time
CN111582032A (en) Pedestrian detection method and device, terminal equipment and storage medium
CN111598913A (en) Image segmentation method and system based on robot vision
CN112966654A (en) Lip movement detection method and device, terminal equipment and computer readable storage medium
CN110675425B (en) Video frame identification method, device, equipment and medium
CN112052702A (en) Method and device for identifying two-dimensional code
CN114998283A (en) Lens blocking object detection method and device
CN112330618B (en) Image offset detection method, device and storage medium
CN113052019A (en) Target tracking method and device, intelligent equipment and computer storage medium
CN111062415B (en) Target object image extraction method and system based on contrast difference and storage medium
CN115984780B (en) Industrial solid waste warehouse-in and warehouse-out judging method and device, electronic equipment and medium
CN111667419A (en) Moving target ghost eliminating method and system based on Vibe algorithm
CN111753775A (en) Fish growth assessment method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination