Dynamic switching control method, device, electronic device and medium for camera filter
By obtaining the target value of the external ambient light intensity, using the recursive average filtering method and weighted calculation method, and controlling the filter working mode switching with multiple threshold judgment results, the problem of misjudgment of camera filter mode switching is solved, and higher accuracy and simplified operation process is achieved.
Patent Information
- Application Number
- CN202211441163.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-11-17
AI Technical Summary
In the prior art, the probability of misjudgment of camera filter mode switching due to sudden changes in external ambient light and poor or aging of photosensitive devices is high, and the operation process of the existing method is complicated.
The target value of the external ambient light intensity is obtained through the preset data acquisition rules, the photosensitive mean and image brightness mean are obtained by recursive average filtering method and weighting calculation, and the filter working mode switching is controlled based on multiple threshold judgment results.
It reduces the probability of misjudgment of filter mode switching, simplifies the operation process, and improves the user experience and the adaptability of the equipment in different scenarios.
Smart Images

Figure CN115767243B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image acquisition, and particularly to a method, device, electronic device and medium for dynamically switching and controlling a camera filter. Background Art
[0002] In the prior art, the working modes of a camera filter are divided into a daytime mode, i.e., an infrared cut-off mode, and a night vision mode, i.e., a full-transmission mode. During the process of switching between the full-transmission mode and the infrared cut-off mode, a photosensitive element can detect the light intensity of the current environment, and by reading the photosensitive value, the automatic switching of the filter according to the change of the ambient light can be realized.
[0003] In actual use, the following common situations occur: after switching to the full-transmission mode, when the infrared lamp is turned on, the ambient light brightness increases, resulting in the photosensitive value decreasing first and then increasing. At this time, the photosensitive value fluctuates around the threshold, causing the filter to switch repeatedly; when the light-shielding curtain is drawn or in rainy weather, the light intensity decreases, resulting in a low photosensitive value, and the filter may mis-switch to the full-transmission mode; due to the malfunction or aging of some photosensitive devices, the photosensitive value becomes inaccurate after working for a period of time, causing the program to misjudge and resulting in an incorrect filter mode setting. Moreover, the resistance characteristics of photosensitive devices in different batches are also inconsistent, resulting in asynchronous switching of filters in different batches.
[0004] In the prior art, Chinese Patent CN110225257A discloses a day-night mode switching method, device, equipment and storage medium, including: if it is determined that N consecutive samplings all meet the first night-to-day switching condition or M consecutive samplings all meet the second night-to-day switching condition, then the current day-night mode is switched to the day mode, where N and M are positive integers greater than 1; if it is determined that L consecutive samplings all meet the day-to-night switching condition, then the current day-night mode is switched to the night mode, where L is a positive integer greater than 1. Among them, the first and second night-to-day switching conditions and the day-to-night switching condition are all determined based on the photosensitive value and further combined with one or more of the camera photosensitive parameters and the infrared scene. The above technical solution requires continuously obtaining the photosensitive value and the camera photosensitive parameters multiple times and inputting them into the program for processing and determination in combination with the infrared scene, and the operation process is relatively complex.
[0005] In summary, when the accuracy of the photosensitive value of the photosensitive element is affected due to sudden changes in the external ambient light and the malfunction or aging of the photosensitive device, how to simply reduce the misjudgment probability of the filter mode switching is an urgent problem to be solved. Summary of the Invention
[0006] In view of this, embodiments of the present invention provide a method, device, electronic device and medium for dynamically switching and controlling a camera filter, which are used to relatively simply solve the problem of high probability of misjudgment in filter mode switching when the accuracy of the photosensitive value is affected due to sudden changes in the external environmental light and poor or aging photosensitive devices in the prior art.
[0007] In a first aspect, embodiments of the present invention provide a method for dynamically switching and controlling a camera filter, the method comprising:
[0008] S1: Obtain a target value for judging the intensity of the external environmental light according to a preset data acquisition rule;
[0009] S2: Process the target value according to a preset data processing rule and output a target average value;
[0010] S3: Judge the target average value according to a preset data determination rule and output a determination result, and comprehensively control the filter to complete the corresponding working mode switching according to the determination result.
[0011] Preferably, the S1 includes:
[0012] S11: Preset the frame rate of the system coding, and obtain the photosensitive value of the photosensitive element at regular intervals according to the frame rate;
[0013] S12: According to the preset frame rate of the system coding and the user's region of interest Area(x0, y0, x1, y1), extract the image data of the user-set region of interest Area(x0, y0, x1, y1) at regular intervals and convert it into the HSV format, and then extract the brightness V value of each pixel point corresponding to the HSV color space in this image.
[0014] Preferably, the S2 includes:
[0015] S21: Input the photosensitive value into the first step of data processing and output a photosensitive average value;
[0016] S22: Input the brightness V value into the second step of data processing and output an image brightness average value Va.
[0017] Preferably, the S21 includes:
[0018] S211: Set multiple buffers to store the photosensitive values obtained each time;
[0019] S212: Insert the newly obtained photosensitive value into the tail of the buffer;
[0020] S213: Obtain the photosensitive average value by the recursive average filtering method;
[0021] S214: Output the photosensitive average value.
[0022] Preferably, the S22 includes:
[0023] S221: Calculate the weighted arithmetic mean value Va within this area by combining with the brightness V value through weighted calculation;
[0024] S222: Output the weighted arithmetic mean value Va, that is, the image brightness mean value Va.
[0025] Preferably, the S3 includes:
[0026] S31: Set the first threshold N1 and the second threshold N2 of the light brightness, such that N2 > N1 > 0, and the difference between N2 and N1 is the brightness amplitude. Among them, the magnitudes and differences of N1 and N2 can be averaged by testing in different scenarios. At the same time, set the first threshold V1 and the second threshold V2 of the image brightness, such that V2 > V1 > 0. Among them, this threshold can be determined by actual testing in the home bedroom scenario. The difference between V1 and V2 is the average value of the amplitude of the environmental brightness change caused by the reflection of light on the object surface before and after the infrared lamp is turned on when the device is working normally;
[0027] S32: Determine the current filter working mode according to the obtained photosensitive value on the current photosensitive element in combination with the thresholds N1 and N2, and output the determination result 1 if the condition is met three times continuously;
[0028] S33: Determine the size relationship between the photosensitive average value and the thresholds N1 and N2 according to the current filter working mode, and output the determination result 2 if the condition is met three times continuously;
[0029] S34: Determine the size relationship between the image brightness mean value Va and the thresholds V1 and V2 according to the size relationship between the photosensitive average value and the thresholds N1 and N2, and output the determination result 3 if the condition is met three times continuously;
[0030] S35: Comprehensively control the filter to complete the corresponding working mode switching according to the determination results 1, 2, and 3.
[0031] Preferably, the S35 includes:
[0032] S351: If the determination result 1 is the infrared cut-off mode, the determination result 2 is that the photosensitive average value is lower than the first threshold N1, and the determination result 3 is that the image brightness mean value Va is lower than the preset first brightness threshold V1, then it is necessary to control the filter to switch to the full-transmission mode for operation;
[0033] S352: If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive average value is higher than the first threshold N1 but lower than the second threshold N2, and the determination result 3 is that the average image brightness Va is lower than the preset second brightness threshold V2, then it is necessary to control the filter to maintain the full-transmission mode operation;
[0034] S353: If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive average value is higher than the second threshold N2, and the determination result 3 is that the average image brightness Va is higher than the preset second brightness threshold V2, then it is necessary to control the filter to switch to the infrared cut-off mode operation.
[0035] Preferably, the present invention further provides a camera filter dynamic switching control device, including:
[0036] A data acquisition module: used to obtain a target value for judging the external environmental light intensity according to a preset data acquisition rule;
[0037] A data processing module: used to process the target value according to a preset data processing rule and output a target average value;
[0038] A data determination module: used to use a mode determination rule to determine the photosensitive average value and the average image brightness Va to obtain a determination result, and then complete the corresponding filter working mode switching according to the determination result.
[0039] Preferably, the present invention further provides a camera filter dynamic switching control electronic device, including:
[0040] A camera (including a filter), a photosensitive element, at least one processor, at least one memory, and computer program instructions stored in the memory, wherein the camera is set for image acquisition; the filter is set to control the amount of infrared light entering the camera; the photosensitive element is set to detect the external environmental light brightness; the computer program instructions, when executed by the processor, implement the method described in any one of the above.
[0041] The present invention further provides a camera filter dynamic switching control medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described in any one of the above is implemented.
[0042] In summary, the beneficial effects of the embodiments of the present invention are as follows:
[0043] An embodiment of the present invention provides a method for dynamically switching and controlling a camera filter, which obtains a target value for judging the intensity of external environmental light according to a preset data acquisition rule; processes the target value according to a preset data processing rule to output a target average value; determines the target average value according to a preset data determination rule to output a determination result, and comprehensively controls the filter to complete the corresponding working mode switching according to the determination result. On the one hand, since the picture is collected in real time, the obtained photosensitive value determines the photosensitive average value through the first step of data processing; the image brightness V value determines the image brightness average value Va through the second step of data processing, which reflects the light brightness change within the entire target time period, thereby filtering out the disturbance of some instantaneous light changes, and further solving the problem of misjudgment of the filter caused by instantaneous light brightness changes; at the same time, the method of determining according to the photosensitive average value, the image brightness average value Va combined with the thresholds N1, N2, V1 and V2 is more abundant in determination conditions than the method of simply controlling the automatic switching of the filter working mode according to the change of the photosensitive value in the prior art. When the photosensitive device is defective or aged and the photosensitive value is affected, the probability of misjudgment of the filter is greatly reduced; on the other hand, when controlling the switching of the filter working mode, only the photosensitive average value and the image brightness average value are used for determination, which simplifies the working process compared with the prior art Chinese patent CN110225257A. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings, and all of them are within the protection scope of the present invention.
[0045] Figure 1 It is a schematic diagram of the overall working process of the method for dynamically switching and controlling a camera filter in Embodiment 1 of the present invention;
[0046] Figure 2 It is a schematic diagram of the process of obtaining data in Embodiment 1 of the present invention;
[0047] Figure 3 It is a schematic diagram of the process of processing data in Embodiment 2 of the present invention;
[0048] Figure 4 It is a schematic diagram of the first step of processing data in Embodiment 2 of the present invention;
[0049] Figure 5 It is a schematic diagram of the second step of processing data in Embodiment 2 of the present invention;
[0050] Figure 6 It is a schematic diagram of the process of determining data in Embodiment 3 of the present invention;
[0051] Figure 7 It is a schematic flowchart of the switching mode in Embodiment 3 of the present invention;
[0052] Figure 8 It is a structural block diagram of the camera filter dynamic switching device in the second implementation manner of the present invention;
[0053] Figure 9 It is a schematic structural diagram of the electronic device in the third implementation manner of the present invention. Specific implementation manners
[0054] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. To make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without some of these specific details. The following description of the embodiments is only provided to provide a better understanding of the present invention by showing examples of the present invention.
[0055] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, the elements defined by the statement "including..." do not exclude the existence of additional identical elements in the process, method, article or device including the said elements.
[0056] Implementation manner one
[0057] Please refer to Figure 1 , the first implementation manner of the present invention provides a method for dynamically switching and controlling a camera filter, including:
[0058] S1: Obtain a target value for judging the external environmental light intensity according to a preset data acquisition rule;
[0059] Specifically, assume that the system encoding frame rate is set to 20 frames per second, that is, one frame of picture can be captured every 50 milliseconds. First, the system can obtain the photosensitive value of the photosensitive element every 100 milliseconds. Secondly, according to the region of interest Area(x0, y0, x1, y1) set by the user in the algorithm module, the image data of this region is extracted and converted into the HSV format, and then the brightness V value in the HSV color space corresponding to each pixel point in this image is extracted. In summary, the user can preset the system encoding frame rate according to actual needs, so that the filter can complete the corresponding working mode switching task according to the user's instructions in different application scenarios, improving the user's operability and experience.
[0060] S2: Process and output the target mean value according to the preset data processing rule for the target value;
[0061] Specifically, assume that 30 caches (buffers) are set to store the obtained photosensitive value and brightness V value each time. Each newly obtained value is inserted into the tail of the cache (buffer). First, the average value of these 30 groups of values can be obtained by the recursive average filtering method to get the photosensitive mean value. The photosensitive mean value obtained by this method detects the light and dark changes over a period of time, and can significantly reduce the misjudgment caused by the instantaneous light and dark changes. Secondly, the weighted arithmetic mean value Va in this region is calculated by combining the brightness V value. Since the picture is captured in real time, the image brightness mean value Va obtained by weighted calculation also reflects the light change trend of the current environment and can filter out the disturbance of some instantaneous light changes.
[0062] S3: Judge and output the judgment result according to the preset data judgment rule for the target mean value, and control the filter to complete the corresponding working mode switching based on the comprehensive judgment result.
[0063] Specifically, a first threshold N1 and a second threshold N2 of the light brightness are set, such that N2 > N1 > 0, and the difference between N2 and N1 is the brightness amplitude. Among them, the magnitudes and differences of N1 and N2 can be averaged by testing in different scenarios. At the same time, a first threshold V1 and a second threshold V2 of the image brightness are set, such that V2 > V1 > 0, where these thresholds can be determined by actual testing in the home bedroom scenario. The difference between V1 and V2 is the average value of the ambient brightness change amplitude caused by the light reflection on the object surface before and after the infrared lamp is turned on when the device is working normally; the current working mode of the filter is determined by combining the obtained photosensitive value on the current photosensitive element with the thresholds N1 and N2, and the determination result 1 is output when the condition is met three times continuously; the magnitude relationship between the photosensitive average value and the thresholds N1 and N2 is determined according to the current working mode of the filter, and the determination result 2 is output when the condition is met three times continuously; the magnitude relationship between the image brightness average value Va and the thresholds V1 and V2 is determined according to the magnitude relationship between the photosensitive average value and the thresholds N1 and N2, and the determination result 3 is output when the condition is met three times continuously; the corresponding working mode switching of the filter is controlled by comprehensively considering the determination results 1, 2, and 3. In summary, compared with the prior art method of simply determining based on the change of the photosensitive value, the method of determining based on the photosensitive average value and the image brightness average value in combination with the thresholds N1, N2, V1, and V2 combines the image brightness average value and the thresholds in the determination conditions, which can reduce the probability of misjudgment of the filter caused by the influence of the accuracy of the photosensitive value of the photosensitive element due to the poor or aging of the photosensitive device.
[0064] Specifically, for the camera filter dynamic switching control method of the first embodiment of the present invention, the target value for judging the external environmental light intensity is obtained according to the preset data acquisition rule; the target average value is output by processing the target value according to the preset data processing rule; the determination result is output by judging the target average value according to the preset data determination rule, and the corresponding working mode switching of the filter is controlled by comprehensively considering the determination result. On the one hand, since the picture is collected in real time, the obtained photosensitive value determines the photosensitive average value through the first step of data processing; the image brightness V value determines the image brightness average value Va through the second step of data processing, which reflects the light brightness change during the entire target time period, so as to filter out the disturbance of some instantaneous light brightness changes, and further solve the problem of misjudgment of the filter caused by the instantaneous light brightness change; at the same time, compared with the prior art method of simply controlling the automatic switching of the working mode of the filter according to the change of the photosensitive value, the method of determining based on the photosensitive average value, the image brightness average value Va in combination with the thresholds N1, N2, V1, and V2 is richer in determination conditions, and when the photosensitive value is affected due to the poor or aging of the photosensitive device, the probability of misjudgment of the filter is greatly reduced; on the other hand, when controlling the filter to switch the working mode, only one determination is made based on the photosensitive average value and the image brightness average value, without collecting data and making multiple determinations, which simplifies the working process compared with the prior art Chinese patent CN110225257A.
[0065] Example 1
[0066] Please refer to Figure 2 , where S1 includes:
[0067] S11: Preset the frame rate of the system encoding, and obtain the photosensitive value of the photosensitive element at regular intervals according to the frame rate;
[0068] S12: According to the preset frame rate of the system encoding and the user's region of interest Area(x0, y0, x1, y1), extract the image data of the user-set region of interest Area(x0, y0, x1, y1) at regular intervals, convert it into the HSV format, and then extract the brightness V value of each pixel point in this image corresponding to the HSV color space.
[0069] Specifically, the user can flexibly preset the system encoding frame rate and the region of interest Area(x0, y0, x1, y1) in different application scenarios. On the one hand, it better meets the different actual needs of the user in different application scenarios; on the other hand, only extract the image data of the region of interest Area(x0, y0, x1, y1), instead of extracting all regions, which improves the extraction efficiency and saves working time.
[0070] Example 2
[0071] Please refer to Figure 3 , where S2 includes:
[0072] S21: Input the photosensitive value into the first step of data processing to output the average photosensitive value;
[0073] S22: Input the brightness V value into the second step of data processing to output the average image brightness Va.
[0074] In one embodiment, please refer to Figure 4 , where S21 includes:
[0075] S211: Set multiple buffers to store the photosensitive values obtained each time;
[0076] S212: Insert the newly obtained photosensitive value into the tail of the buffer each time;
[0077] S213: Obtain the average photosensitive value through the recursive average filtering method;
[0078] S214: Output the average photosensitive value.
[0079] Specifically, multiple cache buffers are introduced to cache the brightness V values within a period of time, enabling the low-speed input / output devices and the high-speed processing unit to work in coordination, avoiding the low-speed input / output devices from occupying the processing unit, freeing up the processing unit to work efficiently, saving the working time of the program, and enhancing the user experience. Meanwhile, a queue with a length of N is set up, and the collected photosensitive value data is placed at the end of the queue, discarding the data at the head of the queue; to ensure that the N data in the queue are all the latest data. Then, the arithmetic mean of the N data in the queue is calculated as the effective value. The photosensitive mean value obtained by this method can effectively overcome the fluctuation interference caused by accidental external factors, thereby filtering out the disturbances of some instantaneous light changes, and further solving the problem of misjudgment of the filter caused by the instantaneous light brightness change.
[0080] In one embodiment, please refer to Figure 5 , where S22 includes:
[0081] S221: Calculate the weighted arithmetic mean Va within this area based on the brightness V value in combination with weighted calculation;
[0082] S222: Output the weighted arithmetic mean Va, that is, the image brightness mean value Va.
[0083] Specifically, one of the greatest advantages of using weighted calculation is that it has a simple method and a small accounting workload, thereby improving the working efficiency of obtaining the image brightness mean value Va.
[0084] Embodiment 3
[0085] Please refer to Figure 6 , where S3 includes:
[0086] S31: Set the first threshold N1 and the second threshold N2 for the photosensitive element to sense light, such that N2 > N1 > 0, and the difference between N2 and N1 is the brightness amplitude of the infrared light-emitting diode, and this difference can be weighted-averaged by testing in different scenarios. Meanwhile, set the first threshold V1 and the second threshold V2 for the image brightness, such that V2 > V1 > 0, where these thresholds can be determined by actual testing in the home bedroom scenario, and the difference between V1 and V2 is the mean value of the environmental brightness change amplitude caused by the reflection of light on the object surface before and after the infrared lamp is turned on when the device is working properly;
[0087] S32: Determine the current working mode of the filter based on the obtained photosensitive value on the current photosensitive element in combination with the thresholds N1 and N2, and output the determination result 1 if the condition is met three times in a row;
[0088] Specifically, if the photosensitive value on the currently obtained photosensitive element is less than the threshold N1 or greater than N1 but less than the threshold N2, and this condition is met three times in a row, the determination result 1 is output, indicating that the current working mode of the filter is the full-transmission mode; if the photosensitive value on the currently obtained photosensitive element is greater than the threshold N2, and this condition is met three times in a row, the determination result 1 is output, indicating that the current working mode of the filter is the infrared cut-off mode.
[0089] S33: According to the determination result 1, combined with the size relationship between the photosensitive average value and the thresholds N1 and N2, if this condition is met three times in a row, the determination result 2 is output;
[0090] Specifically, if the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive average value is higher than the first threshold N1 but lower than the second threshold N2 or the photosensitive average value is higher than the second threshold N2.
[0091] S34: According to the determination results 1 and 2, combined with the size relationship between the image brightness average value Va and the thresholds V1 and V2, if this condition is met three times in a row, the determination result 3 is output;
[0092] Specifically, if the determination result 1 is the infrared cut-off mode and the determination result 2 is that the photosensitive average value is lower than the first threshold N1, the determination result 3 is that the image brightness average value Va is lower than the preset first brightness threshold V1; if the determination result 1 is the full-transmission mode and the determination result 2 is that the photosensitive average value is higher than the first threshold N1 but lower than the second threshold N2, the determination result 3 is that the image brightness average value Va is lower than the preset second brightness threshold V2; if the determination result 1 is the full-transmission mode and the determination result 2 is that the photosensitive average value is higher than the second threshold N2, the determination result 3 is that the image brightness average value Va is higher than the preset second brightness threshold V2.
[0093] S35: Based on the determination results 1, 2, and 3, control the filter to complete the corresponding working mode switching.
[0094] In an embodiment, please refer to Figure 7 , where the S35 includes:
[0095] S351: If the determination result 1 is the infrared cut-off mode, the determination result 2 is that the photosensitive average value is lower than the first threshold N1, and the determination result 3 is that the image brightness average value Va is lower than the preset first brightness threshold V1, then it is necessary to control the filter to switch to the full-transmission mode for operation;
[0096] S352: If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive average value is higher than the first threshold N1 but lower than the second threshold N2, and the determination result 3 is that the image brightness average value Va is lower than the preset second brightness threshold V2, then it is necessary to control the filter to maintain the full-transmission mode for operation;
[0097] S353: If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive average value is higher than the second threshold N2, and the determination result 3 is that the average image brightness Va is higher than the preset second brightness threshold V2, then it is necessary to control the filter to switch to the infrared cut-off mode for operation.
[0098] Embodiment 2
[0099] Please refer to Figure 8 , Embodiment 2 of the present invention further provides a device, including:
[0100] Data acquisition module: configured to acquire a target value for judging the intensity of external ambient light according to a preset data acquisition rule;
[0101] Data processing module: configured to process the target value according to a preset data processing rule and output a target average value;
[0102] Data determination module: configured to use a mode determination rule to determine the photosensitive average value and the average image brightness Va to obtain a determination result, and then complete the switching of the working mode of the corresponding filter according to the determination result.
[0103] Specifically, the data acquisition module of the second embodiment is used to acquire the target value for judging the external environmental light intensity according to the preset data acquisition rule; the data processing module is used to process and output the target mean value according to the preset data processing rule for the target value; the data determination module is used to determine and output the determination result according to the preset data determination rule for the target mean value, and finally control the filter to complete the corresponding working mode switching based on the comprehensive determination result. On the one hand, since the picture is collected in real time, the obtained photosensitive value is used to determine the photosensitive mean value through the first step of data processing; the image brightness V value is used to determine the image brightness mean value Va through the second step of data processing, which reflects the light brightness change during the entire target time period, so that some disturbances caused by instantaneous light changes can be filtered out, and further the problem of misjudgment of the filter caused by instantaneous light brightness changes can be solved; at the same time, the method of making a determination based on the photosensitive mean value, the image brightness mean value Va combined with the thresholds N1, N2, V1, and V2 is more abundant in determination conditions compared with the prior art method of simply controlling the automatic switching of the working mode of the filter according to the change of the photosensitive value. When the photosensitive device is defective or aged and the photosensitive value is affected, the probability of misjudgment of the filter is greatly reduced; on the other hand, when controlling the filter to switch the working mode, only one determination is made based on the photosensitive mean value and the image brightness mean value, without collecting data and making multiple determinations. Compared with the prior art Chinese patent CN110225257A, the working process is simplified. In short, there are many dynamic switching control methods for the camera filter. On the basis of not deviating from the substantial content of the present invention, there can be various technical solutions for the switching method. It should be noted that simple transformation of the technical solutions in the present application document does not require creative labor for those skilled in the art, so they all fall within the protection scope of the present invention and will not be elaborated here.
[0104] Embodiment 3
[0105] In addition, combined with Figure 1 the dynamic switching control method of the camera filter according to Embodiment 1 of the present invention described above can be implemented by an electronic device. Figure 9 FIG. shows the hardware structure diagram of the device provided in Embodiment 3 of the present invention.
[0106] The device may include a processor and a memory storing computer program instructions.
[0107] Specifically, the above-mentioned processor may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0108] The memory may include a mass storage for data or instructions. By way of example and not limitation, the memory may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory may include removable or non-removable (or fixed) media. Where appropriate, the memory may be internal or external to the data processing device. In a particular embodiment, the memory is a non-volatile solid-state memory. In a particular embodiment, the memory includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0109] The processor reads and executes the computer program instructions stored in the memory to implement any one of the camera filter switching control methods in the above embodiments.
[0110] As Figure 9 shown, the electronic device may further include: a camera (including a filter), a photosensitive element, wherein the camera is configured for image acquisition; the filter is configured to control the amount of infrared light entering the camera; and the photosensitive element is configured to detect the brightness of the external ambient light.
[0111] Embodiment 4
[0112] In addition, in combination with the camera filter dynamic switching control method of the above embodiments, the embodiments of the present invention may provide a computer-readable storage medium to implement. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the camera filter switching control methods in the above embodiments is implemented.
[0113] It should be clear that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present invention.
[0114] The functional blocks shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present invention are programs or code segments for performing the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted via a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
[0115] It should also be noted that in the exemplary embodiments mentioned in the present invention, some methods or systems are described based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, can be different from the order in the embodiments, or several steps can be executed simultaneously.
[0116] As described above, the above is only the specific implementation manner of the present invention. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems, modules, and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention.
Claims
1. A method for dynamically switching and controlling a camera filter, characterized in that The method includes: S1: Obtain a target value for judging the external environmental light intensity according to a preset data acquisition rule; S2: Process the target value according to a preset data processing rule and output a target mean value; S3: Judge the target mean value according to a preset data determination rule and output a determination result, and comprehensively control the filter to complete the corresponding working mode switching according to the determination result; The S3 includes: S31: Set a first threshold N1 and a second threshold N2 for the photosensitive element to sense light, such that N2 > N1 > 0. The difference between N2 and N1 is the brightness amplitude of the infrared light-emitting diode. The weighted average of this difference is taken in different scenarios. At the same time, set a first threshold V1 and a second threshold V2 for the image brightness, such that V2 > V1 > 0. Among them, these thresholds are determined through actual tests in the home bedroom scenario. The difference between V1 and V2 is the mean value of the amplitude of the environmental brightness change caused by the reflection of light on the object surface before and after the infrared lamp is turned on when the device is working normally; S32: Determine the current working mode of the filter according to the obtained photosensitive value on the current photosensitive element in combination with the thresholds N1 and N2. If the condition is met three times continuously, output the determination result 1; S33: Determine the size relationship between the photosensitive mean value and the thresholds N1 and N2 according to the current working mode of the filter. If the condition is met three times continuously, output the determination result 2; S34: Determine the size relationship between the image brightness mean value Va and the thresholds V1 and V2 according to the size relationship between the photosensitive mean value and the thresholds N1 and N2. If the condition is met three times continuously, output the determination result 3; S35: Comprehensively control the filter to complete the corresponding working mode switching according to the determination results 1, 2, and 3; The S35 includes: S351: If the determination result 1 is the infrared cut-off mode, the determination result 2 is that the photosensitive mean value is lower than the first threshold N1, and the determination result 3 is that the image brightness mean value Va is lower than the preset first brightness threshold V1, then it is necessary to control the filter to switch to the full-transmission mode for operation; S352: If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive mean value is higher than the first threshold N1 but lower than the second threshold N2, and the determination result 3 is that the image brightness mean value Va is lower than the preset second brightness threshold V2, then it is necessary to control the filter to maintain the full-transmission mode for operation; S353: If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive mean value is higher than the second threshold N2, and the determination result 3 is that the image brightness mean value Va is higher than the preset second brightness threshold V2, then it is necessary to control the filter to switch to the infrared cut-off mode for operation.
2. The dynamic switching control method of the camera filter according to claim 1, wherein, The S1 includes: S11: Preset the frame rate of the system encoding, and obtain the photosensitive value of the photosensitive element at regular intervals according to the frame rate; S12: According to the preset frame rate of the system encoding and the user's region of interest Area(x0, y0, x1, y1), extract the image data of the user-set region of interest Area(x0, y0, x1, y1) at regular intervals and convert it into the HSV format, and then extract the brightness V value of each pixel point corresponding to the HSV color space in this image.
3. The dynamic switching control method of a camera filter according to claim 2, wherein The S2 includes: S21: Input the photosensitive value into the first step of data processing to output the average photosensitive value; S22: Input the brightness V value into the second step of data processing to output the average image brightness Va.
4. The method for dynamically switching and controlling a camera filter according to claim 3, characterized in that The S21 includes: S211: Set multiple buffers to store the photosensitive values obtained each time; S212: Insert the newly obtained photosensitive value into the tail of the buffer; S213: Obtain the average photosensitive value through recursive average filtering; S214: Output the average photosensitive value.
5. The dynamic switching control method of a camera filter according to claim 4, characterized in that, The S22 includes: S221: Calculate the weighted arithmetic mean Va within this area by combining with the weighted calculation according to the brightness V value; S222: Output the weighted arithmetic mean Va, that is, the average image brightness Va.
6. A dynamic switching control device for a camera filter, characterized in that, The device includes: Data acquisition module: Used to obtain the target value for judging the external environmental light intensity according to the preset data acquisition rule; Data processing module: Used to process the target value according to the preset data processing rule to output the target average value; Data determination module: Used to determine the photosensitive average value and the average image brightness Va by using the mode determination rule to obtain the determination result, and then complete the working mode switching of the corresponding filter according to the determination result; The use of the mode determination rule to determine the photosensitive average value and the average image brightness Va to obtain the determination result, and then complete the working mode switching of the corresponding filter according to the determination result includes: Set the first threshold N1 and the second threshold N2 for the photosensitive element to sense, so that N2 > N1 > 0. The difference between N2 and N1 is the brightness amplitude of the infrared light-emitting diode. The weighted average value of this difference is taken in different scenarios; at the same time, set the first threshold V1 and the second threshold V2 of the image brightness, so that V2 > V1 > 0. Among them, these thresholds are determined by actual tests in the home bedroom scenario. The difference between V1 and V2 is the average value of the environmental brightness change amplitude caused by the reflection of light on the object surface before and after the infrared lamp is turned on when the device is working normally; Judge the current working mode of the filter according to the obtained photosensitive value on the current photosensitive element in combination with the thresholds N1 and N2. If the condition is met three times continuously, output the determination result 1; Judge the size relationship between the average photosensitive value and the thresholds N1 and N2 according to the current working mode of the filter. If the condition is met three times continuously, output the determination result 2; Judge the size relationship between the average image brightness Va and the thresholds V1 and V2 according to the size relationship between the average photosensitive value and the thresholds N1 and N2. If the condition is met three times continuously, output the determination result 3; Comprehensively judge the determination results 1, 2, and 3 to control the filter to complete the corresponding working mode switching; The comprehensive judgment of the determination results 1, 2, and 3 to control the filter to complete the corresponding working mode switching includes: If the determination result 1 is the infrared cut-off mode, the determination result 2 is that the average photosensitive value is lower than the first threshold N1, and the determination result 3 is that the average image brightness Va is lower than the preset first brightness threshold V1, then it is necessary to control the filter to switch to the full-transmission mode for operation; If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive average value is higher than the first threshold N1 but lower than the second threshold N2, and the determination result 3 is that the average image brightness Va is lower than the preset second brightness threshold V2, then it is necessary to control the filter to maintain the full-transmission mode operation; If the determination result 1 is the full-transmission mode, the determination result 2 is that the photosensitive average value is higher than the second threshold N2, and the determination result 3 is that the average image brightness Va is higher than the preset second brightness threshold V2, then it is necessary to control the filter to switch to the infrared cut-off mode operation.
7. An electronic device for dynamically switching and controlling a camera filter, characterized in that, The electronic device includes: a camera, a photosensitive element, at least one processor, at least one memory, and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the method described in any one of claims 1-5 is implemented.
8. A dynamic switching control medium for a camera filter, on which computer program instructions are stored, characterized in that, When the computer program instructions are executed by the processor, the method described in any one of claims 1-5 is implemented.
Citation Information
Patent Citations
Day and night mode switching method and device, camera device and storage medium
CN110225257A
Camera and mode switching control method and device thereof
CN108391044A
Camera mode switching control method and device, camera and storage medium
CN111385477A
Law enforcement instrument mode switching method, system and readable storage medium
CN112055151A