CN113163194B - Detection method and device for flicker of shooting scene, shooting equipment and medium - Google Patents

Detection method and device for flicker of shooting scene, shooting equipment and medium Download PDF

Info

Publication number
CN113163194B
CN113163194B CN202110163635.3A CN202110163635A CN113163194B CN 113163194 B CN113163194 B CN 113163194B CN 202110163635 A CN202110163635 A CN 202110163635A CN 113163194 B CN113163194 B CN 113163194B
Authority
CN
China
Prior art keywords
image frame
scene
brightness
ith
average
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
CN202110163635.3A
Other languages
Chinese (zh)
Other versions
CN113163194A (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.)
Zhuhai Shixi Technology Co Ltd
Original Assignee
Zhuhai Shixi 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 Zhuhai Shixi Technology Co Ltd filed Critical Zhuhai Shixi Technology Co Ltd
Priority to CN202110163635.3A priority Critical patent/CN113163194B/en
Publication of CN113163194A publication Critical patent/CN113163194A/en
Application granted granted Critical
Publication of CN113163194B publication Critical patent/CN113163194B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Picture Signal Circuits (AREA)

Abstract

The disclosure relates to a method and a device for detecting flicker of a shooting scene, a shooting device and a medium, wherein a difference value between a first image frame and a first average image frame is obtained and binarized to obtain a first fitting image frame under the condition that the current shooting scene is determined to be a static scene, not dim light and high dynamic; acquiring the line average brightness of each line of the first fitting image frame; fitting a first curve according to the line number and the line average brightness, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis; if the first curve is a sine curve, the flicker of the current shooting scene is determined, and the change of the line brightness of the first fitting image frame can reflect the brightness change of the external light source in the current scene, so that the first curve fitted according to the line number and the line average brightness can reflect the brightness change of the external light source and the brightness change period, and the flicker detection accuracy is improved.

Description

