Day and night oscillation processing method and device for camera
By detecting the day and night oscillation of the camera and judging the triggering cause, adjusting the brightness of the fill light or locking the night mode, the day and night oscillation problem caused by the camera due to reflected light or environmental changes is solved, improving user experience and extending the device life.
Patent Information
- Application Number
- CN202311161814.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2025-03-11
AI Technical Summary
When the camera has a reflective environment and insufficient light, it may frequently switch day and night mode due to reflected light from the fill light or changes in the external environment, resulting in day and night oscillation, reducing user experience and increasing power consumption.
By detecting whether the camera is vibrating day and night, and determining the triggering reason, if it is triggered by reflected light from the fill light, adjust the brightness of the fill light; if it is triggered by changes in the external environment, lock the camera in night mode.
It effectively reduces the day and night oscillation of the camera, reduces power consumption, extends the service life of the equipment, and improves the user experience.
Smart Images

Figure CN119603551A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and device for processing day and night oscillation of a camera. Background Art
[0002] Cameras such as IPC (Internet Protocol Camera) will switch between day and night modes due to external light. When the external light is dark (e.g., the ambient light intensity is lower than a certain threshold), it will switch to night mode. When the external light is strong (e.g., the ambient light intensity is higher than a certain threshold), it will switch to day mode. Generally, cameras will turn off the fill light (e.g., infrared light or white light) and adjust the image to color in day mode. There are two modes in night mode: full-color night vision and black-and-white night vision. In black-and-white night vision, the infrared light is turned on and the image is adjusted to black-and-white. In full-color night vision, the white light is turned on and the image is adjusted to color.
[0003] When the camera is in a reflective environment, if the light is insufficient, the camera will turn on the fill light. Because the environment has reflective characteristics, it is possible that the ambient light intensity collected by the camera after turning on the light exceeds the threshold for switching to day mode, so the camera switches to day mode at this time. However, when the camera switches to day mode, the camera continues to collect the current ambient light and finds that the ambient light does not meet the day mode. The camera will still switch to night mode, and repeat. In addition, if the camera is in an environment where the ambient light changes frequently, it will also trigger frequent changes in day and night mode. This state of frequent day and night switching is called day and night oscillation.
[0004] The day and night oscillation of the camera not only reduces the user experience, but also increases the power consumption of the camera itself. If the camera is in night mode and the picture is full-color night vision, the white light will flicker frequently; if the camera is in night mode and the picture is black and white night vision, the camera will frequently switch between full-color and black and white pictures. Both situations will cause a poor user experience and increase the power consumption of the camera. At present, a solution to reduce the day and night oscillation phenomenon of the camera is urgently needed. Summary of the invention
[0005] The embodiment of the present invention provides a method and device for processing day-night oscillation of a camera, so as to reduce the day-night oscillation phenomenon of the camera.
[0006] The technical solution of the embodiment of the present invention is achieved as follows:
[0007] A method for processing day and night vibration of a camera, the method comprising:
[0008] Detect whether the camera has day and night vibration;
[0009] If day-night oscillation occurs, the triggering cause of the day-night oscillation is detected;
[0010] When it is detected that the day-night oscillation is triggered by the reflected light of the camera's fill light, the brightness of the fill light is adjusted;
[0011] Alternatively, when it is detected that the day-night oscillation is triggered by a change in the external environment, the camera is locked into night mode.
[0012] The step of detecting whether the camera has experienced day and night oscillation includes:
[0013] It is determined whether the camera satisfies: the number of mode switching from night to day and then to night within a preset first time period is not less than a preset first threshold. If so, it is determined that the camera has experienced day and night oscillation.
[0014] The triggering reasons for detecting the day-night oscillation include:
[0015] Determine whether the camera's fill light is turned on. If so, turn it off, then sample the ambient light intensity, and determine whether the ambient light intensity is stable based on the sampled multiple ambient light intensities. If so, determine that the day-night oscillation is triggered by the reflected light of the camera's fill light; if not, determine that the day-night oscillation is triggered by changes in the external environment. If the fill light is not turned on, determine that the day-night oscillation is triggered by changes in the external environment.
[0016] The sampling of the ambient light intensity comprises:
[0017] Counting the total duration of the preset second number of day-night switchings, and calculating the average duration of a single day-night switching; sampling the ambient light intensity at a preset third time interval within the average duration of a single day-night switching;
[0018] Furthermore, judging whether the ambient light intensity is stable according to the sampled multiple ambient light intensities includes:
[0019] Based on the multiple sampled ambient light intensities, the change amplitudes of the ambient light intensities adjacent to each other are calculated, and the change amplitudes of the ambient light intensities adjacent to each other are normalized. Based on the normalized change amplitudes of the ambient light intensities adjacent to each other, the average change amplitude of the ambient light intensity is calculated, and it is determined whether the average change amplitude is less than a preset second threshold value. If so, it is determined that the ambient light intensity is stable; otherwise, it is determined that the ambient light intensity is unstable.
[0020] The step of adjusting the brightness of the fill light comprises:
[0021] Detect the ambient light intensity when the fill light is turned off;
[0022] adjusting the fill light to be at least one brightness, and detecting the ambient light intensity when the fill light is at at least one brightness;
[0023] Calculating a corresponding relationship between the brightness of the fill light and the ambient light intensity according to the ambient light intensity when the fill light is turned off and the ambient light intensity when the fill light is at at least one brightness;
[0024] According to the corresponding relationship between the brightness of the fill light and the ambient light intensity, the brightness of the fill light corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold for the camera to switch from the day mode to the night mode is calculated;
[0025] According to the brightness of the fill light corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold when the camera switches from the day mode to the night mode and the preset weight, the adjusted brightness of the fill light is obtained;
[0026] After adjusting the brightness of the fill light of the camera to the adjusted fill light brightness, turn on the fill light.
[0027] The value range of the preset weight is: not less than 0.85 and not more than 0.95.
[0028] After adjusting the brightness of the fill light, the method further includes:
[0029] Detect whether the camera has switched from day to night. If so, determine whether the number of mode switches from night to day and then to night within the most recent preset fourth time period after adjusting the brightness of the fill light is greater than a preset third threshold. If so, lock the camera in night mode. If not, return to the action of detecting the ambient light intensity when the fill light is turned off.
[0030] After the camera is locked in the night mode, the method further comprises:
[0031] When the ambient light intensity is greater than a preset ambient light intensity threshold for the camera to switch from the night mode to the day mode, the camera is switched to the day mode.
[0032] When the day-night oscillation is detected to be triggered by a change in the external environment, the camera is locked into night mode, including:
[0033] When it is detected that the day-night oscillation is triggered by changes in the external environment, the camera is locked in night mode for a preset fifth time period.
[0034] A day and night vibration processing device for a camera, the device comprising:
[0035] Day-night oscillation detection module, used to detect whether the camera has day-night oscillation;
[0036] A trigger cause detection module is used to detect the trigger cause of the day-night oscillation when the camera experiences day-night oscillation;
[0037] The day-night oscillation processing module is used to adjust the brightness of the fill light when it is detected that the day-night oscillation is triggered by the reflected light of the camera's fill light; or, when it is detected that the day-night oscillation is triggered by changes in the external environment, lock the camera into night mode.
[0038] Through the above-mentioned embodiments, it is possible to detect in time when the camera oscillates day and night, and to detect the triggering cause of the day and night oscillation, and to give different processing methods according to different triggering causes to avoid the continuation of the day and night oscillation, thereby reducing the day and night oscillation phenomenon of the camera, reducing the loss of components of the camera, and extending the service life of the camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0040] Figure 1 A flowchart of a method for processing day and night oscillation of a camera provided by an embodiment of the present invention;
[0041] Figure 2 A flow chart of a method for processing day and night oscillation of a camera provided by another embodiment of the present invention;
[0042] Figure 3 A schematic structural diagram of a device for processing day-night oscillation of a camera provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0044] The terms "first", "second", "third", "fourth", etc. (if any) 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 interchangeable 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, for example. 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.
[0045] Figure 1 This is a flow chart of a method for processing day and night oscillation of a camera provided by an embodiment of the present invention, and the specific steps are as follows:
[0046] Step 101: Detect whether the camera has day-night oscillation.
[0047] In an optional embodiment, this step specifically includes: determining whether the camera satisfies: the number of mode switches from night to day and then to night completed within a preset first duration is not less than a preset first threshold value, and if so, determining that the camera has experienced day and night oscillation. The specific values of the first duration and the first threshold value can be set based on experience, etc. For example: determining whether the camera satisfies: the number of mode switches from night to day and then to night completed within two minutes is not less than 3 times, and if so, determining that the camera has experienced day and night oscillation.
[0048] The day-night switch is caused by changes in external light. If the external light changes frequently within the preset first time period, such as two minutes, the camera will experience day-night oscillation.
[0049] Step 102: If day-night oscillation occurs, the triggering cause of the day-night oscillation is detected.
[0050] Step 103: When it is detected that the day-night oscillation is triggered by the reflected light of the camera's fill light, the brightness of the fill light is adjusted; or, when it is detected that the day-night oscillation is triggered by changes in the external environment, the camera is locked in night mode.
[0051] Through the above-mentioned embodiments, it is possible to detect in time when the camera oscillates day and night, and to detect the triggering cause of the day and night oscillation, and to give different processing methods according to different triggering causes to avoid the continuation of the day and night oscillation, thereby reducing the day and night oscillation phenomenon of the camera, reducing the loss of components of the camera, and extending the service life of the camera.
[0052] In an optional embodiment, in step 102, the triggering cause of the day-night oscillation is detected, including: determining whether the camera's fill light is turned on, if the fill light is turned on, turning off the fill light, and then sampling the ambient light intensity, and determining whether the ambient light intensity is stable based on the sampled multiple ambient light intensities, if it is stable, determining that the day-night oscillation is triggered by the reflected light of the camera's fill light, if it is unstable, determining that the day-night oscillation is triggered by changes in the external environment; if the fill light is not turned on, determining that the day-night oscillation is triggered by changes in the external environment.
[0053] In an optional embodiment, sampling the ambient light intensity includes: counting the total duration of a preset second number of day-night switchings, calculating the average duration of a single day-night switching; sampling the ambient light intensity at a preset third time interval within the average duration of a single day-night switching;
[0054] Furthermore, judging whether the ambient light intensity is stable is based on the multiple sampled ambient light intensities, including: calculating the variation amplitude of the ambient light intensities adjacent to each other based on the multiple sampled ambient light intensities, normalizing the variation amplitude of the ambient light intensities adjacent to each other, calculating the average variation amplitude of the ambient light intensity based on the normalized variation amplitude of the ambient light intensities adjacent to each other, judging whether the average variation amplitude is less than a preset second threshold, and, if so, determining that the ambient light intensity is stable, otherwise, determining that the ambient light intensity is unstable.
[0055] The total duration of the preset second number of day-night switchings is as follows: the total duration of all day-night switching completed within the preset first duration in step 101 .
[0056] Among them, switching from day mode to night mode, or switching from night mode to day mode is considered a day-night switch.
[0057] Among them, the specific values of the second number, the third time interval, and the second threshold value can be set based on experience, etc. For example: if in step 101, it is determined whether the camera meets: the number of mode switching from night to day and then to night is completed within two minutes is not less than 3 times, if so, it is determined that the camera has experienced day and night oscillation, then in step 102, the average duration of a single day and night switch can be calculated based on the duration of each day and night switch completed in step 101. The third time interval can be, for example, 200ms (milliseconds). The value range of the second threshold value can be: 0.3≤second threshold value≤0.7, preferably, the second threshold value = 0.5.
[0058] In the above embodiment, the ambient light intensity after the fill light is turned off is sampled, and whether the ambient light intensity is stable after the fill light is turned off is determined based on the change amplitude of the sampled ambient light intensity. If it is stable, it is determined that the previous day and night oscillation was triggered by the reflected light of the camera's fill light. Otherwise, it is determined that the previous day and night oscillation was triggered by changes in the external environment, thereby realizing the detection of the triggering cause of the day and night oscillation and laying the foundation for the subsequent day and night oscillation processing.
[0059] In an optional embodiment, in step 103, adjusting the brightness of the fill light includes:
[0060] Step 1031: Detecting the ambient light intensity when the fill light is turned off;
[0061] Step 1032: adjusting the fill light to at least one brightness, and detecting the ambient light intensity when the fill light is at at least one brightness;
[0062] Step 1033: Calculate a corresponding relationship between the brightness of the fill light and the ambient light intensity according to the ambient light intensity when the fill light is turned off and the ambient light intensity when the fill light is at at least one brightness;
[0063] Step 1034: according to the corresponding relationship between the brightness of the fill light and the ambient light intensity, calculate the brightness of the fill light corresponding to when the ambient light intensity is equal to a preset ambient light intensity threshold for the camera to switch from the day mode to the night mode;
[0064] Step 1035: obtaining an adjusted fill light brightness according to the fill light brightness corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold for the camera to switch from the day mode to the night mode and the preset weight;
[0065] Step 1036: After adjusting the brightness of the camera's fill light to the adjusted fill light brightness, turn on the fill light. The value range of the preset weight may be: 0.85≤preset weight≤0.95.
[0066] When the day-night oscillation is triggered by the reflected light of the camera's fill light, it means that the brightness of the fill light is too high at this time, and the brightness of the fill light needs to be reduced. In the above embodiment, by obtaining the ambient light intensity when the fill light is turned off and when the fill light is at at least one brightness, the corresponding relationship between the brightness of the fill light and the ambient light intensity is calculated, and according to the corresponding relationship, the brightness of the fill light corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold when the camera switches from day mode to night mode is obtained, and the new brightness of the fill light is set to be less than the brightness of the fill light corresponding to the preset ambient light intensity threshold when the camera switches from day mode to night mode, so as to reduce the possibility of day-night oscillation occurring again.
[0067] In an optional embodiment, in step 103, after adjusting the brightness of the fill light, further comprising: detecting whether the camera has switched from day to night, if so, determining whether the number of mode switches from night to day and then to night within the latest preset fourth time period after adjusting the brightness of the fill light is greater than a preset third threshold, if greater, locking the camera in night mode, if not greater, returning to the action of detecting the ambient light intensity when the fill light is turned off. The fourth time period and the third threshold can be set based on experience, etc. For example: the fourth time period is 10 minutes, and the third threshold is 4.
[0068] If day-night oscillation occurs again after lowering the brightness of the fill light, it means that the brightness of the fill light is not adjusted properly. You need to recalculate the correspondence between the brightness of the fill light and the ambient light intensity, and then recalculate the new brightness of the fill light based on the new correspondence. If the day-night oscillation is still not avoided after adjusting the brightness of the fill light multiple times, in order to avoid day-night oscillation, lock the camera in night mode.
[0069] In an optional embodiment, after locking the camera in the night mode, the method further includes: when the ambient light intensity is greater than a preset ambient light intensity threshold for the camera to switch from the night mode to the day mode, switching the camera to the day mode.
[0070] In an optional embodiment, in step 103, when it is detected that the day-night oscillation is triggered by a change in the external environment, the camera is locked in night mode, including: when it is detected that the day-night oscillation is triggered by a change in the external environment, the camera is locked in night mode within a preset fifth time period. The value of the fifth time period can be set based on experience, etc. For example, the fifth time period is 30 minutes.
[0071] Changes in the external environment, such as frequently turning lights on and off 。 The reason for locking the camera into the night mode within the preset fifth time period is that the changes in the external environment generally end after a period of time, and locking the camera into the night mode for the fifth time period can avoid the changes in the external environment during this period of time.
[0072] Figure 2 A flow chart of a method for processing day and night oscillation of a camera provided by another embodiment of the present invention, wherein the specific steps are as follows:
[0073] Step 201: Monitor the working mode of the camera. When detecting that the camera has switched between day and night, determine whether the camera meets the following conditions: the number of mode switches from night to day and then to night within a preset first time period is not less than a preset first threshold. If so, it is determined that the camera has experienced day and night oscillation.
[0074] If not satisfied, the operation returns to the working mode of the surveillance camera.
[0075] The specific values of the first duration and the first threshold can be set based on experience, etc. For example, judging whether the camera satisfies: the number of mode switching from night to day and then to night within two minutes is not less than 3 times, if so, it is determined that the camera has day and night oscillation.
[0076] Step 202: Determine whether the camera has turned on the fill light. If so, execute step 203; otherwise, execute step 211.
[0077] Step 203: turn off the fill light, count the total duration of all day-night switches that occurred in step 201 within the preset first duration, and calculate the average duration of a single day-night switch; sample the ambient light intensity at a preset third time interval within the average duration of a single day-night switch.
[0078] The ambient light intensity can be expressed by an AE (Auto Exposure) value or a photosensitivity value.
[0079] Step 204: Calculate the variation range of the ambient light intensities adjacent to each other based on the multiple sampled ambient light intensities, normalize the variation range of the ambient light intensities adjacent to each other, and calculate the average variation range of the ambient light intensity based on the normalized variation range of the ambient light intensities adjacent to each other.
[0080] Steps 203 to 204 can be expressed by the following formula:
[0081]
[0082]
[0083]
[0084] in, is the average duration of a single day-night switch, N is the total number of day-night switches completed within the preset first duration in step 201, and t n is the starting time of the nth day-night switch, t n+1 The end time of the nth day-night switch;
[0085] ΔT is the preset third time interval, M is the average duration of a single day-night switch The total number of sampling times of sampling the ambient light intensity according to a preset third time interval ΔT within a period;
[0086] is the average variation of ambient light intensity, E m is the ambient light intensity sampled at the mth time, E m+1 is the ambient light intensity sampled at the m+1th time.
[0087] Step 205: Determine whether the average change amplitude is less than a preset second threshold value. If so, execute step 206; otherwise, execute step 211.
[0088] Specifically, the second number, the third time interval, and the second threshold value may be set based on experience or the like.
[0089] Step 206: Determine that the day-night oscillation is triggered by the reflected light of the camera's fill light, then first detect the ambient light intensity when the fill light is turned off, then adjust the fill light to at least one brightness, and detect the ambient light intensity when the fill light is at at least one brightness.
[0090] In this step, the fill light is adjusted to at least one brightness, and the ambient light intensity when the fill light is at at least one brightness is detected. Specifically, the fill light is first adjusted to a certain brightness, and then turned on the fill light, and then the ambient light intensity is detected; then the fill light is turned off, and then the fill light is adjusted to another brightness, and then the fill light is turned on again, and then the ambient light intensity is detected, and then the fill light is turned off, and so on.
[0091] Step 207: Calculate the corresponding relationship between the brightness of the fill light and the ambient light intensity according to the ambient light intensity when the fill light is turned off and the ambient light intensity when the fill light is at at least one brightness.
[0092] It should be noted that if the brightness of the fill light is set to be linearly related to the ambient light intensity, it is only necessary to adjust the fill light to a certain brightness. For example, if the ambient light intensity is y and the brightness of the fill light is x, then y=y0+ax, where when x=0, i.e. the fill light is turned off, y=y0, and y0 is the ambient light intensity when the fill light is turned off; then, adjust the fill light to any non-zero brightness x1, turn on the fill light, detect the ambient light intensity y1 at this time, and calculate a based on y1, y0, and x1.
[0093] In practical applications, in order to improve the accuracy of the corresponding relationship between the brightness of the fill light and the ambient light intensity, the brightness of the fill light can be adjusted multiple times, and the corresponding relationship between the brightness of the fill light and the ambient light intensity can be fitted based on the multiple adjusted brightness of the fill light and the corresponding ambient light intensity.
[0094] Step 208: According to the corresponding relationship between the brightness of the fill light and the ambient light intensity, calculate the brightness of the fill light corresponding to when the ambient light intensity is equal to a preset ambient light intensity threshold for the camera to switch from the day mode to the night mode.
[0095] Step 209: Obtain the adjusted brightness of the fill light according to the brightness of the fill light corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold for the camera to switch from the day mode to the night mode and the preset weight.
[0096] Step 210: After adjusting the brightness of the camera's fill light to the adjusted fill light brightness obtained in step 209, turn on the fill light, and this process ends.
[0097] In an optional embodiment, in this step 210, after turning on the fill light, it further includes: continuing to monitor the working mode of the camera, and when it is detected that the camera has switched from day to night, determining whether the number of mode switches from night to day and then to night within the most recent preset fourth time period after turning on the fill light in step 210 is greater than a preset third threshold value, if greater, locking the camera in night mode, if not greater, returning to step 206.
[0098] That is, when the number of mode switches from night to day and then to night within the most recent preset fourth time period after the fill light is turned on in step 210 is not greater than the preset third threshold, return to step 206 to recalculate the correspondence between the brightness of the fill light and the ambient light intensity, and readjust the brightness of the fill light according to the new correspondence.
[0099] Step 211: If it is determined that the day-night oscillation is triggered by a change in the external environment, the camera is locked in night mode for a preset fifth time period.
[0100] The camera in the embodiment of the present invention is, for example, an IPC.
[0101] Figure 3 The schematic diagram of the structure of the day-night oscillation processing device of the camera provided in one embodiment of the present invention mainly comprises: a day-night oscillation detection module 31, a trigger cause detection module 32 and a day-night oscillation processing module 33, wherein:
[0102] The day-night oscillation detection module 31 is used to detect whether the camera has day-night oscillation.
[0103] The triggering cause detection module 32 is used to detect the triggering cause of the day-night oscillation when the camera has day-night oscillation.
[0104] The day-night oscillation processing module 33 is used to adjust the brightness of the fill light when it is detected that the day-night oscillation is triggered by the reflected light of the camera's fill light; or, when it is detected that the day-night oscillation is triggered by changes in the external environment, lock the camera into night mode.
[0105] In an optional embodiment, the day-night oscillation detection module 31 is specifically used to determine whether the camera meets: the number of mode switches from night to day and then to night within a preset first time period is not less than a preset first threshold. If so, it is determined that the camera has experienced day-night oscillation.
[0106] In an optional embodiment, the trigger cause detection module 32 detects the trigger cause of the day-night oscillation, including: determining whether the camera's fill light is turned on; if the fill light is turned on, turning off the fill light, and then sampling the ambient light intensity; and determining whether the ambient light intensity is stable based on the sampled multiple ambient light intensities; if it is stable, determining that the day-night oscillation is triggered by the reflected light of the camera's fill light; if it is unstable, determining that the day-night oscillation is triggered by changes in the external environment; if the fill light is not turned on, determining that the day-night oscillation is triggered by changes in the external environment.
[0107] In an optional embodiment, the trigger cause detection module 32 samples the ambient light intensity, including: counting the total duration of a preset second number of day-night switchings, calculating the average duration of a single day-night switching; sampling the ambient light intensity at a preset third time interval within the average duration of a single day-night switching;
[0108] Furthermore, the trigger cause detection module 32 determines whether the ambient light intensity is stable based on the multiple sampled ambient light intensities, including: calculating the variation amplitude of the ambient light intensities adjacent to each other based on the multiple sampled ambient light intensities, normalizing the variation amplitude of the ambient light intensities adjacent to each other, calculating the average variation amplitude of the ambient light intensity based on the normalized variation amplitude of the ambient light intensities adjacent to each other, and determining whether the average variation amplitude is less than a preset second threshold value, and if so, determining that the ambient light intensity is stable; otherwise, determining that the ambient light intensity is unstable.
[0109] In an optional embodiment, the day-night oscillation processing module 33 adjusts the brightness of the fill light, including: detecting the ambient light intensity when the fill light is turned off; adjusting the fill light to at least one brightness, and detecting the ambient light intensity when the fill light is at at least one brightness; calculating the correspondence between the brightness of the fill light and the ambient light intensity according to the ambient light intensity when the fill light is turned off and the ambient light intensity when the fill light is at at least one brightness; calculating the brightness of the fill light corresponding to when the ambient light intensity is equal to a preset ambient light intensity threshold for the camera to switch from day mode to night mode according to the correspondence between the brightness of the fill light and the ambient light intensity; obtaining the adjusted brightness of the fill light according to the brightness of the fill light corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold for the camera to switch from day mode to night mode and a preset weight; after adjusting the brightness of the camera's fill light to the adjusted brightness of the fill light, turn on the fill light.
[0110] In an optional embodiment, after the day-night oscillation processing module 33 adjusts the brightness of the fill light, it is further used to detect whether the camera has switched between day and night. If so, it is determined whether the number of mode switches from night to day and then to night within the most recent preset fourth time period after the adjustment of the brightness of the fill light is greater than a preset third threshold. If so, the camera is locked in night mode. If not, the process returns to the action of detecting the ambient light intensity when the fill light is turned off.
[0111] In an optional embodiment, after the day-night oscillation processing module 33 locks the camera in the night mode, it further includes: when the ambient light intensity is greater than a preset ambient light intensity threshold for the camera to switch from the night mode to the day mode, switching the camera to the day mode.
[0112] In an optional embodiment, when the day-night oscillation processing module 33 detects that the day-night oscillation is triggered by changes in the external environment, the camera is locked in the night mode, including: when it is detected that the day-night oscillation is triggered by changes in the external environment, the camera is locked in the night mode within a preset fifth time period.
[0113] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores instructions. When the instructions are executed by a processor, the processor executes the steps of the day-night oscillation processing method for a camera described in any embodiment of the present invention.
[0114] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope disclosed in the present application.
[0115] Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas, and is not used to limit the present application. For those skilled in the art, changes can be made in the specific implementation methods and application scopes according to the ideas, spirits and principles of the present invention, and any modifications, equivalent substitutions, improvements, etc. made therein should be included in the scope of protection of this application.
Claims
1. A method for processing day and night vibration of a camera, characterized in that: The method includes: Detect whether the camera has day and night vibration; If day-night oscillation occurs, the triggering cause of the day-night oscillation is detected; When it is detected that the day-night oscillation is triggered by the reflected light of the camera's fill light, the brightness of the fill light is adjusted; Alternatively, when it is detected that the day-night oscillation is triggered by a change in the external environment, the camera is locked into night mode.
2. The method according to claim 1, characterized in that: The step of detecting whether the camera has experienced day and night oscillation includes: It is determined whether the camera satisfies: the number of mode switching from night to day and then to night within a preset first time period is not less than a preset first threshold. If so, it is determined that the camera has experienced day and night oscillation.
3. The method according to claim 1, characterized in that The triggering reasons for detecting the day-night oscillation include: Determine whether the camera's fill light is turned on. If so, turn it off, then sample the ambient light intensity, and determine whether the ambient light intensity is stable based on the sampled multiple ambient light intensities. If so, determine that the day-night oscillation is triggered by the reflected light of the camera's fill light; if not, determine that the day-night oscillation is triggered by changes in the external environment. If the fill light is not turned on, determine that the day-night oscillation is triggered by changes in the external environment.
4. The method according to claim 3, characterized in that The sampling of the ambient light intensity comprises: Counting the total duration of the preset second number of day-night switchings, and calculating the average duration of a single day-night switching; sampling the ambient light intensity at a preset third time interval within the average duration of a single day-night switching; Furthermore, judging whether the ambient light intensity is stable according to the sampled multiple ambient light intensities includes: Based on the multiple sampled ambient light intensities, the change amplitudes of the ambient light intensities adjacent to each other are calculated, and the change amplitudes of the ambient light intensities adjacent to each other are normalized. Based on the normalized change amplitudes of the ambient light intensities adjacent to each other, the average change amplitude of the ambient light intensity is calculated, and it is determined whether the average change amplitude is less than a preset second threshold value. If so, it is determined that the ambient light intensity is stable; otherwise, it is determined that the ambient light intensity is unstable.
5. The method according to claim 1, characterized in that The step of adjusting the brightness of the fill light comprises: Detect the ambient light intensity when the fill light is turned off; adjusting the fill light to be at least one brightness, and detecting the ambient light intensity when the fill light is at at least one brightness; Calculating a corresponding relationship between the brightness of the fill light and the ambient light intensity according to the ambient light intensity when the fill light is turned off and the ambient light intensity when the fill light is at at least one brightness; According to the corresponding relationship between the brightness of the fill light and the ambient light intensity, the brightness of the fill light corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold for the camera to switch from the day mode to the night mode is calculated; According to the brightness of the fill light corresponding to when the ambient light intensity is equal to the preset ambient light intensity threshold when the camera switches from the day mode to the night mode and the preset weight, the adjusted brightness of the fill light is obtained; After adjusting the brightness of the fill light of the camera to the adjusted fill light brightness, turn on the fill light.
6. The method according to claim 5, characterized in that The value range of the preset weight is: not less than 0.85 and not more than 0.
95.
7. The method according to claim 1, 5 or 6, characterized in that: After adjusting the brightness of the fill light, the method further includes: Detect whether the camera has switched from day to night. If so, determine whether the number of mode switches from night to day and then to night within the most recent preset fourth time period after adjusting the brightness of the fill light is greater than a preset third threshold. If so, lock the camera in night mode. If not, return to the action of detecting the ambient light intensity when the fill light is turned off.
8. The method according to claim 7, characterized in that After locking the camera in night mode, the method further comprises: When the ambient light intensity is greater than a preset ambient light intensity threshold for the camera to switch from the night mode to the day mode, the camera is switched to the day mode.
9. The method according to claim 1, characterized in that: When the day-night oscillation is detected to be triggered by changes in the external environment, the camera is locked into night mode, including: When it is detected that the day-night oscillation is triggered by changes in the external environment, the camera is locked in night mode for a preset fifth time period.
10. A day and night vibration processing device for a camera, characterized in that: The device includes: Day-night oscillation detection module, used to detect whether the camera has day-night oscillation; A trigger cause detection module is used to detect the trigger cause of the day-night oscillation when the camera experiences day-night oscillation; The day-night oscillation processing module is used to adjust the brightness of the fill light when it is detected that the day-night oscillation is triggered by the reflected light of the camera's fill light; or, when it is detected that the day-night oscillation is triggered by changes in the external environment, lock the camera into night mode.