Disclosure of Invention
The embodiment of the application provides a method for switching day and night modes by monitoring equipment and the monitoring equipment, which are used for improving the accuracy of switching the day and night modes.
In a first aspect, a method for switching day and night modes of a monitoring device is provided, which includes:
acquiring a first monitoring image in a current monitoring mode;
determining a brightness characteristic value of the first monitoring image;
under the condition that the current monitoring mode is a daily mode, when the brightness characteristic value is determined to be smaller than a first preset brightness value, determining an edge detail characteristic value of the first monitoring image;
and when the edge detail characteristic value is greater than or equal to a preset edge detail characteristic value, determining not to switch the current monitoring mode.
In the embodiment of the application, when the current monitoring mode is the day mode, the monitoring device not only simply judges whether to switch according to the brightness characteristic value, but also continuously judges whether to switch according to the edge detail characteristic value of the first monitoring image when the brightness characteristic value is smaller than the first preset brightness value. Moreover, the day and night mode is reasonably switched, so that the monitoring equipment can obtain a relatively better image display effect in any time period, the monitoring quality of the monitoring equipment is improved, and the user experience is improved.
In a possible embodiment, after determining the edge detail feature value of the first monitoring image, the method includes:
under the condition that the edge detail characteristic value is smaller than the preset edge detail characteristic value, when the brightness characteristic value of each frame of monitoring image in the N frames of monitoring images in the current monitoring mode is smaller than the first preset brightness value and the edge detail characteristic value of each frame of monitoring image in the N frames of monitoring images is smaller than the preset edge detail characteristic value, determining to switch the current monitoring mode from a day mode to a night mode;
and the N frames are N monitoring images which are continuously shot after the first monitoring image under the condition of the current monitoring mode, wherein N is a positive integer.
In the embodiment of the present application, after the monitoring device determines that the edge detail feature value is smaller than the preset edge detail feature value, the monitoring device may further determine the luminance feature value and the edge detail feature value of N frames of monitoring images after the first monitoring image.
In a possible embodiment, after acquiring the first monitoring image in the current monitoring mode, the method includes:
under the condition that the current monitoring mode is the night mode, when the brightness characteristic value is determined to be smaller than a second preset brightness value, determining not to switch the current monitoring mode;
under the condition that the current monitoring mode is a night mode, when the brightness characteristic value is determined to be greater than or equal to a second preset brightness value, determining the color characteristic value of the first monitoring image;
under the condition that the color characteristic value is determined to be larger than or equal to a preset color characteristic value, when the brightness characteristic value of each frame of monitoring image in the N frames of monitoring images under the current monitoring mode is determined to be larger than or equal to a second preset brightness value, and the color characteristic value of each frame of monitoring image in the N frames of monitoring images is determined to be larger than or equal to the preset color characteristic value, the current monitoring mode is determined to be switched from the night mode to the day mode.
In the embodiment of the application, when the monitoring device determines that the current monitoring mode is the night mode, whether the current monitoring mode is switched from the working mode to the day mode is determined according to the brightness characteristic value and the color characteristic value, and compared with a mode of switching the monitoring mode according to the brightness in the prior art, the monitoring device determines whether the monitoring mode is switched according to the color characteristic value and the brightness characteristic value, so that the condition of misjudgment of switching the day mode and the night mode is further reduced. And the color characteristic value adopted in the night mode and the edge detail characteristic value adopted in the day mode are matched with the appearance characteristics of the image under different ambient brightness, so that the switching accuracy of the day and night mode is improved, the monitoring flexibility of the monitoring equipment can be relatively increased, and the calculation amount of the monitoring equipment can be relatively reduced.
In one possible embodiment, determining the brightness characteristic value of the first monitored image includes:
and carrying out weighting processing on the average value of the corresponding color component according to the proportionality coefficient of the average value of each color component to the brightness contribution of the first monitoring image, so as to obtain the brightness characteristic value of the first monitoring image.
In the embodiment of the present application, a method for obtaining a luminance characteristic value of a first monitoring image is provided, and a monitoring device may perform weighting processing on an average value of color blocks of the first monitoring image according to a corresponding scale coefficient, so that the obtained luminance characteristic value can have a reference value.
In a possible embodiment, determining the edge detail feature value of the first monitored image comprises:
performing multiple directional filtering processing on each image block in the first monitoring image to obtain an image block gray value after the filtering processing in each direction in the multiple directional filtering;
and accumulating and averaging the image block gray values subjected to filtering processing in each direction in the plurality of direction filtering to obtain an edge detail characteristic value of the first monitoring image.
In the embodiment of the application, the monitoring equipment carries out multidirectional filtering on each image block in the first monitoring image, and filtering processing can enable the region characteristic with obvious characteristic to be more obvious, so that the edge detail characteristic value with distinguishing value is obtained.
In a possible embodiment, the preset edge detail feature value is determined according to the sensitivity of switching the monitoring mode and the optimal edge detail feature value in the current monitoring mode.
In the embodiment of the application, the preset edge detail characteristic value can be flexibly determined according to the sensitivity of switching the monitoring mode and the optimal edge detail characteristic value in the current monitoring mode, so that the preset edge detail characteristic value has a reference value.
In one possible embodiment, determining the color feature value of the first monitored image comprises:
acquiring each color component of each image block in the first monitoring image;
determining the maximum value and the minimum value of each color component of an image block with the brightness within a preset brightness range in a plurality of image blocks in the first monitoring image;
according to the maximum value and the minimum value, carrying out normalization processing on each color component of the image blocks with the brightness within a preset brightness range in the plurality of image blocks to obtain color characteristic values of the image blocks with the brightness within the preset brightness range in the plurality of image blocks;
and accumulating and averaging the color characteristic values of the image blocks with the brightness within a preset brightness range in the plurality of image blocks to obtain the color characteristic value of the first monitoring image.
In the embodiment of the application, each color component in the corresponding image block is subjected to normalization processing to obtain the color characteristic value of the corresponding image block, and the color characteristic values of the corresponding image blocks are accumulated and averaged to obtain the color characteristic value of the first monitoring image.
In a second aspect, there is provided a monitoring device comprising:
the acquisition module is used for acquiring a first monitoring image in a current monitoring mode;
and the processing module is used for determining the brightness characteristic value of the first monitoring image, determining the edge detail characteristic value of the first monitoring image when the brightness characteristic value is determined to be smaller than a first preset brightness value under the condition that the current monitoring mode is the daily mode, and determining not to switch the current monitoring mode when the edge detail characteristic value is greater than or equal to a preset edge detail characteristic value.
In a possible embodiment, the processing module is further configured to:
after determining the edge detail feature value of the first monitoring image, under the condition that the edge detail feature value is smaller than the preset edge detail feature value, when determining that the brightness feature value of each frame of monitoring image in N frames of monitoring images under the current monitoring mode is smaller than the first preset brightness value, and the edge detail feature value of each frame of monitoring image in the N frames of monitoring images is smaller than the preset edge detail feature value, determining to switch the current monitoring mode from a day mode to a night mode;
the N frames of monitoring images are continuously shot after the first monitoring image under the condition of the current monitoring mode, and N is a positive integer.
In a possible embodiment, the processing module is further configured to:
after a first monitoring image in the current monitoring mode is obtained, under the condition that the current monitoring mode is a night mode, when the brightness characteristic value is determined to be smaller than a second preset brightness value, determining not to switch the current monitoring mode;
under the condition that the current monitoring mode is a night mode, when the brightness characteristic value is determined to be greater than or equal to a second preset brightness value, determining the color characteristic value of the first monitoring image;
under the condition that the color characteristic value is determined to be larger than or equal to a preset color characteristic value, when the brightness characteristic value of each frame of monitoring image in the N frames of monitoring images under the current monitoring mode is determined to be larger than or equal to a second preset brightness value, and the color characteristic value of each frame of monitoring image in the N frames of monitoring images is determined to be larger than or equal to the preset color characteristic value, the current monitoring mode is determined to be switched from the night mode to the day mode.
In a third aspect, a monitoring device is provided, comprising:
at least one processor, and
a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the method according to any one of the first aspect and one possible embodiment by executing the instructions stored by the memory.
In a fourth aspect, a computer-readable storage medium is provided, which stores computer instructions that, when executed on a computer, cause the computer to perform the method according to any one of the first aspect and one possible embodiment.
Detailed Description
In order to better understand the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the drawings and specific embodiments.
In order to reduce the misjudgment of day and night mode switching, the embodiment of the application provides a method for switching day and night modes of monitoring equipment, the method is applied to the monitoring equipment, and the monitoring equipment can be realized by integrating an image acquisition unit and an image processing unit. The monitoring device may further include a Unit for assisting the image capturing Unit to rotate, such as a pan/tilt head, in practical applications. The method for switching the day and night mode of the monitoring equipment in the embodiment of the application can be applied to various scenes, such as anti-theft monitoring, forest fire prevention monitoring and the like.
The following describes in detail a method for switching day and night monitoring modes of the monitoring device.
The monitoring device may perform day-night switching judgment in real time, or perform day-night switching judgment at preset time intervals, and when the monitoring device is to perform day-night switching judgment,step 101 is performed first, that is, a first monitoring image in the current monitoring mode is obtained.
Specifically, the monitoring device prestores a current monitoring mode, which is, for example, a day mode or a night mode. If the monitoring device is just started, the monitoring device can enter a preset monitoring mode by default, and the current monitoring mode is the preset monitoring mode. When the monitoring equipment starts to judge day and night switching, the monitoring equipment acquires a monitoring image in a current monitoring mode to obtain a first monitoring image.
Step 102, determining a brightness characteristic value of the first monitoring image.
No matter which monitoring mode the current monitoring mode is, the monitoring equipment determines the brightness characteristic value of the first monitoring image according to the first monitoring image. The brightness characteristic value is used to represent the brightness of the first monitored image, and there are various calculation methods for the brightness characteristic value, which are exemplified below.
A way to calculate the luminance eigenvalues:
and according to the proportion coefficient of the average value of each color component to the brightness contribution of the first monitoring image, carrying out weighting processing on the average value of the corresponding color component to obtain the brightness characteristic value of the first monitoring image.
Specifically, the monitoring device may perform blocking processing on the first monitoring image to obtain a plurality of image blocks for the first monitoring image, obtain each color component of each image block in each image block, and obtain the color block of each image block, for example, the first monitoring image may be input into a preset model to obtain each color component of each image block, and the monitoring device may also obtain each color component of the first monitoring image when obtaining the first monitoring image through a sensing component in the monitoring device. The individual color components are for example represented by Red Green Blue (RGB) color components, i.e. each image patch comprises a corresponding R color component, G color component and B color component. The image block may be understood as a basic unit of the monitoring device processing the first monitoring image, and the size of the image block may be any size, for example, the image block is the first monitoring image, and the size of the image block is not particularly limited herein. After the color components of each block in each block are obtained, the color components of all the blocks are weighted by using the scale factor of the mean value of each color component to the brightness contribution of the first monitoring image, and the brightness characteristic value of the first monitoring image is obtained.
One specific calculation formula is for example:
DY=w1*R+w2*G+w3*B
r, G, B sequentially represents the R color component, the G color component, and the B color component corresponding to each image partition, w1 represents the scaling factor of the R color component mean value to the image luminance, w2 represents the scaling factor of the G color component mean value to the image luminance, and w3 represents the scaling factor of the B color component mean value to the image luminance.
A way to calculate the luminance eigenvalues:
the monitoring device may also send the first monitoring image to other auxiliary devices through other auxiliary devices, and after the brightness characteristic value of the first monitoring image is acquired by other auxiliary devices, the brightness characteristic value is fed back to the monitoring device.
As discussed instep 101, the monitoring device has determined the current monitoring mode, and it should be noted that, in the embodiment of the present application, the current monitoring mode is determined first and then step 102 is performed, but actually, the determination of the current monitoring mode may be performed beforestep 102.
The following describes a specific subsequent processing mode of the monitoring device when the current monitoring mode is the daily mode.
Step 103, the monitoring device determines whether the brightness characteristic value is smaller than a first preset brightness value.
Specifically, instep 102, the monitoring device obtains a brightness characteristic value of the first monitoring image, and determines whether the brightness characteristic value is smaller than a first preset brightness value, if so, the monitoring device jumps to step 104 to determine an edge detail characteristic value of the first monitoring image, and if not (that is, the brightness characteristic value is greater than or equal to the first preset brightness value), the brightness characteristic value of the first monitoring image is relatively large to indicate that the current environment brightness is particularly large, the monitoring device jumps to step 105 to determine that the current monitoring mode is not switched, and this day and night mode switching determination process is finished.
The determination of the edge detail feature value of the first monitored image instep 104 is exemplified below.
The first method is as follows:
carrying out multi-direction filtering processing on each image block in the first monitoring image to obtain an image block gray value after the filtering processing in each direction in the multi-direction filtering;
and accumulating and averaging the image block gray values subjected to filtering processing in each direction in the plurality of directions to obtain an edge detail characteristic value of the first monitoring image.
Specifically, the monitoring device performs filtering processing in multiple directions on each image partition by using the image partition as a processing unit, where the filtering processing may be to pass the first monitoring image through a special-shaped filter in multiple directions, and each direction in the multiple directions is different. After the filtering processing, the edge feature in the first monitoring image is clearer, the monitoring equipment obtains the image block gray value after the filtering processing in each direction, and then the image block gray values after the filtering processing in each direction in the plurality of directions are accumulated to be averaged to obtain the edge detail feature value of the first monitoring image. The accumulation averaging refers to summing corresponding gray values of all image blocks, and averaging is carried out after summing.
One specific calculation formula is for example:
e(x,y)=E1(f(x,y))+E2(f(x,y))+…+Ek(f(x,y))
wherein m image patches are of a size in the transverse direction, n represents the image patch size in the longitudinal direction, f (x, y) represents the gray value at the image patch coordinate (x, y), E1(f(x,y))、E2(f(x,y))…Ek(f (x, y)) represents K results obtained by performing filtering processing in K different directions on the image block coordinates (x, y), respectively, and DE represents the image edge detail feature value of the obtained first monitor image.
The plurality of directions include, for example, a 45 ° direction along the first monitor image, and a 135 ° direction along the first monitor image.
In the case of the daily mode, the monitoring device may use an infrared cut-off filter, at this time, when an image is shot, there is no infrared supplementary lighting, and when the ambient brightness is relatively low, the shot image may have characteristics of significant noise and unclear edge details, therefore, in the embodiment of the present application, an edge detail feature value of the first monitoring image is determined first, and then step 106 is performed, that is, it is determined whether the edge detail feature value is smaller than a preset edge detail feature value, if not, step 107 is performed, that is, it is determined that the current monitoring mode is not switched, and if so,step 108 is performed, that is, it is determined whether each frame of monitoring image in the N frames of monitoring images satisfies that the brightness feature value is smaller than a first preset brightness value, and the edge detail feature value is smaller than the preset edge detail feature value.
Specifically, if the monitoring device determines that the edge detail feature value is greater than or equal to the preset edge detail feature value, indicating that the edge detail feature value of the first monitored image is large and indicating that the current environment brightness is large, the monitoring device executes step 107, that is, it is determined that the current monitoring mode is not switched, indicating that the day and night mode switching judgment process is ended. If the monitoring device determines that the edge detail feature value is smaller than the preset edge detail feature value, it indicates that the current environment brightness may be smaller, but in order to avoid the situation that an error occurs due to the judgment of the monitoring device, in the embodiment of the present application, it is continuously judged whether each frame of monitoring image in the N frames of monitoring images meets the condition that the brightness feature value is smaller than the first preset brightness value, and the edge detail feature value is smaller than the preset edge detail feature value.
Specifically, the N-frame monitoring images refer to N-frame monitoring images that are continuously shot by the monitoring device after the first monitoring image. N is a positive integer, where N may be a preset fixed value, or may be determined according to a default preset time length of the monitoring device, for example, the default preset time length of the monitoring device is 2 seconds, and if the monitoring device can shoot 25 monitoring images every 1 second, the value of N is 50.
After the monitoring device obtains the N frames of images, the brightness characteristic value and the edge detail characteristic value of each frame of monitored image in the N frames of monitored images may be determined, and the manner of determining the brightness characteristic value of each frame of monitored image in the N frames of monitored images may refer to the content instep 102, which is not described herein again. The method for determining the brightness characteristic value of each monitoring image in the N monitoring images may refer to the content ofstep 104, which is not described herein again.
After the monitoring device obtains the brightness characteristic value and the edge detail characteristic value of each frame of monitoring image in the N frames of monitoring images, it can be determined whether the brightness characteristic value and the edge detail characteristic value of each frame of monitoring image are both less than a preset brightness value and whether the edge detail characteristic value is both less than a preset edge detail characteristic value. If some of the N frames of monitoring images cannot satisfy that the brightness characteristic value is smaller than the preset brightness value and the edge detail characteristic value is smaller than the preset edge detail characteristic value, the monitoring device performsstep 109, that is, determines not to switch the current monitoring mode. If the brightness characteristic value of each monitoring image in the N frames of monitoring images is less than the preset brightness value and the edge detail characteristic value is less than the preset edge detail characteristic value, the monitoring device performsstep 110, i.e., determines to switch the current monitoring mode from the day mode to the night mode.
Specifically, if the first monitoring image satisfies that the brightness characteristic value is smaller than the preset brightness value, the edge detail characteristic value is smaller than the preset edge detail characteristic value, the brightness characteristic value of each monitoring image in the N frames of monitoring images is smaller than the preset brightness value, and the edge detail characteristic value is smaller than the preset edge detail characteristic value, which indicates that the brightness of the shot monitoring image is low and the edge detail characteristic is not obvious, and further determines that the brightness of the current environment is low, so that the monitoring device is switched from the day mode to the night mode. After switching to night mode, because supervisory equipment opens infrared cut-off filter, supervisory equipment has the infrared light when shooing to make supervisory equipment under the condition that ambient brightness is low, can shoot more clear monitoring image, the later stage of being convenient for is according to monitoring image and is going on verifying etc..
As an embodiment, the preset edge detail feature value may be a fixed value, or may be determined according to the sensitivity of switching the monitoring mode and the optimal edge detail feature value in the current monitoring scene. The monitoring scene refers to the current environment of the monitoring device, such as a mall hall.
Specifically, the optimal edge detail feature value represents the optimal edge detail feature value of the current shooting scene, and is dynamically updated through real-time statistics, and when the image shooting scene changes, the value is reinitialized and then is updated through real-time statistics again. The sensitivity requirements of different users for switching the monitoring mode may be different, and the user may set the sensitivity of the monitoring device, or adopt a preset sensitivity if the user does not set the sensitivity.
The formula for calculating the preset edge detail characteristic value is as follows:
TE1=Ratio*DEmax
TE1 is a preset edge detail feature value, Ratio represents a scaling factor determined by dividing the sensitivity of the switched monitoring mode by the reference sensitivity of the monitoring device, and DEmax represents an optimal edge detail feature value.
It should be noted thatsteps 103 to 105 are the first case, steps 103, 104, 106, and 107 are the second case, steps 103, 104, 106, 108, and 109 are the third case, and steps 103, 104, 106, 108, and 110 are the fourth case. In the actual implementation of the monitoring device, the four situations may occur, but only one situation usually occurs at a time.
Insteps 103 to 110, various cases where the current monitoring mode of the monitoring device is the day mode are described, and various cases where the current monitoring mode is the night mode are described below.
Afterstep 102, in the case that the monitoring apparatus determines that the current monitoring mode is the night mode, step 111 is executed to determine whether the brightness characteristic value of the first monitoring image is greater than or equal to a second preset brightness value. If so, the monitoring device proceeds to step 112 where the color feature value of the first monitored image is determined. If not, the process proceeds to step 113, where it is determined not to switch the current monitoring mode.
Specifically, when the monitoring device determines that the brightness characteristic value of the first monitored image is greater than or equal to the second preset brightness value, it indicates that the current ambient brightness may be greater but cannot be determined, and therefore the monitoring device continues to determine the color characteristic value of the first monitored image. When the monitoring device determines that the brightness characteristic value of the first monitoring image is smaller than the second preset brightness value, the current environment brightness is smaller, and therefore the monitoring device determines that the current monitoring mode is not switched.
The second preset brightness value and the first preset brightness value are experience values determined according to actual switching requirements. Generally, the second predetermined brightness value is greater than the first predetermined brightness value.
The following describes a specific manner of determining the color feature value of the first monitored image instep 112.
Obtaining each color component of each image block in a first monitoring image;
determining the maximum value and the minimum value of each color component of an image block with the brightness within a preset brightness range in a plurality of image blocks in a first monitoring image;
according to the maximum value and the minimum value, carrying out normalization processing on each color component of the image blocks with the brightness within the preset brightness range in the plurality of image blocks to obtain the color characteristic value of the image block with the brightness within the preset brightness range in the plurality of image blocks;
and accumulating and averaging the color characteristic values of the image blocks with the brightness within the preset brightness range in the plurality of image blocks to obtain the color characteristic value of the first monitoring image.
Specifically, in the embodiment of the present application, the color characteristic value of the image partition is represented by color saturation, and the monitoring device divides the first monitoring image into a plurality of image partitions, where the image partitions may refer to the content discussed above, and are not described herein again. After obtaining a plurality of image blocks, acquiring each color component of each image block, but some image blocks may have abnormal brightness, and the like, and image blocks with abnormal brightness may also have abnormal color characteristic values, so that image blocks with more than preset brightness are excluded. And after the normalization processing, the color saturation of each image block can be obtained, and after the color saturations of all the image blocks are accumulated and summed, the average value is calculated to obtain the color characteristic value of the first monitoring image.
A calculation formula for calculating a color feature value such as:
where count represents the number of blocks satisfying the statistical characteristic, m represents the size of an image block in the lateral direction, n represents the size of an image block in the longitudinal direction, c (x, y) represents the color saturation of an image block, max represents the maximum value among the color components R, B, G in an image block, and min represents the minimum value among the color components R, B, G in an image block. S represents the luminance of the image block, S can be characterized by the luminance characteristic value in theprevious step 102, and the NC table monitors the color characteristic value of the image.
After determining the color feature value of the first monitored image,step 114 is performed, i.e., it is determined whether the color feature value is greater than or equal to a preset color feature value.
Specifically, in the night mode, the monitoring device uses the full transmittance optical sheet, that is, the infrared cut-off filter is closed, and there is infrared light supplement, so that when the ambient brightness is low, the visible light components are less, and the infrared light components are more, and because the monitoring device usually has stronger photosensitivity to the R, G, and B color components in the visible light band, under the night mode, if the visible light components are more, the image color saturation correspondingly obtained by the monitoring device will be larger, and if the visible light components are less, the image color saturation correspondingly obtained by the monitoring device will be smaller. Therefore, in the embodiment of the present application, the monitoring device determines whether the color characteristic value is greater than or equal to the preset color characteristic value, and if not, jumps to step 115, that is, it is determined not to switch the current monitoring mode. If yes, step 116 is executed to determine whether the N frames of monitored images satisfy that the luminance characteristic value is greater than or equal to the second preset luminance value, and the color characteristic values are all greater than or equal to the preset color characteristic value.
If the N frames of monitored images do not satisfy that the luminance characteristic value is greater than or equal to the second preset luminance value and the color characteristic values are all greater than or equal to the preset color characteristic value, that is, if each frame of the N frames of monitored images does not satisfy that the luminance characteristic value is greater than or equal to the second preset luminance value and the color characteristic values are all greater than or equal to the preset color characteristic value, the monitoring device proceeds to step 117, that is, it is determined that the current monitoring mode is not switched. If the N frames of monitoring images satisfy that the brightness characteristic value is greater than or equal to the second preset brightness value, and the color characteristic values are both greater than or equal to the preset color characteristic value, which indicates that the current ambient brightness is greater, the monitoring device proceeds to step 118, i.e., determines to switch the current monitoring mode from the night mode to the day mode.
On the basis of the method for switching day and night modes of the monitoring device discussed in the foregoing fig. 1, the embodiment of the present application provides a monitoring device, which is also the monitoring device discussed in the foregoing. The monitoring device includes:
the system comprises anacquisition module 201, a monitoring module and a processing module, wherein the acquisition module is used for acquiring a first monitoring image in a current monitoring mode;
theprocessing module 202 is configured to determine a brightness feature value of the first monitoring image, determine an edge detail feature value of the first monitoring image when the brightness feature value is determined to be smaller than a first preset brightness value when the current monitoring mode is the daily mode, and determine not to switch the current monitoring mode when the edge detail feature value is greater than or equal to the preset edge detail feature value.
The related contents in the embodiment of the present application may specifically refer to the contents discussed in the foregoingstep 101,step 102,step 103, and step 105, and are not described herein again.
In a possible embodiment, theprocessing module 202 is further configured to:
after determining an edge detail characteristic value of a first monitoring image, under the condition that the edge detail characteristic value is smaller than a preset edge detail characteristic value, when determining that the brightness characteristic value of each frame of monitoring image in N frames of monitoring images under a current monitoring mode is smaller than a first preset brightness value and the edge detail characteristic value of each frame of monitoring image in the N frames of monitoring images is smaller than the preset edge detail characteristic value, determining to switch the current monitoring mode from a day mode to a night mode;
the N frames of monitoring images are continuously shot after the first monitoring image under the condition of the current monitoring mode, and N is a positive integer.
In a possible embodiment, theprocessing module 202 is further configured to:
after a first monitoring image in the current monitoring mode is obtained, under the condition that the current monitoring mode is a night mode, when the brightness characteristic value is determined to be smaller than a second preset brightness value, determining not to switch the current monitoring mode;
under the condition that the current monitoring mode is a night mode, when the brightness characteristic value is determined to be greater than or equal to a second preset brightness value, determining the color characteristic value of the first monitoring image;
under the condition that the color characteristic value is determined to be larger than or equal to the preset color characteristic value, when the brightness characteristic value of each frame of monitoring image in the N frames of monitoring images under the current monitoring mode is determined to be larger than or equal to the second preset brightness value, and the color characteristic value of each frame of monitoring image in the N frames of monitoring images is determined to be larger than or equal to the preset color characteristic value, the current monitoring mode is determined to be switched from the night mode to the day mode.
In a possible embodiment, theprocessing module 202 is specifically configured to:
and according to the proportion coefficient of the average value of each color component to the brightness contribution of the first monitoring image, carrying out weighting processing on the average value of the corresponding color component to obtain the brightness characteristic value of the first monitoring image.
In a possible embodiment, theprocessing module 202 is specifically configured to:
determining an edge detail feature value of a first monitoring image, comprising:
carrying out multi-direction filtering processing on each image block in the first monitoring image to obtain an image block gray value after the filtering processing in each direction in the multi-direction filtering;
and accumulating and averaging the image block gray values subjected to filtering processing in each direction in the plurality of directions to obtain an edge detail characteristic value of the first monitoring image.
In one possible embodiment, the preset edge detail feature value is determined according to the sensitivity of switching the monitoring mode and the optimal edge detail feature value in the current monitoring mode.
In one possible embodiment, determining the color feature value of the first monitored image comprises:
obtaining each color component of each image block in a first monitoring image;
determining the maximum value and the minimum value of each color component of an image block with the brightness within a preset brightness range in a plurality of image blocks in a first monitoring image;
according to the maximum value and the minimum value, carrying out normalization processing on each color component of the image blocks with the brightness within the preset brightness range in the plurality of image blocks to obtain the color characteristic value of the image block with the brightness within the preset brightness range in the plurality of image blocks;
and accumulating and averaging the color characteristic values of the image blocks with the brightness within the preset brightness range in the plurality of image blocks to obtain the color characteristic value of the first monitoring image.
On the basis of the method for switching day and night modes of the monitoring device discussed in the foregoing fig. 1, an embodiment of the present application provides a monitoring device, please refer to fig. 3, which includes aprocessor 301 and amemory 302, wherein:
at least oneprocessor 301, and
amemory 302 communicatively coupled to the at least oneprocessor 301;
wherein thememory 302 stores instructions executable by the at least oneprocessor 301, the at least oneprocessor 301 implements the method for monitoring device switching day and night mode as discussed in fig. 1 by executing the instructions stored by thememory 302.
Theprocessor 301 in fig. 3 may be one or more, as an example.
As an embodiment, theacquisition module 201 and theprocessing module 202 in fig. 2 may be implemented by theprocessor 301 in fig. 3.
On the basis of the method for switching day and night modes by the monitoring device discussed in the foregoing fig. 1, embodiments of the present application further provide a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the method for switching day and night modes by the monitoring device as discussed in fig. 1.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.