A day and night filter switcher and its switching method and switching device

By calculating the brightness threshold and bright area proportion in the camera image and dynamically adjusting the average brightness threshold range, the problem of inaccurate switching of the camera day and night filters is solved, and switching accuracy and image stability are improved.

CN115802154BActive Publication Date: 2025-02-28LUXSHARE PRECISION TECH(NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211327956.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-27
Publication Date
2025-02-28
Estimated Expiration
2042-10-27

AI Technical Summary

Technical Problem

The existing camera day and night filter switches are inaccurate in dynamic scenes, resulting in frequent switching and instability in image, affecting the quality of use.

Method used

By determining the average brightness value and maximum brightness value in the images captured by the camera, calculating the brightness threshold and brightness area ratio, dynamically adjusting the average brightness threshold range, and counting the image frame number to determine whether to switch the working mode.

Benefits of technology

Improve the switching accuracy and reliability of day and night filter switches, reduce frequent switching, and enhance image stability and usage quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115802154B_ABST
    Figure CN115802154B_ABST
Patent Text Reader

Abstract

The present invention discloses a day-night filter switcher and a switching method and a switching device thereof. The switching method includes, in a first working mode, determining the average brightness value of each pixel in the image and the maximum brightness value of each pixel in the image based on the brightness of each pixel in the image captured by a camera; determining a brightness threshold according to the maximum brightness value in the image; determining the proportion of areas in the image whose brightness values ​​of pixels in the image are greater than or equal to the brightness threshold as the proportion of bright areas in the image; determining the average brightness threshold and the average brightness threshold range of the image according to the proportion of bright areas in the image; wherein the average brightness threshold is negatively correlated with the proportion of bright areas in the image; counting the number of image frames whose average brightness of the image is continuously within the range of the average brightness threshold, and switching the first working mode to the second working mode when the number of image frames is greater than or equal to the frame number threshold. The above technical scheme can improve the switching accuracy and reliability of the day-night filter switcher.
Need to check novelty before this filing date? Find Prior Art

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 a switching device thereof. Background Art

[0002] With the development and progress of science and technology, many scenes now require all-weather monitoring. During the day, there is sufficient light and brightness, and the color of the image must be restored as accurately as possible. At night, due to insufficient illumination, it is necessary to turn on the night mode, turn on the infrared light and switch the IR filter, so as to increase the image brightness without causing light interference to the environment. Therefore, switching between day and night modes is particularly important.

[0003] At present, there are mainly hardware and software switching solutions for cameras to achieve this day and night mode switching. The hardware switching solution mainly adds a photosensitive sensor that is sensitive to visible light. The photosensitive sensor detects the brightness in the visible light environment and presets the upper and lower brightness thresholds to switch the day and night modes. In this way, the automatic day and night switching judgment will not be interfered by infrared light, which can solve the problem of repeated day and night switching. The software switching solution uses software to judge the brightness of the current frame image. The software switching solution needs to set two switching image brightness thresholds. One threshold is used to switch from day mode to night mode, thereby switching the IR filter, and the other threshold is used to switch from night mode to day mode. The problem of repeated switching between day and night is dealt with by adjusting these two brightness thresholds.

[0004] However, this hardware switching solution has high requirements for the camera structure design and the camera hardware cost is relatively high. The software switching solution only solves the problem of repeated switching between day and night modes by adjusting the switching threshold. When encountering a scene with strong infrared light or high dynamics, switching to night mode can easily cause the image brightness to exceed the upper limit, thus switching to day mode. However, insufficient visible light will cause insufficient image brightness, thus switching back to night mode. This repeated process causes the image to be unstable, and the noise emitted by the switching filter affects the quality of life, greatly reducing the quality of product use.

[0005] In summary, how to improve the switching accuracy of the camera day and night filter switcher is a problem that needs to be solved urgently. Summary of the invention

[0006] The invention provides a day-night filter switcher and a switching method and a switching device thereof, which can improve the switching accuracy of the day-night filter switcher of a camera.

[0007] According to one aspect of the present invention, a method for switching a day / night filter switch is provided, comprising:

[0008] In the first working mode, based on the brightness of each pixel in the image captured by the camera, determine the average brightness value Mean Luma of each pixel in the image and the maximum brightness value Ymax of each pixel in the image;

[0009] Determine a brightness threshold value Y_thresh of the image according to the maximum brightness value Ymax in the image; wherein the brightness threshold value Y_thresh=Ymax*Y_Percent, 0<Y_Percent<1;

[0010] Determine the proportion of areas in the image whose brightness values ​​of pixels in the image are greater than or equal to the brightness threshold Y_thresh as the bright area proportion bright_tone_percent of the image;

[0011] According to the bright area ratio bright_tone_percent of the image, determine the average brightness threshold and the average brightness threshold range of the image; wherein the average brightness threshold is negatively correlated with the bright area ratio bright_tone_percent of the image;

[0012] Counting the number of image frames whose average brightness of the image is continuously within the average brightness threshold range;

[0013] Determine whether the image frame number is greater than or equal to a frame number threshold;

[0014] If yes, switching the first working mode to the second working mode;

[0015] Among them, when the first working mode is the day mode, the second working mode is the night mode, and the average brightness threshold range is: less than or equal to the average brightness threshold; when the first working mode is the night mode, the second working mode is the day mode, and the average brightness threshold range is: greater than or equal to the average brightness threshold.

[0016] Optionally, when the first working mode is the day mode, the average brightness threshold is a first average brightness threshold Day2Night_Mean_Luma_thresh; when the first working mode is the night mode, the average brightness threshold is a second average brightness threshold Night2Day_Mean_Luma_thresh;

[0017] The first average brightness threshold Day2Night_Mean_Luma_thresh is: Day2Night_Mean_Luma_thresh=Day2Night_Final_Mean_Luma_thresh*

[0018] (1-bright_tone_percent); wherein Day2Night_Final_Mean_Luma_thresh is the first average brightness preset value;

[0019] The second average brightness threshold Night2Day_Mean_Luma_thresh is: Night2Day_Mean_Luma_thresh=Night2Day_Final_Mean_Luma_thresh*

[0020] (1-bright_tone_percent); wherein Night2Day_Final_Mean_Luma_thresh is the second average brightness preset value.

[0021] Optionally, the first average brightness threshold Day2Night_Mean_Luma_thresh is less than the second average brightness threshold Night2Day_Mean_Luma_thresh.

[0022] Optionally, before counting the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range, the method further includes:

[0023] Obtaining the gain total_gain and exposure time shut_time of the camera, and determining the exposure value EV of the camera;

[0024] Determine an exposure threshold and an exposure threshold range of the image according to a bright area ratio bright_tone_percent of the image; wherein the exposure threshold is positively correlated with the bright area ratio bright_tone_percent of the image;

[0025] Counting the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range includes:

[0026] 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;

[0027] Among them, when the first working mode is the day mode, the exposure threshold range is: greater than or equal to the exposure threshold; when the first working mode is the night mode, the exposure threshold range is: less than or equal to the exposure threshold.

[0028] Optionally, when the first working mode is the day mode, the exposure threshold is a first exposure threshold Day2Night_Final_EV_thresh; when the first working mode is the night mode, the exposure threshold is a second exposure threshold Night2Day_Final_EV_thresh;

[0029] The first exposure threshold Day2Night_Final_EV_thresh is: Day2Night_Final_EV_thresh=Day2Night_EV_thresh*

[0030] (1+bright_tone_percent); wherein Day2Night_EV_thresh is the first exposure preset value;

[0031] The second exposure threshold Night2Day_Final_EV_thresh is: Night2Day_Final_EV_thresh=Night2Day_EV_thresh*

[0032] (1+bright_tone_percent); wherein Night2Day_EV_thresh is the second exposure preset value.

[0033] Optionally, the first exposure threshold Day2Night_Final_EV_thresh is greater than the second exposure threshold Night2Day_Final_EV_thresh.

[0034] Optionally, before 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, the method further includes:

[0035] Obtaining a white balance gain value, a white balance threshold, and a white balance threshold range of the image in the current environment;

[0036] 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, comprises:

[0037] 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, 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;

[0038] Among them, when the first working mode is the day mode, the white balance threshold range is: less than or equal to the white balance threshold; when the first working mode is the night mode, the white balance threshold range is: greater than or equal to the white balance threshold.

[0039] Optionally, get the white balance threshold, including:

[0040] Obtaining a white balance gain value in the invisible light environment;

[0041] Convert the white balance gain value in the invisible light environment into floating point coordinates (x0, y0) in the two-dimensional space of the white balance algorithm;

[0042] According to the floating point coordinates (x0, y0), the white balance threshold R0 is determined; wherein the white balance threshold R0 = (x-x0) 2 +(y-y0) 2 .

[0043] Optionally, when the first working mode is the daytime mode, switching the first working mode to the second working mode includes:

[0044] Switching the working state of the camera from the day mode to the night mode, switching to the IR filter, and turning on the infrared light;

[0045] When the first working mode is the night mode, switching the first working mode to the second working mode includes:

[0046] The working state of the camera is switched from the night mode to the day mode, the all-pass filter is switched, and the infrared light is turned off.

[0047] According to another aspect of the present invention, a switching device of a day / night filter switch is provided, comprising:

[0048] A brightness acquisition module, used to determine, in a first working mode, an average brightness value Mean Luma of each pixel in the image and a maximum brightness value Ymax of each pixel in the image based on the brightness of each pixel in the image captured by the camera;

[0049] A brightness threshold determination module, used to determine a brightness threshold Y_thresh of the image according to a maximum brightness value Ymax in the image; wherein the brightness threshold Y_thresh=Ymax*Y_Percent, 0<Y_Percent<1;

[0050] A bright area ratio determination module, used to determine the ratio of the area in the image whose brightness value of the pixel points in the image is greater than or equal to the brightness threshold Y_thresh as the bright area ratio bright_tone_percent of the image;

[0051] An average brightness threshold determination module, used to determine the average brightness threshold and the average brightness threshold range of the image according to the bright area ratio bright_tone_percent of the image; wherein the average brightness threshold is negatively correlated with the bright area ratio bright_tone_percent of the image;

[0052] An image frame number statistics module is used to count the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range;

[0053] A frame number determination module, used to determine whether the image frame number is greater than or equal to a frame number threshold; if so, switching the first working mode to a second working mode;

[0054] Among them, when the first working mode is the day mode, the second working mode is the night mode, and the average brightness threshold range is: less than or equal to the average brightness threshold; when the first working mode is the night mode, the second working mode is the day mode, and the average brightness threshold range is: greater than or equal to the average brightness threshold.

[0055] According to another aspect of the present invention, there is provided a day-night filter switch, comprising: a switching device of the day-night filter switch described in any embodiment of the present invention; wherein the switching device is used to execute the switching method of the day-night filter switch described in any embodiment of the present invention.

[0056] The technical solution of the embodiment of the present invention can achieve that in dynamic scenes, the basic conditions for working mode switching can be adjusted according to the bright area ratio bright_tone_percent of the image in the current environment by determining the average brightness threshold and the average brightness threshold range of the image according to the bright area ratio bright_tone_percent of the image, and by judging whether the image continuously meets the basic conditions for working mode switching, frequent switching caused by changes in image brightness can be avoided, inaccurate working mode switching can be avoided, and the switching accuracy and reliability of the day and night filter switch can be improved; the size of the average brightness threshold can be adjusted by Y_Percent, the difficulty of working mode switching can be changed, and the controllability can be improved, so that the switching method of the day and night filter switch can be applicable to different scenes, thereby improving applicability.

[0057] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1 A flow chart of a method for switching a day / night filter switch is provided for the first embodiment of the present invention;

[0060] Figure 2 A flow chart of a switching method of a day / night filter switcher provided in Embodiment 2 of the present invention;

[0061] Figure 3 A flow chart of a switching method of a day / night filter switch provided in Embodiment 3 of the present invention;

[0062] Figure 4 A schematic diagram of the structure of a switching device for a day / night filter switch provided in a fourth embodiment of the present invention;

[0063] Figure 5 This is a structural schematic diagram of a day / night filter switch provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0064] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0065] 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 are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0066] Embodiment 1

