Determination Method, Device, Storage Medium and Electronic Device for Abnormal State of Signal Lamp

By adjusting the camera equipment parameters and equipment parameters, and obtaining and processing the brightness of the signal light, the problem of low accuracy in determining abnormal state of the signal light is solved, and high accuracy and stability of the signal light brightness statistics in different environments are achieved.

CN119854656BActive Publication Date: 2025-07-22ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510327004.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-07-22
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

In the prior art, the accuracy of determining abnormal state of the signal lamp is low and the environmental adaptability is poor.

Method used

By adjusting the camera parameters and equipment parameters of the camera device, the target signal light brightness in the detection frame image is obtained, and the signal light brightness is adjusted based on these parameters to determine its abnormal state, including the comprehensive use of exposure time, gain parameters, aperture value and transmittance, and normalization processing, to ensure that the signal light brightness is within a reasonable range.

Benefits of technology

It improves the accuracy of determining abnormal state of the signal light, enhances the adaptability in different environments, and ensures the accuracy and stability of the signal light brightness statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854656B_ABST
    Figure CN119854656B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, device, storage medium, and electronic device for determining an abnormal state of a signal lamp. The method includes: when the imaging parameters of an imaging device meet a predetermined condition, acquiring a detected frame image collected by the imaging device; determining a first signal lamp brightness of a target signal lamp of a target color included in the detected frame image; adjusting the first signal lamp brightness based on the imaging parameters of the imaging device and device parameters when collecting the detected frame image to obtain a second signal lamp brightness; and determining an abnormal state of the target signal lamp based on the second signal lamp brightness. Through the present invention, the technical problem of poor accuracy in determining the abnormal state of a signal lamp in the related art is solved, and the effect of improving the accuracy of determining the abnormal state of a signal lamp is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communications, and in particular, to a method, apparatus, storage medium, and electronic device for determining an abnormal state of a signal lamp. Background Art

[0002] An important basis for monitoring and capturing is the color state of the signal lamp. Since the signal lamp is used for a long time, its brightness will gradually become dim, affecting the recognition of the video signal lamp and thus the recognition effect of the capture. In the related art, usually two preset cameras with fixed parameters are used to detect the corresponding brightness and compare them, but the detection environment needs to be stable and the adaptability is poor.

[0003] It can be seen that there is a technical problem of poor accuracy in determining the abnormal state of the signal lamp in the related art.

[0004] In view of the above problems in the related art, no effective solution has been proposed yet. Summary of the Invention

[0005] The embodiments of the present invention provide a method, apparatus, storage medium, and electronic device for determining an abnormal state of a signal lamp, so as to at least solve the problem of poor accuracy in determining the abnormal state of the signal lamp in the related art.

[0006] According to an embodiment of the present invention, there is provided a method for determining an abnormal state of a signal lamp, including: obtaining a detected frame image collected by the imaging device when the imaging parameters of the imaging device meet a predetermined condition; determining a first signal lamp brightness of a target signal lamp of a target color included in the detected frame image; adjusting the first signal lamp brightness based on the imaging parameters of the imaging device and the device parameters when collecting the detected frame image to obtain a second signal lamp brightness; and determining the abnormal state of the target signal lamp based on the second signal lamp brightness.

[0007] In an exemplary embodiment, adjusting the first signal lamp brightness based on the imaging parameters of the imaging device and the device parameters when collecting the detected frame image to obtain a second signal lamp brightness includes: determining an exposure time, a gain parameter, and an aperture value included in the imaging parameters; determining a transmittance included in the device parameters; and adjusting the first signal lamp brightness based on the exposure time, the gain parameter, the aperture value, and the transmittance to obtain the second signal lamp brightness.

[0008] In an exemplary embodiment, adjusting the brightness of the first signal lamp based on the exposure time, the gain parameter, the aperture value, and the transmittance to obtain the brightness of the second signal lamp includes: determining a first ratio of the gain parameter to a first constant; determining a first value that is the power of the first ratio of the second constant; determining a second value that is the square value of the aperture value; determining a first product of the exposure time, the first value, the second value, and the transmittance; and determining a second ratio of the brightness of the first signal lamp to the first product as the brightness of the second signal lamp.

[0009] In an exemplary embodiment, after adjusting the brightness of the first signal lamp based on the imaging parameters and device parameters of the imaging device when collecting the detection frame image to obtain the brightness of the second signal lamp, the method further includes: determining a first minimum signal lamp brightness and a first maximum signal lamp brightness collected by the imaging device under preset parameters; adjusting the first minimum signal lamp brightness based on the preset parameters to obtain a second minimum signal lamp brightness; adjusting the first maximum signal lamp brightness based on the preset parameters to obtain a second maximum signal lamp brightness; normalizing the brightness of the second signal lamp based on the second minimum signal lamp brightness and the second maximum signal lamp brightness to obtain a third signal lamp brightness; and updating the brightness of the second signal lamp to the third signal lamp brightness.

[0010] In an exemplary embodiment, normalizing the brightness of the second signal lamp based on the second minimum signal lamp brightness and the second maximum signal lamp brightness to obtain the third signal lamp brightness includes: when the brightness of the second signal lamp is less than the second minimum signal lamp brightness, determining a first set value as the third signal lamp brightness; when the brightness of the second signal lamp is greater than the second maximum signal lamp brightness, determining a second set value as the third signal lamp brightness; when the brightness of the second signal lamp is greater than or equal to the second minimum signal lamp brightness and less than or equal to the second maximum signal lamp brightness, determining a first difference between the brightness of the second signal lamp and the second minimum signal lamp brightness, determining a second difference between the second maximum signal lamp brightness and the second minimum signal lamp brightness, determining a third ratio of the first difference to the second difference, determining a third difference between the second set value and the first set value, determining a second product of the third ratio and the third difference, and determining a sum value of the second product and the first set value as the third signal lamp brightness, where the second set value is greater than the first set value.

[0011] In an exemplary embodiment, determining the first signal lamp brightness of a target signal lamp of a target color included in the detected frame image includes: determining the signal lamp image included in the detected frame image; determining the pixel points belonging to the target signal lamp included in the signal lamp image; and determining the average brightness of the pixel points as the first signal lamp brightness.