Detection method and device for flicker of shooting scene, shooting equipment and medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and an apparatus for detecting flicker in a shooting scene, a shooting device, and a medium.
Background
When an object is photographed by an imaging device under a light source supplied with power from a commercial ac power source, a luminance change with respect to time, so-called flicker, is generated in a video signal outputted for photographing. The reason for causing the flicker is that the energy of the alternating current periodically changes in a sine wave form, when the external light source is light, under the condition that the exposure time does not meet integral multiple of the alternating current energy period, the brightness of the image periodically changes along with the change of the number of lines, and the dynamic image looks like stripes flickering on the surface.
In the existing flicker detection method, a line average vector of a current image frame is usually calculated, a difference value is calculated with the line average vector of a previous image frame to obtain a difference vector, and whether a flicker phenomenon exists in the current image frame is judged through the difference vector; or obtaining the picture of the light source area, calculating the average gray value of all pixels in each row, and judging whether the current scene has the flicker phenomenon or not according to the change rule of the average gray value.
However, in the case of dark light or high dynamic state, by adopting the method in the prior art, the phenomenon of weak light flicker is easy to miss detection or false detection, and the flicker detection accuracy is reduced.
Disclosure of Invention
To solve the technical problem or at least partially solve the technical problem, the present disclosure provides a method, an apparatus, a photographing device, and a medium for detecting flicker of a photographing scene.
In a first aspect, the present disclosure provides a method for detecting flicker in a shooting scene, including:
under the condition that the current shooting scene is determined to be a static scene, not dim light and high in dynamic, obtaining a difference value between a first image frame and a first average image frame and carrying out binarization to obtain a first fitting image frame, wherein the first average image frame is an average image frame of a first group of image frames, the first group of image frames comprise N continuous image frames, the first image frame is the first image frame, and N is an integer greater than or equal to 2;
acquiring the line average brightness of each line of the first fitting image frame;
fitting a first curve according to the line number and the line average brightness, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
and if the first curve is a sine curve, determining that the current shooting scene has flicker.
Optionally, the method further includes:
under the condition that the current shooting scene is determined to be a static scene, dim light and high dynamic, obtaining a difference value between an ith image frame and an ith average image frame and carrying out binarization to obtain an ith fitting image frame, wherein i is an integer which is more than or equal to 1 and less than or equal to M, the ith average image frame is an average image frame of an ith group of image frames, the ith group of image frames comprises N continuous image frames, a first image frame of the ith group of image frames is the ith image frame, and N is an integer which is more than or equal to 2;
acquiring the row average brightness of each row of the ith fitting image frame;
fitting a second curve according to the line number and the line average brightness of the ith fitting image frame, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
and if the second curve contains S periods of sine waves, determining that the current shooting scene has flicker, wherein S is an integer greater than or equal to 1.
Optionally, the method further includes:
determining that the current shooting scene is a static scene;
and performing histogram statistics on the first average image frame, and determining that the current static scene is a non-dim light and high dynamic situation or a dim light and high dynamic situation according to histogram statistical information.
Optionally, the determining, according to the histogram statistical information, that the current static scene is a non-dim light and high dynamic situation, or a dim light and high dynamic situation includes:
if the difference value of the pixel quantity of the adjacent brightness value intervals is larger than a first preset threshold value, determining that the current static scene is high dynamic;
if the number of pixels in the brightness value interval larger than the first brightness value is smaller than a second preset threshold value, determining that the current scene is dim light;
and if the number of pixels in the brightness value interval larger than the first brightness value is larger than or equal to a second preset threshold value, determining that the current scene is not dim light.
Optionally, the determining that the current shooting scene is a static scene includes:
acquiring an ith average image frame of an ith group of image frames, and determining the ith scene brightness according to the ith average image frame, wherein i is an integer which is more than or equal to 1 and less than or equal to K, the ith group of image frames comprises N continuous image frames, and the initial image frames of two adjacent groups of image frames are adjacent;
and determining that the current scene is a static scene according to the 1 st scene brightness to the Kth scene brightness, wherein the difference value of any two scene brightness in the K scene brightness is smaller than a third preset threshold value.
In a second aspect, the present disclosure provides a device for detecting flicker in a shooting scene, including:
the image processing device comprises a processing module, a first fitting image frame and a second fitting image frame, wherein the processing module is used for acquiring a difference value between a first image frame and a first average image frame and carrying out binarization to obtain the first fitting image frame under the condition that a current shooting scene is a static scene, is not dim light and is high in dynamic state, the first average image frame is an average image frame of a first group of image frames, the first group of image frames comprises N continuous image frames, the first image frame is the first image frame, and N is an integer greater than or equal to 2;
the obtaining module is used for obtaining the line average brightness of each line of the first fitting image frame;
the processing module is further used for fitting a first curve according to the line number and the line average brightness, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
the processing module is further configured to determine that flicker exists in the current shooting scene if the first curve is a sinusoidal curve.
Optionally, the method further includes:
the processing module is further configured to, when it is determined that a current shooting scene is a static scene, dim light and high dynamic, obtain a difference value between an ith image frame and an ith average image frame and perform binarization, so as to obtain an ith fitted image frame, where i is an integer greater than or equal to 1 and less than or equal to M, the ith average image frame is an average image frame of an ith group of image frames, the ith group of image frames includes N consecutive image frames, a first image frame of the ith group of image frames is the ith image frame, and N is an integer greater than or equal to 2;
the obtaining module is further configured to obtain a row average brightness of each row of the ith fitting image frame;
the processing module is further used for fitting a second curve according to the line number and the line average brightness of the ith fitting image frame, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
the processing module is further configured to determine that flicker exists in the current shooting scene if the second curve includes S periods of sine waves, where S is an integer greater than or equal to 1.
Optionally, the method further includes:
the processing module is further used for determining that the current shooting scene is a static scene; and the histogram statistics is carried out on the first average image frame, and the condition that the current static scene is not dim light and high in dynamic state or the condition that the current static scene is dim light and high in dynamic state is determined according to the histogram statistical information.
Optionally, the processing module is specifically configured to:
if the difference value of the pixel quantity of the adjacent brightness value intervals is larger than a first preset threshold value, determining that the current static scene is high dynamic;
if the number of pixels in the brightness value interval larger than the first brightness value is smaller than a second preset threshold value, determining that the current scene is dim light;
and if the number of pixels in the brightness value interval larger than the first brightness value is larger than or equal to a second preset threshold value, determining that the current scene is not dim light.
Optionally, the processing module is specifically configured to:
acquiring an ith average image frame of an ith group of image frames, and determining the ith scene brightness according to the ith average image frame, wherein i is an integer which is more than or equal to 1 and less than or equal to K, the ith group of image frames comprises N continuous image frames, and the initial image frames of two adjacent groups of image frames are adjacent;
and determining that the current scene is a static scene according to the 1 st scene brightness to the Kth scene brightness, wherein the difference value of any two scene brightness in the K scene brightness is smaller than a third preset threshold value.
In a third aspect, the present disclosure provides a photographing apparatus comprising: memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of the first aspect when executing the program.
In a fourth aspect, the present disclosure provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
obtaining a difference value between a first image frame and a first average image frame and carrying out binarization to obtain a first fitting image frame under the condition that the current shooting scene is a static scene, is not dim and is high in dynamic, wherein the first average image frame is an average image frame of a first group of image frames, the first group of image frames comprise N continuous image frames, the first image frame is the first image frame, and N is an integer greater than or equal to 2; acquiring the line average brightness of each line of the first fitting image frame; fitting a first curve according to the line number and the line average brightness, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis; if the first curve is a sine curve, the flicker of the current shooting scene is determined, and the change of the line brightness of the first fitting image frame can reflect the brightness change of the external light source in the current scene, so that the first curve fitted according to the line number and the line average brightness can reflect the brightness change of the external light source and the brightness change period, and the flicker detection accuracy is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of an embodiment of a method for detecting flicker in a shooting scene according to the present disclosure;
fig. 2 is a schematic flowchart of another embodiment of a method for detecting flicker in a shooting scene according to the present disclosure;
fig. 3 is a schematic flowchart of another embodiment of a method for detecting flicker in a shooting scene according to the present disclosure;
fig. 4 is a schematic flowchart of another embodiment of a method for detecting flicker in a shooting scene according to the present disclosure;
fig. 5 is a schematic flowchart of another embodiment of a method for detecting flicker in a shooting scene according to the present disclosure;
fig. 6 is a schematic structural diagram of a detection apparatus for detecting scene flicker provided in the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
The technical solutions of the present disclosure are described in several specific embodiments, and the same or similar concepts may be referred to one another, and are not described in detail in each place.
The detection method for flicker of shooting scene provided by the embodiment of the present disclosure may be applied to electronic devices such as a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a Personal Digital Assistant (PDA), a wearable electronic device, and a virtual reality device, and the embodiment of the present disclosure does not limit the above.
Fig. 1 is a schematic flowchart of an embodiment of a method for detecting flicker in a shooting scene, as shown in fig. 1, the method of the embodiment includes:
s101: and under the condition that the current shooting scene is determined to be a static scene, not dim light and high in dynamic, obtaining the difference value of the first image frame and the first average image frame and carrying out binarization to obtain a first fitting image frame.
The first average image frame is an average image frame of a first group of image frames, the first group of image frames comprises N continuous image frames, the first image frame is a first image frame, and N is an integer greater than or equal to 2.
For example, after a user opens a camera application on a mobile phone, a camera starts to acquire a shooting picture according to a certain shooting frequency, the shooting picture is displayed in a preview interface, under the condition that the current shooting scene is determined to be a static scene, not dim light and high dynamic according to image frames captured by the camera, the 1 st image frame captured by the camera is acquired, 30 frames are buffered by taking the 1 st image frame as a reference, an average image frame from the 1 st image frame to the 30 th image frame is calculated, the difference value between the 1 st image frame and the average image frame is acquired, and binarization processing is performed on the image frames after the difference value to acquire a fitting image frame.
Optionally, it may be determined that the current shooting scene is a static scene, non-dim light and high dynamic according to the following manner, as shown in fig. 2:
s201: and determining that the current shooting scene is a static scene.
Optionally, if the current shooting scene is not a static scene, the flicker does not need to be detected, and the process is ended.
S202: and performing histogram statistics on the first average image frame, and determining that the current static scene is not dim light and is high in dynamic according to the histogram statistical information.
For example: if the difference value of the pixel quantity of the adjacent brightness value intervals is larger than a first preset threshold value, determining that the current static scene is high dynamic; and if the number of pixels in the brightness value interval larger than the first brightness value is larger than or equal to a second preset threshold value, determining that the current scene is not dim light.
S102: the line average brightness of each line of the first fitted image frame is obtained.
Wherein the first fitting image frame is an image with alternating regularity of black and white.
S103: a first curve is fitted based on the row number and the row average luminance.
Wherein, the line number is the horizontal axis, and the line average brightness is the vertical axis.
With the (line number, line average brightness) of the first fitted image frame as known data, the appropriate curve type is selected to fit the data.
S104: and judging whether the first curve is a sine curve or not.
If yes, go to step S105.
S105: and determining that the flicker exists in the current shooting scene.
One possible implementation is: and according to the period of the sine curve, calculating the frequency of the external light source in the current scene, feeding back the frequency of the external light source and the exposure time of the current image to the automatic exposure algorithm module, and readjusting the image exposure time in the current scene by the automatic exposure algorithm module to eliminate image flicker.
In this embodiment, under the condition that the current shooting scene is a static scene, not dim light and high dynamic, obtaining a difference value between a first image frame and a first average image frame and performing binarization to obtain a first fitted image frame, where the first average image frame is an average image frame of a first group of image frames, the first group of image frames includes N consecutive image frames, the first image frame is a first image frame, and N is an integer greater than or equal to 2; acquiring the line average brightness of each line of the first fitting image frame; fitting a first curve according to the line number and the line average brightness; judging whether the first curve is a sine curve or not; if so, determining that the current shooting scene has flicker, and reflecting the brightness change of the external light source in the current scene due to the change of the line brightness of the first fitting image frame, so that the brightness change of the external light source and the brightness change period can be reflected according to the first curve fitted by the line number and the line average brightness, and the flicker detection accuracy is improved.
Fig. 3 is a schematic flowchart of another embodiment of a method for detecting flicker in a shooting scene according to the present disclosure, where fig. 3 is a technical solution for determining whether flicker exists in a current shooting scene under the condition that the current static scene is not dim light and is highly dynamic, as shown in fig. 3:
s301: and under the condition that the current shooting scene is determined to be a static scene, dim light and high dynamic, obtaining the difference value of the ith image frame and the ith average image frame and carrying out binarization to obtain the ith fitting image frame.
The image processing method comprises the steps of obtaining an ith group of image frames, obtaining an ith average image frame, obtaining an ith group of image frames, obtaining a ith group of image frames, wherein i is an integer which is greater than or equal to 1 and less than or equal to M, the ith average image frame is an average image frame of the ith group of image frames, the ith group of image frames comprises N continuous image frames, the first image frame of the ith group of image frames is the ith image frame, N is an integer which is greater than or equal to 2, and M is an integer which is greater than or equal to 2 and less than N.
Optionally, it may be determined that the current shooting scene is dim and highly dynamic according to the following manner, as shown in fig. 4:
s203: and performing histogram statistics on the first average image frame, and determining the condition that the current static scene is dim light and high dynamic according to the histogram statistical information.
For example: if the difference value of the pixel quantity of the adjacent brightness value intervals is larger than a first preset threshold value, determining that the current static scene is high dynamic; and if the number of the pixels in the brightness value interval larger than the first brightness value is smaller than a second preset threshold value, determining that the current scene is dim light.
S302: and acquiring the row average brightness of each row of the ith fitting image frame.
Wherein the ith fitting image frame is an image which is irregular in black and white alternation.
S303: and fitting a second curve according to the line number and the line average brightness of the ith fitting image frame.
Wherein, the line number is the horizontal axis, and the line average brightness is the vertical axis.
S304: and judging whether the second curve contains S periods of sine waves.
Wherein S is an integer of 1 or more. The sine wave may be a full cycle sine wave or a partial cycle sine wave.
If yes, S305 is performed.
If not, a possible implementation manner is as follows: determining that no flicker exists in the current shooting scene, and ending the process; another possible implementation is: and S301 is executed again, and the next image frame of the ith group of image frames is obtained, wherein the initial image frame of the next group of image frames is adjacent to the ith image frame.
S305: and determining that the flicker exists in the current shooting scene.
One possible implementation is: and calculating the frequency of the external light source in the current scene according to the sine waves of the S periods, feeding back the frequency of the external light source and the exposure time of the current image to the automatic exposure algorithm module, and readjusting the exposure time of the image in the current scene by the automatic exposure algorithm module to adaptively eliminate image flicker.
In this embodiment, under the condition that a current shooting scene is a static scene, dim light and high dynamic, a difference value between an ith image frame and an ith average image frame is obtained and binarized to obtain an ith fitting image frame, where i is an integer greater than or equal to 1 and less than or equal to M, the ith average image frame is an average image frame of an ith group of image frames, the ith group of image frames includes N continuous image frames, a first image frame of the ith group of image frames is the ith image frame, and N is an integer greater than or equal to 2; acquiring the row average brightness of each row of the ith fitting image frame, and fitting a second curve according to the row number and the row average brightness of the ith fitting image frame; and judging whether the second curve contains sine waves of S periods, wherein S is an integer more than or equal to 1, if so, determining that the current shooting scene has flicker, and determining that the current shooting scene has flicker when the second curve which is fit according to the line number and the line average brightness of the ith fitting image frame contains sine waves of S periods because the current shooting scene is dim light and high dynamic.
Fig. 5 is a schematic flowchart of another embodiment of a method for detecting flicker in a shooting scene according to the present disclosure, and fig. 5 is a description of a possible manner of S201 based on the embodiment shown in fig. 2 or fig. 4, and includes:
s2011: and acquiring the ith average image frame of the ith group of image frames, and determining the ith scene brightness according to the ith average image frame.
Wherein i is an integer greater than or equal to 1 and less than or equal to K, the ith group of image frames comprises N continuous image frames, and the initial image frames of the two adjacent groups of image frames are adjacent.
Taking K equal to 20 and N equal to 30 as an example, buffering 30 consecutive image frames with reference to the 1 st image frame acquired by the camera, calculating the 1 st average image frame of the 1 st group of image frames from the 1 st image frame to the 30 th image frame, and determining the 1 st scene brightness according to the 1 st average image frame.
And buffering 30 continuous image frames by taking the 2 nd image frame as a reference, calculating the 2 nd average image frame of the 2 nd group of image frames by taking the 2 nd image frame to the 31 nd image frame as the 2 nd group of image frames, and determining the 2 nd scene brightness according to the 2 nd average image frame.
And buffering 30 continuous image frames by taking the 20 th image frame as a reference, calculating the 20 th average image frame of the 20 th image frame by taking the 20 th image frame to the 49 th image frame as the 20 th group image frame, and determining the 20 th scene brightness according to the 20 th average image frame.
S2012: and determining that the current scene is a static scene according to the 1 st scene brightness to the Kth scene brightness.
And in the K scene brightness, the difference value of any two scene brightness is smaller than a third preset threshold value.
In this embodiment, the luminance of an ith scene is determined according to an ith average image frame of an ith group of image frames, where i is an integer greater than or equal to 1 and less than or equal to K, the ith group of image frames includes N consecutive image frames, and starting image frames of two adjacent groups of image frames are adjacent; and determining that the current scene is a static scene according to the 1 st scene brightness to the K th scene brightness, wherein the difference value of any two scene brightness in the K scene brightness is smaller than a third preset threshold value, namely, determining that the current scene is the static scene according to the brightness of a plurality of scenes, thereby improving the accuracy of flicker detection and the shooting quality of images in the static scene.
Fig. 6 is a schematic structural diagram of a detection apparatus for detecting flicker in a shooting scene, the apparatus of this embodiment includes: a processing module 601 and an acquisition module 602.
The processing module 601 is configured to, under the condition that a current shooting scene is determined to be a static scene, not dim light and high dynamic, obtain a difference value between a first image frame and a first average image frame and perform binarization to obtain a first fitted image frame, where the first average image frame is an average image frame of a first group of image frames, the first group of image frames includes N consecutive image frames, the first image frame is the first image frame, and N is an integer greater than or equal to 2;
an obtaining module 602, configured to obtain a row average brightness of each row of the first fitted image frame;
the processing module 601 is further configured to fit a first curve according to the line number and the line average luminance, where the line number is a horizontal axis and the line average luminance is a vertical axis;
the processing module 601 is further configured to determine that a flicker exists in the current shooting scene if the first curve is a sinusoidal curve.
Optionally, the method further includes:
the processing module 601 is further configured to, when it is determined that a current shooting scene is a static scene, dim light and high dynamic, obtain a difference between an ith image frame and an ith average image frame and perform binarization, to obtain an ith fitted image frame, where i is an integer greater than or equal to 1 and less than or equal to M, the ith average image frame is an average image frame of an ith group of image frames, the ith group of image frames includes N consecutive image frames, a first image frame of the ith group of image frames is the ith image frame, and N is an integer greater than or equal to 2;
an obtaining module 602, further configured to obtain a row average brightness of each row of the ith fitted image frame;
the processing module 601 is further configured to fit a second curve according to the line number and the line average brightness of the i-th fit image frame, where the line number is a horizontal axis and the line average brightness is a vertical axis;
the processing module 601 is further configured to determine that flicker exists in the current shooting scene if the second curve includes S periods of sine waves, where S is an integer greater than or equal to 1.
Optionally, the method further includes:
the processing module 601 is further configured to determine that the current shooting scene is a static scene; and the histogram statistics is carried out on the first average image frame, and the condition that the current static scene is not dim light and high in dynamic state or the condition that the current static scene is dim light and high in dynamic state is determined according to the histogram statistical information.
Optionally, the processing module 601 is specifically configured to:
if the difference value of the pixel quantity of the adjacent brightness value intervals is larger than a first preset threshold value, determining that the current static scene is high dynamic;
if the number of pixels in the brightness value interval larger than the first brightness value is smaller than a second preset threshold value, determining that the current scene is dim light;
and if the number of pixels in the brightness value interval larger than the first brightness value is larger than or equal to a second preset threshold value, determining that the current scene is not dim light.
Optionally, the processing module 601 is specifically configured to:
acquiring an ith average image frame of an ith group of image frames, and determining the ith scene brightness according to the ith average image frame, wherein i is an integer which is more than or equal to 1 and less than or equal to K, the ith group of image frames comprises N continuous image frames, and the initial image frames of two adjacent groups of image frames are adjacent;
and determining that the current scene is a static scene according to the 1 st scene brightness to the Kth scene brightness, wherein the difference value of any two scene brightness in the K scene brightness is smaller than a third preset threshold value.
The device of this embodiment may be used to implement the technical solution of any one of the methods shown in fig. 1 to fig. 5, and the implementation principle and the technical effect are similar, which are not described herein again.
The embodiment of the present disclosure provides a shooting device, including: the memory, the processor, and the computer program stored in the memory and capable of running on the processor, where the processor executes the program to implement the technical solution of any one of the methods shown in fig. 1 to 5, and the implementation principle and the technical effect are similar, and are not described herein again.
The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the solution of the method embodiment shown in any one of fig. 1 to 5.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for detecting flicker in a shooting scene, comprising:
under the condition that the current shooting scene is determined to be a static scene, not dim light and high in dynamic, obtaining a difference value between a first image frame and a first average image frame and carrying out binarization to obtain a first fitting image frame, wherein the first average image frame is an average image frame of a first group of image frames, the first group of image frames comprise N continuous image frames, the first image frame is the first image frame, and N is an integer greater than or equal to 2;
acquiring the line average brightness of each line of the first fitting image frame;
fitting a first curve according to the line number and the line average brightness, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
if the first curve is a sine curve, determining that the current shooting scene has flicker;
the determining that the current shooting scene is a static scene, a non-dim light and a high dynamic condition includes:
determining that the current shooting scene is a static scene;
and performing histogram statistics on the first average image frame, and determining that the current static scene is not dim light and is high in dynamic according to histogram statistical information.
2. The method of claim 1, further comprising:
under the condition that a current shooting scene is determined to be a static scene, dim light and high dynamic, obtaining a difference value between an ith image frame and an ith average image frame and carrying out binarization to obtain an ith fitting image frame, wherein i is an integer which is more than or equal to 1 and less than or equal to M, the ith average image frame is an average image frame of an ith group of image frames, the ith group of image frames comprises N continuous image frames, the first image frame of the ith group of image frames is the ith image frame, N is an integer which is more than or equal to 2, and M is an integer which is more than or equal to 2 and less than N;
acquiring the row average brightness of each row of the ith fitting image frame;
fitting a second curve according to the line number and the line average brightness of the ith fitting image frame, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
if the second curve contains S periods of sine waves, determining that the current shooting scene has flicker, wherein S is an integer greater than or equal to 1;
the determining that the current shooting scene is a static scene, a dim light and a high dynamic condition includes:
determining that the current shooting scene is a static scene;
and performing histogram statistics on the first average image frame, and determining the condition that the current static scene is dim and highly dynamic according to histogram statistical information.
3. The method according to claim 1 or 2, wherein the determining that the current static scene is a non-dim and high dynamic case or a dim and high dynamic case according to the histogram statistical information comprises:
if the difference value of the pixel quantity of the adjacent brightness value intervals is larger than a first preset threshold value, determining that the current static scene is high dynamic;
if the number of pixels in the brightness value interval larger than the first brightness value is smaller than a second preset threshold value, determining that the current scene is dim light;
and if the number of pixels in the brightness value interval larger than the first brightness value is larger than or equal to a second preset threshold value, determining that the current scene is not dim light.
4. The method according to claim 1 or 2, wherein the determining that the current shooting scene is a static scene comprises:
acquiring an ith average image frame of an ith group of image frames, and determining the ith scene brightness according to the ith average image frame, wherein i is an integer which is more than or equal to 1 and less than or equal to K, the ith group of image frames comprises N continuous image frames, and the initial image frames of two adjacent groups of image frames are adjacent;
and determining that the current scene is a static scene according to the 1 st scene brightness to the Kth scene brightness, wherein the difference value of any two scene brightness in the K scene brightness is smaller than a third preset threshold, and K is an integer which is larger than or equal to 2 and smaller than N.
5. A detection apparatus for flicker in a scene, comprising:
the image processing device comprises a processing module, a first fitting image frame and a second fitting image frame, wherein the processing module is used for acquiring a difference value between a first image frame and a first average image frame and carrying out binarization to obtain the first fitting image frame under the condition that a current shooting scene is a static scene, is not dim light and is high in dynamic state, the first average image frame is an average image frame of a first group of image frames, the first group of image frames comprises N continuous image frames, the first image frame is the first image frame, and N is an integer greater than or equal to 2;
the obtaining module is used for obtaining the line average brightness of each line of the first fitting image frame;
the processing module is further used for fitting a first curve according to the line number and the line average brightness, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
the processing module is further configured to determine that flicker exists in the current shooting scene if the first curve is a sinusoidal curve;
the processing module is specifically configured to determine that a current shooting scene is a static scene; and the histogram statistics is carried out on the first average image frame, and the condition that the current static scene is not dim light and is high in dynamic is determined according to the histogram statistical information.
6. The apparatus of claim 5, further comprising:
the processing module is further configured to, when it is determined that a current shooting scene is a static scene, dim light and high dynamic, obtain a difference value between an ith image frame and an ith average image frame and perform binarization, to obtain an ith fitted image frame, where i is an integer greater than or equal to 1 and less than or equal to M, the ith average image frame is an average image frame of an ith group of image frames, the ith group of image frames includes N consecutive image frames, a first image frame of the ith group of image frames is the ith image frame, N is an integer greater than or equal to 2, and M is an integer greater than or equal to 2 and less than N;
the obtaining module is further configured to obtain a row average brightness of each row of the ith fitting image frame;
the processing module is further used for fitting a second curve according to the line number and the line average brightness of the ith fitting image frame, wherein the line number is a horizontal axis, and the line average brightness is a vertical axis;
the processing module is further configured to determine that flicker exists in the current shooting scene if the second curve includes S periods of sine waves, where S is an integer greater than or equal to 1;
the processing module is specifically configured to determine that a current shooting scene is a static scene; and the histogram statistics is carried out on the first average image frame, and the condition that the current static scene is dim light and high in dynamic is determined according to the histogram statistical information.
7. The apparatus according to claim 5 or 6, wherein the processing module is specifically configured to:
if the difference value of the pixel quantity of the adjacent brightness value intervals is larger than a first preset threshold value, determining that the current static scene is high dynamic;
if the number of pixels in the brightness value interval larger than the first brightness value is smaller than a second preset threshold value, determining that the current scene is dim light;
and if the number of pixels in the brightness value interval larger than the first brightness value is larger than or equal to a second preset threshold value, determining that the current scene is not dim light.
8. The apparatus according to claim 5 or 6, wherein the processing module is specifically configured to:
acquiring an ith average image frame of an ith group of image frames, and determining the ith scene brightness according to the ith average image frame, wherein i is an integer which is more than or equal to 1 and less than or equal to K, the ith group of image frames comprises N continuous image frames, and the initial image frames of two adjacent groups of image frames are adjacent;
determining that the current scene is a static scene according to the 1 st scene brightness to the Kth scene brightness, wherein the difference value of any two scene brightness in the K scene brightness is smaller than a third preset threshold value; and K is an integer which is more than or equal to 2 and less than N.
9. A photographing apparatus, characterized by comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 4 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN202110163635.3A 2021-02-05 2021-02-05 Detection method and device for flicker of shooting scene, shooting equipment and medium Active CN113163194B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110163635.3A CN113163194B (en) 2021-02-05 2021-02-05 Detection method and device for flicker of shooting scene, shooting equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110163635.3A CN113163194B (en) 2021-02-05 2021-02-05 Detection method and device for flicker of shooting scene, shooting equipment and medium