[0067] Figure 1 A flowchart of a switching method of a day and night filter switch is provided for Embodiment 1 of the present invention. This embodiment is applicable to situations where a surveillance camera needs to switch day and night filters for all-day monitoring. The method can be executed by a switching device of the day and night filter switch. The switching device can be implemented in the form of hardware and / or software, and the switching device can be configured in the day and night filter switch.

[0068] like Figure 1 As shown, the method includes:

[0069] S1001. In a first working mode, based on the brightness of each pixel in an image captured by a camera, determine an average brightness value Mean Luma of each pixel in the image and a maximum brightness value Ymax of each pixel in the image.

[0070] The first working mode refers to the working mode of the day / night filter switcher, which can be a day mode or a night mode. The images in this article all refer to images of the current environment captured by the camera.

[0071] S1002 . Determine a brightness threshold Y_thresh of the image according to the maximum brightness value Ymax in the image.

[0072] Wherein, the brightness threshold Y_thresh=Ymax*Y_Percent, 0<Y_Percent<1, and Y_Percent can be set according to actual needs.

[0073] S1003 . Determine the proportion of the area in the image where the brightness value of the pixels in the image is greater than or equal to the brightness threshold Y_thresh as the bright area proportion bright_tone_percent of the image.

[0074] For example, the higher the proportion of bright area in the image bright_tone_percent is, the higher the proportion of areas with higher brightness in the image is, the more areas with stronger current ambient light are, and the higher the possibility that the current environment is daytime; the lower the proportion of bright area in the image bright_tone_percent is, the lower the proportion of areas with higher brightness in the image is, the fewer areas with stronger current ambient light are, and the higher the possibility that the current environment is night.

