CN-121999413-A - Abnormality detection method and device for lighting equipment, storage medium and electronic device
Abstract
The application discloses an anomaly detection method and device for lighting equipment, a storage medium and an electronic device, wherein the method comprises the steps of determining a target brightness level of each lighting equipment in a target area according to ambient light brightness in the target area, acquiring first video images corresponding to each lighting equipment when the lighting equipment is sequentially lightened based on the target brightness level, and respectively detecting anomaly of each lighting equipment according to each first video image and an anomaly spot template image to determine whether stains exist in the target object. According to the application, the problem of low detection accuracy of water stain detection caused by the fact that the water stain detection method in the related technology relies on manual inspection or passive image analysis can be solved.
Inventors
- Zhang Liugun
- XIONG JIANPING
- MAO LIJIAN
Assignees
- 浙江大华技术股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260126
Claims (13)
- 1. An abnormality detection method of a lighting device, characterized by comprising: Determining a target brightness level of each lighting device in a target object according to the ambient light brightness in a target area, wherein the target area comprises the target object; Under the condition that each lighting device is sequentially lightened based on the target brightness level, respectively acquiring first video images corresponding to each lighting device; and respectively carrying out anomaly detection on each lighting device according to each first video image and the anomaly spot template image so as to determine whether stains exist in the target object.
- 2. The abnormality detection method of lighting devices of claim 1, characterized in that before determining a target brightness level of each lighting device in a target object from ambient light brightness in a target area, the method further comprises: acquiring a target image corresponding to the target region, and determining the number of pixel points of a first pixel point corresponding to each gray value contained in the target image; And determining the ambient light brightness according to the pixel point number of the first pixel point corresponding to each gray value and a preset brightness threshold value.
- 3. The abnormality detection method of a lighting device according to claim 2, wherein determining the ambient light level according to the number of pixels of the first pixel corresponding to each gray value and a preset brightness threshold value includes: Determining the ambient light level according to a first formula, wherein the first formula is: , For the ambient light level, k is a gray value, p is a preset brightness threshold, And the number of the pixel points of the first pixel point corresponding to the gray value i contained in the target image is the number of the pixel points of the first pixel point.
- 4. The abnormality detection method of lighting devices according to claim 1, characterized in that determining a target brightness level of each lighting device in a target object from an ambient light level in a target area, comprises: And matching the ambient light brightness with a preset brightness level table to determine the brightness level matched with the ambient light brightness in the preset brightness level table, and determining the brightness level matched with the ambient light brightness in the preset brightness level table as the target brightness level.
- 5. The abnormality detection method of lighting devices according to claim 1, characterized in that after determining a target brightness level of each lighting device in a target object from ambient light brightness in a target area, the method further comprises: Determining a brightness parameter corresponding to the target brightness level; constructing a target instruction corresponding to each lighting device according to the brightness parameter and the device identifier corresponding to each lighting device; and sending the target instruction to the target object in turn to light each lighting device in the target object in turn.
- 6. The abnormality detection method of lighting devices according to claim 1, wherein abnormality detection is performed on each lighting device based on each first video image and an abnormality spot template image to determine whether or not stains are present in the target object, respectively, comprising: Training an anomaly detection model according to the anomaly spot template image; respectively inputting each first video image into a trained abnormality detection model so that the trained abnormality detection model outputs a detection result corresponding to each first video image; Under the condition that each detection result is a normal detection result, determining that no stain exists in the target object; and determining that stains exist in the target object under the condition that any detection result is determined to be an abnormal detection result.
- 7. The abnormality detection method of lighting devices according to claim 1, characterized in that after abnormality detection is performed on each lighting device separately from each first video image and an abnormality spot template image to determine whether or not there is a stain in the target object, the method further comprises: And operating the cleaning equipment in the target object to enable the cleaning equipment to clean the target object under the condition that the stain exists in the target object.
- 8. The abnormality detection method of a lighting device according to claim 7, characterized in that after operating a cleaning device in the target object to cause the cleaning device to clean the target object, the method further comprises: Under the condition that each cleaned lighting device is lightened in sequence at the target brightness level, respectively acquiring a second video image corresponding to each cleaned lighting device, wherein each cleaned lighting device is used for indicating each lighting device in a cleaned target object obtained after cleaning the target object; Determining a first pixel value corresponding to each second pixel point contained in the first video image, and determining a second pixel value corresponding to each third pixel point contained in the second video image; and respectively carrying out anomaly detection on each cleaned lighting device according to the first pixel value and the second pixel value so as to determine whether stains exist in the cleaned target object.
- 9. The abnormality detection method of a lighting device according to claim 8, wherein performing abnormality detection on each of the cleaned lighting devices based on the first pixel value and the second pixel value, respectively, to determine whether or not stains are present in the cleaned target object, comprises: determining pixel difference values corresponding to the first video image and the second video image; Comparing the pixel difference value with a preset threshold value to determine a comparison result; And if the comparison result indicates that the pixel difference value is smaller than the preset threshold value, determining that no stain exists in the cleaned target object.
- 10. The abnormality detection method of a lighting device according to claim 9, wherein determining pixel differences corresponding to the first video image and the second video image includes: calculating the pixel difference value according to a second formula, wherein the second formula is: , For the difference value of the pixel value, For a first pixel value of a second pixel point in the first video image at an (x, y) coordinate location, And (3) taking the second pixel value of a third pixel point at the (x, y) coordinate position in the second video image as a second pixel value, wherein M is the number of the second pixel point, and N is the number of the third pixel point.
- 11. An abnormality detection apparatus for a lighting device, comprising: A determining module, configured to determine a target brightness level of each lighting device in a target object according to an ambient light brightness in a target area, where the target area includes the target object; An acquisition module, configured to, when each of the lighting devices is sequentially turned on based on the target brightness level, acquire a first video image corresponding to each of the lighting devices; and the detection module is used for respectively carrying out anomaly detection on each lighting device according to each first video image and each anomaly spot template image so as to determine whether stains exist in the target object.
- 12. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program runs the method according to any one of claims 1 to 10.
- 13. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the method according to any of the claims 1 to 10 by means of the computer program.
Description
Abnormality detection method and device for lighting equipment, storage medium and electronic device Technical Field The application relates to the technical field of video image processing, in particular to an abnormality detection method and device of lighting equipment, a storage medium and an electronic device. Background In outdoor monitoring scenes, rainwater, fog or condensed water easily form water stains on the surface of a lens, so that imaging is fuzzy, and monitoring effects are affected. The traditional water stain detection method relies on manual inspection or passive image analysis, and has the problems of slow response and high false alarm rate. Therefore, the related art has the problem of low detection accuracy of water stain detection due to the dependence of manual inspection or passive image analysis on water stain detection. Aiming at the problem that the detection accuracy of water stain detection is low due to the fact that the water stain detection method in the related technology relies on manual inspection or passive image analysis, no effective solution is proposed yet. Disclosure of Invention The embodiment of the application provides an anomaly detection method and device of lighting equipment, a storage medium and an electronic device, which at least solve the problem of low detection accuracy of water stain detection caused by the fact that a water stain detection method in the related technology depends on manual inspection or passive image analysis. According to one aspect of the embodiment of the application, the abnormality detection method of the lighting equipment comprises the steps of determining a target brightness level of each lighting equipment in a target area according to the ambient light brightness in the target area, wherein the target area comprises the target object, respectively acquiring first video images corresponding to each lighting equipment when the lighting equipment is sequentially lightened based on the target brightness level, and respectively carrying out abnormality detection on each lighting equipment according to each first video image and an abnormal spot template image to determine whether stains exist in the target object. In an exemplary embodiment, before determining the target brightness level of each lighting device in the target object according to the ambient light brightness in the target area, the method further comprises the steps of obtaining a target image corresponding to the target area, determining the number of pixels of the first pixel corresponding to each gray value contained in the target image, and determining the ambient light brightness according to the number of pixels of the first pixel corresponding to each gray value and a preset brightness threshold. In an exemplary embodiment, determining the ambient light brightness according to the number of pixels of the first pixel corresponding to each gray value and a preset brightness threshold value includes determining the ambient light brightness according to a first formula, where the first formula is:, For the ambient light level, k is a gray value, p is a preset brightness threshold, And the number of the pixel points of the first pixel point corresponding to the gray value i contained in the target image is the number of the pixel points of the first pixel point. In one exemplary embodiment, determining a target brightness level for each lighting device in a target object based on ambient light levels within a target area includes matching the ambient light levels with a preset brightness level table to determine brightness levels matching the ambient light levels in the preset brightness level table, and determining brightness levels matching the ambient light levels in the preset brightness level table as the target brightness levels. In one exemplary embodiment, after determining the target brightness level of each lighting device in the target object according to the ambient light brightness in the target area, the method further comprises determining a brightness parameter corresponding to the target brightness level, constructing a target instruction corresponding to each lighting device according to the brightness parameter and the device identifier corresponding to each lighting device, and sequentially sending the target instruction to the target object to sequentially light each lighting device in the target object. In an exemplary embodiment, the method for determining whether the target object has the stain includes the steps of respectively performing anomaly detection on each lighting device according to each first video image and each anomaly spot template image to determine whether the target object has the stain, training an anomaly detection model according to each anomaly spot template image, respectively inputting each first video image into the trained anomaly detection model to enable the trained anomaly detection model to output a detection