Publications (2)

Publication Number Publication Date
CN113163194A CN113163194A (en) 2021-07-23
CN113163194B true CN113163194B (en) 2022-01-04

Family

ID=76883168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110163635.3A Active CN113163194B (en) 2021-02-05 2021-02-05 Detection method and device for flicker of shooting scene, shooting equipment and medium

Country Status (1)

Country Link
CN (1) CN113163194B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100721664B1 (en) * 2005-12-22 2007-05-23 매그나칩 반도체 유한회사 Circuit and method for detecting flicker of image sensor
CN103561232A (en) * 2010-12-29 2014-02-05 中国移动通信集团公司 Method and device for identifying video monitoring scenes
CN102256062A (en) * 2011-05-06 2011-11-23 钰创科技股份有限公司 Circuit and method for automatically detecting image flicker
CN106572345B (en) * 2015-10-13 2018-09-25 富士通株式会社 Flash detecting device and method
CN110225403A (en) * 2019-07-12 2019-09-10 四川长虹电器股份有限公司 The bright dark scene of video image identifies control method
CN111355864B (en) * 2020-04-16 2022-06-14 浙江大华技术股份有限公司 Image flicker elimination method and device

Also Published As

Publication number Publication date
CN113163194A (en) 2021-07-23

Similar Documents