[0075] S1004. Determine an average brightness threshold and an average brightness threshold range of the image according to the bright area ratio bright_tone_percent of the image; wherein the average brightness threshold is negatively correlated with the bright area ratio bright_tone_percent of the image.

[0076] Among them, when the first working mode is the day mode, the average brightness threshold range is: less than or equal to the average brightness threshold; when the first working mode is the night mode, the average brightness threshold range is: greater than or equal to the average brightness threshold.

[0077] S1005. Count the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range.

[0078] Exemplarily, when the first mode is the day mode, the number of image frames whose average brightness value Mean Luma of the statistical image is continuously less than or equal to the average brightness threshold; when the first mode is the night mode, the number of image frames whose average brightness value Mean Luma of the statistical image is continuously greater than or equal to the average brightness threshold.

[0079] S1006: Determine whether the image frame number is greater than or equal to the frame number threshold. If so, execute S1007.

[0080] The frame number threshold can be set according to actual conditions.

[0081] S1007. Switch the first working mode to the second working mode.

[0082] Among them, the second working mode also refers to the working mode of the day and night filter switch, and is different from the first working mode. When the first working mode is day mode, the second working mode is night mode, or when the first working mode is night mode, the second working mode is day mode.

[0083] Exemplarily, in day mode, when the average brightness value Mean Luma of the image is less than or equal to the average brightness threshold, that is, 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 dim; 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 ambient light is a continuous phenomenon, and the working mode of the day and night filter switcher can be switched from day mode to night mode, and the working state of the camera can be switched from day mode to night mode, switched to the IR filter, and the infrared light is turned on.

[0084] 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, 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 brighter; 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 brighter ambient light is a continuous phenomenon, then the working mode of the day and night filter switcher can be switched from night mode to day mode, and the working state of the camera can be switched from night mode to day mode, switched to the all-pass filter, and the infrared light can be turned off.