[0012] In an exemplary embodiment, before acquiring the detected frame image acquired by the imaging device, the method further includes: acquiring a target image acquired by the imaging device; determining an average brightness of a signal lamp of a predetermined color included in the target image; determining that the imaging parameters meet the predetermined conditions when the average brightness is within a preset brightness range; increasing the exposure time included in the imaging parameters when the average brightness is less than the minimum value of the preset brightness range; and decreasing the exposure time included in the imaging parameters when the average brightness is greater than the maximum value of the preset brightness range.

[0013] In an exemplary embodiment, the predetermined color is red.

[0014] In an exemplary embodiment, determining the abnormal state of the target signal lamp based on the second signal lamp brightness: determining that the brightness of the target signal lamp is abnormal in the detected frame image when the second signal lamp brightness is less than a brightness threshold; determining a target number of times that the brightness of the target signal lamp is abnormal in the detected frame and other detected frame images, where the other detected frame images are images acquired after the detected frame image; and determining that the abnormal state of the target signal lamp is signal lamp brightness abnormal when the target number of times is greater than a preset number of times.

[0015] According to another embodiment of the present invention, there is provided a device for determining an abnormal state of a signal lamp, including: an acquisition module, configured to acquire a detected frame image acquired by the imaging device when the imaging parameters of the imaging device meet predetermined conditions; a first determination module, configured to determine a first signal lamp brightness of a target signal lamp of a target color included in the detected frame image; an acquisition module, configured to adjust the first signal lamp brightness based on the imaging parameters and device parameters of the imaging device when acquiring the detected frame image to obtain a second signal lamp brightness; and a second determination module, configured to determine the abnormal state of the target signal lamp based on the second signal lamp brightness.

[0016] According to still another embodiment of the present invention, there is further provided a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0017] According to another embodiment of the present invention, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0018] According to another embodiment of the present invention, there is also provided a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the methods in the various embodiments of the present application are implemented.

[0019] Through the present invention, the imaging parameters of an imaging device can be adjusted. Under the condition that the imaging parameters meet a predetermined condition, a detection frame image can be collected by the imaging device. Determine the first signal brightness of the target signal lamp of the target color in the detection frame image collected by the imaging device, and record the imaging parameters corresponding to the imaging device. Then, based on the first signal brightness and the imaging parameters of the imaging device, the second signal lamp brightness after removing environmental interference can be determined. Based on the second signal lamp brightness, the abnormal state of the target signal lamp can be determined. Since the imaging parameters of the imaging device are comprehensively considered, environmental interference can be excluded. In addition, by separately setting a detection frame for the signal lamp effect, the statistical signal lamp brightness can be made more accurate. Therefore, the technical problem of poor accuracy in determining the abnormal state of the signal lamp in the related art can be solved, and the effect of improving the accuracy of determining the abnormal state of the signal lamp is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 is a hardware structure block diagram of a mobile terminal for a method for determining the abnormal state of a signal lamp according to an embodiment of the present invention;

[0021] Figure 2 is a flowchart of a method for determining the abnormal state of a signal lamp according to an embodiment of the present invention;

[0022] Figure 3 is a signal lamp area according to an embodiment of the present invention;

[0023] Figure 4 is a flowchart of an image segmentation process according to an embodiment of the present invention;

[0024] Figure 5 is a schematic diagram of the process of raw signal lamp brightness adjustment and statistics according to an embodiment of the present invention;

[0025] Figure 6 is a schematic diagram of the process for judging insufficient brightness of a target signal lamp according to an embodiment of the present invention;

[0026] Figure 7 is a flowchart of a method for determining the abnormal state of a signal lamp according to a specific embodiment of the present invention;

[0027] Figure 8 It is a structural block diagram of a device for determining the abnormal state of a signal lamp according to an embodiment of the present invention. Detailed implementation manners

[0028] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence.

[0030] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 It is a hardware structural block diagram of a mobile terminal for a method of determining the abnormal state of a signal lamp according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above-mentioned mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may further include more or fewer components than Figure 1 shown in the figure, or have a configuration different from Figure 1 shown in the figure.

[0031] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the method for determining the abnormal state of a signal lamp in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories may be connected to the mobile terminal through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of a mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] In this embodiment, a method for determining the abnormal state of a signal lamp is provided. Figure 2 It is a flowchart of the method for determining the abnormal state of a signal lamp according to an embodiment of the present invention. As Figure 2 shown, the process includes the following steps:

[0034] Step S202, when the imaging parameters of the imaging device meet a predetermined condition, obtain the detected frame image collected by the imaging device;

[0035] Step S204, determine the first signal lamp brightness of the target signal lamp of the target color included in the detected frame image;

[0036] Step S206, adjust the first signal lamp brightness based on the imaging parameters of the imaging device and the device parameters when collecting the detected frame image to obtain the second signal lamp brightness;

[0037] Step S208, determine the abnormal state of the target signal lamp based on the second signal lamp brightness.

[0038] In the above embodiment, all frames captured by the imaging device can be divided into video frames and detected frames. Video frames can be used to monitor and capture illegal acts, and detected frames can be responsible for detecting the effect of signal lamps. Therefore, it is possible to mainly detect the insufficient brightness of the signal lamps in the detected frames. Among them, the imaging device can be a camera, a camera head, or any other device with a shooting ability. For the detected frame, the imaging parameters of the imaging device that captures the detected frame can be adjusted by the brightness of the signal lamp in the raw (RAW Domain) domain, which can ensure that the brightness of the signal lamp on the raw is within a reasonable range, that is, most of the pixel points in the signal lamp are not overexposed or underexposed. Among them, the detected frame image can be an original data image, that is, raw domain data. The raw domain can be understood as the original data output from the sensor without any processing.