Publication Publication Date Title
CN110766621B (en) Image processing method, image processing device, storage medium and electronic equipment
CN109003249B (en) Method, device and terminal for enhancing image details
CN102473061B (en) Ambient correction in rolling image capture system
CN109829859B (en) Image processing method and terminal equipment
US9569688B2 (en) Apparatus and method of detecting motion mask
JP2003198932A (en) Flicker correction device, flicker correction method, and recording medium with flicker correction program recorded
CN109286758B (en) High dynamic range image generation method, mobile terminal and storage medium
CN110728705B (en) Image processing method, image processing device, storage medium and electronic equipment
US11546524B2 (en) Reducing a flicker effect of multiple light sources in an image
US20170104914A1 (en) Flicker detection apparatus and method
CN110740266A (en) Image frame selection method and device, storage medium and electronic equipment
CN112383718A (en) Image exposure method and device and electronic equipment
US8189068B2 (en) Apparatus and method for detecting flicker noise and computer readable medium stored thereon computer executable instructions for performing the method
CN109120856B (en) Camera shooting method and device
CN113163194B (en) Detection method and device for flicker of shooting scene, shooting equipment and medium
CN113395599B (en) Video processing method, device, electronic equipment and medium
CN114222070A (en) Brightness compensation method, device, equipment and storage medium
CN110428411B (en) Backlight plate detection method and system based on secondary exposure
US10965877B2 (en) Image generating method and electronic apparatus
CN115658410B (en) Method and system for testing fluency of touch screen of electronic equipment and storage medium
WO2023001373A1 (en) Device and method for processing image data
CN103279234B (en) Method and system for positioning touch point
JP2011259390A (en) Flicker detector
JP2019045990A (en) Image processing apparatus, image processing method, and program
US20230209210A1 (en) System and method for image banding detection

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519000 room 601-1, 6 / F, building 4, Gangwan science and Innovation Park, No. 1, Jintang Road, Tangjiawan Town, high tech Zone, Zhuhai, Guangdong

Applicant after: Zhuhai Shixi Technology Co.,Ltd.

Address before: 519000 Room 401, 4th floor, building 17, science and Technology Innovation Park, 1 Jintang Road, Tangjiawan Town, Gaoxin District, Zhuhai City, Guangdong Province

Applicant before: Zhuhai Shixi Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant