Camera equipment dirt detection method and device, camera equipment and storage medium
By using infrared fill lights and image sensors in the camera equipment, the dirt on the lens protection cover of the camera equipment is automatically detected, and the problem of low detection efficiency in the prior art is solved, and efficient dirt detection is achieved.
Patent Information
- Application Number
- CN202411881129.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, the dirt detection efficiency of camera equipment is low and manual detection is required, resulting in low efficiency.
By setting up infrared fill lights and image sensors in the imaging device, the reflection characteristics of dirty light on infrared light are used to collect images and dirty detection is performed based on the area of the brightness area.
Automatic detection of dirty camera equipment is realized, detection efficiency is improved, and the need for manual detection is reduced.
Smart Images

Figure CN119715586A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection technology, and in particular to a method and device for detecting dirtiness of a camera device, a camera device and a storage medium. Background Art
[0002] With the gradual popularization of video equipment, the product forms of video equipment are increasing, and various types of video equipment are being well applied in the market. Video equipment usually needs to be installed in a fixed position, and the installation process involves drilling holes and adjusting the horizontal and vertical angles. Therefore, the protective cover at the lens of the video equipment is prone to dirt and other problems, thereby affecting the quality of the images collected by the video equipment.
[0003] In the related art, it is usually manually detected whether the protective cover of the camera lens is dirty, and when it is manually detected that the protective cover is dirty, the dirt is cleaned.
[0004] However, in the above-mentioned related technologies, manual dirt detection is required, which reduces the efficiency of dirt detection of the camera equipment. Summary of the invention
[0005] The present invention provides a method and device for detecting dirt of a camera device, a camera device and a storage medium, so as to solve the defect of low efficiency of detecting dirt of a camera device in the related art.
[0006] The present invention provides a method for detecting dirtiness of a camera device, comprising the following steps.
[0007] When a first frame pulse arrives, the infrared fill light is turned on based on a preset frequency, and the image sensor of the camera device is controlled to collect an image based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for dirt detection; Determine a first area in the first image having brightness greater than a preset brightness; Based on the area of the first region, dirt detection is performed on the imaging device.
[0008] According to a method for detecting dirt on a camera device provided by the present invention, the method of detecting dirt on the camera device based on the area of the first region includes: When the area of the first region is larger than the preset area and the second frame pulse arrives, the infrared fill light is turned on based on the preset frequency, and the image sensor is controlled to collect an image based on a second exposure duration to obtain a second image, wherein the second frame pulse is a pulse for dirt detection, and the second exposure duration is shorter than the first exposure duration; Determine a second area in the second image having a brightness greater than the preset brightness; When the difference between the area of the first region and the area of the second region is smaller than a preset value, it is determined that the camera device is dirty.
[0009] According to a method for detecting dirtiness of a camera device provided by the present invention, the step of controlling an image sensor of the camera device to collect images based on a first exposure duration includes: Switching the working mode of the infrared cut-off filter of the camera device to an infrared light transmission mode; In the infrared light transmission mode, the image sensor is controlled to capture images based on the first exposure time.
[0010] According to a method for detecting dirtiness of a camera device provided by the present invention, the method further comprises: When the third frame pulse arrives, the image sensor is controlled to perform image acquisition, and the third frame pulse is a pulse used for non-dirty detection, and the third frame pulse is at least one of the following pulses: a pulse between adjacent first frame pulses and second frame pulses, any pulse before the first frame pulse, and any pulse after the second frame pulse.
[0011] According to a method for detecting dirtiness of an imaging device provided by the present invention, when the third frame pulse arrives, controlling the image sensor to collect images comprises: When the camera device operates in daytime mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the infrared light filtering mode, and the image sensor is controlled to capture images, and the infrared fill light is kept off.
[0012] According to a method for detecting dirtiness of an imaging device provided by the present invention, when the third frame pulse arrives, controlling the image sensor to collect images comprises: When the camera device operates in night mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the full light transmission mode, the infrared fill light is turned on, and the image sensor is controlled to capture images.
[0013] The present invention also provides a camera equipment dirt detection device, comprising: A first control unit is used to turn on the infrared fill light based on a preset frequency when a first frame pulse arrives, and control the image sensor of the camera device to collect an image based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for dirt detection; A determining unit, configured to determine a first area in the first image having a brightness greater than a preset brightness; A detection unit is used to perform dirt detection on the camera device based on the area of the first region.
[0014] The present invention also provides an imaging device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the above-described imaging device dirt detection methods is implemented.
[0015] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for detecting dirtiness of a camera device as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for detecting dirtiness of a camera device.
[0017] The camera device dirt detection method, device, camera device and storage medium provided by the present invention, when the first frame pulse for dirt detection arrives, turns on the infrared fill light based on a preset frequency, and controls the image sensor of the camera device to perform image acquisition based on a first exposure time to obtain a first image, determines a first area in the first image with a brightness greater than a preset brightness, and performs dirt detection on the camera device based on the area of the first area. It can be seen that the present invention sets a first frame pulse for dirt detection, and when the first frame pulse arrives, uses the obvious reflection characteristics of dirt to infrared light to control the image sensor to collect the first image in an environment of the infrared fill light turned on based on a preset frequency, so that it can be determined whether the camera device is dirty based on the area of the first area in the first image with a brightness greater than the preset brightness, thereby realizing automatic detection of dirt on the camera device, thereby improving the efficiency of dirt detection on the camera device. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is one of the flow charts of the method for detecting dirtiness of a camera device provided in an embodiment of the present invention.
[0020] Figure 2 This is the second flow chart of the method for detecting dirtiness of a camera device provided in an embodiment of the present invention.
[0021] Figure 3 This is the third flow chart of the method for detecting dirtiness of a camera device provided in an embodiment of the present invention.
[0022] Figure 4 This is one of the overall flow diagrams of the camera device dirt detection method provided by an embodiment of the present invention.
[0023] Figure 5 This is the second overall flow diagram of the method for detecting dirtiness of a camera device provided in an embodiment of the present invention.
[0024] Figure 6 It is a structural schematic diagram of a camera equipment dirt detection device provided in an embodiment of the present invention.
[0025] Figure 7 It is a schematic diagram of the physical structure of the camera device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] Combine the following Figure 1-Figure 5 The present invention describes a camera device dirt detection method. The execution subject of the camera device dirt detection method can be various camera devices with lens protection covers, or a camera device dirt detection device set in the camera device, and the camera device dirt detection device can be implemented by software, hardware, or a combination of the two.
[0028] Figure 1 FIG. 1 is a flow chart of a method for detecting dirtiness of a camera device provided in an embodiment of the present invention. Figure 1 As shown, the camera device dirt detection method includes the following steps: Step 101, when the first frame pulse arrives, turn on the infrared fill light based on a preset frequency, and control the image sensor of the camera device to capture an image based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for dirt detection.
[0029] Among them, any pulse sent after the camera device is turned on can be used as the first frame pulse, and the first frame pulse can be used as a trigger condition for initiating the dirt detection function. The preset frequency can be set based on demand, and the present invention does not limit this.
[0030] For example, when the first frame pulse arrives, the infrared fill light is controlled to be turned on based on a preset frequency, and the recorded moment of turning on the infrared fill light is used as the emission moment of the infrared light. If infrared light reflected by dirt is received, the reflection moment of the infrared light is recorded, and the time from the emission of the infrared light to the reflection of the infrared light is determined based on the reflection moment and the emission moment, and then the image frame rate is determined based on the time, and the image sensor of the camera device is controlled to capture the first image based on the image frame rate and the first exposure time to ensure that the infrared light reflected by dirt can be reflected in the captured first image. Alternatively, a preset image frame rate is pre-set, and the preset image frame rate needs to ensure that the infrared light reflected by dirt can be reflected in the captured first image.
[0031] It should be noted that after the first image is acquired, the infrared fill light can be turned off in the day mode, but the infrared fill light can be kept on in the night mode.
[0032] Step 102: Determine a first area in the first image whose brightness is greater than a preset brightness.
[0033] The preset brightness may be determined based on actual application scenarios, which is not limited in the present invention.
[0034] For example, when the first image is acquired, the brightness of each pixel in the first image is compared with the preset brightness, all first pixels with brightness greater than the preset brightness are found, and each first sub-region composed of continuous first pixels is determined. The set of all first sub-regions can be determined as the first region, or the first sub-regions smaller than the preset region in all first sub-regions can be removed, and the set of remaining first sub-regions can be determined as the first region. The preset region here can be a region including a preset number of first pixels, for example, the preset number is 1.
[0035] Step 103: Perform dirt detection on the camera device based on the area of the first region.
[0036] For example, when the first region is obtained, the area of the first region is determined based on the number of pixels included in the first region and the size of each pixel, and the area of the first region is compared with a preset area. When the area of the first region is larger than the preset area, it is determined that there is dirt on the protective cover of the camera lens, and a prompt message indicating the presence of dirt is output at this time, so that the user can clean the dirt on the protective cover in time upon receiving the prompt message, so as to improve the quality of the image captured by the camera. When the area of the first region is less than or equal to the preset area, it is determined that there is no dirt on the protective cover of the camera lens, and no prompt message is output. The preset area here can be determined based on experience or the size of the dirt on the protective cover of the camera lens in history, and the present invention is not limited to this.
[0037] The camera device dirt detection method provided by the present invention turns on the infrared fill light based on a preset frequency when the first frame pulse for dirt detection arrives, controls the image sensor of the camera device to perform image acquisition based on a first exposure time to obtain a first image, determines a first area in the first image whose brightness is greater than a preset brightness, and performs dirt detection on the camera device based on the area of the first area. It can be seen that the present invention sets a first frame pulse for dirt detection, and when the first frame pulse arrives, uses the obvious reflection characteristics of dirt to infrared light to control the image sensor to acquire the first image in an environment of the infrared fill light turned on based on a preset frequency, so that it can be determined whether the camera device is dirty based on the area of the first area in the first image that is greater than the preset brightness, thereby realizing automatic detection of dirt on the camera device, thereby improving the efficiency of dirt detection on the camera device.
[0038] In one embodiment, Figure 2 FIG. 2 is a flow chart of the method for detecting dirtiness of a camera device provided by an embodiment of the present invention. Figure 2 As shown, the above step 103 performs dirt detection on the camera device based on the area of the first region, which can be specifically implemented by the following steps: Step 1031: When the area of the first region is larger than the preset area and the second frame pulse arrives, turn on the infrared fill light based on the preset frequency, and control the image sensor to capture the image based on the second exposure time to obtain a second image, wherein the second frame pulse is a pulse for dirt detection, and the second exposure time is less than the first exposure time.
[0039] For example, when the area of the first region is larger than the preset area, in order to avoid false alarms caused by determining that the camera device is dirty based only on the first image, a second frame pulse can be set to perform dirt detection again. When the second frame pulse arrives, the infrared fill light is controlled to turn on based on the preset frequency again, and the moment when the infrared fill light is turned on again is recorded as the new emission moment of the infrared light. If the infrared light reflected by the dirt is received again, the new reflection moment of the infrared light is recorded, and the new duration from the emission to the reflection of the infrared light is determined based on the new reflection moment and the new emission moment, and then the new image frame rate is determined based on the new duration. The image sensor of the camera device is controlled to capture the second image based on the new image frame rate and the second exposure moment to ensure that the infrared light reflected by the dirt can be reflected in the captured second image.
[0040] Step 1032: Determine a second area in the second image whose brightness is greater than the preset brightness.
[0041] For example, when the second image is captured, the brightness of each pixel in the second image is compared with the preset brightness, all second pixels with brightness greater than the preset brightness are found, and the second sub-regions composed of continuous second pixels are determined. The set of all second sub-regions can be determined as the second region, or all second sub-regions with a brightness smaller than the preset region can be removed, and the set of remaining second sub-regions can be determined as the second region.
[0042] Step 1033: When the difference between the area of the first region and the area of the second region is smaller than a preset value, determine that the camera device is dirty.
[0043] The preset value may be set based on demand, and the present invention does not limit this.
[0044] For example, when the second area is obtained, the area of the second area is determined based on the number of pixels included in the second area and the size of each pixel, the difference between the area of the first area and the area of the second area is calculated, and the difference is compared with a preset value. When the difference is less than the preset value, it is determined that there is indeed dirt on the protective cover of the camera lens, and then a prompt message indicating the presence of dirt is output, so that the user can clean the dirt on the protective cover in time after receiving the prompt message. When the difference is greater than or equal to the preset value, it is determined that the presence of dirt on the protective cover of the camera lens based on the first image is a false detection, and no prompt message is output.
[0045] It should be noted that the reason why the second exposure time is controlled to be shorter than the first exposure time is that by changing the exposure time, the change in brightness information can be observed. If the protective cover is indeed dirty, the brightness caused by the dirt should be consistent under different exposure times. That is, the dirt will still appear as abnormal brightness in a shorter exposure time, which helps to reduce false alarms and improve the accuracy of detection.
[0046] In this embodiment, when the area of the first region is larger than the preset area, whether the camera device is actually dirty is further confirmed based on the acquired second image, thereby improving the accuracy of detecting dirt on the camera device.
[0047] In one embodiment, in the above step 101, controlling the image sensor of the camera device to collect images based on the first exposure duration may be specifically implemented in the following manner: The working mode of the infrared cutoff filter of the camera device is switched to the infrared light transmission mode; in the infrared light transmission mode, the image sensor is controlled to capture images based on the first exposure time.
[0048] For example, when the first frame pulse arrives, the infrared fill light is turned on based on a preset frequency, and the working mode of the infrared cut filter (IR-CUT) of the camera device is switched to the infrared light transmission mode. In the infrared light transmission mode, only the 850nm (nanometer) band is allowed to pass through, and the image sensor of the camera device is controlled to capture an image based on a first exposure time to obtain a first image.
[0049] In this embodiment, after the infrared fill light is turned on based on a preset frequency and the working mode of the infrared cutoff filter of the camera device is switched to the infrared light transmission mode, the image sensor is controlled to perform image capture based on the first exposure time, so that the first image captured is captured in an environment with only infrared light, which can avoid the interference of dirt on visible light, thereby further improving the accuracy of dirt detection of the camera device.
[0050] In one embodiment, Figure 3 FIG. 3 is a flow chart of a method for detecting dirtiness of a camera device provided by an embodiment of the present invention. Figure 3 As shown, the camera device dirt detection method also includes the following steps: Step 301: When the third frame pulse arrives, control the image sensor to capture an image.
[0051] The third frame pulse is a pulse for non-dirty detection, and the third frame pulse is at least one of the following pulses: a pulse between the adjacent first frame pulse and the second frame pulse, any pulse before the first frame pulse, and any pulse after the second frame pulse.
[0052] For example, the third frame pulse can be set before the first frame pulse, or between the adjacent first frame pulse and the second frame pulse, or after the second frame pulse. The specific setting can be based on the needs, and the present invention does not limit this. The non-dirty detection is performed by the third frame pulse, and the non-dirty detection can be understood as the detection of normal monitoring. When the third frame pulse arrives, the image sensor is controlled to perform image acquisition to obtain a third image. The third image is used for normal monitoring of the camera device, for example, to determine whether the third image includes an object that needs to be tracked.
[0053] It should be noted that step 301 may be performed before step 101 or after step 103. Figure 3 In the description, the execution of step 301 before step 101 is taken as an example, and the present invention does not limit this.
[0054] In this embodiment, when the third frame pulse for non-dirt detection arrives, the image sensor is controlled to perform image acquisition, and normal monitoring of the camera device is achieved based on the acquired third image. That is, the present invention incorporates the frame pulse for dirt detection into the frame pulse for normal monitoring detection, and can achieve dirt detection of the camera device in the intervals of normal operation of the camera device.
[0055] In one embodiment, when the third frame pulse arrives, controlling the image sensor to perform image acquisition may be specifically implemented in the following manner: When the camera device operates in daytime mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the infrared light filtering mode, and the image sensor is controlled to capture images, and the infrared fill light is kept off.
[0056] For example, when the camera device is working in day mode (day mode) and the third frame pulse arrives, since the day includes visible light and infrared light, infrared light is not required for normal monitoring, so the working mode of the infrared cutoff filter of the camera device needs to be switched to the infrared light filtering mode. The infrared light of the day is filtered through the infrared light filtering mode, and only visible light is retained. At this time, the image sensor is controlled to perform image acquisition so that the acquired image is acquired in a visible light environment to achieve normal monitoring in the day mode. In the day mode, the ambient brightness is brighter and there is no need for infrared fill light for fill light, so the infrared fill light needs to be kept off.
[0057] In this embodiment, when the camera device operates in the daytime mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the infrared light filtering mode, and the image sensor is controlled to perform image acquisition, so that the image acquired in the daytime mode is acquired in an environment with only visible light, thereby avoiding the influence of infrared light on normal detection and improving the accuracy of normal detection of the camera device.
[0058] In one embodiment, when the third frame pulse arrives, controlling the image sensor to perform image acquisition may be specifically implemented in the following manner: When the camera device operates in night mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the full light transmission mode, the infrared fill light is turned on, and the image sensor is controlled to capture images.
[0059] For example, when the camera device is working in night mode (night mode) and the third frame pulse arrives, due to the dim light at night, the working mode of the infrared cutoff filter of the camera device is switched to the full light transmission mode, and the infrared fill light is turned on. At this time, the image sensor is controlled to perform image acquisition to achieve normal monitoring in night mode.
[0060] In this embodiment, when the camera device operates in night mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the full light transmission mode, and the image sensor is controlled to perform image acquisition, so that normal detection in night mode can be achieved.
[0061] Figure 4 FIG. 1 is one of the overall flow diagrams of the method for detecting dirtiness of a camera device provided by an embodiment of the present invention. Figure 4As shown, in the daytime mode, taking three image frames of normal monitoring as an example, they are the first image frame, the second image frame and the third image frame, a third frame pulse is set corresponding to the first image frame, a third frame pulse and a first frame pulse are set corresponding to the second image frame, and a third frame pulse and a second frame pulse are set corresponding to the third image frame. When the third frame pulse corresponding to the first image frame arrives, the working mode of the infrared cutoff filter is switched to the infrared light filtering mode to filter out the infrared light. The infrared fill light is not turned on during the day, and the image sensor is controlled to collect images. The image collection process mainly includes exposure, transmission and readout, wherein exposure refers to opening the shutter when the third frame pulse corresponding to the first image frame arrives to allow light to shine on the image sensor; transmission refers to that after exposure, the light information of each unit on the image sensor will be converted into electrical signals and transmitted to the processor; readout refers to that the processor converts these electrical signals into images for output. When the third frame pulse corresponding to the second image frame arrives, the infrared cutoff filter switches to an infrared light filtering mode to filter out infrared light, and the infrared fill light remains off; when the first frame pulse corresponding to the second image frame arrives, dirt detection starts, and the infrared cutoff filter switches to an infrared light transmission mode to transmit only the 850nm band, and turns on the infrared fill light based on a preset frequency, and controls the image sensor to acquire an image based on a first exposure time to obtain a first image, and determines a first area in the first image whose brightness is greater than a preset brightness. When the area of the first area is less than or equal to a preset area, it is determined that there is no dirt on the protective cover of the camera lens; when the area of the first area is greater than the preset area, detection continues, and when the third frame pulse corresponding to the third frame image arrives, the infrared cutoff filter switches to a mode where the infrared light is transmitted and only transmits 850nm. The infrared fill light is turned on based on a preset frequency, and the image sensor is controlled to perform image acquisition based on a first exposure time to obtain a first image. Infrared light filtering mode, filters out infrared light, and keeps the infrared fill light off; when the second frame pulse corresponding to the third image frame arrives, continue to perform dirt detection, switch the working mode of the infrared cutoff filter to the infrared light transmission mode, only transmit the 850nm band, turn on the infrared fill light based on a preset frequency, control the image sensor to perform image acquisition based on a second exposure time that is less than the first exposure time, obtain a second image, determine a second area in the second image whose brightness is greater than a preset brightness, and when the difference between the area of the first area and the area of the second area is less than a preset value, determine that the protective cover of the camera device lens is dirty and needs to be cleaned; when the difference between the area of the first area and the area of the second area is greater than or equal to the preset value, determine that the protective cover of the camera device lens is not dirty, and the previous determination based on the first image that the protective cover is dirty is a false detection.
[0062] Figure 5 FIG. 2 is a second overall flow chart of the method for detecting dirtiness of a camera device provided by an embodiment of the present invention. Figure 5As shown, in night mode, taking three image frames of normal monitoring as an example, namely the first image frame, the second image frame and the third image frame, a third frame pulse is set corresponding to the first image frame, a third frame pulse and a first frame pulse are set corresponding to the second image frame, and a third frame pulse and a second frame pulse are set corresponding to the third image frame. When the third frame pulse corresponding to the first image frame arrives, the working mode of the infrared cutoff filter is switched to the full light transmission mode, and the infrared fill light is turned on to control the image sensor to acquire the image. The image acquisition process mainly includes exposure, transmission and readout. When the third frame pulse corresponding to the second image frame arrives, the working mode of the infrared cutoff filter is switched to the full light transmission mode, and the infrared fill light is kept turned on; when the first frame pulse corresponding to the second image frame arrives, the dirt detection is started, and the working mode of the infrared cutoff filter is switched to the infrared light transmission mode, only the 850nm band is transmitted, the infrared fill light is turned on based on a preset frequency, and the image sensor is controlled to perform image acquisition based on the first exposure time to obtain a first image, and a first area in the first image with a brightness greater than a preset brightness is determined. When the area of the first area is less than or equal to a preset area, it is determined that there is no dirt on the protective cover of the camera lens; when the area of the first area is greater than the preset area, the detection is continued, and when the third frame pulse corresponding to the third frame image arrives, the working mode of the infrared cutoff filter is kept switched to the full light transmission mode. Full light transmission mode, and keep the infrared fill light turned on; when the second frame pulse corresponding to the third image frame arrives, continue to detect dirt, switch the working mode of the infrared cutoff filter to the infrared light transmission mode, only transmit 850nm band, turn on the infrared fill light based on the preset frequency, control the image sensor to collect image based on a second exposure time that is less than the first exposure time, obtain a second image, determine a second area in the second image whose brightness is greater than a preset brightness, and when the difference between the area of the first area and the area of the second area is less than a preset value, determine that the protective cover of the camera device lens is dirty and needs to be cleaned; when the difference between the area of the first area and the area of the second area is greater than or equal to the preset value, determine that the protective cover of the camera device lens is not dirty, and the previous determination based on the first image that the protective cover is dirty is a false detection.
[0063] The following is a description of the camera device dirt detection device provided by the present invention. The camera device dirt detection device described below and the camera device dirt detection method described above can be referenced to each other.
[0064] Figure 6 is a schematic diagram of the structure of a camera device dirt detection device provided by an embodiment of the present invention. Figure 6 As shown, the camera device dirt detection device 600 includes a first control unit 601, a determination unit 602 and a detection unit 603; wherein: A first control unit 601 is used to turn on the infrared fill light based on a preset frequency when a first frame pulse arrives, and control the image sensor of the camera device to collect an image based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for dirt detection; A determining unit 602 is configured to determine a first area in the first image whose brightness is greater than a preset brightness; The detection unit 603 is used to perform dirt detection on the camera device based on the area of the first region.
[0065] The camera device dirt detection device provided by the present invention turns on the infrared fill light based on a preset frequency when the first frame pulse for dirt detection arrives, and controls the image sensor of the camera device to perform image acquisition based on a first exposure time to obtain a first image, determines a first area in the first image whose brightness is greater than a preset brightness, and performs dirt detection on the camera device based on the area of the first area. It can be seen that the present invention sets a first frame pulse for dirt detection, and when the first frame pulse arrives, uses the obvious reflection characteristics of dirt to infrared light to control the image sensor to collect the first image in an environment of the infrared fill light turned on based on a preset frequency, so that it can be determined whether the camera device is dirty based on the area of the first area in the first image that is greater than the preset brightness, thereby realizing automatic detection of dirt on the camera device, thereby improving the efficiency of dirt detection on the camera device.
[0066] Based on any of the above embodiments, the detection unit 603 is specifically used for: When the area of the first region is larger than the preset area and the second frame pulse arrives, the infrared fill light is turned on based on the preset frequency, and the image sensor is controlled to collect an image based on a second exposure duration to obtain a second image, wherein the second frame pulse is a pulse for dirt detection, and the second exposure duration is shorter than the first exposure duration; Determine a second area in the second image having a brightness greater than the preset brightness; When the difference between the area of the first region and the area of the second region is smaller than a preset value, it is determined that the camera device is dirty.
[0067] Based on any of the foregoing embodiments, the first control unit 601 is specifically configured to: Switching the working mode of the infrared cut-off filter of the camera device to an infrared light transmission mode; In the infrared light transmission mode, the image sensor is controlled to capture images based on the first exposure time.
[0068] Based on any of the above embodiments, the camera device dirt detection device 600 further includes: A second control unit is used to control the image sensor to perform image acquisition when a third frame pulse arrives, wherein the third frame pulse is a pulse for non-dirty detection, and the third frame pulse is at least one of the following pulses: a pulse between adjacent first frame pulses and second frame pulses, any pulse before the first frame pulse, and any pulse after the second frame pulse.
[0069] Based on any of the foregoing embodiments, the second control unit is specifically configured to: When the camera device operates in daytime mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the infrared light filtering mode, and the image sensor is controlled to capture images, and the infrared fill light is kept off.
[0070] Based on any of the above embodiments, the second control unit is further specifically configured to: When the camera device operates in night mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the full light transmission mode, the infrared fill light is turned on, and the image sensor is controlled to capture images.
[0071] Figure 7 is a schematic diagram of the physical structure of the camera device provided by an embodiment of the present invention, such as Figure 7 As shown, the camera device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a camera device dirt detection method, the method comprising: when a first frame pulse arrives, turning on an infrared fill light based on a preset frequency, and controlling the image sensor of the camera device to perform image acquisition based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for dirt detection; Determine a first area in the first image having brightness greater than a preset brightness; Based on the area of the first region, dirt detection is performed on the imaging device.
[0072] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0073] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the camera device dirt detection method provided by the above methods, the method comprising: when a first frame pulse arrives, turning on an infrared fill light based on a preset frequency, and controlling the image sensor of the camera device to perform image acquisition based on a first exposure duration to obtain a first image, the first frame pulse being a pulse for dirt detection; Determine a first area in the first image having brightness greater than a preset brightness; Based on the area of the first region, dirt detection is performed on the imaging device.
[0074] In another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for detecting dirtiness of a camera device provided by the above methods is implemented, the method comprising: when a first frame pulse arrives, turning on an infrared fill light based on a preset frequency, and controlling an image sensor of the camera device to perform image acquisition based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for detecting dirtiness; Determine a first area in the first image having brightness greater than a preset brightness; Based on the area of the first region, dirt detection is performed on the imaging device.
[0075] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0076] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting dirtiness of a camera device, characterized in that: include: When a first frame pulse arrives, the infrared fill light is turned on based on a preset frequency, and the image sensor of the camera device is controlled to collect an image based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for dirt detection; Determine a first area in the first image having brightness greater than a preset brightness; Based on the area of the first region, dirt detection is performed on the imaging device.
2. The method for detecting dirtiness of a camera device according to claim 1, characterized in that: The performing dirt detection on the camera device based on the area of the first region includes: When the area of the first region is larger than the preset area and the second frame pulse arrives, the infrared fill light is turned on based on the preset frequency, and the image sensor is controlled to collect an image based on a second exposure duration to obtain a second image, wherein the second frame pulse is a pulse for dirt detection, and the second exposure duration is shorter than the first exposure duration; Determine a second area in the second image having a brightness greater than the preset brightness; When the difference between the area of the first region and the area of the second region is smaller than a preset value, it is determined that the camera device is dirty.
3. The method for detecting dirtiness of a camera device according to claim 1, characterized in that: The controlling the image sensor of the camera device to collect images based on the first exposure duration includes: Switching the working mode of the infrared cut-off filter of the camera device to an infrared light transmission mode; In the infrared light transmission mode, the image sensor is controlled to capture images based on the first exposure time.
4. The method for detecting dirtiness of a camera device according to claim 2, characterized in that: The method further comprises: When the third frame pulse arrives, the image sensor is controlled to perform image acquisition, and the third frame pulse is a pulse used for non-dirty detection, and the third frame pulse is at least one of the following pulses: a pulse between adjacent first frame pulses and second frame pulses, any pulse before the first frame pulse, and any pulse after the second frame pulse.
5. The method for detecting dirtiness of a camera device according to claim 4, characterized in that: When the third frame pulse arrives, controlling the image sensor to collect an image comprises: When the camera device operates in daytime mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the infrared light filtering mode, the image sensor is controlled to capture images, and the infrared fill light is kept off.
6. The method for detecting dirtiness of a camera device according to claim 4, characterized in that: When the third frame pulse arrives, controlling the image sensor to collect an image comprises: When the camera device operates in night mode and the third frame pulse arrives, the operating mode of the infrared cutoff filter of the camera device is switched to the full light transmission mode, the infrared fill light is turned on, and the image sensor is controlled to capture images.
7. A camera equipment dirt detection device, characterized in that: include: A first control unit is used to turn on the infrared fill light based on a preset frequency when a first frame pulse arrives, and control the image sensor of the camera device to collect an image based on a first exposure duration to obtain a first image, wherein the first frame pulse is a pulse for dirt detection; A determining unit, configured to determine a first area in the first image having a brightness greater than a preset brightness; A detection unit is used to perform dirt detection on the camera device based on the area of the first region.
8. A camera device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for detecting dirtiness of the imaging device according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting dirtiness of an imaging device as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting dirtiness of an imaging device as claimed in any one of claims 1 to 6 is implemented.