Camera lens stain detection method and device suitable for mine environment
By pre-processing, binarization and connection domain analysis of the camera lens in a mine environment, combining water mist and dust detection and time-sequential area growth methods, the problem of camera lens stain detection in a mine environment is solved, and effective detection and cleaning with low computing power requirements is achieved.
Patent Information
- Application Number
- CN202411814693.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to effectively detect the stains of camera lenses in a mine environment, especially the computing power requirements are high, so it cannot be suitable for special working conditions such as mines.
A camera lens stain detection method suitable for mine environment is proposed. By acquiring the images collected by the camera, pre-processing, binarization processing and connection domain analysis, the suspected stain area is determined, and water mist detection and dust detection are carried out. The area growth method of time is used to determine whether the stained area becomes larger with time, thereby determining whether there is stain in the lens.
It realizes camera lens stain detection with low computing power requirements in mine environments, and can detect stains as soon as possible and clean them to avoid stains affecting data quality.
Smart Images

Figure CN119810028A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a camera lens stain detection method and device suitable for a mine environment. Background Art
[0002] In a mine environment, cameras are usually used to collect video scenes of the working surface and environment in the mine, so as to monitor the internal environment of the mine and perform target detection and other processing based on the collected video frames. Due to the poor environment of the mine, the camera lens may be covered with pollutants such as dust and water mist, which will affect the quality of the camera's collected data.
[0003] In the prior art, there are two main methods for detecting camera lens stains. One method uses a deep learning network for detection, and the other method uses a traditional model, such as a Gaussian pyramid for feature detection. The above methods have problems such as high computing power requirements and are not applicable to special working conditions such as mines.
[0004] Therefore, it is necessary to obtain a camera lens stain detection method and device suitable for a mine environment. Summary of the invention
[0005] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0006] To this end, the first purpose of the present application is to propose a camera lens stain detection method suitable for a mine environment, so as to realize camera lens stain detection in a mine environment.
[0007] The second objective of the present application is to provide a camera lens stain detection device suitable for a mine environment.
[0008] The third objective of the present application is to provide an electronic device.
[0009] A fourth objective of the present application is to provide a computer-readable storage medium.
[0010] A fifth object of the present application is to provide a computer program product.
[0011] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a camera lens stain detection method suitable for a mine environment, comprising:
[0012] Acquire a first image captured by a camera, and preprocess the first image to obtain a preprocessed first image;
[0013] Binarizing the preprocessed first image to obtain a binary image; and performing connected domain analysis on the binary image to obtain a connected domain in the binary image;
[0014] Determine the area in the preprocessed first image corresponding to the connected domain in the binary image as a suspected stain area; and perform water mist detection and dust detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist pollution area or a suspected dust pollution area;
[0015] Acquire a second image captured by the camera, and determine a suspected stain area in the second image; wherein the second image is captured by the camera after the first image;
[0016] Based on the areas of the corresponding suspected stain areas in the second image and the first image and whether the suspected stain area in the first image is a suspected mist pollution area or a suspected dust pollution area, it is determined whether the suspected stain area is a stain area.
[0017] In some implementations, preprocessing the first image to obtain a preprocessed first image includes:
[0018] Processing the first image by using a low-light enhancement algorithm to obtain a first image after light enhancement;
[0019] Gray-scale the first image after the illumination enhancement to obtain a gray-scaled first image;
[0020] Processing the grayscaled first image by a filtering algorithm to obtain a filtered first image;
[0021] The filtered first image is processed by an image contrast enhancement algorithm to obtain a preprocessed first image.
[0022] In some implementations, after obtaining the connected domain in the binary image, the method further includes:
[0023] Performing an expansion operation on the connected domain to obtain an expanded connected domain;
[0024] An opening operation is performed on the extended connected domain to obtain a connected domain after noise points are removed.
[0025] In some implementations, the performing water mist detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist contaminated area includes:
[0026] Obtaining average contrast and brightness gradient change values of the suspected stain area;
[0027] If the average contrast is less than the contrast threshold, and the brightness gradient change value is less than the brightness change threshold, it is determined that the suspected stain area is a suspected water mist pollution area.
[0028] In some implementations, the performing dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust contaminated area includes:
[0029] Obtaining the local clarity of the suspected stain area to obtain a local clarity value;
[0030] If the local clarity value is less than the clarity threshold, it is determined that the suspected stain area is a suspected dust pollution area.
[0031] In some implementations, the performing dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust contaminated area includes:
[0032] Using a clustering algorithm to identify whether the suspected stain area has an area showing small spots;
[0033] If there is an area showing fine spots in the suspected stain area, it is determined that the suspected stain area is a suspected dust pollution area.
[0034] In some implementations, the determining whether the suspected stain area is a stain area based on the areas of the suspected stain areas corresponding to the second image and the first image and whether the suspected stain area of the first image is a suspected mist pollution area or a suspected dust pollution area includes:
[0035] determining whether the area of the suspected stain region in the second image is larger than the area of the suspected stain region in the first image;
[0036] If the area of the suspected stain region in the second image is larger than the area of the suspected stain region in the first image, and the suspected stain region in the first image is a suspected mist pollution region or a suspected dust pollution region, the suspected stain region is determined to be a stain region.
[0037] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a camera lens stain detection device suitable for a mine environment, comprising:
[0038] An image processing module, used for acquiring a first image captured by a camera, and preprocessing the first image to obtain a preprocessed first image;
[0039] The image processing module is further used to perform binarization processing on the pre-processed first image to obtain a binary image; and perform connected domain analysis on the binary image to obtain a connected domain in the binary image;
[0040] An image detection module is used to determine the area in the preprocessed first image corresponding to the connected domain in the binary image as a suspected stain area; and perform water mist detection and dust detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist pollution area or a suspected dust pollution area;
[0041] The image processing module is further used to obtain a second image captured by the camera and determine a suspected stain area in the second image; wherein the second image is captured by the camera after the first image;
[0042] A result output module is used to determine whether the suspected stain area is a stain area based on the area of the suspected stain area corresponding to the second image and the first image and whether the suspected stain area of the first image is a suspected water mist pollution area or a suspected dust pollution area.
[0043] In some implementations, when the image processing module pre-processes the first image, it is used to:
[0044] Processing the first image by using a low-light enhancement algorithm to obtain a first image after light enhancement;
[0045] Gray-scale the first image after the illumination enhancement to obtain a gray-scaled first image;
[0046] Processing the grayscaled first image by a filtering algorithm to obtain a filtered first image;
[0047] The filtered first image is processed by an image contrast enhancement algorithm to obtain a preprocessed first image.
[0048] In some implementations, after obtaining the connected domain in the binary image, the image processing module is further used to:
[0049] Performing an expansion operation on the connected domain to obtain an expanded connected domain;
[0050] An opening operation is performed on the extended connected domain to obtain a connected domain after noise points are removed.
[0051] In some implementations, the image detection module performs water mist detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist contaminated area;
[0052] Obtaining average contrast and brightness gradient change values of the suspected stain area;
[0053] If the average contrast is less than the contrast threshold, and the brightness gradient change value is less than the brightness change threshold, it is determined that the suspected stain area is a suspected water mist pollution area.
[0054] In some implementations, the image detection module performs dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust contaminated area;
[0055] Obtaining the local clarity of the suspected stain area to obtain a local clarity value;
[0056] If the local clarity value is less than the clarity threshold, it is determined that the suspected stain area is a suspected dust pollution area.
[0057] In some implementations, the image detection module performs dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust contaminated area;
[0058] Using a clustering algorithm to identify whether the suspected stain area has an area showing small spots;
[0059] If there is an area showing fine spots in the suspected stain area, it is determined that the suspected stain area is a suspected dust pollution area.
[0060] In some implementations, the result output module is specifically used to:
[0061] determining whether the area of the suspected stain region in the second image is larger than the area of the suspected stain region in the first image;
[0062] If the area of the suspected stain region in the second image is larger than the area of the suspected stain region in the first image, and the suspected stain region in the first image is a suspected mist pollution region or a suspected dust pollution region, the suspected stain region is determined to be a stain region.
[0063] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.
[0064] To achieve the above-mentioned purpose, the fourth aspect of the present application proposes a computer-readable storage medium, in which computer-readable storage medium is stored computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0065] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0066] The present application provides a camera lens stain detection method, device, electronic device and storage medium suitable for a mine environment. The method obtains a suspected stain area by processing the camera captured image and identifying the connected domain; performs water mist detection and dust detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist pollution area or a suspected dust pollution area; then combines the time series region growing method to determine whether the suspected stain area becomes larger over time, thereby finally determining whether there is a stain area on the camera lens; the implementation method of the present invention has low computing power requirements and can be used for camera lens stain detection in a mine environment. Once a stain area is detected on the camera lens, a manual or automatic cleaning device can be used to remove the stain on the camera lens as soon as possible to prevent the stain from affecting the quality of the camera captured data.
[0067] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0069] Figure 1 A schematic flow chart of a camera lens stain detection method applicable to a mine environment provided in an embodiment of the present application;
[0070] Figure 2 A schematic diagram of an image preprocessing process provided in an embodiment of the present application;
[0071] Figure 3 A block diagram of a camera lens stain detection device suitable for a mine environment provided in an embodiment of the present application;
[0072] Figure 4 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0074] The following describes the camera lens stain detection method, device and equipment applicable to a mine environment according to an embodiment of the present application with reference to the accompanying drawings.
[0075] Figure 1 A schematic flow chart of a camera lens stain detection method suitable for a mine environment provided in an embodiment of the present application.
[0076] It should be noted that the executor of the camera lens stain detection method suitable for a mine environment of the embodiment of the present application is the camera lens stain detection device suitable for a mine environment of the embodiment of the present application. The camera lens stain detection device suitable for a mine environment can be configured in an electronic device so that the electronic device can perform the camera lens stain detection function suitable for a mine environment.
[0077] like Figure 1 As shown, the camera lens stain detection method suitable for a mine environment comprises the following steps:
[0078] Step S101, acquiring a first image captured by a camera, and preprocessing the first image to obtain a preprocessed first image.
[0079] As an implementation manner, a method for preprocessing the first image to obtain the preprocessed first image; Figure 2 As shown, including:
[0080] Step S201, processing the first image by using a low-light enhancement algorithm to obtain the first image after light enhancement.
[0081] Exemplarily, the low-light enhancement algorithm selects the Retinex algorithm.
[0082] It can be understood that due to the poor lighting conditions underground, the low-light enhancement algorithm is first used to improve the quality of low-light images.
[0083] Step S202 , gray-scale the first image after the illumination enhancement to obtain a gray-scaled first image.
[0084] Step S203, processing the grayscaled first image by a filtering algorithm to obtain a filtered first image.
[0085] Exemplarily, the filtering algorithm selects a bilateral filtering algorithm.
[0086] It can be understood that after the image is grayed to obtain a grayscale image, a filtering algorithm is applied to remove noise in the grayscale image.
[0087] Step S204: Process the filtered first image using an image contrast enhancement algorithm to obtain a preprocessed first image.
[0088] Exemplarily, the image contrast enhancement algorithm selects a histogram equalization algorithm.
[0089] It can be understood that the image contrast is enhanced by using the image contrast enhancement algorithm, so that the difference between the stain area and other areas is more obvious.
[0090] In this embodiment, after obtaining the preprocessed first image, the preprocessed first image is copied to obtain a copy of the preprocessed first image, so as to perform the subsequent processing of step S102 and step S103.
[0091] Step S102, binarizing the preprocessed first image to obtain a binarized image; and performing connected domain analysis on the binarized image to obtain a connected domain in the binarized image.
[0092] As an implementation method, a copy of the preprocessed image is made for binarization, and possible stain areas can be separated by an adaptive image binarization algorithm; a connected domain analysis is performed on the binarized image to find the connected domain in the binarized image.
[0093] In some embodiments, after the connected domain is obtained, a dilation operation is performed on the connected domain to obtain an expanded connected domain; and an opening operation is performed on the expanded connected domain to obtain a connected domain after noise points are removed.
[0094] That is to say, morphological operations are performed on the connected domains in the found binary image, with the aim of removing isolated noise points and connecting broken stain areas. When implementing, a dilation operation is first performed to expand the stain area, and then an opening operation is performed to remove noise points to determine the final range of the connected domain.
[0095] It can be understood that each connected domain may correspond to a stain area, that is, each connected domain is a suspected stain area.
[0096] It should be noted that there may be multiple connected domains in the binary image, and each connected domain is processed and judged in subsequent steps to determine whether the connected domain is a stain area.
[0097] Step S103, determining the area where the connected domain in the corresponding binary image in the preprocessed first image is located as the suspected stain area; and performing water mist detection and dust detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist pollution area or a suspected dust pollution area.
[0098] It can be understood that after confirming the connected domain on the copy image of the preprocessed image, the area on the original preprocessed image corresponding to the connected domain of the copy image is determined as the suspected stain area, and the suspected stain area is further confirmed by water mist detection and dust detection to confirm whether the suspected stain area is a suspected water mist contaminated area or a suspected dust contaminated area.
[0099] In some embodiments, water mist detection is performed on the suspected stain area to determine whether the suspected stain area is a suspected water mist contaminated area; including: obtaining the average contrast and brightness gradient change value of the suspected stain area; if the average contrast is less than the contrast threshold, and the brightness gradient change value is less than the brightness change threshold, determining that the suspected stain area is a suspected water mist contaminated area.
[0100] It can be understood that the contrast of the stain area under water mist conditions is low and the brightness changes are relatively uniform. If the average contrast of a suspected stain area is lower than the contrast threshold and the corresponding gradient change of the brightness is also lower than the brightness change threshold, it is considered that the suspected stain area may be an area contaminated by water mist, that is, a suspected water mist contaminated area.
[0101] In some embodiments, dust detection is performed on the suspected stain area to determine whether the suspected stain area is a suspected dust contaminated area; including:
[0102] Obtaining the local clarity of the suspected stain area to obtain a local clarity value;
[0103] If the local clarity value is less than the clarity threshold, the suspected stain area is determined to be a suspected dust pollution area.
[0104] In some embodiments, dust detection is performed on the suspected stain area to determine whether the suspected stain area is a suspected dust contaminated area; including:
[0105] A clustering algorithm is used to identify whether there are areas showing small spots in the suspected stain area;
[0106] If there are areas showing small spots in the suspected stain area, it is determined that the suspected stain area is a suspected dust contaminated area.
[0107] It can be understood that dust usually appears as fine, uniform blurred areas, and the impact of dust can be detected by calculating the local clarity of the image (such as edge strength). The blur caused by dust will appear as low-contrast areas in the image. At the same time, clustering algorithms (such as K-means or DBSCAN) can be used to identify areas in the image that appear as small spots. In this way, the detected areas may be dust-contaminated areas, that is, suspected dust-contaminated areas.
[0108] It should be noted that it is also possible to simultaneously use local clarity and clustering algorithms to jointly determine whether a suspected stain area is a suspected dust pollution area.
[0109] Step S104, obtaining a second image captured by the camera, and determining a suspected stain area in the second image; wherein the second image is captured by the camera after the first image.
[0110] It can be understood that after determining whether the suspected stain area is a suspected water mist pollution area or a suspected dust pollution area, the suspected stain area is further confirmed based on the time series region growing method, which requires obtaining a video frame located behind the first image captured by the camera, that is, a second image. The second image can be a video frame adjacent to the first image or a video frame separated from the first image by a preset time. After obtaining the second image, the same processing steps as the first image are used to determine the suspected stain area in the second image.
[0111] Step S105 , determining whether the suspected stain area is a stain area based on the areas of the corresponding suspected stain areas in the second image and the first image and whether the suspected stain area in the first image is a suspected mist pollution area or a suspected dust pollution area.
[0112] As an implementation method, it is determined whether the area of the suspected stain area in the second image is larger than the area of the suspected stain area in the first image; if the area of the suspected stain area in the second image is larger than the area of the suspected stain area in the first image, and the suspected stain area in the first image is a suspected water mist pollution area or a suspected dust pollution area, the suspected stain area is determined to be a stain area.
[0113] It can be understood that since the stains caused by dust and water mist will continue to expand over time, the growth of the area can be judged based on the time series. If the suspected stain area at the corresponding position of the previous and next frames becomes larger over time, and the suspected stain area is the suspected water mist pollution area or the suspected dust pollution area identified in the above steps, then it can be confirmed that the suspected stain area is a stain area, and the stain area is successfully detected. After the stain area is detected, the staff can be notified immediately to perform camera lens decontamination treatment, or the automatic cleaning device can be controlled to remove stains from the camera lens.
[0114] The embodiment of the present application is suitable for camera lens stain detection in a mine environment. A suspected stain area is obtained by processing the camera-captured image and identifying the connected domain. Water mist detection and dust detection are performed on the suspected stain area to determine whether the suspected stain area is a suspected water mist pollution area or a suspected dust pollution area. Then, a time-series region growing method is used to determine whether the suspected stain area becomes larger over time, thereby ultimately determining whether there is a stain area on the camera lens. The implementation method of the present invention has low requirements on computing power and can be used for camera lens stain detection in a mine environment. Once a stain area is detected on the camera lens, a manual or automatic cleaning device can be used to remove the stain on the camera lens as soon as possible to prevent the stain from affecting the quality of the camera-captured data.
[0115] In order to implement the above embodiment, the present application also proposes a camera lens stain detection device suitable for a mine environment. Figure 3This is a block diagram of a camera lens stain detection device suitable for a mine environment provided in an embodiment of the present application. Figure 3 As shown, the camera lens stain detection device suitable for a mine environment may include: an image processing module 301 , an image detection module 302 and a result output module 303 .
[0116] The image processing module 301 is used to obtain a first image captured by a camera and preprocess the first image to obtain a preprocessed first image;
[0117] The image processing module 301 is further used to perform binarization processing on the pre-processed first image to obtain a binary image; and perform connected domain analysis on the binary image to obtain a connected domain in the binary image;
[0118] The image detection module 302 is used to determine the area where the connected domain in the corresponding binary image in the pre-processed first image is located as the suspected stain area; and perform water mist detection and dust detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist pollution area or a suspected dust pollution area;
[0119] The image processing module 301 is also used to obtain a second image captured by the camera and determine the suspected stain area in the second image; wherein the second image is captured by the camera after the first image;
[0120] The result output module 303 is used to determine whether the suspected stain area is a stain area based on the areas of the corresponding suspected stain areas in the second image and the first image and whether the suspected stain area in the first image is a suspected water mist pollution area or a suspected dust pollution area.
[0121] Furthermore, in a possible implementation of the embodiment of the present application, when the image processing module 301 pre-processes the first image, it is used to:
[0122] Processing the first image by using a low-light enhancement algorithm to obtain the first image after light enhancement;
[0123] Gray-scale the first image after the illumination enhancement to obtain a gray-scaled first image;
[0124] Processing the grayscaled first image by a filtering algorithm to obtain a filtered first image;
[0125] The filtered first image is processed by an image contrast enhancement algorithm to obtain a preprocessed first image.
[0126] Furthermore, in a possible implementation of the embodiment of the present application, after acquiring the connected domain in the binary image, the image processing module 301 is further configured to:
[0127] Perform expansion operation on the connected domain to obtain the expanded connected domain;
[0128] The expanded connected domain is opened to obtain the connected domain after noise points are removed.
[0129] Further, in a possible implementation of the embodiment of the present application, the image detection module 302 performs water mist detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist contaminated area;
[0130] Obtain the average contrast and brightness gradient change values of the suspected stain area;
[0131] If the average contrast is less than the contrast threshold and the brightness gradient change value is less than the brightness change threshold, the suspected stain area is determined to be a suspected water mist pollution area.
[0132] Furthermore, in a possible implementation of the embodiment of the present application, the image detection module 302 performs dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust pollution area;
[0133] Obtaining the local clarity of the suspected stain area to obtain a local clarity value;
[0134] If the local clarity value is less than the clarity threshold, the suspected stain area is determined to be a suspected dust pollution area.
[0135] Furthermore, in a possible implementation of the embodiment of the present application, the image detection module 302 performs dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust pollution area;
[0136] A clustering algorithm is used to identify whether there are areas showing small spots in the suspected stain area;
[0137] If there are areas showing small spots in the suspected stain area, it is determined that the suspected stain area is a suspected dust contaminated area.
[0138] Furthermore, in a possible implementation of the embodiment of the present application, the result output module 303 is specifically configured to:
[0139] determining whether the area of the suspected stain region in the second image is greater than the area of the suspected stain region in the first image;
[0140] If the area of the suspected stain region in the second image is larger than the area of the suspected stain region in the first image, and the suspected stain region in the first image is a suspected mist pollution region or a suspected dust pollution region, the suspected stain region is determined to be a stain region.
[0141] It should be noted that the above explanation of the embodiment of the camera lens stain detection method applicable to a mine environment is also applicable to the camera lens stain detection device applicable to a mine environment of this embodiment, and will not be repeated here.
[0142] In order to implement the above embodiment, the present application also proposes an electronic device. Figure 4 , Figure 4 is a block diagram of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 400 includes: a processor 401, and a memory 402 communicatively connected to the processor 401; the memory 402 stores computer-executable instructions; the processor 401 executes the computer-executable instructions stored in the memory to implement the method provided by the aforementioned embodiment.
[0143] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0144] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.
[0145] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0146] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0147] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0148] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0149] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0150] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0151] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0152] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A camera lens stain detection method suitable for a mine environment, characterized in that: The following steps are involved: Acquire a first image captured by a camera, and preprocess the first image to obtain a preprocessed first image; Performing binarization processing on the preprocessed first image to obtain a binarized image; and performing a connected domain analysis on the binary image to obtain a connected domain in the binary image; Determine the area in the preprocessed first image corresponding to the connected domain in the binary image as a suspected stain area; and performing water mist detection and dust detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist contaminated area or a suspected dust contaminated area; Acquire a second image captured by the camera, and determine a suspected stain area in the second image; wherein the second image is captured by the camera after the first image; Based on the areas of the corresponding suspected stain areas in the second image and the first image and whether the suspected stain area in the first image is a suspected mist pollution area or a suspected dust pollution area, it is determined whether the suspected stain area is a stain area.
2. The method according to claim 1, characterized in that The preprocessing of the first image to obtain the preprocessed first image comprises: Processing the first image by using a low-light enhancement algorithm to obtain a first image after light enhancement; Gray-scale the first image after the illumination enhancement to obtain a gray-scaled first image; Processing the grayscaled first image by a filtering algorithm to obtain a filtered first image; The filtered first image is processed by an image contrast enhancement algorithm to obtain a preprocessed first image.
3. The method according to claim 1, characterized in that After obtaining the connected domain in the binary image, the method further comprises: Performing an expansion operation on the connected domain to obtain an expanded connected domain; An opening operation is performed on the extended connected domain to obtain a connected domain after noise points are removed.
4. The method according to claim 1, characterized in that: The step of performing water mist detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist contaminated area comprises: Obtaining average contrast and brightness gradient change values of the suspected stain area; If the average contrast is less than the contrast threshold, and the brightness gradient change value is less than the brightness change threshold, it is determined that the suspected stain area is a suspected water mist pollution area.
5. The method according to claim 1, characterized in that The performing dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust pollution area comprises: Obtaining the local clarity of the suspected stain area to obtain a local clarity value; If the local clarity value is less than the clarity threshold, it is determined that the suspected stain area is a suspected dust pollution area.
6. The method according to claim 1, characterized in that The performing dust detection on the suspected stain area to determine whether the suspected stain area is a suspected dust pollution area comprises: A clustering algorithm is used to identify whether the suspected stain area has an area showing small spots; If there is an area showing fine spots in the suspected stain area, it is determined that the suspected stain area is a suspected dust pollution area.
7. The method according to claim 1, characterized in that The determining whether the suspected stain area is a stain area based on the area of the suspected stain area corresponding to the second image and the first image and whether the suspected stain area of the first image is a suspected mist pollution area or a suspected dust pollution area comprises: determining whether the area of the suspected stain region in the second image is larger than the area of the suspected stain region in the first image; If the area of the suspected stain region in the second image is larger than the area of the suspected stain region in the first image, and the suspected stain region in the first image is a suspected mist pollution region or a suspected dust pollution region, the suspected stain region is determined to be a stain region.
8. A camera lens stain detection device suitable for a mine environment, characterized in that: include: An image processing module, used for acquiring a first image captured by a camera, and preprocessing the first image to obtain a preprocessed first image; The image processing module is further used to perform binarization processing on the pre-processed first image to obtain a binary image; and perform connected domain analysis on the binary image to obtain a connected domain in the binary image; An image detection module, used for determining the area in the preprocessed first image corresponding to the connected domain in the binary image as a suspected stain area; and performing water mist detection and dust detection on the suspected stain area to determine whether the suspected stain area is a suspected water mist contaminated area or a suspected dust contaminated area; The image processing module is further used to obtain a second image captured by the camera and determine a suspected stain area in the second image; wherein the second image is captured by the camera after the first image; A result output module is used to determine whether the suspected stain area is a stain area based on the area of the suspected stain area corresponding to the second image and the first image and whether the suspected stain area of the first image is a suspected water mist pollution area or a suspected dust pollution area.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Camera module white spot detection system based on turntable
CN111739012A
Method for detecting dirt on lens of camera module
CN112583999A
Lens dirt identification method and device, computer equipment and storage medium
CN114359414A
Camera lens foreign matter identification method and device
CN115578669A
Lens pollution identification method and device, electronic equipment and storage medium
CN118351302A