CN110519522B - Method, device and equipment for video anti-overexposure processing and storage medium - Google Patents

Method, device and equipment for video anti-overexposure processing and storage medium Download PDF

Info

Publication number
CN110519522B
CN110519522B CN201910730041.9A CN201910730041A CN110519522B CN 110519522 B CN110519522 B CN 110519522B CN 201910730041 A CN201910730041 A CN 201910730041A CN 110519522 B CN110519522 B CN 110519522B
Authority
CN
China
Prior art keywords
brightness
video
value
video frame
overexposure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910730041.9A
Other languages
Chinese (zh)
Other versions
CN110519522A (en
Inventor
陈铨
黄澄琛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201910730041.9A priority Critical patent/CN110519522B/en
Publication of CN110519522A publication Critical patent/CN110519522A/en
Application granted granted Critical
Publication of CN110519522B publication Critical patent/CN110519522B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

The application discloses a method, a device, equipment and a storage medium for video anti-overexposure processing, and belongs to the technical field of image processing. The method comprises the following steps: in the process of shooting a target video, acquiring a first video frame in the target video; dividing the first video frame into at least two image areas, and acquiring the brightness value of each image area to obtain at least two area brightness values; and acquiring a maximum region brightness value from the at least two region brightness values, and performing anti-overexposure processing on the target video according to a comparison result of the maximum region brightness value and a first brightness threshold value. The technical scheme provided by the embodiment of the application can solve the problem of poor video anti-overexposure processing effect.

Description

Method, device and equipment for video anti-overexposure processing and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for video anti-overexposure processing.
Background
During the video shooting process, a phenomenon of video overexposure often occurs, and the phenomenon refers to the phenomenon that the brightness of a video picture is too high and the video picture is whitened. When the video overexposure phenomenon occurs, the picture in the video can be difficult to see clearly, and therefore, the shooting effect of the video can be seriously influenced. In practical applications, in order to ensure the shooting effect of the video, some means are generally required to be adopted in the video shooting process to prevent the video overexposure phenomenon.
In the related art, a camera may acquire a video frame in a video during video shooting, and acquire an average brightness value of an entire picture in the video frame, and when the average brightness value is greater than a preset certain brightness threshold, the camera determines that an overexposure phenomenon may occur in the video being shot.
However, the accuracy of determining whether the video is likely to have the overexposure phenomenon by using the average brightness value of the whole picture in the video frame is low, so that the video is less effectively subjected to the overexposure prevention processing.
Disclosure of Invention
Therefore, it is necessary to provide a method, an apparatus, a device and a storage medium for video anti-overexposure processing, which are used to solve the problem of poor video anti-overexposure processing effect.
In a first aspect, a video anti-overexposure processing method is provided, and the method includes:
in the process of shooting a target video, acquiring a first video frame in the target video;
dividing the first video frame into at least two image areas, and acquiring the brightness value of each image area to obtain at least two area brightness values;
and acquiring a maximum region brightness value from the at least two region brightness values, and performing anti-overexposure processing on the target video according to a comparison result of the maximum region brightness value and a first brightness threshold value.
In one embodiment, the performing the anti-overexposure processing on the target video according to the comparison result between the maximum region brightness value and the first brightness threshold includes:
and when the maximum area brightness value is larger than or equal to the first brightness threshold value, performing anti-overexposure processing on the target video.
In one embodiment, the performing the anti-overexposure processing on the target video according to the comparison result between the maximum region brightness value and the first brightness threshold includes:
and when the maximum area brightness values of n first video frames adjacent in time sequence in the target video are all larger than or equal to the first brightness threshold, carrying out anti-overexposure processing on the target video, wherein n is a positive integer larger than 1.
In one embodiment, after the anti-overexposure processing is performed on the target video, the method further includes:
acquiring a second video frame in the target video subjected to the anti-overexposure treatment;
determining a dark portion image area having a luminance value less than a second luminance threshold value in the second video frame;
the brightness value of the dark image area is increased.
In one embodiment, the performing the anti-overexposure processing on the target video includes:
acquiring a frame brightness reduction value in unit time;
and reducing the brightness value of a video frame positioned in the target video after the first video frame in time sequence according to the frame brightness reduction value in the unit time.
In one embodiment, the reducing, according to the frame brightness decrease value in the unit time, the brightness value of a video frame chronologically subsequent to the first video frame in the target video includes:
acquiring the time length between the shooting time of a video frame positioned behind the first video frame in time sequence and the shooting time of the first video frame;
determining the product of the duration and the frame brightness reduction value in the unit time as a frame brightness reduction total value;
and reducing the brightness value of the video frame positioned after the first video frame in the time sequence according to the frame brightness reduction total value, wherein the difference value between the maximum area brightness value of the video frame subjected to brightness value reduction processing and the maximum area brightness value of the first video frame is equal to the frame brightness reduction total value.
In one embodiment, the obtaining the frame brightness drop value in the unit time includes:
acquiring a difference value between the maximum region brightness value of the first video frame and the first brightness threshold value;
acquiring a preset anti-overexposure processing time length;
and taking the ratio of the difference value to the anti-overexposure processing time length as a frame brightness reduction value in the unit time.
In one embodiment, the method is used in a white light camera, the white light camera includes a white light lamp and an image sensor, and the performing the anti-overexposure processing on the target video includes:
the brightness of the white light lamp is reduced, and/or the gain value of the image sensor is reduced.
In a second aspect, an apparatus for video anti-overexposure processing is provided, the apparatus comprising:
the first acquisition module is used for acquiring a first video frame in a target video in the process of shooting the target video;
the second acquisition module is used for dividing the first video frame into at least two image areas and acquiring the brightness value of each image area to obtain at least two area brightness values;
and the determining module is used for acquiring a maximum region brightness value from the at least two region brightness values and performing anti-overexposure processing on the target video according to a comparison result of the maximum region brightness value and a first brightness threshold value.
In a third aspect, a computer device is provided, which includes a memory and a processor, wherein the memory stores a computer program, and the computer program is configured to implement the video anti-overexposure processing method according to any one of the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the video anti-overexposure processing method according to any one of the above-mentioned first aspects.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the method comprises the steps of acquiring a first video frame of a target video in the process of shooting the target video, then dividing the first video frame into at least two image areas, and acquires a brightness value of each image region to obtain at least two region brightness values, and then, performing anti-overexposure processing on the target video according to the maximum area brightness value of the at least two area brightness values, so that, when the brightness of the local area of the first video frame in the target video is too high, that is, when the local area of the first video frame in the target video may be overexposed, no matter whether the average brightness of the whole picture of the first video frame is high or low, the target video can be subjected to the overexposure prevention processing, therefore, the accuracy rate of determining whether the target video is likely to have the overexposure phenomenon can be improved, and the effect of performing the overexposure prevention treatment on the target video is improved.
Drawings
Fig. 1 is a flowchart of a video anti-overexposure processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a grid provided in an embodiment of the present application;
fig. 3 is a flowchart of a video anti-overexposure processing method according to an embodiment of the present application;
fig. 4 is a flowchart of a video anti-overexposure processing method according to an embodiment of the present application;
fig. 5 is a block diagram of a video anti-overexposure processing apparatus according to an embodiment of the present application;
fig. 6 is a block diagram of a video anti-overexposure processing apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The camera is an electronic device for shooting videos, and is currently widely applied to the field of monitoring and security protection. In practical applications, a camera usually has a poor shooting effect in a low-illumination environment (such as a night environment, a haze environment, or a rainy environment), because in a case of low illumination, light reflected by an object (such as a human face or a vehicle) in the environment toward the camera generally has a low light intensity, and an image of the object in a video formed by the camera based on the light with the low light intensity is often blurred.
In order to ensure the shooting effect in a low-light environment, an illumination assembly may be installed in the camera, for example, the illumination assembly may be a white light lamp or an infrared light lamp. When ambient illuminance is lower, the camera can open the lighting assembly of self installation to utilize this lighting assembly to carry out the light filling to the environment, can improve the light intensity of the object in the environment to the light of camera reflection through the light filling. The camera is usually clear for the image of the object in the video based on the light ray for improving the light intensity, so that the shooting effect of the camera in the low-illumination environment can be ensured.
However, in practical applications, after the light is supplemented by the lighting assembly, the light intensity of the light reflected by the object in the environment to the camera may be too high, and in this case, the video shot by the camera is likely to be overexposed. The occurrence of the overexposure phenomenon can seriously affect the video shooting effect, so that in the video shooting process, the camera usually needs to take some measures to prevent the video overexposure phenomenon.
In the related art, during the process of shooting a video, a camera can acquire a video frame from the video, and then the camera can acquire an average brightness value of the whole picture in the video frame. When the average brightness value is larger than a certain preset brightness threshold value, the camera determines that the overexposure phenomenon may occur in the video being shot, and in this case, the camera can perform the overexposure prevention processing on the video being shot.
In the related art, the manner for the camera to obtain the average brightness value of the whole frame in the video frame may be: for example, the camera may assign a higher weight value to a picture region with a higher occurrence probability of a sensitive object (e.g., a human face or a license plate) in the video frame (e.g., the picture region is a triangular region at the lower half part of the video frame), and assign a lower weight value to a region with a lower occurrence probability of the sensitive object in the video frame. Then, for each picture area in the video frame, the camera may calculate a brightness value of the picture area, and multiply the brightness value by a weight value corresponding to the picture area to obtain a picture area brightness value. The camera may then add the picture region fractional luminance values for each picture region to obtain an average luminance value for the entire picture in the video frame.
However, in many cases, the average brightness value of the entire frame of the video frame does not accurately reflect whether the video is likely to be overexposed.
For example, in some cases, some objects in the environment (e.g., a person's face or a vehicle, etc.) may be closer to the camera, while other objects in the environment (e.g., a tree or a building, etc.) may be farther from the camera, with the light reflected back toward the camera by objects closer to the camera having a greater intensity, and the light reflected back toward the camera by objects farther from the camera having a lesser intensity. In this case, the brightness of an image of an object closer to the camera in the video captured by the camera is high, and the brightness of an image of an object farther from the camera is low. However, because the brightness of the image of the object far away from the camera in the video captured by the camera is low, the average brightness value of the whole frame of the video frame is likely to be low when the brightness of the image of the object near the camera is too high, that is, overexposure occurs.
Because the average brightness value of the whole frame of the video frame cannot accurately reflect whether the video is possibly overexposed, in the related art, the camera may not be able to perform the overexposure prevention processing on the video being shot in time, which results in poor overexposure prevention processing effect.
The embodiment of the application provides a method, a device, equipment and a storage medium for video anti-overexposure processing, which can improve the effect of the video anti-overexposure processing.
In the video anti-overexposure processing method provided by the embodiment of the application, a camera can acquire a first video frame of a target video in a process of shooting the target video, then the camera can divide the first video frame into at least two image areas and acquire a brightness value of each image area, so as to acquire at least two area brightness values, and then the camera can perform anti-overexposure processing on the target video according to a maximum area brightness value of the at least two area brightness values. Therefore, when the picture brightness of the local area of the first video frame in the target video is too high, that is, when the local area of the first video frame in the target video is likely to be overexposed, no matter whether the average brightness of the whole picture of the first video frame is high or low, the target video can be subjected to the overexposure prevention treatment, so that the accuracy rate of determining whether the target video is likely to have the overexposure phenomenon can be improved, and the effect of performing the overexposure prevention treatment on the target video is improved.
Next, a brief description will be given of an implementation environment related to the video anti-overexposure processing method provided in the embodiment of the present application.
The implementation environment may include a camera, optionally, the camera may include an illumination assembly and an image sensor, the illumination assembly may be a white light lamp or an infrared light lamp, and the image sensor may receive light reflected by an object in the environment toward the camera, and image according to the light, thereby capturing the object in the environment.
In the embodiment of the application, the camera can shoot the target video by using the image sensor installed on the camera, and can acquire the first video frame in the target video in the process of shooting the target video, and the camera can perform anti-overexposure processing on the target video according to the maximum area brightness value of the first video frame.
Referring to fig. 1, a flowchart of a video anti-overexposure processing method provided in an embodiment of the present application is shown, where the video anti-overexposure processing method can be applied to the implementation environment described above. As shown in fig. 1, the video anti-overexposure processing method may include the following steps:
step 101, in the process of shooting a target video, a camera acquires a first video frame in the target video.
As described above, the camera may have an image sensor mounted therein, and the camera may capture a target video using the image sensor. During the shooting of the target video, the camera may acquire a first video frame in the target video.
Step 102, the camera divides the first video frame into at least two image areas, and obtains a brightness value of each image area to obtain at least two area brightness values.
In step 102, the camera may segment the acquired first video frame, and optionally, all the segmentation lines used by the camera to segment the first video frame may form a mesh, as shown in fig. 2, which is an exemplary schematic diagram of the mesh.
The camera can obtain at least two image areas after segmenting the first video frame, and the at least two image areas can form the first video frame. In the embodiment of the present application, in order to simplify the process of segmenting the first video frame, each image region obtained by segmenting the first video frame by the camera may be a rectangle, and the areas of each image region obtained by segmenting the first video frame by the camera may be equal.
After the first video frame is segmented into at least two image regions, the camera may acquire a luminance value of each image region, thereby obtaining at least two region luminance values.
In a possible implementation manner, the manner in which the camera acquires the brightness value of a certain image area may be: the camera acquires pixel values of all pixels located in the image area, wherein the pixel value of each pixel may include sub-pixel values corresponding to three color channels of R (red), G (green) and B (blue), the camera may acquire the sub-pixel value corresponding to the G color channel of each pixel and determine the sub-pixel value corresponding to the G color channel as a luminance value of the pixel, and then the camera adds the luminance values of all pixels located in the image area to obtain the luminance value of the image area.
In another possible implementation manner, the manner in which the camera acquires the brightness value of a certain image region may be: the camera acquires pixel values of all pixels located in the image area, then the camera may acquire a sum of a sub-pixel value corresponding to the R color channel, a sub-pixel value corresponding to the G color channel, and a sub-pixel value corresponding to the B color channel of each pixel, and determine the sum as a luminance value of the pixel, and then the camera may add the luminance values of all pixels located in the image area, thereby obtaining a luminance value of the image area.
In yet another possible implementation manner, the manner in which the camera acquires the brightness value of a certain image region may be: the camera randomly acquires m (m is a positive integer smaller than q, q is the number of all pixels in the image area) pixels from the pixels in the image area, then the camera can acquire a sub-pixel value corresponding to a G color channel of each pixel in the m pixels, determine the sub-pixel value corresponding to the G color channel as a brightness value of the pixel, and then the camera adds the brightness values of the m pixels to obtain the brightness value of the image area.
And 103, acquiring a maximum area brightness value from at least two area brightness values by the camera, and performing anti-overexposure processing on the target video according to a comparison result of the maximum area brightness value and a first brightness threshold value.
In a possible implementation manner, the camera may acquire one first video frame from the target video in step 101, and when a maximum area brightness value of the one first video frame is greater than or equal to a first brightness threshold, the camera may perform an anti-overexposure process on the target video.
In this implementation, when the camera determines that the maximum region brightness value of one first video frame in the target video is greater than or equal to the first brightness threshold, the camera may perform the anti-overexposure processing on the target video. Since the target video is likely to be overexposed when the brightness value of the maximum area of a first video frame in the target video is greater than or equal to the first brightness threshold, in this case, the camera can immediately perform the overexposure prevention processing on the target video, which can improve the efficiency of performing the overexposure prevention processing on the target video.
In another possible implementation manner, the camera may acquire n first video frames (n is a positive integer greater than 1) adjacent in time sequence from the target video in step 101, and when the maximum area brightness values of the n first video frames are all greater than or equal to the first brightness threshold, the camera performs the anti-overexposure processing on the target video.
In this implementation, when the camera determines that the brightness values of the maximum areas of n consecutive first video frames in the target video are all greater than or equal to the first brightness threshold, the camera may perform the anti-overexposure processing on the target video. In this case, the camera may perform the anti-overexposure processing on the target video because the target video is more likely to be overexposed when the brightness values of the maximum regions of the n consecutive first video frames in the target video are all greater than or equal to the first brightness threshold. In this implementation manner, since the camera performs the anti-overexposure processing on the target video only when the target video is more likely to be overexposed, the camera can be prevented from performing the anti-overexposure processing on the target video which is less likely to be overexposed by mistake to a certain extent, and thus the purpose of improving the effect of performing the anti-overexposure processing on the target video is achieved.
In the embodiment of the present application, the first brightness threshold may be preset by a technician, and the embodiment of the present application is not particularly limited thereto.
In this embodiment of the present application, performing anti-overexposure processing on a target video may include: at least one of reducing the brightness of a white light lamp of a camera and reducing a gain value of an image sensor of the camera.
In the video anti-overexposure processing method provided in the embodiment of the application, a first video frame of a target video is acquired in the process of shooting the target video, then the first video frame is divided into at least two image areas, the brightness value of each image area is acquired, so as to obtain at least two area brightness values, and then the target video is subjected to anti-overexposure processing according to the maximum area brightness value of the at least two area brightness values, so that when the brightness of a local area of the first video frame in the target video is too high, that is, when the local area of the first video frame in the target video is likely to be overexposed, the target video can be subjected to the anti-overexposure processing no matter whether the average brightness of the whole picture of the first video frame is high or low, so as to improve the accuracy rate of determining whether the target video is likely to have the overexposure phenomenon, and then the effect of performing anti-overexposure processing on the target video is improved.
Referring to fig. 3, a flowchart of another video anti-overexposure processing method provided in the embodiment of the present application is shown, where the video anti-overexposure processing method can be applied in the implementation environment described above. As shown in fig. 3, on the basis of the above-mentioned embodiment, after the camera determines that the target video needs to be subjected to the anti-overexposure according to the comparison result between the maximum region brightness value of the first video frame and the first brightness threshold, the technical process of performing the anti-overexposure processing on the target video by the camera may include:
step 201, the camera acquires a frame brightness reduction value in unit time.
In the embodiment of the present application, the performing of the anti-overexposure processing on the target video refers to: the brightness value of a video frame (for convenience of description, it is simply referred to as a subsequent video frame hereinafter) in the target video, which is temporally subsequent to the first video frame, is reduced by some means, so as to prevent the subsequent video frame from being overexposed.
For example, assuming that the first video frame is the p-th video frame in the target video, performing the anti-overexposure processing on the target video refers to: and reducing the brightness value of the video frame positioned after the p-th video frame in the target video by adopting some means, so as to avoid the overexposure of the video frame after the p-th video frame.
Wherein, as mentioned above, "some means" in the above may include: at least one of reducing the brightness of a white light lamp of a camera and reducing a gain value of an image sensor of the camera.
In the process of performing the anti-overexposure processing on the target video, the camera can gradually reduce the brightness value of the subsequent video frame until the brightness value of the maximum area of the subsequent video frame is less than or equal to the first brightness threshold value, and the camera completes the anti-overexposure processing on the target video.
For example, assuming that the first video frame is the p-th video frame in the target video, the camera may gradually decrease the luminance values of k consecutive video frames after the p-th video frame, and after performing the decreasing processing on the luminance values of the k consecutive video frames, the maximum region luminance value of the p + k-th video frame in the target video is less than or equal to the first luminance threshold, at which point the camera completes the anti-overexposure processing on the target video.
In order to gradually reduce the brightness value of the subsequent video frame, the camera may acquire a frame brightness reduction value in a unit time, where the "frame brightness reduction value in a unit time" refers to a reduction value of the brightness of the subsequent video frame in a unit time during the anti-overexposure processing, and optionally, the unit time may be a time duration between shooting time of two adjacent video frames in the target video.
In a possible implementation manner, the technician may set the frame brightness reduction value in the unit time in advance, and in step 201, the camera may acquire the frame brightness reduction value in the unit time that is set in advance by the technician.
In another possible implementation manner, a technician may set an anti-overexposure processing duration in advance, where the anti-overexposure processing duration refers to a duration required by the camera to perform the anti-overexposure processing, that is, a duration between when the camera starts to perform the anti-overexposure processing and when the camera completes the anti-overexposure processing. In the above example, the anti-overexposure processing time length may be a time length required for the camera to perform the reduction processing on the luminance values of the consecutive k video frames.
In step 201, the camera may obtain the preset anti-overexposure processing time period, and at the same time, the camera may obtain a difference between the first brightness threshold and the maximum region brightness value of the first video frame, and then, the camera may use a ratio of the difference to the anti-overexposure processing time period as a frame brightness decrease value in unit time.
And step 202, the camera reduces the brightness value of the subsequent video frame according to the frame brightness reduction value in unit time.
In one possible implementation manner, during the process of performing the overexposure prevention processing on the target video, the camera may acquire a duration between the shooting time of the subsequent video frame and the shooting time of the first video frame. Then, the camera may determine the product of the time length and the frame luminance drop value per unit time as a frame luminance drop total value. Then, the camera may perform reduction processing on the brightness value of the subsequent video frame according to the frame brightness reduction total value, so that a difference between the maximum region brightness value of the subsequent video frame after the brightness value reduction processing and the maximum region brightness value of the first video frame is equal to the frame brightness reduction total value.
For example, assuming that the first video frame is the p-th video frame in the target video, the subsequent video frame acquired by the camera may be located in k consecutive video frames after the p-th video frame, and if the shooting time of the p-th video frame is t1 and the shooting time of the subsequent video frame is t2, the camera may acquire the difference r between t2 and t1 and determine the difference r as the duration between the shooting time of the subsequent video frame and the shooting time of the first video frame. Then, the camera may determine the product of the difference value r and the frame luminance drop value per unit time as a frame luminance drop total value z. Then, the camera may perform reduction processing on the brightness value of the subsequent video frame, where a difference between the maximum region brightness value of the subsequent video frame after the reduction processing and the maximum region brightness value of the p-th video frame is equal to the total brightness reduction value z of the frame.
The obtaining method of the maximum region brightness value of the subsequent video frame is the same as the obtaining method of the maximum region brightness value of the first video frame, and the description of the embodiment of the present application is omitted here.
In one embodiment of the present application, the reducing the luminance value of the subsequent video frame may include: and carrying out reduction processing on a sub-pixel value corresponding to the R color channel, a sub-pixel value corresponding to the G color channel and a sub-pixel value corresponding to the B color channel of the pixel in the subsequent video frame.
In the video anti-overexposure processing method provided by the embodiment of the application, in the process of performing anti-overexposure processing on the target video, the camera can gradually reduce the brightness value of the subsequent video frame according to the frame brightness reduction value in unit time, so that the sudden drop of the brightness value of the subsequent video frame can be avoided, the brightness jump of the target video can be avoided, and the influence on the shooting effect of the target video is avoided.
Referring to fig. 4, a flowchart of another video anti-overexposure processing method provided in the embodiment of the present application is shown, where the video anti-overexposure processing method can be applied to the implementation environment described above. As shown in fig. 4, on the basis of the above-mentioned embodiment, after the step 103, the video anti-overexposure processing method further includes:
step 301, the camera acquires a second video frame in the target video after the overexposure prevention processing.
As described above, in the process of performing the overexposure prevention processing on the target video, the camera may reduce the brightness value of the subsequent video frame, thereby preventing the subsequent video frame from being overexposed.
However, there is a high possibility that an image region having a low luminance value originally exists in the subsequent video frame, and in the process of performing the luminance value reduction processing on the luminance value of the subsequent video frame, the luminance value of the image region having a low luminance value originally is further reduced, so that the image region having a low luminance value originally is difficult to see, which causes a lot of details in the image region having a low luminance value originally to be lost. In order to avoid the above situation and ensure the shooting effect of the target video, the embodiment of the application can brighten the area with lower brightness value in the subsequent video frame after the target video is subjected to the anti-overexposure processing.
In order to perform the brightness enhancement processing on the region with a lower brightness value in the subsequent video frame, the camera may perform the technical process of step 301, that is, the camera may acquire the second video frame in the target video after the overexposure prevention processing, where the second video frame is the video frame in the subsequent video frame described above.
Step 302, the camera determines a dark portion image area in the second video frame having a luminance value less than a second luminance threshold.
In one possible implementation, the camera may acquire a brightness value of each pixel in the second video frame, and then the camera may acquire a pixel having a brightness value smaller than the second brightness threshold from all pixels included in the second video frame, and then the camera may acquire a dark portion image area composed of pixels having a brightness value smaller than the second brightness threshold from the second video frame.
In another possible implementation, the camera may divide the second video frame into at least two image areas, and acquire a brightness value of each image area, and then, the camera may determine an image area having a brightness value smaller than the second brightness threshold as the dark portion image area.
In yet another possible implementation, the camera may obtain a plurality of pixels from different areas of the second video frame according to a certain rule, the camera may obtain pixels with a luminance value smaller than the second luminance threshold value from the plurality of pixels, and then the camera may obtain a dark portion image area including all pixels with a luminance value smaller than the second luminance threshold value from the second video frame.
It should be noted that the second brightness threshold described above may be preset by a skilled person, and the embodiment of the present application is not particularly limited thereto. Wherein the second brightness threshold is less than the first brightness threshold.
It should also be noted that, similarly to the above, the brightness value of the pixel may refer to the sub-pixel value corresponding to the G color channel of the pixel, or the brightness value of the pixel may refer to the sum of the sub-pixel value corresponding to the R color channel, the sub-pixel value corresponding to the G color channel, and the sub-pixel value corresponding to the B color channel of the pixel.
It should be further noted that the obtaining manner of the brightness value of the image region in step 302 is the same as the obtaining manner of the brightness value of the image region in step 102, and the description of the embodiment of the present application is omitted here.
In step 303, the camera performs an increase process on the brightness value of the dark portion image area.
The camera may increase the brightness value of the dark portion region by using a local tone mapping (english).
Optionally, in an embodiment of the present application, the increasing the brightness value of the dark image area by the camera may include: and performing increasing processing on the sub-pixel value corresponding to the R color channel, the sub-pixel value corresponding to the G color channel and the sub-pixel value corresponding to the B color channel of the pixel in the dark part image area.
In the video anti-overexposure processing method provided by the embodiment of the application, the camera can increase the brightness value of the dark part image area of the second video frame, so that the dark part image area can be seen clearly after the target video is subjected to the anti-overexposure processing, the details in the dark part image area can be reserved, and then the shooting effect of the target video can be guaranteed.
Referring to fig. 5, a block diagram of a video anti-overexposure processing apparatus 400 according to an embodiment of the present application is shown, where the video anti-overexposure processing apparatus 400 can be configured in a camera. As shown in fig. 5, the video anti-overexposure processing apparatus 400 may include: a first obtaining module 401, a second obtaining module 402 and a determining module 403.
The first obtaining module 401 is configured to obtain a first video frame in a target video during shooting the target video.
The second obtaining module 402 is configured to divide the first video frame into at least two image regions, and obtain a luminance value of each image region to obtain at least two region luminance values.
The determining module 403 is configured to obtain a maximum region brightness value from the at least two region brightness values, and perform an anti-overexposure process on the target video according to a comparison result between the maximum region brightness value and a first brightness threshold.
In an embodiment of the present application, the determining module 403 is specifically configured to: and when the maximum area brightness value is larger than or equal to the first brightness threshold value, performing anti-overexposure processing on the target video.
In an embodiment of the present application, the determining module 403 is specifically configured to: and when the maximum area brightness values of n first video frames adjacent in time sequence in the target video are all larger than or equal to the first brightness threshold, carrying out anti-overexposure processing on the target video, wherein n is a positive integer larger than 1.
Referring to fig. 6, an embodiment of the present application further provides a video anti-overexposure processing apparatus 500, where the video anti-overexposure processing apparatus 500 may further include, in addition to the modules included in the video anti-overexposure processing apparatus 400, optionally, a brightness value increasing module 404 and an anti-overexposure processing module 405.
Wherein the brightness value increasing module 404 is configured to: acquiring a second video frame in the target video subjected to the anti-overexposure treatment; determining a dark portion image area having a luminance value less than a second luminance threshold value in the second video frame; the brightness value of the dark image area is increased.
The overexposure prevention processing module 405 is configured to: acquiring a frame brightness reduction value in unit time; and reducing the brightness value of a video frame positioned in the target video after the first video frame in time sequence according to the frame brightness reduction value in the unit time.
The overexposure prevention processing module 405 is configured to: the brightness of the white light lamp is subjected to reduction processing, and/or the gain value of the image sensor is subjected to reduction processing.
In an embodiment of the present application, the overexposure prevention processing module 405 is specifically configured to: acquiring the time length between the shooting time of a video frame positioned behind a first video frame in a time sequence and the shooting time of the first video frame; determining the product of the duration and the frame brightness reduction value in the unit time as a frame brightness reduction total value; and reducing the brightness value of the video frame positioned after the first video frame in the time sequence according to the frame brightness reduction total value, wherein the difference value between the maximum area brightness value of the video frame subjected to brightness value reduction processing and the maximum area brightness value of the first video frame is equal to the frame brightness reduction total value.
In an embodiment of the present application, the overexposure prevention processing module 405 is specifically configured to: acquiring a difference value between the maximum region brightness value of the first video frame and the first brightness threshold value; acquiring a preset anti-overexposure processing time length; and determining the ratio of the difference to the anti-overexposure processing time length as the frame brightness reduction value in the unit time.
The video anti-overexposure processing apparatus provided in the embodiment of the present application can implement the method embodiments described above, and the implementation principle and technical effect are similar, which are not described herein again.
For specific limitations of the video anti-overexposure processing apparatus, reference may be made to the above limitations of the video anti-overexposure processing method, which are not described herein again. The modules in the video anti-overexposure processing device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment of the present application, a computer device is provided, which may be a video camera, the internal structure of which may be as shown in fig. 7. The computer device comprises a processor, a memory, an image sensor and an illumination assembly which are connected through a system bus, wherein the illumination assembly can be a white light lamp or an infrared light lamp and the like. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The computer program is executed by a processor to implement a video anti-overexposure processing method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment of the present application, there is provided a computer device, which may be a camera, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the following steps when executing the computer program:
in the process of shooting a target video, acquiring a first video frame in the target video;
dividing the first video frame into at least two image areas, and acquiring the brightness value of each image area to obtain at least two area brightness values;
and acquiring a maximum region brightness value from the at least two region brightness values, and performing anti-overexposure processing on the target video according to a comparison result of the maximum region brightness value and a first brightness threshold value.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: and when the maximum area brightness value is larger than or equal to the first brightness threshold value, performing anti-overexposure processing on the target video.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: and when the maximum area brightness values of n first video frames adjacent in time sequence in the target video are all larger than or equal to the first brightness threshold, carrying out anti-overexposure processing on the target video, wherein n is a positive integer larger than 1.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring a second video frame in the target video subjected to the anti-overexposure treatment; determining a dark portion image area having a luminance value less than a second luminance threshold value in the second video frame; the brightness value of the dark image area is increased.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring a frame brightness reduction value in unit time; and reducing the brightness value of a video frame positioned in the target video after the first video frame in time sequence according to the frame brightness reduction value in the unit time.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring the time length between the shooting time of a video frame positioned behind a first video frame in a time sequence and the shooting time of the first video frame; determining the product of the duration and the frame brightness reduction value in the unit time as a frame brightness reduction total value; and reducing the brightness value of a video frame positioned after the first video frame in sequence according to the frame brightness reduction total value, wherein the difference value between the maximum region brightness value of the video frame subjected to brightness value reduction processing and the maximum region brightness value of the first video frame is equal to the frame brightness reduction total value.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring a difference value between the maximum region brightness value of the first video frame and the first brightness threshold value; acquiring a preset anti-overexposure processing time length; and determining the ratio of the difference to the anti-overexposure processing time length as the frame brightness reduction value in the unit time.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: the brightness of the white light lamp is reduced, and/or the gain value of the image sensor is reduced.
The implementation principle and technical effect of the computer device provided by the embodiment of the present application are similar to those of the method embodiment described above, and are not described herein again.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of:
in the process of shooting a target video, acquiring a first video frame in the target video;
dividing the first video frame into at least two image areas, and acquiring the brightness value of each image area to obtain at least two area brightness values;
and acquiring a maximum region brightness value from the at least two region brightness values, and performing anti-overexposure processing on the target video according to a comparison result of the maximum region brightness value and a first brightness threshold value.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: and when the maximum area brightness value is larger than or equal to the first brightness threshold value, performing anti-overexposure processing on the target video.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: and when the maximum area brightness values of n first video frames adjacent in time sequence in the target video are all larger than or equal to the first brightness threshold, carrying out anti-overexposure processing on the target video, wherein n is a positive integer larger than 1.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: acquiring a second video frame in the target video subjected to the anti-overexposure treatment; determining a dark portion image area having a luminance value less than a second luminance threshold value in the second video frame; the brightness value of the dark image area is increased.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: acquiring a frame brightness reduction value in unit time; and reducing the brightness value of a video frame positioned in the target video after the first video frame in time sequence according to the frame brightness reduction value in the unit time.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: acquiring the time length between the shooting time of a video frame positioned behind a first video frame in a time sequence and the shooting time of the first video frame; determining the product of the duration and the frame brightness reduction value in the unit time as a frame brightness reduction total value; and reducing the brightness value of the video frame positioned after the first video frame in the time sequence according to the frame brightness reduction total value, wherein the difference value between the maximum area brightness value of the video frame subjected to brightness value reduction processing and the maximum area brightness value of the first video frame is equal to the frame brightness reduction total value.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: acquiring a difference value between the maximum region brightness value of the first video frame and the first brightness threshold value; acquiring a preset anti-overexposure processing time length; and determining the ratio of the difference to the anti-overexposure processing time length as the frame brightness reduction value in the unit time.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: the brightness of the white light lamp is reduced, and/or the gain value of the image sensor is reduced.
The implementation principle and technical effect of the computer-readable storage medium provided by this embodiment are similar to those of the above-described method embodiment, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for video anti-overexposure processing, the method comprising:
in the process of shooting a target video, acquiring a first video frame in the target video;
dividing the first video frame into at least two image areas, and acquiring a brightness value of each image area to obtain at least two area brightness values;
acquiring a maximum region brightness value from the at least two region brightness values, and performing anti-overexposure processing on the target video according to a comparison result of the maximum region brightness value and a first brightness threshold value;
wherein, the performing the anti-overexposure processing on the target video comprises:
acquiring a difference value between the maximum region brightness value of the first video frame and the first brightness threshold value;
acquiring a preset anti-overexposure processing time length;
taking the ratio of the difference value to the anti-overexposure processing time length as a frame brightness reduction value in unit time;
and reducing the brightness value of a video frame which is positioned in the target video after the first video frame in time sequence according to the frame brightness reduction value.
2. The method according to claim 1, wherein the performing the anti-overexposure processing on the target video according to the comparison result between the maximum region brightness value and the first brightness threshold comprises:
and when the brightness value of the maximum area is greater than or equal to the first brightness threshold value, performing anti-overexposure processing on the target video.
3. The method according to claim 1, wherein the performing the anti-overexposure processing on the target video according to the comparison result between the maximum region brightness value and the first brightness threshold comprises:
and when the brightness values of the maximum areas of n first video frames adjacent in time sequence in the target video are all larger than or equal to the first brightness threshold, carrying out anti-overexposure processing on the target video, wherein n is a positive integer larger than 1.
4. The method according to claim 2 or 3, wherein after the anti-overexposure processing is performed on the target video, the method further comprises:
acquiring a second video frame in the target video subjected to the anti-overexposure treatment;
determining a dark portion image area having a luminance value less than a second luminance threshold in the second video frame;
and increasing the brightness value of the dark part image area.
5. The method according to claim 1, wherein said performing a reduction process on the luminance values of video frames in the target video that are temporally subsequent to the first video frame comprises:
acquiring the time length between the shooting time of a video frame positioned behind the first video frame in time sequence and the shooting time of the first video frame;
taking the product of the duration and the frame brightness reduction value as a total frame brightness reduction value;
and reducing the brightness value of the video frame positioned after the first video frame in sequence according to the frame brightness reduction total value, wherein the difference value between the maximum region brightness value of the video frame subjected to brightness value reduction processing and the maximum region brightness value of the first video frame is equal to the frame brightness reduction total value.
6. The method according to claim 1, wherein the method is used in a white light camera, the white light camera comprises a white light lamp and an image sensor, and the performing the anti-overexposure processing on the target video comprises:
and carrying out reduction processing on the brightness of the white light lamp, and/or carrying out reduction processing on the gain value of the image sensor.
7. An apparatus for video anti-overexposure processing, the apparatus comprising:
the first acquisition module is used for acquiring a first video frame in a target video in the process of shooting the target video;
the second acquisition module is used for dividing the first video frame into at least two image areas and acquiring the brightness value of each image area to obtain at least two area brightness values;
the determining module is used for acquiring a maximum region brightness value from the at least two region brightness values and performing anti-overexposure processing on the target video according to a comparison result of the maximum region brightness value and a first brightness threshold value;
wherein the determining module is specifically configured to:
acquiring a difference value between the maximum region brightness value of the first video frame and the first brightness threshold value;
acquiring a preset anti-overexposure processing time length;
taking the ratio of the difference value to the anti-overexposure processing time length as a frame brightness reduction value in unit time;
and reducing the brightness value of a video frame which is positioned in the target video after the first video frame in time sequence according to the frame brightness reduction value.
8. The apparatus of claim 7, wherein the determining module is specifically configured to: and when the brightness value of the maximum area is greater than or equal to the first brightness threshold value, performing anti-overexposure processing on the target video.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the computer program, when executed by the processor, implements the video anti-overexposure processing method of any of claims 1 to 6.
10. A computer-readable storage medium, having stored thereon a computer program, wherein the program, when executed by a processor, implements the video anti-overexposure processing method of any of claims 1 to 6.
CN201910730041.9A 2019-08-08 2019-08-08 Method, device and equipment for video anti-overexposure processing and storage medium Active CN110519522B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910730041.9A CN110519522B (en) 2019-08-08 2019-08-08 Method, device and equipment for video anti-overexposure processing and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910730041.9A CN110519522B (en) 2019-08-08 2019-08-08 Method, device and equipment for video anti-overexposure processing and storage medium

Publications (2)

Publication Number Publication Date
CN110519522A CN110519522A (en) 2019-11-29
CN110519522B true CN110519522B (en) 2021-10-22

Family

ID=68624458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910730041.9A Active CN110519522B (en) 2019-08-08 2019-08-08 Method, device and equipment for video anti-overexposure processing and storage medium

Country Status (1)

Country Link
CN (1) CN110519522B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898532A (en) * 2020-07-30 2020-11-06 杭州海康威视数字技术股份有限公司 Image processing method and device, electronic equipment and monitoring system
CN114170169A (en) * 2021-11-30 2022-03-11 广州思德医疗科技有限公司 Light source brightness adjusting method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103826066A (en) * 2014-02-26 2014-05-28 芯原微电子(上海)有限公司 Automatic exposure adjusting method and system
CN104184957A (en) * 2014-09-17 2014-12-03 中国科学院光电技术研究所 Automatic exposure control method based on adaptive expected image average brightness and suitable for space exploration imaging
CN104881644A (en) * 2015-05-25 2015-09-02 华南理工大学 Face image acquisition method under uneven lighting condition
CN105472268A (en) * 2015-12-24 2016-04-06 Tcl集团股份有限公司 Method and device for filling light during photographing
CN107566752A (en) * 2017-10-31 2018-01-09 努比亚技术有限公司 A kind of image pickup method, terminal and computer-readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101431185B1 (en) * 2007-06-22 2014-08-27 삼성전자 주식회사 Image enhancement method and apparatus, image processing system thereof
CN103118232B (en) * 2013-02-20 2016-07-13 浙江宇视科技有限公司 A kind of light supplementing control device and method
CN105828065B (en) * 2015-01-08 2017-11-21 中国移动通信集团浙江有限公司 A kind of video pictures overexposure detection method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103826066A (en) * 2014-02-26 2014-05-28 芯原微电子(上海)有限公司 Automatic exposure adjusting method and system
CN104184957A (en) * 2014-09-17 2014-12-03 中国科学院光电技术研究所 Automatic exposure control method based on adaptive expected image average brightness and suitable for space exploration imaging
CN104881644A (en) * 2015-05-25 2015-09-02 华南理工大学 Face image acquisition method under uneven lighting condition
CN105472268A (en) * 2015-12-24 2016-04-06 Tcl集团股份有限公司 Method and device for filling light during photographing
CN107566752A (en) * 2017-10-31 2018-01-09 努比亚技术有限公司 A kind of image pickup method, terminal and computer-readable storage medium

Also Published As

Publication number Publication date
CN110519522A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US9384539B2 (en) Method and device for processing digital image, and computer-readable recording medium
JP6160004B2 (en) Scene recognition method and apparatus
US8072507B2 (en) Method and system of generating high dynamic range image corresponding to specific scene
US9479705B2 (en) Exposure value adjustment apparatus, method, and non-transitory tangible machine-readable medium thereof
CN109862282B (en) Method and device for processing person image
EP3849170B1 (en) Image processing method, electronic device, and computer-readable storage medium
US11240443B2 (en) Systems and methods for image acquisition
US20210344826A1 (en) Image Acquisition Method, Electronic Device, andNon-Transitory Computer Readable Storage Medium
CN108322651B (en) Photographing method and device, electronic equipment and computer readable storage medium
CN110445952B (en) Picture flicker processing method, device, equipment and storage medium of camera
CN107925726B (en) Efficient storage device for generating high dynamic range images
US9544506B1 (en) Image processing method for image capturing device
CN110519522B (en) Method, device and equipment for video anti-overexposure processing and storage medium
US9489750B2 (en) Exposure metering based on background pixels
CN110620881A (en) License plate exposure compensation method and device, computer equipment and storage medium
CN111383206B (en) Image processing method and device, electronic equipment and storage medium
CN106651797B (en) Method and device for determining effective area of signal lamp
CN112312030A (en) Photographing light supplement method and device, computer equipment and storage medium
CN113163127B (en) Image processing method, device, electronic equipment and storage medium
CN110971841A (en) Image processing method, image processing device, storage medium and electronic equipment
CN113747008B (en) Camera and light supplementing method
CN109859142B (en) Image brightness adjusting method and device, computer equipment and storage medium
CN114173062A (en) Image processing method, device and equipment for camera equipment and storage medium
CN110418066B (en) Image processing method, device, equipment and storage medium
CN112446833B (en) Image processing method, intelligent terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant