Day / night filter changer, and changeover method and device thereof
The method improves day/night filter switching in cameras by using statistical brightness and exposure adjustments to stabilize mode transitions, addressing hardware costs and inaccuracies in existing systems, ensuring reliable operation across dynamic lighting scenarios.
Patent Information
- Application Number
- JP2023089365
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2022-10-27
- Filing Date
- 2023-05-31
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2043-05-31
AI Technical Summary
Existing day/night filter switching methods in cameras suffer from high hardware costs and frequent, inaccurate mode switching due to infrared light interference, leading to unstable image quality and increased energy consumption.
A method that determines average brightness thresholds and ranges based on pixel brightness percentages, adjusting exposure values and white balance gains to accurately switch between day and night modes, using statistical analysis to ensure stable operation in dynamic lighting conditions.
Enhances switching accuracy and reliability, reducing frequent mode changes and energy consumption by adapting to varying lighting conditions, thus improving image quality and operational stability.
Smart Images

Figure 0007612754000001 
Figure 0007612754000002 
Figure 0007612754000003
Abstract
Description
[Technical field]
[0001] The present invention relates to the technical field of image processing, and in particular to a day / night filter switcher and a switching method and device thereof. [Background technology]
[0002] With the development and progress of science and technology, nowadays, many scenes require all-weather monitoring. During the day, the light is sufficient and the brightness is sufficient, and at the same time, it is necessary to ensure that the color of the image is restored as accurately and realistically as possible. On the other hand, the illumination of the night environment is insufficient, so it is necessary to activate the night mode, turn on the infrared lamp, and switch the IR filter at the same time, to avoid light interference in the environment, and at the same time, to increase the image brightness. Therefore, it seems that it is particularly important to switch the day and night mode accordingly.
[0003] Currently, the methods for cameras to achieve such day-night mode switching are mainly hardware and software switching methods. The hardware switching method mainly adds a light sensor sensitive to visible light, and the light sensor switches between day and night modes based on the brightness in a visible light environment and the upper and lower boundary thresholds of the preset brightness. Such automatic day-night switching judgment can solve the problem of repeated day-night switching without being interfered with by infrared light. The software switching method uses software to judge the brightness of the current frame image, and the software switching method requires the setting of two switching image brightness thresholds, one threshold used to switch the day mode to the night mode and switch the IR filter, and the other threshold used to switch the night mode to the day mode, and the problem of repeated day-night switching is addressed by adjusting these two brightness thresholds.
[0004] However, this hardware switching solution has the problem that the requirements for camera structure design are high and the hardware cost of the camera is high. The software switching solution solves the problem that the day and night modes are repeatedly switched by simply adjusting the switching threshold. When encountering a scene with strong infrared light or high dynamics, when switching to night mode, the screen brightness exceeds the upper limit value, making it easy to switch to day mode. In addition, due to insufficient visible light, the image brightness on the screen is insufficient, and the situation will occur where the screen is switched back to night mode. This repetition makes the screen unstable, and the noise caused by the filter switching affects the quality of life, which greatly reduces the quality of use of the product.
[0005] Therefore, how to improve the accuracy of the day / night filter switch of the camera is currently an issue that needs to be resolved as soon as possible. Summary of the Invention [Problem to be solved by the invention]
[0006] The present invention provides a day / night filter changer and a switching method and device thereof, which can improve the accuracy of switching of the day / night filter changer of a camera. [Means for solving the problem]
[0007] According to one aspect of the present invention, In a first operation mode, determining an average luminance value Mean Luma of each pixel point in the image and a maximum luminance value Ymax of each pixel point in the image based on the luminance of each pixel point in the image captured by the camera; A luminance threshold Y_thresh of the image is determined according to a maximum luminance value Ymax in the image, and the luminance threshold Y_thresh=Ymax*Y_Percent is set to 0. <Y_Percent<1であることと、 determining a percentage of the image of areas where the luminance values of pixel points in the image are greater than or equal to the luminance threshold Y_thresh as a bright tone percentage of the image; determining an average luminance threshold and an average luminance threshold range for the image according to a bright region percentage (bright_tone_percent) of the image, wherein the average luminance threshold is negatively correlated with the bright region percentage (bright_tone_percent) of the image; Counting the number of image frames whose average luminance of the image is continuously within the average luminance threshold range; determining whether the image frame number is greater than or equal to a frame number threshold; if greater than or equal, switching the first mode of operation to a second mode of operation; The present invention provides a method for switching a day / night filter switch, in which, when the first operating mode is a daytime mode, the second operating mode is a nighttime mode, and the average brightness threshold range is smaller than or equal to the average brightness threshold, and, when the first operating mode is the nighttime mode, the second operating mode is the daytime mode, and the average brightness threshold range is larger than or equal to the average brightness threshold.
[0008] Preferably, when the first operation mode is the daytime mode, the average luminance threshold is a first average luminance threshold Day2Night_Mean_Luma_thresh, and when the first operation mode is the nighttime mode, the average luminance threshold is a second average luminance threshold Night2Day_Mean_Luma_thresh; The first average brightness threshold Day2Night_Mean_Luma_thresh is Day2Night_Mean_Luma_thresh=Day2Night_Final_Mean_Luma_thresh*(1-bright_tone_percent), where Day2Night_Final_Mean_Luma_thresh is a first average brightness preset value; The second mean brightness threshold value Night2Day_Mean_Luma_thresh is Night2Day_Mean_Luma_thresh=Night2Day_Final_Mean_Luma_thresh*(1-bright_tone_percent), where Night2Day_Final_Mean_Luma_thresh is the second mean brightness preset value.
[0009] Preferably, the first average luminance threshold Day2Night_Mean_Luma_thresh is smaller than the second average luminance threshold Night2Day_Mean_Luma_thresh.
[0010] Preferably, before counting the number of image frames in which the average luminance value Mean Luma of the image is continuously within the average luminance threshold range, acquiring a gain total_gain and an exposure time shut_time of the camera and determining an exposure value EV of the camera; determining an exposure threshold and an exposure threshold range for the image according to a bright area percentage (bright_tone_percent) of the image, wherein the exposure threshold is positively correlated with the bright area percentage (bright_tone_percent) of the image; The step of collecting data on the number of image frames whose average luminance value Mean Luma of the image is continuously within the average luminance threshold range is collecting statistics on the number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range and the exposure value EV of the image is continuously within the exposure threshold range; Wherein, when the first operating mode is the daytime mode, the exposure threshold range is greater than or equal to the exposure threshold, and when the first operating mode is the nighttime mode, the exposure threshold range is less than or equal to the exposure threshold.
[0011] Preferably, when the first operation mode is the daytime mode, the exposure threshold is a first exposure threshold Day2Night_Final_EV_thresh, and when the first operation mode is the nighttime mode, the exposure threshold is a second exposure threshold Night2Day_Final_EV_thresh; The first exposure threshold value Day2Night_Final_EV_thresh is Day2Night_Final_EV_thresh=Day2Night_EV_thresh*(1+bright_tone_percent), where Day2Night_EV_thresh is a first exposure preset value; The second exposure threshold value Night2Day_Final_EV_thresh is Night2Day_Final_EV_thresh=Night2Day_EV_thresh*(1+bright_tone_percent), where Night2Day_EV_thresh is the second exposure preset value.
[0012] Preferably, the first exposure threshold Day2Night_Final_EV_thresh is greater than the second exposure threshold Night2Day_Final_EV_thresh.
[0013] Preferably, before counting the number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range and the exposure value EV of the image is continuously within the exposure threshold range, The method further includes obtaining a white balance gain value and a white balance threshold value of the image in a current environment, and a white balance threshold range; The number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range and the exposure value EV of the image is continuously within the exposure threshold range is calculated by: counting the number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range, the exposure value EV of the image is continuously within the exposure threshold range, and the white balance gain value of the image is continuously within the white balance threshold range; Among them, when the first operation mode is the daytime mode, the white balance threshold range is less than or equal to the white balance threshold, and when the first operation mode is the nighttime mode, the white balance threshold range is greater than or equal to the white balance threshold.
[0014] Preferably, obtaining the white balance threshold includes: obtaining the white balance gain value in the infrared environment; converting the white balance gain value in the infrared environment into floating-point coordinates (x0, y0) in the two-dimensional space of the white balance algorithm; determining the white balance threshold R0 according to the floating-point coordinates (x0, y0), where the white balance threshold R0 = (x - x0) 2 +(y - y0) 2 and
[0016] According to another aspect of the present invention, a luminance acquisition module for determining the mean luminance value Mean Luma of each pixel point in the image and the maximum luminance value Ymax of each pixel point in the image based on the luminance of each pixel point in the image captured by the camera in the first operation mode; a luminance threshold determination module for determining the luminance threshold Y_thresh of the image according to the maximum luminance value Ymax in the image, where the luminance threshold Y_thresh = Ymax * Y_Percent and 0 < Y_Percent < 1; a bright tone percentage determination module for determining a percentage of the image of areas in which the luminance values of pixel points in the image are greater than or equal to the luminance threshold Y_thresh as a bright tone percentage of the image; an average brightness threshold determination module for determining an average brightness threshold and an average brightness threshold range of the image according to a bright region percentage (bright_tone_percent) of the image, in which the average brightness threshold is negatively correlated with the bright region percentage (bright_tone_percent) of the image; an image frame number statistic module for stating the number of image frames whose average luminance value Mean Luma of the image is continuously within the average luminance threshold range; a frame number determination module for determining whether the image frame number is greater than or equal to a frame number threshold, and if so, for switching the first operation mode to a second operation mode; The present invention provides a day / night filter switcher switching device, wherein when the first operating mode is a daytime mode, the second operating mode is a nighttime mode, and the average brightness threshold range is smaller than or equal to the average brightness threshold, and when the first operating mode is the nighttime mode, the second operating mode is the daytime mode, and the average brightness threshold range is larger than or equal to the average brightness threshold.
[0017] According to another aspect of the present invention, there is provided a day-night filter switcher comprising a switching device for a day-night filter switcher described in any of the embodiments of the present invention, wherein the switching device is used to perform a switching method for a day-night filter switcher described in any of the embodiments of the present invention. Effect of the Invention
[0018] The technical solution of the embodiment of the present invention determines the average brightness threshold and the average brightness threshold range of the image according to the bright area percentage bright_tone_percent of the image, thereby realizing that the basic condition for switching the operating mode in a dynamic scene can be adjusted according to the bright area percentage bright_tone_percent of the image in the current environment. By determining whether the image continuously satisfies the basic condition for switching the operating mode, frequent switching due to changes in image brightness can be avoided, and inaccurate switching of the operating mode can be avoided, and the accuracy and reliability of the switching of the day-night filter switch can be improved. The magnitude of the average brightness threshold can be adjusted and controlled according to Y_Percent, so as to change the difficulty of switching the operating mode and improve the controllability, thereby making the switching method of the day-night filter switch applicable to different scenes and improving its applicability.
[0019] It should be understood that the subject matter described in this section is not intended to identify key or critical features of the embodiments of the invention, nor is it intended to be used to limit the scope of the invention. Other features of the invention will become more readily apparent from the following specification. [Brief description of the drawings]
[0020] In order to more clearly explain the technical aspects in the embodiments of the present invention, the drawings necessary to be used in the description of the embodiments are briefly introduced below. However, the drawings described below are only some embodiments of the present invention, and it is obvious that a person skilled in the art can further obtain other drawings according to these drawings without paying any creative labor.
[0021] [Figure 1] FIG. 4 is a flow diagram of a switching method for one day / night filter switcher according to the first embodiment of the present invention. [Diagram 2] FIG. 11 is a flow diagram of a switching method for one day / night filter switcher according to a second embodiment of the present invention. [Diagram 3] FIG. 11 is a flow diagram of a switching method for one day / night filter switcher according to a third embodiment of the present invention. [Figure 4]FIG. 11 is a structural schematic diagram of a switching device of a day / night filter switch according to embodiment 4 of the present invention; [Diagram 5] FIG. 11 is a structural schematic diagram of one day / night filter switch according to embodiment 5 of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0022] In order to allow those skilled in the art to better understand the aspects of the present invention, the technical aspects of the embodiments of the present invention will be described clearly and completely below with reference to the drawings in the embodiments of the present invention. It is clear that the described embodiments are only some embodiments of the present invention, and are not all embodiments. All other embodiments obtained by those skilled in the art on the basis of the embodiments of the present invention without paying creative labor should fall within the protection scope of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the present specification and claims, as well as in the drawings, are not necessarily used to describe a particular order or priority, but are merely used to distinguish between similar objects. The data used in this manner may be substituted where appropriate, so that it should be understood that the embodiments of the present invention described herein may be practiced in other orders than those shown or described herein. In addition, the terms "comprise" and "have" and any variations thereof are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or apparatus of a series of steps or units, and are not necessarily limited to those steps or units expressly recited, but may include other steps or units not expressly recited or inherent to the process, method, product, or apparatus.
[0024] Example 1 FIG. 1 is a flowchart of a switching method for a day-night filter switch according to Embodiment 1 of the present invention. This embodiment is applicable to situations where it is necessary to switch the day-night filter for all-day monitoring of a surveillance camera. The method can be executed by a switching device of the day-night filter switch. The switching device can be realized in the form of hardware and / or software and can be arranged in the day-night filter switch. As shown in FIG. 1, the method includes the following.
[0025] In S1001, in a first operation mode, based on the luminance of each pixel point in the image captured by the camera, the average luminance value Mean Luma of each pixel point in the image and the maximum luminance value Ymax of each pixel point in the image are determined.
[0026] Among them, the first operation mode refers to the operation mode of the day-night filter switch, which may be the daytime mode or the nighttime mode. The images in this specification all refer to the images of the current environment captured by the camera.
[0027] In S1002, according to the maximum luminance value Ymax in the image, the luminance threshold value Y_thresh of the image is determined.
[0028] Among them, the luminance threshold value Y_thresh = Ymax * Y_Percent, where 0 < Y_Percent < 1, and Y_Percent can be set according to actual needs.
[0029] In S1003, the ratio of the area in the image where the luminance value of the pixel point is greater than or equal to the luminance threshold value Y_thresh in the image is determined as the bright area ratio bright_tone_percent of the image.
[0030] For example, a higher bright area percentage bright_tone_percent of an image means a higher proportion of areas with high brightness in the image, and the more areas with strong light in the current environment, the more likely it is that the current environment is daytime; a lower bright area percentage bright_tone_percent of an image means a lower proportion of areas with high brightness in the image, and the fewer areas with strong light in the current environment, the more likely it is that the current environment is nighttime.
[0031] In S1004, an average brightness threshold and an average brightness threshold range of the image are determined according to the bright region percentage bright_tone_percent of the image, among which the average brightness threshold is negatively correlated with the bright region percentage bright_tone_percent of the image.
[0032] Wherein, when the first operating mode is a daytime mode, the average brightness threshold range is smaller than or equal to the average brightness threshold, and when the first operating mode is a nighttime mode, the average brightness threshold range is larger than or equal to the average brightness threshold.
[0033] In S1005, the number of image frames whose average image luminance value Mean Luma is continuously within the average luminance threshold range is counted.
[0034] For example, when the first operating mode is a daytime mode, the number of image frames in which the image mean luminance value Mean Luma is continuously less than or equal to the average luminance threshold is counted, and when the first operating mode is a nighttime mode, the number of image frames in which the image mean luminance value Mean Luma is continuously greater than or equal to the average luminance threshold is counted.
[0035] In S1006, it is determined whether the image frame number is greater than or equal to the frame number threshold. If it is greater than or equal, S1007 is executed.
[0036] The frame number threshold can be set according to the actual situation.
[0037] In S1007, the first operation mode is switched to the second operation mode.
[0038] Among them, the second operating mode also refers to the operating mode of the day / night filter switch, and is different from the first operating mode. When the first operating mode is the daytime mode, the second operating mode is the nighttime mode, or when the first operating mode is the nighttime mode, the second operating mode is the daytime mode.
[0039] For example, in daytime mode, when the average brightness value Mean Luma of the image is smaller than or equal to the average brightness threshold, i.e., the average brightness value Mean Luma of the image is within the average brightness threshold range, it means that the light in the current environment is dark; when the number of image frames in which the average brightness value Mean Luma of the image of the current environment captured by the camera is continuously within the average brightness threshold range is greater than or equal to the frame number threshold, it means that the dark environmental light is a persistent phenomenon, and the operating mode of the day / night filter switcher can be switched from daytime mode to night mode, the operating state of the camera can be switched from daytime mode to night mode, the IR filter can be switched on, and the infrared lamp can be turned on.
[0040] In night mode, when the average brightness value Mean Luma of the image is greater than or equal to the average brightness threshold, that is, when the average brightness value Mean Luma of the image is within the average brightness threshold range, it means that the light in the current environment is bright; when the number of image frames in which the average brightness value Mean Luma of the image of the current environment captured by the camera is continuously within the average brightness threshold range is greater than or equal to the frame number threshold, it means that the bright environmental light is a persistent phenomenon, and the operating mode of the day / night filter switcher can be switched from night mode to day mode, the operating state of the camera can be switched from night mode to day mode, the all-pass filter can be switched, and the infrared lamp can be turned off.
[0041] The average brightness value Mean Luma of the image being within the average brightness threshold range is merely a basic condition for switching the operating mode, and it is assumed that the image of the current environment captured by the camera satisfies the basic condition. In addition, it is necessary to ensure that the number of image frames of the image that continuously meet the basic condition is greater than or equal to the frame number threshold. If the number of image frames of the image of the current environment captured by the camera that continuously meet the basic condition is smaller than the frame number threshold, it means that the average brightness value Mean Luma of the image cannot continuously be within the average brightness threshold range. The situation in which the image of the current environment captured by the camera satisfies the basic condition may be caused by a short-term change in the light source. For example, when the sun is blocked by dark clouds during the day or there are high-powered lights at night, the operating state should not be switched.
[0042] Among them, the average brightness threshold and the average brightness threshold range are related to the bright region ratio bright_tone_percent of the image, and are also related to the brightness threshold Y_thresh=Ymax*Y_Percent and Y_Percent. The larger the bright region ratio bright_tone_percent of the image, the higher the brightness of the current environment and the easier it is to switch to daytime mode. In this case, the average brightness threshold is small, the average brightness threshold range in daytime mode is narrowed, making it difficult to switch from daytime mode to night mode, the average brightness threshold range in night mode is widened, making it easy to switch from night mode to day mode. The smaller the bright region ratio bright_tone_percent of the image, the lower the brightness of the current environment and the easier it is to switch to night mode. In this case, the average brightness threshold is large, the average brightness threshold range in daytime mode is widened, making it easy to switch from daytime mode to night mode, the average brightness threshold range in night mode is narrowed, making it difficult to switch from night mode to day mode.
[0043] The magnitude of the average brightness threshold can also be adjusted and controlled by Y_Percent, and the difficulty of switching between operation modes can be changed. For example, when Y_Percent is set small, for example 70%, the bright region percentage bright_tone_percent of the same image can be increased, the average brightness threshold can be decreased, the average brightness threshold range in daytime mode can be reduced, and the average brightness threshold range in nighttime mode can be increased, making it easier for the operation mode to become the night mode, and when Y_Percent is set large, for example 90%, the bright region percentage bright_tone_percent of the same image can be decreased, the average brightness threshold can be increased, the average brightness threshold range in daytime mode can be increased, and the average brightness threshold range in nighttime mode can be reduced, making it easier for the operation mode to become the daytime mode.
[0044] In an embodiment of the present invention, by determining the average brightness threshold and the average brightness threshold range of an image according to the bright area percentage bright_tone_percent of the image, it is possible to realize that in a dynamic scene, the basic conditions for switching the operating mode can be adjusted according to the bright area percentage bright_tone_percent of the image in the current environment. By determining whether the image continuously satisfies the basic conditions for switching the operating mode, frequent switching due to changes in image brightness can be avoided, and inaccurate switching of the operating mode can be avoided, and the accuracy and reliability of switching of the day-night filter switch can be improved. The magnitude of the average brightness threshold can be adjusted and controlled according to Y_Percent, so that the difficulty of switching the operating mode can be changed and the controllability can be improved. Thus, the switching method of the day-night filter switch can be applied to different scenes, and the applicability can be improved.
[0045] Preferably, when the first operation mode is a daytime mode, the average luminance threshold is a first average luminance threshold Day2Night_Mean_Luma_thresh, and when the first operation mode is a nighttime mode, the average luminance threshold is a second average luminance threshold Night2Day_Mean_Luma_thresh.
[0046] Among them, the first average brightness threshold Day2Night_Mean_Luma_thresh is Day2Night_Mean_Luma_thresh=Day2Night_Final_Mean_Luma_thresh*(1-bright_tone_percent), where Day2Night_Final_Mean_Luma_thresh is the first average brightness preset value.
[0047] The second mean brightness threshold Night2Day_Mean_Luma_thresh is Night2Day_Mean_Luma_thresh=Night2Day_Final_Mean_Luma_thresh*(1-bright_tone_percent), where Night2Day_Final_Mean_Luma_thresh is the second mean brightness preset value.
[0048] Specifically, the first average luminance threshold Day2Night_Mean_Luma_thresh and the second average luminance threshold Night2Day_Mean_Luma_thresh are both negatively correlated with the bright region proportion bright_tone_percent of the image, and decrease as the bright region proportion bright_tone_percent of the image increases.
[0049] For example, when the first operating mode is the daytime mode, the average brightness threshold range is smaller than or equal to the first average brightness threshold Day2Night_Mean_Luma_thresh, and an increase in the bright area percentage bright_tone_percent of the image reduces the first average brightness threshold Day2Night_Mean_Luma_thresh, reducing the average brightness threshold range, making it difficult to switch from the daytime mode to the night mode; when the first operating mode is the night mode, the average brightness threshold range is larger than or equal to the second average brightness threshold Night2Day_Mean_Luma_thresh, and an increase in the bright area percentage bright_tone_percent of the image reduces the second average brightness threshold Night2Day_Mean_Luma_thresh, reducing the average brightness threshold range, making it easier to switch from the night mode to the day mode. The first average brightness preset value Day2Night_Final_Mean_Luma_thresh and the second average brightness preset value Night2Day_Final_Mean_Luma_thresh can be set according to actual needs, and the embodiment of the present invention does not limit the magnitude relationship between them.
[0050] In this way, the first average luminance threshold Day2Night_Mean_Luma_thresh and the second average luminance threshold Night2Day_Mean_Luma_thresh enable the average luminance threshold range when the first operating mode is a daytime mode and the average luminance threshold range when the first operating mode is a nighttime mode to have multiple possibilities, for example overlapping or not, thereby increasing controllability and applicability.
[0051] In one preferred embodiment, the first mean luminance threshold Day2Night_Mean_Luma_thresh is less than the second mean luminance threshold Night2Day_Mean_Luma_thresh.
[0052] For example, in the daytime mode, if the average luminance value Mean Luma of the image does not decrease to be smaller than or equal to the first average luminance threshold Day2Night_Mean_Luma_thresh, the basic condition for switching the operation mode is not met, and since the first average luminance threshold Day2Night_Mean_Luma_thresh is small, the image will not meet the basic condition in the daytime mode, and the switching to the night mode can be delayed, and in the night mode, if the average luminance value Mean Luma of the image does not increase to be larger than or equal to the second average luminance threshold Night2Day_Mean_Luma_thresh, the basic condition for switching the operation mode is not met, and since the second average luminance threshold Night2Day_Mean_Luma_thresh is large, the image will not meet the basic condition in the night mode, and the switching to the daytime mode can be delayed. In this way, the first operation mode can be delayed from being switched to the second operation mode, and frequent switching can be avoided, reducing the switching frequency, lowering energy consumption, and saving energy.
[0053] Example 2 2 is a flow chart of a switching method of a day / night filter switcher according to the second embodiment of the present invention, in which, compared with the above embodiment, a basic condition for switching the operation mode is added that the exposure value EV of the image is within the exposure threshold range. As shown in FIG. 2, the method includes:
[0054] In S2001, in a first operation mode, based on the luminance of each pixel point in an image captured by a camera, an average luminance value Mean Luma of each pixel point in the image and a maximum luminance value Ymax of each pixel point in the image are determined.
[0055] In S2002, a luminance threshold Y_thresh of the image is determined according to the maximum luminance value Ymax in the image.
[0056] In S2003, the percentage of the image in which the luminance value of the pixel point in the image is greater than or equal to the luminance threshold Y_thresh is determined as the bright region percentage of the image, bright_tone_percent.
[0057] In S2004, an average brightness threshold and an average brightness threshold range of the image are determined according to the bright region percentage bright_tone_percent of the image, among which the average brightness threshold is negatively correlated with the bright region percentage bright_tone_percent of the image.
[0058] In S2005, the camera gain total_gain and exposure time shut_time are obtained to determine the camera exposure value EV.
[0059] The exposure value EV of the camera refers to the amplification gain for amplifying an analog signal so that the image can be seen or the image can well restore the original color of the actual environment, and the exposure value EV of the camera is EV=total_gain*shut_time.
[0060] In S2006, an exposure threshold and an exposure threshold range for the image are determined according to the bright region proportion bright_tone_percent of the image, where the exposure threshold has a positive correlation with the bright region proportion bright_tone_percent of the image.
[0061] Wherein, when the first operating mode is a daytime mode, the exposure threshold range is greater than or equal to the exposure threshold, and when the first operating mode is a nighttime mode, the exposure threshold range is less than or equal to the exposure threshold.
[0062] In S2007, the number of image frames in which the image mean luminance value Mean Luma is continuously within the average luminance threshold range and the image exposure value EV is continuously within the exposure threshold range is calculated.
[0063] In S2008, it is determined whether the image frame number is greater than or equal to the frame number threshold. If it is greater than or equal, S2009 is executed.
[0064] In S2009, the first operation mode is switched to the second operation mode.
[0065] For example, the basic condition for switching the operation mode further includes that the exposure value EV of the image is within the exposure threshold range. In the daytime mode, if the exposure value EV of the image is greater than or equal to the exposure threshold, that is, if the exposure value EV of the image is within the exposure threshold range, it means that the light in the current environment is dark, and without a large exposure value EV, the normal display of the image cannot be met. Also refer to the average luminance value Mean Luma of the image, if the average luminance value Mean Luma of the image is continuously within the average luminance threshold range, and the number of image frames in which the exposure value EV of the image is continuously within the exposure threshold range is greater than or equal to the frame number threshold, it means that the dark light in the environment is a persistent phenomenon, and the operation mode of the day / night filter switcher can be switched from the daytime mode to the nighttime mode.
[0066] In the night mode, when the exposure value EV of the image is smaller than or equal to the exposure threshold, that is, when the exposure value EV of the image is within the exposure threshold range, it means that the light in the current environment is bright, and with a small exposure value EV, the normal display of the image can be met; also referring to the average brightness value Mean Luma of the image, when the average brightness value Mean Luma of the image is continuously within the average brightness threshold range, and the number of image frames in which the exposure value EV of the image is continuously within the exposure threshold range is greater than or equal to the frame number threshold, it means that the bright environmental light is a persistent phenomenon, and the operating mode of the day / night filter switcher can be switched from the night mode to the day mode.
[0067] Among them, the exposure threshold and exposure threshold range of the image are also related to the bright area ratio bright_tone_percent. The larger the bright area ratio bright_tone_percent of the image, the higher the luminance of the current environment and the easier it is to switch to daytime mode. At this time, the exposure threshold is higher, the exposure threshold range in daytime mode is narrowed, making it difficult to switch from daytime mode to night mode, the exposure threshold range in night mode is increased, making it easier to switch from night mode to day mode. The smaller the bright area ratio bright_tone_percent of the image, the lower the luminance of the current environment and the easier it is to switch to night mode. At this time, the exposure threshold is lower, the exposure threshold range in daytime mode is increased, making it easier to switch from daytime mode to night mode, and the exposure threshold range in night mode is narrowed, making it easier to switch from night mode to day mode.
[0068] In an embodiment of the present invention, by determining the exposure threshold and exposure threshold range of an image according to the bright area percentage bright_tone_percent of the image, it is also possible to adjust the basic conditions for switching the operating mode according to the bright area percentage bright_tone_percent of the image in a dynamic scene in the current environment. The content of the basic conditions for switching the operating mode can be added by counting the number of image frames in which the average brightness value Mean Luma of the image is continuously within the average brightness threshold range and the exposure value EV of the image is continuously within the exposure threshold range, and switching the operating mode when the number of image frames is greater than or equal to the frame number threshold. At the same time, if all the contents of the basic conditions are not continuously met, the operating mode will not be switched, thereby avoiding false triggering and further improving the accuracy and reliability of switching the day-night filter switch.
[0069] Preferably, when the first operation mode is a daytime mode, the exposure threshold is a first exposure threshold Day2Night_Final_EV_thresh, and when the first operation mode is a nighttime mode, the exposure threshold is a second exposure threshold Night2Day_Final_EV_thresh.
[0070] Among them, the first exposure threshold value Day2Night_Final_EV_thresh is Day2Night_Final_EV_thresh=Day2Night_EV_thresh*(1+bright_tone_percent), where Day2Night_EV_thresh is the first exposure preset value.
[0071] The second exposure threshold, Night2Day_Final_EV_thresh, is Night2Day_Final_EV_thresh=Night2Day_EV_thresh*(1+bright_tone_percent), where Night2Day_EV_thresh is the second exposure preset value.
[0072] Specifically, the first exposure threshold Day2Night_Final_EV_thresh and the second exposure threshold Night2Day_Final_EV_thresh are both positively correlated with the bright region proportion bright_tone_percent of the image, and increase as the bright region proportion bright_tone_percent of the image increases.
[0073] For example, when the first operating mode is the daytime mode, the exposure threshold range is greater than or equal to the first exposure threshold Day2Night_Final_EV_thresh, and as the bright area percentage bright_tone_percent of the image increases, the first exposure threshold Day2Night_Final_EV_thresh increases, the exposure threshold range is reduced, and it is difficult to switch the daytime mode to the nighttime mode; when the first operating mode is the nighttime mode, the exposure threshold range is less than or equal to the second exposure threshold Night2Day_Final_EV_thresh, and as the bright area percentage bright_tone_percent of the image increases, the second exposure threshold Night2Day_Final_EV_thresh increases, the exposure threshold range is increased, and it is easy to switch the nighttime mode to the daytime mode. Among them, the first exposure preset value Day2Night_EV_thresh and the second exposure preset value Night2Day_EV_thresh can be set according to actual needs, and the embodiment of the present invention does not limit the magnitude relationship between the two.
[0074] In this way, the first exposure threshold Day2Night_Final_EV_thresh and the second exposure threshold Night2Day_Final_EV_thresh enable the exposure threshold range when the first operating mode is a daytime mode and the exposure threshold range when the first operating mode is a nighttime mode to have multiple possibilities, for example overlapping or not, thereby increasing controllability and applicability.
[0075] In one preferred embodiment, the first exposure threshold Day2Night_Final_EV_thresh is greater than the second exposure threshold Night2Day_Final_EV_thresh.
[0076] For example, since the first exposure threshold Day2Night_Final_EV_thresh is large, it takes longer for an image to satisfy the basic conditions in the daytime mode, and it is possible to delay switching to the nighttime mode, and since the second exposure threshold Night2Day_Final_EV_thresh is small, it takes longer for an image to satisfy the basic conditions in the nighttime mode, and it is possible to delay switching to the daytime mode. In this way, it is possible to delay switching from the first operating mode to the second operating mode, and frequent switching is avoided, reducing the switching frequency, lowering energy consumption, and saving energy.
[0077] Example 3 3 is a flow chart of a switching method of a day-night filter switcher according to the third embodiment of the present invention, in which, compared with the above embodiment, a basic condition for switching the operation mode is added that the white balance gain value of the image is within the white balance threshold range. As shown in FIG. 3, the method includes:
[0078] In S3001, in a first operation mode, based on the luminance of each pixel point in an image captured by a camera, an average luminance value Mean Luma of each pixel point in the image and a maximum luminance value Ymax of each pixel point in the image are determined.
[0079] In S3002, a luminance threshold Y_thresh of the image is determined according to the maximum luminance value Ymax in the image.
[0080] In S3003, the ratio of the area in the image in which the luminance value of the pixel point in the image is greater than or equal to the luminance threshold Y_thresh is determined as the bright area ratio of the image, bright_tone_percent.
[0081] In S3004, an average brightness threshold and an average brightness threshold range of the image are determined according to the bright region percentage bright_tone_percent of the image, where the average brightness threshold is negatively correlated with the bright region percentage bright_tone_percent of the image.
[0082] In S3005, the camera gain total_gain and exposure time shut_time are acquired to determine the camera exposure value EV.
[0083] In S3006, an exposure threshold and an exposure threshold range of the image are determined according to the bright region proportion bright_tone_percent of the image, where the exposure threshold is positively correlated with the bright region proportion bright_tone_percent of the image.
[0084] In S3007, the white balance gain value, white balance threshold value, and white balance threshold range of the image in the current environment are acquired.
[0085] Wherein, the white balance gain value refers to the gain that brightens the red light, green light and blue light of each pixel point in the image so that the image can be seen or the image can well restore the original color of the actual environment. When the first operation mode is the daytime mode, the white balance threshold range is smaller than or equal to the white balance threshold, and when the first operation mode is the nighttime mode, the white balance threshold range is larger than or equal to the white balance threshold.
[0086] Preferably, obtaining the white balance threshold value includes obtaining a white balance gain value in an invisible light environment, converting the white balance gain value in the invisible light environment into a floating-point coordinate (x0, y0) in a two-dimensional space of a white balance algorithm, and determining a white balance threshold value R0 according to the floating-point coordinate (x0, y0), where R0=(x-x0). 2 +(y-y0) 2 It is.
[0087] For example, in order to make the image captured by the camera in the invisible light environment restore the original color of the actual environment, the camera must perform white balance and perform global statistics of the white balance gain value according to the gray world algorithm, and brighten the red light, green light and blue light respectively with respect to the R0 gain, G0 gain and B0 gain, before it can obtain the floating-point coordinate (x0, y0) transformed into the corresponding white balance algorithm two-dimensional space, that is, the white balance gain value in the invisible light environment, where x0=G0 / R0 and y0=G0 / B0.
[0088] The white balance gain value (x1, y1) of the image in the current environment is less than or equal to the white balance threshold value R0, i.e., (x1-x0). 2 +(y1-y0) 2 If R0, the white balance gain value (x1, y1) of the image in the current environment is close to the white balance gain value (x0, y0) in the invisible light environment, which means that the current environment is dark, and the white balance gain value (x1, y1) of the image in the current environment is greater than or equal to the white balance threshold value R0, i.e., (x1-x0). 2 +(y1-y0) 2 If R0, the white balance gain value (x1, y1) of the image in the current environment at this time is far from the white balance gain value (x0, y0) in the invisible light environment, which means that the current environment is bright.
[0089] In S3008, the number of image frames in which the image mean luminance value Mean Luma is continuously within the average luminance threshold range, the image exposure value EV is continuously within the exposure threshold range, and the image white balance gain value is continuously within the white balance threshold range is calculated.
[0090] In S3009, it is determined whether the image frame number is greater than or equal to the frame number threshold. If it is greater than or equal, S3010 is executed.
[0091] In S3010, the first operation mode is switched to the second operation mode.
[0092] For example, the basic condition for switching the operation mode further includes that the white balance gain value of the image is within a white balance threshold range. In the daytime mode, when the white balance gain value of the image is smaller than or equal to the white balance threshold, that is, when the white balance gain value of the image is within the white balance threshold range, it means that the light of the current environment is dark; referring to the mean luminance value Mean Luma and the exposure value EV of the image together, when the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range, the exposure value EV of the image is continuously within the exposure threshold range, and the number of image frames in which the white balance gain value of the image is continuously within the white balance threshold range is greater than or equal to the frame number threshold, it means that the dark light of the environment is a persistent phenomenon, and the operation mode of the day / night filter switcher can be switched from the daytime mode to the nighttime mode.
[0093] In the night mode, when the white balance gain value of the image is greater than or equal to the white balance threshold, i.e., when the white balance gain value of the image is within the white balance threshold range, it means that the light in the current environment is bright. By jointly referring to the average brightness value Mean Luma and the exposure value EV of the image, when the average brightness value Mean Luma of the image is continuously within the average brightness threshold range, the exposure value EV of the image is continuously within the exposure threshold range, and the number of image frames in which the white balance gain value of the image is continuously within the white balance threshold range is greater than or equal to the frame number threshold, it means that the bright environmental light is a persistent phenomenon, and the operating mode of the day / night filter switcher can be switched from the night mode to the day mode.
[0094] In an embodiment of the present invention, the number of image frames in which the average luminance value Mean Luma of an image is continuously within an average luminance threshold range, the exposure value EV of the image is continuously within an exposure threshold range, and the white balance gain value of the image is continuously within a white balance threshold range is statistically counted. When the number of image frames is greater than or equal to a frame number threshold, the operation mode is switched, so that the content of the basic conditions for operation mode switching can be added. The strength of the light in the current environment is judged according to the situation of the white balance gain, false triggering is avoided, and the accuracy and reliability of the switching of the day / night filter switch are further improved.
[0095] Embodiment 4 FIG. 4 is a structural schematic diagram of a switching device of a day / night filter switch according to Embodiment 4 of the present invention. As shown in FIG. 4, the device 40 includes In a first operation mode, a luminance acquisition module 410 for determining an average luminance value Mean Luma of each pixel point in an image and a maximum luminance value Ymax of each pixel point in the image based on the luminance of each pixel point in the image captured by a camera; A luminance threshold determination module 420 for determining a luminance threshold Y_thresh of the image according to the maximum luminance value Ymax in the image, where the luminance threshold Y_thresh = Ymax * Y_Percent and 0 < Y_Percent < 1; A bright area ratio determination module 430 for determining, as a bright area ratio bright_tone_percent of the image, the ratio of the area in the image where the luminance value of the pixel point in the image is greater than or equal to the luminance threshold Y_thresh; An average luminance threshold determination module 440 for determining an average luminance threshold and an average luminance threshold range of the image according to the bright area ratio bright_tone_percent of the image, where the average luminance threshold is negatively correlated with the bright area ratio bright_tone_percent of the image; An image frame number statistics module 450 for statistically counting the number of image frames in which the average luminance value Mean Luma of the image is continuously within the average luminance threshold range; and a frame number determination module 460 for determining whether the image frame number is greater than or equal to a frame number threshold, and if so, for switching the first operation mode to a second operation mode.
[0096] Wherein, when the first operating mode is a daytime mode, the second operating mode is a nighttime mode, and the average brightness threshold range is smaller than or equal to the average brightness threshold; when the first operating mode is a nighttime mode, the second operating mode is a daytime mode, and the average brightness threshold range is larger than or equal to the average brightness threshold.
[0097] The switching device of the day-night filter switch according to the embodiment of the present invention is capable of executing the switching method of the day-night filter switch according to any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0098] Example 5 5 is a structural schematic diagram of a day-night filter switch according to the fifth embodiment of the present invention. As shown in FIG. 5, the day-night filter switch 50 includes a switching device 40 for the day-night filter switch according to any embodiment of the present invention.
[0099] The switching device of the day / night filter changer in the day / night filter changer according to the embodiment of the present invention is capable of performing the switching method of the day / night filter changer according to any embodiment of the present invention, and therefore the day / night filter changer according to the embodiment of the present invention has functional modules and beneficial effects corresponding to the performance of the method.
[0100] It should be understood that the various types of flows shown above can be used, and steps can be rearranged, added, or removed. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, and the present specification is not limited thereto, as long as the desired results of the technical solution of the present invention can be achieved.
Claims
1. In a first operation mode, determining an average luminance value Mean Luma of each pixel point in the image and a maximum luminance value Ymax of each pixel point in the image based on the luminance of each pixel point in the image captured by the camera; determining a luminance threshold value Y_thresh of the image according to a maximum luminance value Ymax in the image, the luminance threshold value Y_thresh=Ymax*Y_Percent, where 0<Y_Percent<1; determining a percentage of the image of areas where the luminance values of pixel points in the image are greater than or equal to the luminance threshold Y_thresh as a bright tone percentage of the image; determining an average luminance threshold and an average luminance threshold range of the image according to a bright region percentage bright_tone_percent of the image, the average luminance threshold being negatively correlated with the bright region percentage bright_tone_percent of the image; Counting the number of image frames whose average luminance value (Mean Luma) of the image is continuously within the average luminance threshold range; determining whether the image frame number is greater than or equal to a frame number threshold; if so, switching the first mode of operation to a second mode of operation; When the first operating mode is a daytime mode, the second operating mode is a nighttime mode and the average brightness threshold range is less than or equal to the average brightness threshold; when the first operating mode is the nighttime mode, the second operating mode is the daytime mode and the average brightness threshold range is greater than or equal to the average brightness threshold; switching the first operation mode to a second operation mode when the first operation mode is the daytime mode, switching an operating state of the camera from the day mode to the night mode, switching on an IR filter, and turning on an infrared lamp; When the first operation mode is the night mode, switching the first operation mode to a second operation mode includes: switching an operating state of the camera from the night mode to the day mode, switching an all-pass filter, and turning off the infrared lamp. A method for switching between day and night filters.
2. When the first operating mode is the daytime mode, the average luminance threshold is a first average luminance threshold Day2Night_Mean_Luma_thresh, and when the first operating mode is the nighttime mode, the average luminance threshold is a second average luminance threshold Night2Day_Mean_Luma_thresh; the first average brightness threshold Day2Night_Mean_Luma_thresh is Day2Night_Mean_Luma_thresh=Day2Night_Final_Mean_Luma_thresh*(1-bright_tone_percent), where Day2Night_Final_Mean_Luma_thresh is a first average brightness preset value; The second average brightness threshold Night2Day_Mean_Luma_thresh is Night2Day_Mean_Luma_thresh=Night2Day_Final_Mean_Luma_thresh*(1-bright_tone_percent), where Night2Day_Final_Mean_Luma_thresh is a second average brightness preset value; 2. The method for switching a day / night filter switcher according to claim 1.
3. The first average luminance threshold Day2Night_Mean_Luma_thresh is smaller than the second average luminance threshold Night2Day_Mean_Luma_thresh; 3. The method for switching a day / night filter switch according to claim 2.
4. Prior to counting the number of image frames whose mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range, obtaining a gain total_gain and an exposure time shut_time of the camera and determining an exposure value EV of the camera; The method further includes: determining an exposure threshold and an exposure threshold range of the image according to a bright area percentage bright_tone_percent of the image, and the exposure threshold is positively correlated with the bright area percentage bright_tone_percent of the image; The step of collecting the number of image frames whose average luminance value (Mean Luma) of the image is continuously within the average luminance threshold range is collecting statistics on the number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range and the exposure value EV of the image is continuously within the exposure threshold range; When the first operating mode is the day mode, the exposure threshold range is greater than or equal to the exposure threshold, and when the first operating mode is the night mode, the exposure threshold range is less than or equal to the exposure threshold.
2. The method for switching a day / night filter switcher according to claim 1.
5. When the first operating mode is the daytime mode, the exposure threshold is a first exposure threshold Day2Night_Final_EV_thresh, and when the first operating mode is the nighttime mode, the exposure threshold is a second exposure threshold Night2Day_Final_EV_thresh; The first exposure threshold value Day2Night_Final_EV_thresh is: Day2Night_Final_EV_thresh=Day2Night_EV_thresh*(1+bright_tone_percent), where Day2Night_EV_thresh is a first exposure preset value; The second exposure threshold value Night2Day_Final_EV_thresh is Night2Day_Final_EV_thresh=Night2Day_EV_thresh*(1+bright_tone_percent), where Night2Day_EV_thresh is a second exposure preset value; 5. The method for switching a day / night filter switcher according to claim 4.
6. The first exposure threshold Day2Night_Final_EV_thresh is greater than the second exposure threshold Night2Day_Final_EV_thresh; The method for switching a day / night filter switcher according to claim 5 .
7. Prior to counting the number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range and the exposure value EV of the image is continuously within the exposure threshold range, The method further includes obtaining a white balance gain value and a white balance threshold R0 of the image in a current environment, and a white balance threshold range; The counting of the number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range and the exposure value EV of the image is continuously within the exposure threshold range is collecting statistics on the number of image frames in which the mean luminance value Mean Luma of the image is continuously within the mean luminance threshold range, the exposure value EV of the image is continuously within the exposure threshold range, and the white balance gain value of the image is continuously within the white balance threshold range; When the first operating mode is the daytime mode, the white balance threshold range is less than or equal to the white balance threshold R0, and when the first operating mode is the nighttime mode, the white balance threshold range is greater than or equal to the white balance threshold R0.
5. The method for switching a day / night filter switcher according to claim 4.
8. Obtaining the white balance threshold R0 Obtaining a white balance gain value in an invisible light environment; converting the white balance gain value in the invisible light environment into floating-point coordinates (x0, y0) in a two-dimensional space of a white balance algorithm; determining the white balance threshold R0 in response to the floating-point coordinates (x0, y0), wherein the white balance threshold R0=(x-x0) 2 +(y-y0) 2 That is, The method for switching a day / night filter switcher according to claim 7.
9. a luminance acquisition module for determining, in a first operation mode, based on the luminance of each pixel point in an image captured by a camera, a mean luminance value Mean Luma of each pixel point in the image and a maximum luminance value Ymax of each pixel point in the image; a brightness threshold determination module for determining a brightness threshold Y_thresh of the image according to a maximum brightness value Ymax in the image, where Y_thresh=Ymax*Y_Percent, where 0<Y_Percent<1; a bright tone percentage determination module for determining a percentage of the image of regions in which the luminance values of pixel points in the image are greater than or equal to the luminance threshold Y_thresh as a bright tone percentage of the image; an average brightness threshold determination module for determining an average brightness threshold and an average brightness threshold range of the image according to a bright region percentage bright_tone_percent of the image, the average brightness threshold being negatively correlated with the bright region percentage bright_tone_percent of the image; an image frame number statistic module for stating the number of image frames whose mean luminance value (Mean Luma) of the image is continuously within the mean luminance threshold range; a frame number determination module for determining whether the image frame number is greater than or equal to a frame number threshold, and if so, for switching the first operation mode to a second operation mode; When the first operating mode is a daytime mode, the second operating mode is a nighttime mode and the average brightness threshold range is less than or equal to the average brightness threshold; when the first operating mode is the nighttime mode, the second operating mode is the daytime mode and the average brightness threshold range is greater than or equal to the average brightness threshold; switching the first operation mode to a second operation mode when the first operation mode is the daytime mode, switching an operating state of the camera from the day mode to the night mode, switching on an IR filter, and turning on an infrared lamp; When the first operation mode is the night mode, switching the first operation mode to a second operation mode includes: switching an operating state of the camera from the night mode to the day mode, switching an all-pass filter, and turning off the infrared lamp. A switching device for a day / night filter switcher.
10. The day / night filter changer according to claim 9, A day / night filter switcher.
Citation Information
Patent Citations
Imaging apparatus
JP2016025573A
Imaging device, method for controlling the same, and control program
JP2016086391A
Imaging device, method for controlling the same, and control program
JP2016086392A
Imaging apparatus, imaging system, information processing apparatus, control method, program, and storage medium
JP2021148984A