[0085] The mean brightness value Mean Luma of the image being within the mean brightness threshold range is only a basic condition for switching the working mode. On the premise that the image of the current environment taken by the camera meets the basic conditions, the number of image frames that continuously meet the basic conditions must also be greater than or equal to the frame number threshold. If the number of image frames that continuously meet the basic conditions taken by the camera is less than the frame number threshold, it means that the mean brightness value Mean Luma of the image has not been continuously within the mean brightness threshold range. The situation that the image of the current environment taken by the camera meets the basic conditions may be caused by a short-term change in the light source, such as the sun being covered by dark clouds during the day or there are high-power lighting lamps at night. In this case, the working state should not be switched.

[0086] Among them, the average brightness threshold and the average brightness threshold range are related to the proportion of bright area in the image bright_tone_percent, and are also related to the brightness threshold Y_thresh = Ymax*Y_Percent and Y_Percent. The larger the proportion of brightness in the image bright_tone_percent, the greater the brightness of the current environment, and it should be easier to be in day mode. At this time, the average brightness threshold is smaller, the average brightness threshold range in day mode is reduced, and it is not easy to switch from day mode to night mode. The average brightness threshold range in night mode increases, and it is easier to switch from night mode to day mode; the smaller the proportion of brightness in the image bright_tone_percent, the smaller the brightness of the current environment, and it should be easier to be in night mode. At this time, the average brightness threshold is larger, the average brightness threshold range in day mode increases, and it is easier to switch from day mode to night mode. The average brightness threshold range in night mode decreases, and it is not easy to switch from night mode to day mode.

[0087] The size of the average brightness threshold can also be adjusted through Y_Percent to change the difficulty of switching the working mode. For example, when Y_Percent is set to a small value, such as 70%, the proportion of bright areas in the same image can be increased by bright_tone_percent, the average brightness threshold can be lowered, the average brightness threshold range can be reduced in the day mode, and the average brightness threshold range can be increased in the night mode, so that the working mode is easier to be in the day mode; when Y_Percent is set to a large value, such as 90%, the proportion of bright areas in the same image can be reduced by bright_tone_percent, the average brightness threshold can be increased, the average brightness threshold range can be reduced in the day mode, and the average brightness threshold range can be reduced in the night mode, so that the working mode is easier to be in the day mode.

[0088] In the embodiments of the present invention, by determining the average brightness threshold and the average brightness threshold range of the image according to the bright_tone_percent ratio of the bright area of ​​the image, it is possible to achieve that in a dynamic scene, the basic condition for switching the working mode can be adjusted according to the bright_tone_percent ratio of the bright area of ​​the image in the current environment, and by judging whether the image continuously satisfies the basic condition for switching the working mode, frequent switching caused by changes in image brightness can be avoided, inaccurate working mode switching can be avoided, and the switching accuracy and reliability of the day and night filter switch can be improved; the size of the average brightness threshold can be adjusted by Y_Percent, the difficulty of switching the working mode can be changed, and the controllability can be improved, so that the switching method of the day and night filter switch can be applicable to different scenes, thereby improving applicability.

[0089] Optionally, when the first working mode is the day mode, the average brightness threshold is the first average brightness threshold Day2Night_Mean_Luma_thresh; when the first working mode is the night mode, the average brightness threshold is the second average brightness threshold Night2Day_Mean_Luma_thresh.

[0090] The first average brightness threshold Day2Night_Mean_Luma_thresh is: Day2Night_Mean_Luma_thresh=Day2Night_Final_Mean_Luma_thresh*

[0091] (1-bright_tone_percent); wherein Day2Night_Final_Mean_Luma_thresh is the first average brightness preset value.

[0092] The second average brightness threshold Night2Day_Mean_Luma_thresh is: Night2Day_Mean_Luma_thresh=Night2Day_Final_Mean_Luma_thresh*

[0093] (1-bright_tone_percent); wherein Night2Day_Final_Mean_Luma_thresh is the second average brightness preset value.

[0094] Specifically, the first average brightness threshold Day2Night_Mean_Luma_thresh and the second average brightness threshold Night2Day_Mean_Luma_thresh are both negatively correlated with the bright area ratio bright_tone_percent of the image, and decrease as the bright area ratio bright_tone_percent of the image increases.

[0095] Exemplarily, when the first mode is the day mode, the average brightness threshold range is: less than or equal to the first average brightness threshold Day2Night_Mean_Luma_thresh, the increase of the bright area ratio bright_tone_percent of the image will cause the first average brightness threshold Day2Night_Mean_Luma_thresh to decrease, the average brightness threshold range will decrease, and the day mode is not easy to switch to the night mode; when the first mode is the night mode, the average brightness threshold range is: greater than or equal to the second average brightness threshold Night2Day_Mean_Luma_thresh, the increase of the bright area ratio bright_tone_percent of the image will cause the second average brightness threshold Night2Day_Mean_Luma_thresh to decrease, the average brightness threshold range will increase, and the night mode is easier to switch to the day mode. Among them, 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 size relationship between the two.

[0096] In this way, through the first average brightness threshold Day2Night_Mean_Luma_thresh and the second average brightness threshold Night2Day_Mean_Luma_thresh, the average brightness threshold range when the first working mode is the day mode and the average brightness threshold range when the first working mode is the night mode can have multiple possibilities, such as overlapping, non-overlapping, etc., which can increase controllability and applicability.