[0039] In the above embodiments, the imaging parameters of the imaging device may be determined based on the images captured by the imaging device before capturing the detection frame image. When the imaging parameters do not meet the predetermined conditions, the imaging parameters of the imaging device are adjusted until the imaging parameters of the imaging device meet the predetermined conditions. Among them, determining whether the imaging parameters of the imaging device meet the predetermined conditions may include: obtaining N frames of images captured by the imaging device between capturing the detection frame image, determining the average brightness of the signal lights in each frame of image included in the N frames of images, and determining that the imaging parameters of the imaging device meet the predetermined conditions when the average brightness is within the set interval, and determining that the imaging parameters of the imaging device do not meet the predetermined conditions when the average brightness is outside the set area.

[0040] In the above embodiments, before determining the target signal light of the target color, a target signal light image may be determined in the detection frame image. For example, a rectangular frame input through the target interface may be received, and the image corresponding to the rectangular frame area may be determined as the signal light area. After determining the signal light area, a foreground area and a background area may also be determined in the signal light area, where the foreground area may be the light-emitting area and the background area may be the lamp panel area of the signal light. The schematic diagram of the signal light area can be seen Figure 3 , Figure 3 is the schematic diagram of the signal light area according to the embodiment of the present invention. As Figure 3 shown, the larger rectangular frame is the signal light area that the user can define, and the recognition module of the signal light will recognize this area and output the color state of the signal lights in the signal light group and the rectangular area outside the signal light. Inside the rectangular area outside the signal light, the foreground points of the signal light can be segmented. Since in this rectangular frame, except for the signal light, it is the lamp panel area, if the histogram distribution form is used, the result is basically the shape of two peaks. Considering the real-time detection and time-consuming related issues of the brightness statistics of the signal light, the global threshold segmentation method can be selected to achieve this.

[0041] In the above embodiments, Figure 4 is the flowchart of the image segmentation process according to the embodiment of the present invention. As Figure 4As shown, after obtaining the frame coordinates of the target signal light, the average gray value Me of the pixel points within the frame can be calculated, and the average gray value Me is set as the initial segmentation threshold T, that is, T = Me. Initialize the iteration count as 0, and determine the relationship between the current iteration count and M. If it is less than M, enter the next iteration, and at this time, the iteration count count is incremented by 1. If it is not less than M, end the process. Here, M can be understood as the number of signal light groups. Based on the initial segmentation threshold T, the pixel points within the frame can be divided into foreground points and background points. Calculate the average gray value Me1 of all foreground points within the frame and the average gray value Me2 of all background points within the frame respectively. The new segmentation threshold Tnext can be calculated from Me1 and Me2: Tnext = 0.5 * (Me1 + Me2). Here, the foreground points can be understood as pixel points greater than or equal to the initial segmentation threshold T, and the background points can be understood as pixel points less than the initial segmentation threshold T. Compare the new segmentation threshold Tnext with the initial segmentation threshold T. If the difference between the two is less than or equal to Tc, the final segmentation threshold T = Tnext, and the iteration process ends; if the difference between the two is greater than Tc, enter the next iteration. Here, Tc can be 1, can be 2, 5, but is not limited thereto.

[0042] In the above embodiment, when it is determined that the parameters of the imaging device meet the predetermined conditions, the detection frame image captured by the imaging device at this time can be obtained. In the detection frame image, the first signal light brightness of the target color light in the target signal light can be determined. According to the first signal light brightness and the imaging parameters of the imaging device when the detection frame image is captured, the second signal light brightness can be adjusted, and the abnormal state of the target signal light can be determined based on the adjusted second signal light brightness. Here, the target color can be yellow, red, or green.

[0043] Through the present invention, the imaging parameters of the imaging device can be adjusted. When the imaging parameters meet the predetermined conditions, the detection frame image can be collected by the imaging device. Determine the first signal brightness of the target signal light of the target color in the detection frame image collected by the imaging device, and record the corresponding imaging parameters of the imaging device. Then, the second signal light brightness after removing environmental interference can be determined through the first signal brightness and the imaging parameters of the imaging device. Based on the second signal light brightness, the abnormal state of the target signal light can be determined. Since the imaging parameters of the imaging device are comprehensively considered, environmental interference can be excluded. In addition, a separate detection frame is set to be responsible for the signal light effect, which can make the statistical signal light brightness more accurate. Therefore, the technical problem of poor accuracy in determining the abnormal state of the signal light in the related art can be solved, and the effect of improving the accuracy of determining the abnormal state of the signal light is achieved.

[0044] Optionally, the execution entity of the above steps may be a background processor, or other devices with similar processing capabilities, or may also be a machine integrated with at least an image acquisition device and a data processing device. Among them, the image acquisition device may include a graphic acquisition module such as a camera, and the data processing device may include terminals such as a computer and a mobile phone, but is not limited thereto.

[0045] In an exemplary embodiment, adjusting the brightness of the first signal lamp based on the imaging parameters and device parameters of the imaging device when acquiring the detected frame image to obtain the brightness of the second signal lamp includes: determining the exposure time, gain parameter, and aperture value included in the imaging parameters; determining the transmittance included in the device parameters; adjusting the brightness of the first signal lamp based on the exposure time, the gain parameter, the aperture value, and the transmittance to obtain the brightness of the second signal lamp.

[0046] In the above embodiment, the imaging parameters of the imaging device may include the exposure time, gain parameter, and aperture value, and the device parameters may include the transmittance corresponding to the filter type. Among them, the exposure time can be understood as the shutter time corresponding to the exposure of the imaging device; the gain parameter can be understood as the process of improving the image brightness by electronically amplifying the signal; the aperture value can be understood as the opening size of the lens of the imaging device to control the amount of light entering the imaging device, which can affect the amount of light entering; the filter type can be a MICR micro filter, a polarizer, a neutral gray filter, etc., and the light transmittance of different types of filters is different. According to the determined exposure time, gain parameter, aperture value, and transmittance of the imaging device, the brightness of the first signal lamp can be adjusted to obtain the brightness of the second signal lamp.

[0047] In an exemplary embodiment, adjusting the brightness of the first signal lamp based on the exposure time, the gain parameter, the aperture value, and the transmittance to obtain the brightness of the second signal lamp includes: determining a first ratio of the gain parameter to a first constant; determining a first value that is the power of the first ratio of a second constant; determining a second value that is the square value of the aperture value; determining a first product of the exposure time and the first value, the second value, and the transmittance; determining a second ratio of the brightness of the first signal lamp to the first product as the brightness of the second signal lamp.

[0048] In the above embodiment, taking the transmittance of the filter Micr as Kicr, the exposure time as cur_shut (unit: ms), the gain parameter as cur_gain (unit: db), and the aperture value Viris as an example, the brightness Y2 of the second signal lamp can be calculated by the following formula: , where Y1 can be understood as the brightness of the first signal lamp, that is, the first ratio of the above gain parameter to the first constant, That is, the first numerical value determined by the first ratio power of the second constant as described above. That is, the second numerical value determined by the square value of the aperture value as described above.

[0049] In the above embodiment, the brightness of the second signal lamp can also be calculated through a functional relationship: when the aperture value is fixed, the brightness of the second signal lamp is inversely proportional to the conversion multiple of the exposure gain and the transmittance of the filter; when the aperture value and the transmittance of the filter are fixed, the brightness of the second signal lamp is inversely proportional to the conversion multiple of the exposure gain. In addition, the brightness of the second signal lamp can also be calculated through a fitting relationship that is inversely proportional to the exposure time, exposure gain, square of the aperture value (corresponding to the light incident amount), and transmittance of the filter.

[0050] In an exemplary embodiment, after adjusting the brightness of the first signal lamp based on the imaging parameters and device parameters of the imaging device when collecting the detection frame image to obtain the brightness of the second signal lamp, the method further includes: determining the first minimum signal lamp brightness and the first maximum signal lamp brightness collected by the imaging device under preset parameters; adjusting the first minimum signal lamp brightness based on the preset parameters to obtain the second minimum signal lamp brightness; adjusting the first maximum signal lamp brightness based on the preset parameters to obtain the second maximum signal lamp brightness; normalizing the brightness of the second signal lamp based on the second minimum signal lamp brightness and the second maximum signal lamp brightness to obtain the brightness of the third signal lamp; updating the brightness of the second signal lamp to the brightness of the third signal lamp.

[0051] In the above embodiment, the preset parameters of the imaging device can be understood as the preset exposure time cur_shuts (unit: ms), gain parameter cur_gains (unit: db), aperture value Vs, and filter type Ms (transmittance Ks). It is possible to determine the maximum value Y of the signal lamp brightness in the detection frame collected by the imaging device under the above preset parameters 1smax (that is, the above first maximum signal lamp brightness) and the minimum value Y 1smin (that is, the above first minimum signal lamp brightness). The first maximum signal lamp brightness and the first minimum signal lamp brightness can be adjusted according to the preset parameters to obtain the second minimum signal lamp brightness Y 2smin and the second maximum signal lamp brightness Y 2smax , where Y 2smin and Y 2smax can be calculated through the following formula: . Using Y 2smin and Y 2smaxNormalize the brightness Y2 of the second signal lamp, which can normalize the brightness Y2 of the second signal lamp to a specific range to obtain the brightness Y3 of the third signal lamp, and update the brightness of the second signal lamp to the brightness of the third signal lamp. Among them, the normalization process can be understood as the process of converting a dimensional expression into a dimensionless expression through mathematical transformation, that is, it is used to simplify calculations and eliminate differences between different dimensions.

[0052] In an exemplary embodiment, normalizing the brightness of the second signal lamp based on the second minimum signal lamp brightness and the second maximum signal lamp brightness to obtain the brightness of the third signal lamp includes: when the brightness of the second signal lamp is less than the second minimum signal lamp brightness, determining the first set value as the brightness of the third signal lamp; when the brightness of the second signal lamp is greater than the second maximum signal lamp brightness, determining the second set value as the brightness of the third signal lamp; when the brightness of the second signal lamp is greater than or equal to the second minimum signal lamp brightness and the brightness of the second signal lamp is less than or equal to the second maximum signal lamp brightness, determining a first difference between the brightness of the second signal lamp and the second minimum signal lamp brightness, determining a second difference between the second maximum signal lamp brightness and the second minimum signal lamp brightness, determining a third ratio of the first difference to the second difference, determining a third difference between the second set value and the first set value, determining a second product of the third ratio and the third difference, and determining the sum value of the second product and the first set value as the brightness of the third signal lamp, where the second set value is greater than the first set value.

[0053] In the above embodiment, the brightness Y2 of the second signal lamp can be normalized to a specific range from the first set value Y 3min to the second set value Y 3max : When the brightness Y2 of the second signal lamp is less than the second minimum signal lamp brightness Y 2smin , the brightness Y3 of the third signal lamp can be determined as the first set value Y 3min ; when the brightness Y2 of the second signal lamp is greater than the second maximum signal lamp brightness Y 2smax , the brightness Y3 of the third signal lamp can be determined as the second set value Y 3max ; when the brightness Y2 of the second signal lamp is between the second minimum signal lamp brightness Y 2smin and the second maximum signal lamp brightness Y 2smax , it can be determined by linear mapping, that is, the brightness Y3 of the third signal lamp can be calculated by the following formula: Y3 = , where can be understood as the first difference between the brightness of the second signal lamp and the second minimum signal lamp brightness, It can be understood as the second difference between the second maximum signal lamp brightness and the second minimum signal lamp brightness. It can be understood as the third ratio of the first difference to the second difference. It can be understood as the third difference between the second set value and the first set value.

[0054] In an exemplary embodiment, determining the first signal lamp brightness of the target signal lamp of the target color included in the detected frame image includes: determining the signal lamp image included in the detected frame image; determining the pixel points belonging to the target signal lamp included in the signal lamp image; and determining the average brightness of the pixel points as the first signal lamp brightness.

[0055] In the above embodiment, after the imaging parameters of the imaging device meet the predetermined conditions, the foreground points among the pixel points of each target signal lamp can be filtered out by combining the color information and the signal lamp coordinate information of the signal lamp recognition module, and the average brightness of the signal lamp can be counted. Since the bit positions of different sensors are inconsistent, the above average brightness can be unified to a specific bit position, such as 8 bits, 16 bits, etc. This average brightness can be determined as the first signal lamp brightness Y1, and the imaging parameters of the imaging device at this time can be recorded simultaneously.

[0056] In the above embodiment, the signal lamp image can be recognized from the detected frame image by machine learning. The signal lamp image is the signal lamp area in the detected frame image. The signal lamp area can also be determined by receiving a rectangular box input through the target interface. For example, the image at the position of the rectangular box in the detected frame image is determined as the signal lamp image. After determining the signal lamp image, the foreground area and the background area in the signal lamp image can be determined, and the pixel points in the foreground area are the pixel points of the target signal lamp.

[0057] In the above embodiment, the signal lamp image may include images of multiple signal lamp groups. When the signal lamp image includes images of multiple signal lamp groups, the average brightness of the target signal lamp in the multiple signal lamp groups is determined as the first signal lamp brightness. For example, the signal lamp image includes 3 groups of signal lamp groups. The first group of signal lamp groups includes red lamp 1, green lamp 1, and yellow lamp 1. The second group of signal lamp groups includes red lamp 2, green lamp 2, and yellow lamp 2. The third group of signal lamp groups includes red lamp 3, green lamp 3, and yellow lamp 3. When the target signal lamp is a red lamp, the first signal lamp brightness is the average brightness of the brightnesses of red lamp 1, red lamp 2, and red lamp 3. When the signal lamp image only includes one group of signal lamp groups, such as only including red lamp 1, green lamp 1, and yellow lamp 1 included in the first group of signal lamp groups, when the target signal lamp is a red lamp, the first signal lamp brightness is the brightness of red lamp 1. When determining the brightness of each signal lamp, the average brightness of all the pixel points of the signal lamp can be determined, and the average brightness of all the pixel points is determined as the signal lamp brightness.

[0058] In an exemplary embodiment, before obtaining the detection frame image collected by the imaging device, the method further includes: obtaining a target image collected by the imaging device; determining an average brightness of signal lights of a predetermined color included in the target image; in a case where the average brightness is within a preset brightness range, determining that the imaging parameters meet the predetermined conditions; in a case where the average brightness is less than the minimum value of the preset brightness range, increasing the exposure time included in the imaging parameters; and in a case where the average brightness is greater than the maximum value of the preset brightness range, decreasing the exposure time included in the imaging parameters.

[0059] In the above embodiment, before the imaging device collects a detection frame image, the imaging parameters of the imaging device can be adjusted for different environments: the average brightness of the signal lights included in the target image collected by the imaging device in this environment can be compared with the preset brightness range first, and by adjusting the exposure time of the imaging device, the brightness of the signal lights in the captured image can be within the preset brightness range, ensuring that the average brightness of the signal lights collected by the imaging device in this environment is moderate. Since the imaging device can adaptively adjust the imaging parameters for different shooting environments, it is ensured that the imaging device can better adapt to various lighting conditions. Whether it is a sunny day with high brightness or a cloudy day with low illuminance, the brightness of the signal lights captured by the imaging device can be properly exposed. In addition, through adaptive adjustment, the imaging device can better process scenes with a dynamic range, retain details of bright and dark parts, obtain clearer images, and improve the shooting efficiency, that is, in a rapidly changing environment, it can quickly adapt to changes in light. Furthermore, the environmental adaptability of the method for determining the abnormal state of the signal light is improved, and the problem in the related art that only fixed parameters can be used to collect images, resulting in poor environmental adaptability, is solved.

[0060] In the above embodiment, continue to refer to Figure 3 , within the signal light frame, the average brightness of a predetermined color can be statistically obtained based on the foreground points segmented, and thus the average brightness of the predetermined color can be obtained. The predetermined color can be red, yellow, or green. If the average brightness is within the preset brightness range, it is determined that the imaging parameters meet the predetermined conditions, that is, the brightness of the signal light is within a reasonable range, and most of the pixel points in the signal light are not overexposed or underexposed; if the average brightness is less than the minimum value of the preset brightness range, the exposure time of the imaging device is increased; if the average brightness is greater than the maximum value of the preset brightness range, the exposure time of the imaging device is decreased. Among them, for determining whether the imaging parameters meet the predetermined conditions, reference can be made to Figure 5 , Figure 5 is a process diagram of raw signal light brightness adjustment and statistics according to an embodiment of the present invention. The process includes:

[0061] Step S502, start;

[0062] Step S504, determine whether the current frame is a detection frame. If so, execute Step S506; if not, execute Step S524.

[0063] Step S506, obtain the results of the traffic signal recognition module: traffic signal box coordinates + color information.

[0064] Step S508, determine whether there is a traffic signal currently. If so, execute Step S510; if not, execute Step S524.

[0065] Step S510, determine whether there is a red light currently. If so, execute Step S512; if not, execute Step S524.

[0066] Step S512, perform foreground point screening on the image.

[0067] Step S514, calculate the average brightness of each red light.

[0068] Step S516, calculate the average brightness of all red lights.

[0069] Step S518, determine whether the average brightness of the red lights is within a reasonable range. If so, execute Step S522; if not, execute Step S520.

[0070] Step S520, adjust the camera parameters of the detection frame.

[0071] Step S522, screen the foreground points of each traffic signal and count the brightness.

[0072] Step S524, end.

[0073] In the above embodiments, the results processed by the traffic signal recognition module of the detection frame can be obtained first, which may include the traffic signal box coordinates and color information. Within the circumscribed rectangle area of the traffic signal, the foreground points of the traffic signal can be segmented, and the average brightness of all red lights can be counted and calculated. If it is within a reasonable range, the foreground points of each traffic signal are screened and the brightness is counted. If the average brightness does not meet the reasonable range, the camera parameters of the detection frame imaging device are adjusted.