[0097] In an optional embodiment, the first average brightness threshold Day2Night_Mean_Luma_thresh is less than the second average brightness threshold Night2Day_Mean_Luma_thresh.

[0098] Exemplarily, in the day mode, the basic condition for switching the working mode is met only when the average brightness value Mean Luma of the image decreases to less than or equal to the first average brightness threshold Day2Night_Mean_Luma_thresh, and the first average brightness threshold Day2Night_Mean_Luma_thresh is small, so that the image in the day mode meets the basic condition later, and can be switched to the night mode later; in the night mode, the basic condition for switching the working mode is met only when the average brightness value Mean Luma of the image increases to greater than or equal to the second average brightness threshold Night2Day_Mean_Luma_thresh, and the second average brightness threshold Night2Day_Mean_Luma_thresh is large, so that the image in the night mode meets the basic condition later, and can be switched to the day mode later. In this way, the first working mode can be switched to the second working mode later, avoiding frequent switching, reducing the switching frequency, reducing energy consumption, and saving energy.

[0099] Embodiment 2

[0100] Figure 2 This is a flow chart of a switching method of a day / night filter switcher provided in the second embodiment of the present invention. Compared with the above embodiment, this embodiment adds a basic condition for switching the working mode: the exposure value EV of the image is within the exposure threshold range. Figure 2 As shown, the method includes:

[0101] S2001. In a first working mode, based on the brightness of each pixel in an image captured by a camera, determine an average brightness value Mean Luma of each pixel in the image and a maximum brightness value Ymax of each pixel in the image.

[0102] S2002. Determine a brightness threshold Y_thresh of the image according to the maximum brightness value Ymax in the image.

[0103] S2003 , determining the proportion of the area in the image where the brightness value of the pixels in the image is greater than or equal to the brightness threshold Y_thresh as the bright area proportion bright_tone_percent of the image.

[0104] S2004. Determine an average brightness threshold and an average brightness threshold range of the image according to the bright area ratio bright_tone_percent of the image; wherein the average brightness threshold is negatively correlated with the bright area ratio bright_tone_percent of the image.

[0105] S2005. Obtain the gain total_gain and exposure time shut_time of the camera, and determine the exposure value EV of the camera.

[0106] The exposure value EV of the camera refers to the amplification gain of the analog signal to make the image visible or to better restore the original color of the actual environment. The exposure value EV of the camera is: EV=total_gain*shut_time.

[0107] S2006. Determine an exposure threshold and an exposure threshold range of the image according to the bright area ratio bright_tone_percent of the image; wherein the exposure threshold is positively correlated with the bright area ratio bright_tone_percent of the image.

[0108] Among them, when the first working mode is the day mode, the exposure threshold range is: greater than or equal to the exposure threshold; when the first working mode is the night mode, the exposure threshold range is: less than or equal to the exposure threshold.

[0109] S2007. Count 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.

[0110] S2008: Determine whether the image frame number is greater than or equal to the frame number threshold. If so, execute S2009.

[0111] S2009: Switch the first working mode to the second working mode.

[0112] Exemplarily, the basic condition for switching the working mode also includes that the exposure value EV of the image is within the exposure threshold range. In day mode, when the exposure value EV of the image is greater than or equal to the exposure threshold, that is, 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 a larger exposure value EV is required to satisfy the normal display of the image; combined with the average brightness value Mean Luma of the reference 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 for 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 ambient light is a continuous phenomenon, and the working mode of the day and night filter switcher can be switched from day mode to night mode.

[0113] In night mode, when the exposure value EV of the image is less than or equal to the exposure threshold, that is, the exposure value EV of the image is within the exposure threshold range, it means that the light in the front environment is brighter and a smaller exposure value EV is required to meet the normal display of the image; combined with the average brightness value Mean Luma of the reference 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 ambient light is a continuous phenomenon, and the working mode of the day and night filter switcher can be switched from night mode to day mode.

[0114] 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 image brightness ratio bright_tone_percent, the greater the brightness of the current environment, and it should be easier to be in day mode. At this time, the exposure threshold is larger, the exposure threshold range in day mode is reduced, and it is not easy to switch from day mode to night mode. The exposure threshold range in night mode increases, and it is easier to switch from night mode to day mode; the smaller the image brightness ratio bright_tone_percent, the smaller the brightness of the current environment, and it should be easier to be in night mode. At this time, the exposure threshold is smaller, the average brightness threshold range in day mode increases, and it is easier to switch from day mode to night mode. The average brightness threshold range in night mode decreases, and it is not easy to switch from night mode to day mode.

[0115] In an embodiment of the present invention, by determining the exposure threshold and exposure threshold range of an image according to the bright_tone_percent ratio of the bright area of ​​the image, it is also possible to adjust the basic conditions for switching the working mode according to the bright_tone_percent ratio of the bright area of ​​the image in the current environment in a dynamic scene. 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 working mode when the number of image frames is greater than or equal to the frame number threshold, the content of the basic conditions for switching the working mode can be increased. The working mode can be switched only when all the basic conditions are continuously met at the same time, thereby avoiding false triggering and further improving the switching accuracy and reliability of the day and night filter switcher.

[0116] Optionally, when the first working mode is the day mode, the exposure threshold is the first exposure threshold Day2Night_Final_EV_thresh; when the first working mode is the night mode, the exposure threshold is the second exposure threshold Night2Day_Final_EV_thresh.

[0117] The first exposure threshold Day2Night_Final_EV_thresh is: Day2Night_Final_EV_thresh=Day2Night_EV_thresh*

[0118] (1+bright_tone_percent); wherein Day2Night_EV_thresh is the first exposure preset value.

[0119] The second exposure threshold Night2Day_Final_EV_thresh is: Night2Day_Final_EV_thresh=Night2Day_EV_thresh*

[0120] (1+bright_tone_percent); wherein Night2Day_EV_thresh is the second exposure preset value.

[0121] 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 area ratio bright_tone_percent of the image, and increase as the bright area ratio bright_tone_percent of the image increases.

[0122] Exemplarily, when the first mode is the day mode, the exposure threshold range is: greater than or equal to the first exposure threshold Day2Night_Final_EV_thresh, an increase in the proportion of bright areas in the image bright_tone_percent will cause the first exposure threshold Day2Night_Final_EV_thresh to increase, the exposure threshold range will decrease, and the day mode is not easy to switch to the night mode; when the first mode is the night mode, the exposure threshold range is: less than or equal to the second exposure threshold Night2Day_Final_EV_thresh, an increase in the proportion of bright areas in the image bright_tone_percent will cause the second exposure threshold Night2Day_Final_EV_thresh to increase, the exposure threshold range will increase, and the night mode is easier to switch to the day 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 size relationship between the two.

[0123] In this way, through the first exposure threshold Day2Night_Final_EV_thresh and the second exposure threshold Night2Day_Final_EV_thresh, the exposure threshold range when the first working mode is the day mode and the exposure threshold range when the first working mode is the night mode can have multiple possibilities, such as overlapping, non-overlapping, etc., which can increase controllability and applicability.

[0124] In an optional embodiment, the first exposure threshold Day2Night_Final_EV_thresh is greater than the second exposure threshold Night2Day_Final_EV_thresh.

[0125] For example, the first exposure threshold Day2Night_Final_EV_thresh is relatively large, so that the image in the day mode meets the basic conditions later, and can be switched to the night mode later; the first exposure threshold Day2Night_Final_EV_thresh is relatively small, so that the image in the night mode meets the basic conditions later, and can be switched to the day mode later. In this way, the first working mode can be switched to the second working mode later, avoiding frequent switching, reducing the switching frequency, reducing energy consumption, and saving energy.

[0126] Embodiment 3

[0127] Figure 3 This is a flow chart of a method for switching a day / night filter switcher provided by Embodiment 3 of the present invention. Compared with the above embodiments, this embodiment adds a basic condition for switching the working mode: the white balance gain value of the image is within the white balance threshold range. Figure 3 As shown, the method includes:

[0128] S3001. In the first working mode, based on the brightness of each pixel in the image captured by the camera, determine the average brightness value Mean Luma of each pixel in the image and the maximum brightness value Ymax of each pixel in the image.

[0129] S3002. Determine a brightness threshold Y_thresh of the image according to the maximum brightness value Ymax in the image.

[0130] S3003 . Determine the proportion of the area in which the brightness value of the pixels in the image is greater than or equal to the brightness threshold Y_thresh as the bright area proportion bright_tone_percent of the image.

[0131] S3004. Determine an average brightness threshold and an average brightness threshold range of the image according to the bright_tone_percent ratio of the bright area of ​​the image; wherein the average brightness threshold is negatively correlated with the bright_tone_percent ratio of the bright area of ​​the image.

[0132] S3005. Obtain the gain total_gain and exposure time shut_time of the camera, and determine the exposure value EV of the camera.

[0133] S3006. Determine an exposure threshold and an exposure threshold range of the image according to the bright area ratio bright_tone_percent of the image; wherein the exposure threshold is positively correlated with the bright area ratio bright_tone_percent of the image.

[0134] S3007. Obtain the white balance gain value, white balance threshold, and white balance threshold range of the image in the current environment.

[0135] The white balance gain value refers to the gain of brightening the red light, green light and blue light of each pixel in the image so that the image can be visible or the image can better restore the original color of the actual environment. When the first working mode is the day mode, the white balance threshold range is: less than or equal to the white balance threshold; when the first working mode is the night mode, the white balance threshold range is: greater than or equal to the white balance threshold.

[0136] Optionally, obtaining a white balance threshold 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; determining a white balance threshold R0 according to the floating point coordinate (x0, y0); wherein the white balance threshold R0 = (x-x0) 2 +(y-y0) 2 .

[0137] For example, in an invisible light environment, in order to restore the original color of the actual environment to the image captured by the camera, the camera needs to perform white balance, and perform global statistical white balance gain values ​​based on the gray world algorithm, and brighten the red light, green light, and blue light by R0 gain, G0 gain, and B0 gain, respectively, which can be converted into floating point coordinates (x0, y0) in the two-dimensional space of the corresponding white balance algorithm, that is, the white balance gain value in the invisible light environment. Among them, x0 = G0 / R0, y0 = G0 / B0.

[0138] When the white balance gain value (x1, y1) of the image in the current environment is less than or equal to the white balance threshold R0, that is, (x1-x0)2+(y1-y0)2≤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, indicating that the current environment is darker; when the white balance gain value (x1, y1) of the image in the current environment is greater than or equal to the white balance threshold R0, that is, (x1-x0) 2 +(y1-y0) 2 ≥R0, at this time, the white balance gain value (x1, y1) of the image in the current environment is far different from the white balance gain value (x0, y0) in the invisible light environment, indicating that the current environment is brighter.

[0139] S3008. Count the number of image frames in which 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 white balance gain value of the image is continuously within the white balance threshold range.

[0140] S3009: Determine whether the image frame number is greater than or equal to the frame number threshold. If so, execute S3010.

[0141] S3010. Switch the first working mode to the second working mode.

[0142] Exemplarily, the basic condition for switching the working mode also includes that the white balance gain value of the image is within the white balance threshold range. In day mode, when the white balance gain value of the image is less 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 indicates that the light in the current environment is dark; combined with the average brightness value MeanLuma and the exposure value EV of the reference 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 indicates that the dark ambient light is a continuous phenomenon, and the working mode of the day and night filter switcher can be switched from day mode to night mode.

[0143] In night mode, when the white balance gain value of the image is greater than or equal to the white balance threshold, that is, the white balance gain value of the image is within the white balance threshold range, it means that the light in the front environment is brighter; combined with the average brightness value MeanLuma and the exposure value EV of the reference 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 brighter ambient light is a continuous phenomenon, and the working mode of the day and night filter switcher can be switched from night mode to day mode.

[0144] The embodiment of the present invention increases the content of the basic conditions for switching the working mode 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, 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, and switches the working mode when the number of image frames is greater than or equal to the frame number threshold. The intensity of the light in the current environment is judged by the white balance gain situation to avoid false triggering, thereby further improving the switching accuracy and reliability of the day and night filter switch.

[0145] Embodiment 4

[0146] Figure 4 This is a schematic diagram of the structure of a switching device for a day / night filter switch provided by the fourth embodiment of the present invention. Figure 4 As shown, the device 40 includes:

[0147] The brightness acquisition module 410 is used to determine the average brightness value Mean Luma of each pixel in the image and the maximum brightness value Ymax of each pixel in the image based on the brightness of each pixel in the image captured by the camera in the first working mode;

[0148] The brightness threshold determination module 420 is used to determine the brightness threshold Y_thresh of the image according to the maximum brightness value Ymax in the image; wherein the brightness threshold Y_thresh=Ymax*Y_Percent, 0<Y_Percent<1;

[0149] The bright area ratio determination module 430 is used to determine the ratio of the area in the image whose brightness value of the pixel points in the image is greater than or equal to the brightness threshold Y_thresh as the bright area ratio bright_tone_percent of the image;

[0150] The average brightness threshold determination module 440 is used to determine the average brightness threshold and the average brightness threshold range of the image according to the bright area ratio bright_tone_percent of the image; wherein the average brightness threshold is negatively correlated with the bright area ratio bright_tone_percent of the image;

[0151] An image frame number statistics module 450 is used to count the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range;

[0152] The frame number determination module 460 is used to determine whether the image frame number is greater than or equal to the frame number threshold; if so, the first working mode is switched to the second working mode.

[0153] Among them, when the first working mode is day mode, the second working mode is night mode, and the average brightness threshold range is: less than or equal to the average brightness threshold; when the first working mode is night mode, the second working mode is day mode, and the average brightness threshold range is: greater than or equal to the average brightness threshold.

[0154] The switching device of the day-night filter switch provided in the embodiment of the present invention can execute the switching method of the day-night filter switch provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0155] Embodiment 5

[0156] Figure 5 This is a schematic diagram of the structure of a day / night filter switcher provided by Embodiment 5 of the present invention. Figure 5 As shown, the day-night filter switch 50 includes: a switching device 40 of the day-night filter switch provided by any embodiment of the present invention.

[0157] The switching device of the day / night filter switch in the day / night filter switch provided in the embodiment of the present invention can execute the switching method of the day / night filter switch provided in any embodiment of the present invention. Therefore, the day / night filter switch provided in the embodiment of the present invention has the functional modules and beneficial effects corresponding to the execution method.

[0158] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0159] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for switching a day and night filter switch, characterized in that: include: In the first working mode, based on the brightness of each pixel in the image captured by the camera, determine the average brightness value Mean Luma of each pixel in the image and the maximum brightness value Ymax of each pixel in the image; Determine a brightness threshold value Y_thresh of the image according to the maximum brightness value Ymax in the image; wherein the brightness threshold value Y_thresh=Ymax*Y_Percent, 0<Y_Percent<1; Determine the proportion of areas in the image whose brightness values ​​of pixels in the image are greater than or equal to the brightness threshold Y_thresh as the bright area proportion bright_tone_percent of the image; According to the bright area ratio bright_tone_percent of the image, determine the average brightness threshold and the average brightness threshold range of the image; wherein the average brightness threshold is negatively correlated with the bright area ratio bright_tone_percent of the image; Counting the number of image frames whose average brightness of the image is continuously within the average brightness threshold range; Determine whether the image frame number is greater than or equal to a frame number threshold; If yes, switching the first working mode to the second working mode; Among them, when the first working mode is the day mode, the second working mode is the night mode, and the average brightness threshold range is: less than or equal to the average brightness threshold; when the first working mode is the night mode, the second working mode is the day mode, and the average brightness threshold range is: greater than or equal to the average brightness threshold.

2. The switching method of the day and night filter switcher according to claim 1, characterized in that: When the first working mode is the day mode, the average brightness threshold is the first average brightness threshold Day2Night_Mean_Luma_thresh; when the first working mode is the night mode, the average brightness threshold is the second average brightness 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); wherein 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); wherein Night2Day_Final_Mean_Luma_thresh is a second average brightness preset value.

3. The switching method of the day and night filter switcher according to claim 2, characterized in that: The first average brightness threshold Day2Night_Mean_Luma_thresh is less than the second average brightness threshold Night2Day_Mean_Luma_thresh.

4. The switching method of the day and night filter switcher according to claim 1, characterized in that: Before counting the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range, the method further includes: Obtaining the gain total_gain and exposure time shut_time of the camera, and determining the exposure value EV of the camera; Determine an exposure threshold and an exposure threshold range of the image according to a bright area ratio bright_tone_percent of the image; wherein the exposure threshold is positively correlated with the bright area ratio bright_tone_percent of the image; Counting the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range includes: 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; Among them, when the first working mode is the day mode, the exposure threshold range is: greater than or equal to the exposure threshold; when the first working mode is the night mode, the exposure threshold range is: less than or equal to the exposure threshold.

5. The switching method of the day and night filter switcher according to claim 4, characterized in that: When the first working mode is the day mode, the exposure threshold is the first exposure threshold Day2Night_Final_EV_thresh; when the first working mode is the night mode, the exposure threshold is the second exposure threshold Night2Day_Final_EV_thresh; The first exposure threshold Day2Night_Final_EV_thresh is: Day2Night_Final_EV_thresh=Day2Night_EV_thresh*(1+bright_tone_percent); wherein Day2Night_EV_thresh is the first exposure preset value; The second exposure threshold Night2Day_Final_EV_thresh is: Night2Day_Final_EV_thresh=Night2Day_EV_thresh*(1+bright_tone_percent); wherein Night2Day_EV_thresh is the second exposure preset value.

6. The switching method of the day and night filter switcher according to claim 5, characterized in that: The first exposure threshold Day2Night_Final_EV_thresh is greater than the second exposure threshold Night2Day_Final_EV_thresh.

7. The switching method of the day and night filter switcher according to claim 4, characterized in that: Before 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, the method further includes: Obtaining a white balance gain value, a white balance threshold, and a white balance threshold range of the image in the current environment; 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, comprises: 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, 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 working mode is the day mode, the white balance threshold range is: less than or equal to the white balance threshold; when the first working mode is the night mode, the white balance threshold range is: greater than or equal to the white balance threshold.

8. The switching method of the day and night filter switcher according to claim 7, characterized in that: Get the white balance threshold, including: Get the white balance gain value in invisible light environment; Convert the white balance gain value in the invisible light environment into floating point coordinates (x0, y0) in the two-dimensional space of the white balance algorithm; According to the floating point coordinates (x0, y0), the white balance threshold R0 is determined; wherein the white balance threshold R0 = (x-x0) 2 +(y-y0) 2 .

9. The switching method of the day and night filter switcher according to claim 1, characterized in that: When the first working mode is the daytime mode, switching the first working mode to the second working mode includes: Switching the working state of the camera from the day mode to the night mode, switching to the IR filter, and turning on the infrared light; When the first working mode is the night mode, switching the first working mode to the second working mode includes: The working state of the camera is switched from the night mode to the day mode, the all-pass filter is switched, and the infrared light is turned off.

10. A switching device for a day and night filter switch, characterized in that: include: A brightness acquisition module, used to determine, in a first working mode, an average brightness value Mean Luma of each pixel in the image and a maximum brightness value Ymax of each pixel in the image based on the brightness of each pixel in the image captured by the camera; A brightness threshold determination module, used to determine a brightness threshold Y_thresh of the image according to a maximum brightness value Ymax in the image; wherein the brightness threshold Y_thresh=Ymax*Y_Percent, 0<Y_Percent<1; A bright area ratio determination module, used to determine the ratio of the area whose brightness value of the pixel points in the image is greater than or equal to the brightness threshold Y_thresh in the image as the bright area ratio bright_tone_percent of the image; An average brightness threshold determination module, used to determine the average brightness threshold and the average brightness threshold range of the image according to the bright area ratio bright_tone_percent of the image; wherein the average brightness threshold is negatively correlated with the bright area ratio bright_tone_percent of the image; An image frame number statistics module is used to count the number of image frames whose average brightness value Mean Luma of the image is continuously within the average brightness threshold range; A frame number determination module, used to determine whether the image frame number is greater than or equal to a frame number threshold; if so, switching the first working mode to a second working mode; Among them, when the first working mode is the day mode, the second working mode is the night mode, and the average brightness threshold range is: less than or equal to the average brightness threshold; when the first working mode is the night mode, the second working mode is the day mode, and the average brightness threshold range is: greater than or equal to the average brightness threshold.

11. A day and night filter switcher, characterized in that: include: The switching device of the day-night filter switcher according to claim 10; wherein the switching device is used to execute the switching method of the day-night filter switcher according to any one of claims 1-9.

Citation Information

Patent Citations

  • IR-Cut optical filter switching method, device and camera

    CN103945201A

  • Work mode switching method and device of camera

    CN107026967A