[0074] In an exemplary embodiment, the predetermined color is red. In this embodiment, since it is considered that the red traffic signal is more likely to be overexposed compared to the lights of the other two colors, the exposure parameters of the detection frame imaging device can be adjusted according to the average brightness of the red (i.e., the above-mentioned predetermined color) traffic signal to ensure that the average brightness is within a reasonable range and the brightness of most traffic signals will be moderate. Within the traffic signal box, the brightness of the red lights can be counted based on the segmented foreground points, and thus the average brightness of the red lights can be obtained.

[0075] In an exemplary embodiment, an abnormal state of the target signal lamp is determined based on the brightness of the second signal lamp: when the brightness of the second signal lamp is less than a brightness threshold, it is determined that the brightness of the target signal lamp is abnormal in the detected frame image; the target number of times that the brightness of the target signal lamp is abnormal in the detected frame and other detected frame images is determined, where the other detected frame images are images collected after the detected frame image; when the target number of times is greater than a preset number of times, it is determined that the abnormal state of the target signal lamp is abnormal signal lamp brightness.

[0076] In the above embodiment, the abnormal state of the target signal lamp may be insufficient brightness of the target signal lamp. Through the set upper-layer open brightness deficiency threshold T and the number of detection frames N, the process of determining that the brightness of the target signal lamp is abnormal can be referred to Figure 6 as shown Figure 6 is a schematic diagram of the process for determining insufficient brightness of the target signal lamp according to an embodiment of the present invention. As Figure 6 shown, first, configuration information sent from the upper layer can be received, which may include the number of lamp groups M, the brightness deficiency threshold T, and the number of detection frames N. The number of frames with insufficient brightness of the three target colors of red, yellow, and green for the above M lamp groups is initialized, that is, nr[M]=ny[M]=ng[M]={0}, where nr[M], ny[M], and ng[M] can be respectively understood as the number of frames of the red lamp group, the number of frames of the yellow lamp group, and the number of frames of the green lamp group. Through the result of the signal lamp recognition module, the coordinate information and color information of the signal lamp frame can be obtained. Detection starts from the lamp group with lamp group number m = 0. Each time during detection, it can be determined whether the lamp group number m is less than the number of lamp groups M. If so, it indicates that not all lamp groups have been completely detected, and the current numbered lamp group is continued to be processed. If m is equal to or greater than M, the detection data of the next frame is processed.

[0077] In the above embodiment, the brightness of the signal lamp with lamp group number m is detected. By judging the color of the signal lamp, the three target colors of red, yellow, and green can be processed respectively. The brightness of the second signal lamp within lamp group number m can be calculated, and it is judged whether the brightness of the second signal lamp is lower than the brightness threshold T. If so, the number of frames with insufficient brightness detection of the corresponding color lamp in lamp group number m is incremented by 1, and it is determined that the brightness of the detected target signal lamp is abnormal in the detected frame image. Otherwise, the number of frames with insufficient brightness detection of the corresponding color lamp in lamp group number m is cleared to 0. It is judged whether the number of frames with insufficient brightness detection (i.e., the above target number of times) is lower than the number of detection frames N (i.e., the above preset number of times). As shown in the formula, the lamp group number is incremented by 1, and the next lamp group is detected. If not, it indicates that the corresponding color lamp of the current lamp group number has abnormal brightness, which can be reported to the cloud platform for subsequent operations, and at the same time, the brightness detection of the signal lamp of the next lamp group is also performed.

[0078] In the above embodiment, the number of lamp groups M = 10 and the number of detection frames N is 10. First, the brightness of the signal lamp with lamp group number m = 0 can be detected. Since the number m is less than the number of lamp groups M, the current lamp group can be processed, and the brightnesses of the lights of three colors, namely red, yellow, and green, are detected respectively, that is, the brightnesses of the third signal lamps of lamp group m = 0 under the three colors of red, yellow, and green are determined respectively. If it is less than the brightness deficiency threshold T, the detection frame number of the corresponding color of lamp group m is incremented by 1. When the detected detection frame number of brightness deficiency is less than N, it indicates that the brightness of the signal lamp of lamp group m = 0 is normal, and the brightness of the signal lamp of lamp group m = 1 can be continued to be detected. If the detected detection frame number of brightness deficiency is greater than N, it may indicate that the brightness of the signal lamp of lamp group m0 is abnormal. While reporting, the signal lamp group of lamp group m = 1 is processed. When it comes to the case where the lamp group number m = 10, the processing can return to the next detection frame.

[0079] It should be noted that the preset values or parameters such as the preset conditions, preset parameters, first set value, second set value, preset color, preset brightness interval, and preset number in the foregoing embodiments can all be customized through the target interface, which improves the stability of the detection scheme and the environmental adaptability.

[0080] The method for determining the abnormal state of the signal lamp will be described below in conjunction with specific embodiments:

[0081] Figure 7 It is a flowchart of the method for determining the abnormal state of the signal lamp according to a specific embodiment of the present invention. As Figure 7 shown, the process includes the following steps:

[0082] Step S702: Divide all frames into video frames and detection frames. The video frames are used for monitoring and capturing, and the detection frames are responsible for the signal lamp effect;

[0083] Step S704: Based on the signal lamp brightness in the raw domain, adjust the camera parameters of the detection frame to ensure that the signal lamp brightness is within a reasonable range, and obtain the first signal lamp brightness;

[0084] Step S706: Based on the exposure time, aperture size, filter type, and first signal lamp brightness of the current detection frame, calculate the signal lamp brightness after excluding environmental interference, that is, the second signal lamp brightness;

[0085] Step S708: Normalize the second signal lamp brightness to a specific range to obtain the third signal lamp brightness;

[0086] Step S710: When the number of frames in which the third signal lamp brightness is continuously lower than the threshold exceeds a certain number, report the state of insufficient signal lamp brightness.

[0087] In the above embodiments, in different ambient brightness conditions, factors such as exposure gain, aperture, and filter are comprehensively considered to calculate the brightness of the signal lamp, excluding the influence of environmental changes. Additionally, the upper-layer interface opens the interfaces for the brightness deficiency threshold and the number of detection frames, improving the stability of the detection scheme and the environmental adaptability. Pulling out a single detection frame to be responsible for the signal lamp effect can ensure that the brightness of the traffic lights is within a reasonable range, preventing overexposure or underexposure that may affect the brightness statistics of the signal lamp. Furthermore, by statistically calculating the brightness of the signal lamp through raw data, it is not affected by the isp (Image Signal Processor), and the statistical brightness can be more accurate.

[0088] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.

[0089] In this embodiment, a device for determining the abnormal state of a signal lamp is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated here. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0090] Figure 8 is a structural block diagram of a device for determining the abnormal state of a signal lamp according to an embodiment of the present invention. As Figure 8 shown, the device includes:

[0091] An acquisition module 802, configured to acquire a detected frame image collected by the imaging device when the imaging parameters of the imaging device meet a predetermined condition;

[0092] A first determination module 804, configured to determine a first signal lamp brightness of a target signal lamp of a target color included in the detected frame image;

[0093] An adjustment module 806, configured to adjust the first signal lamp brightness based on the imaging parameters of the imaging device and device parameters when collecting the detected frame image to obtain a second signal lamp brightness;

[0094] A second determination module 808, configured to determine an abnormal state of the target signal lamp based on the second signal lamp brightness.

[0095] In an exemplary embodiment, the adjustment module 806 adjusts the first signal lamp brightness based on the camera parameters and device parameters of the camera device when collecting the detection frame image, to obtain a second signal lamp brightness: determining an exposure time, a gain parameter, and an aperture value included in the camera parameters; determining a transmittance included in the device parameters; adjusting the first signal lamp brightness based on the exposure time, the gain parameter, the aperture value, and the transmittance, to obtain the second signal lamp brightness.

[0096] In an exemplary embodiment, the adjustment module 806 may implement adjusting the first signal lamp brightness based on the exposure time, the gain parameter, the aperture value, and the transmittance, to obtain the second signal lamp brightness in the following manner: determining a first ratio of the gain parameter to a first constant; determining a first value that is the first ratio power of a second constant; determining a second value that is the square value of the aperture value; determining a first product of the exposure time and the first value, the second value, and the transmittance; determining a second ratio of the first signal lamp brightness to the first product as the second signal lamp brightness.

[0097] In an exemplary embodiment, the apparatus may be used after adjusting the first signal lamp brightness based on the camera parameters and device parameters of the camera device when collecting the detection frame image, to obtain a second signal lamp brightness: determining a first minimum signal lamp brightness and a first maximum signal lamp brightness collected by the camera device under preset parameters; adjusting the first minimum signal lamp brightness based on the preset parameters, to obtain a second minimum signal lamp brightness; adjusting the first maximum signal lamp brightness based on the preset parameters, to obtain a second maximum signal lamp brightness; performing normalization processing on the second signal lamp brightness based on the second minimum signal lamp brightness and the second maximum signal lamp brightness, to obtain a third signal lamp brightness; updating the second signal lamp brightness to the third signal lamp brightness.

[0098] In an exemplary embodiment, the device may normalize the second signal light brightness based on the second minimum signal light brightness and the second maximum signal light brightness to obtain a third signal light brightness in the following manner: when the second signal light brightness is less than the second minimum signal light brightness, determining a first set value as the third signal light brightness; when the second signal light brightness is greater than the second maximum signal light brightness, determining a second set value as the third signal light brightness; when the second signal light brightness is greater than or equal to the second minimum signal light brightness and less than or equal to the second maximum signal light brightness, determining a first difference between the second signal light brightness and the second minimum signal light brightness, determining a second difference between the second maximum signal light brightness and the second minimum signal light brightness, determining a third ratio of the first difference to the second difference, determining a third difference between the second set value and the first set value, determining a second product of the third ratio and the third difference, and determining a sum value of the second product and the first set value as the third signal light brightness, where the second set value is greater than the first set value.

[0099] In an exemplary embodiment, the first determination module 804 may determine the first signal light brightness of the target signal light of the target color included in the detected frame image in the following manner: determining the signal light image included in the detected frame image; determining the pixel points belonging to the target signal light included in the signal light image; and determining the average brightness of the pixel points as the first signal light brightness.

[0100] In an exemplary embodiment, the device may be used to, before acquiring the detected frame image collected by the imaging device: acquire the target image collected by the imaging device; determine the average brightness of the signal lights of a predetermined color included in the target image; when the average brightness is within a preset brightness range, determining that the imaging parameters meet the predetermined conditions; when the average brightness is less than the minimum value of the preset brightness range, increasing the exposure time included in the imaging parameters; and when the average brightness is greater than the maximum value of the preset brightness range, decreasing the exposure time included in the imaging parameters.

[0101] In an exemplary embodiment, the predetermined color determined by the device is red.

[0102] In an exemplary embodiment, the second determination module 808 may determine the abnormal state of the target signal lamp based on the brightness of the second signal lamp in the following manner: when the brightness of the second signal lamp is less than the brightness threshold, it is determined that the brightness of the target signal lamp is abnormal in the detected frame image; determining the target number of times that the brightness of the target signal lamp is abnormal in the detected frame and other detected frame images, where the other detected frame images are images collected after the detected frame image; when the target number of times is greater than the preset number of times, it is determined that the abnormal state of the target signal lamp is abnormal signal lamp brightness.

[0103] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0104] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks or optical disks and other media that can store computer programs.

[0105] An embodiment of the present invention further provides an electronic device, including a memory and a processor, a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0106] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0107] An embodiment of the present invention further provides a computer program product, including a computer program, and the steps of the methods in the various embodiments of the present application are implemented when the computer program is executed by a processor.

[0108] The specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0109] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order from here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.

[0110] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for determining the abnormal state of a signal lamp, characterized in that, Including: When the imaging parameters of the imaging device meet a predetermined condition, acquiring a detected frame image collected by the imaging device; wherein, the method for determining whether the imaging parameters of the imaging device meet the predetermined condition is as follows: acquiring N frame images collected by the imaging device before collecting the detected frame image; determining the average brightness of the signal lights in each of the N frame images; when the average brightness is within a set range, determining that the imaging parameters of the imaging device meet the predetermined condition; when the average brightness is outside the set range, determining that the imaging parameters of the imaging device do not meet the predetermined condition; when the average brightness is less than the minimum value of the preset brightness range, increasing the exposure time included in the imaging parameters; when the average brightness is greater than the maximum value of the preset brightness range, decreasing the exposure time included in the imaging parameters; Determining a first signal light brightness of a target signal light of a target color included in the detected frame image; Adjusting the first signal light brightness based on the imaging parameters of the imaging device and the device parameters when collecting the detected frame image to obtain a second signal light brightness; Determining an abnormal state of the target signal light based on the second signal light brightness; Determining an abnormal state of the target signal light based on the second signal light brightness includes: when the second signal light brightness is less than a brightness threshold, determining that the brightness of the target signal light is abnormal in the detected frame image; determining a target number of times that the target signal light has abnormal brightness in the detected frame and other detected frame images, where the other detected frame images are images collected after the detected frame image; when the target number of times is greater than a preset number of times, determining that the abnormal state of the target signal light is signal light brightness abnormality.

2. The method according to claim 1, wherein Adjusting the first signal light brightness based on the imaging parameters of the imaging device and the device parameters when collecting the detected frame image to obtain a second signal light brightness includes: Determining the exposure time, gain parameter, and aperture value included in the imaging parameters; Determining the transmittance included in the device parameters; Adjusting the first signal light brightness based on the exposure time, the gain parameter, the aperture value, and the transmittance to obtain the second signal light brightness.

3. The method according to claim 2, characterized in that, Adjusting the first signal light brightness based on the exposure time, the gain parameter, the aperture value, and the transmittance to obtain the second signal light brightness includes: Determining a first ratio of the gain parameter to a first constant; Determining a first power of the first ratio of a second constant as a first value; Determining a square value of the aperture value as a second value; Determining a first product of the exposure time and the first value, the second value, and the transmittance; Determining a second ratio of the first signal light brightness to the first product as the second signal light brightness.

4. The method according to claim 1, characterized in that After adjusting the first signal light brightness based on the imaging parameters of the imaging device and the device parameters when collecting the detected frame image to obtain a second signal light brightness, the method further includes: Determine the first minimum signal lamp brightness and the first maximum signal lamp brightness collected by the camera device under preset parameters; Adjust the first minimum signal lamp brightness based on the preset parameters to obtain the second minimum signal lamp brightness; Adjust the first maximum signal lamp brightness based on the preset parameters to obtain the second maximum signal lamp brightness; Normalize the second signal lamp brightness based on the second minimum signal lamp brightness and the second maximum signal lamp brightness to obtain the third signal lamp brightness; Update the second signal lamp brightness to the third signal lamp brightness.

5. The method according to claim 4, wherein Normalizing the second signal lamp brightness based on the second minimum signal lamp brightness and the second maximum signal lamp brightness to obtain the third signal lamp brightness includes: When the second signal lamp brightness is less than the second minimum signal lamp brightness, determine the first set value as the third signal lamp brightness; When the second signal lamp brightness is greater than the second maximum signal lamp brightness, determine the second set value as the third signal lamp brightness; When the second signal lamp brightness is greater than or equal to the second minimum signal lamp brightness and the second signal lamp brightness is less than or equal to the second maximum signal lamp brightness, determine the first difference between the second signal lamp brightness and the second minimum signal lamp brightness, determine the second difference between the second maximum signal lamp brightness and the second minimum signal lamp brightness, determine the third ratio of the first difference to the second difference, determine the third difference between the second set value and the first set value, determine the second product of the third ratio and the third difference, and determine the sum value of the second product and the first set value as the third signal lamp brightness, where the second set value is greater than the first set value.

6. The method according to claim 1, characterized in that, Determining the first signal lamp brightness of the target signal lamp of the target color included in the detected frame image includes: Determine the signal lamp image included in the detected frame image; Determine the pixel points belonging to the target signal lamp included in the signal lamp image; Determine the average brightness of the pixel points as the first signal lamp brightness.

7. The method according to claim 1, characterized in that, Before obtaining the detected frame image collected by the camera device, the method further includes: Obtain the target image collected by the camera device; Determine the average brightness of the signal lamps of a predetermined color included in the target image; When the average brightness is within a preset brightness range, determine that the camera parameters meet the predetermined conditions.

8. The method according to claim 7, wherein The predetermined color is red.

9. A device for determining an abnormal state of a signal lamp, characterized in that, Includes: An acquisition module, configured to acquire a detected frame image collected by the imaging device when the imaging parameters of the imaging device meet a predetermined condition; wherein, the device determines whether the imaging parameters of the imaging device meet the predetermined condition in the following manner: acquiring N frame images collected by the imaging device before collecting the detected frame image; determining the average brightness of the signal lights in each of the N frame images; when the average brightness is within a set range, determining that the imaging parameters of the imaging device meet the predetermined condition; when the average brightness is outside the set range, determining that the imaging parameters of the imaging device do not meet the predetermined condition; when the average brightness is less than the minimum value of the preset brightness range, increasing the exposure time included in the imaging parameters; when the average brightness is greater than the maximum value of the preset brightness range, decreasing the exposure time included in the imaging parameters; A first determination module, configured to determine the first signal light brightness of the target signal light of the target color included in the detected frame image; An adjustment module, configured to adjust the first signal light brightness based on the imaging parameters and device parameters of the imaging device when collecting the detected frame image to obtain a second signal light brightness; A second determination module, configured to determine the abnormal state of the target signal light based on the second signal light brightness; The second determination module realizes determining the abnormal state of the target signal light based on the second signal light brightness in the following manner: when the second signal light brightness is less than a brightness threshold, determining that the brightness of the target signal light is abnormal in the detected frame image; determining the target number of times that the brightness of the target signal light is abnormal in the detected frame and other detected frame images, where the other detected frame images are images collected after the detected frame image; when the target number of times is greater than a preset number of times, determining that the abnormal state of the target signal light is signal light brightness abnormality.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 8 when running.

11. An electronic device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN116634279A