Shooting method, device and equipment
By acquiring the time-domain signal of the light source in the shooting scene and performing Fourier transform, the exposure time and inter-frame interval time were adjusted after determining the reference frequency, thus solving the flicker problem caused by multiple light sources and improving image quality.
Patent Information
- Application Number
- CN202511222797.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies cannot effectively eliminate the flickering phenomenon caused by multiple light sources in the shooting scene, resulting in stripes in the captured images and poor image quality.
By acquiring the time-domain signal of the light source in the shooting scene, performing Fourier transform to obtain the frequency-domain waveform, determining the reference frequency, and adjusting the exposure time and inter-frame interval time according to the frequency, the flicker of multiple light sources can be eliminated.
Even in the presence of multiple light sources, it can effectively eliminate flicker, improve image quality, and prevent stripes from appearing in the image.
Smart Images

Figure CN120935463A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of camera technology, specifically relating to a shooting method, apparatus, and equipment. Background Technology
[0002] Image flicker is caused by the interaction between a time-modulated light source and an image sensor, resulting in the flickering of lights in the scene being photographed, creating scrolling stripes in the image.
[0003] When there are at least two light sources in the shooting scene, the relevant technology can only remove the flicker caused by one light source, but cannot remove the flicker caused by other light sources, resulting in stripes still appearing in the captured image and poor image quality. Summary of the Invention
[0004] The purpose of this application is to provide a shooting method, apparatus, and device that can eliminate flickering.
[0005] In a first aspect, embodiments of this application provide a shooting method, including:
[0006] Obtain the time-domain signal of the light source in the shooting scene to obtain the first time-domain waveform of the shooting scene;
[0007] Perform a Fourier transform on the first time-domain waveform to obtain the first frequency-domain waveform;
[0008] Determine the reference frequency based on the first frequency domain waveform diagram;
[0009] When only a first frequency is determined based on a reference frequency, an image is captured using a first target exposure method; wherein, the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy cycle of the first frequency;
[0010] When a first frequency and at least one second frequency are determined based on a reference frequency, an image is captured using a second target exposure method; wherein the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy cycle of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy cycle of at least one second frequency.
[0011] Secondly, embodiments of this application provide a shooting device, including:
[0012] The acquisition module is used to acquire the time-domain signal of the light source in the shooting scene and obtain the first time-domain waveform of the shooting scene;
[0013] The transformation module is used to perform a Fourier transform on the first time-domain waveform to obtain the first frequency-domain waveform.
[0014] The determination module is used to determine the reference frequency based on the first frequency domain waveform diagram;
[0015] The imaging module is configured to capture an image using a first target exposure method when only a first frequency is determined based on a reference frequency; and to capture an image using a second target exposure method when both the first frequency and at least one second frequency are determined based on the reference frequency. The first target exposure method includes adjusting the exposure time to an integer multiple of the energy cycle of the first frequency; the second target exposure method includes adjusting the exposure time to an integer multiple of the energy cycle of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy cycle of at least one second frequency.
[0016] Thirdly, embodiments of this application provide an electronic device, which includes a processor and a memory. The memory stores programs or instructions that can run on the processor, and when the program or instructions are executed by the processor, they implement the steps of the shooting method provided in embodiments of this application.
[0017] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions, which, when executed by a processor, implement the steps of the shooting method provided in embodiments of this application.
[0018] Fifthly, this application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the steps of the shooting method provided in this application.
[0019] Sixthly, embodiments of this application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the steps of the shooting method provided in embodiments of this application.
[0020] In this embodiment, a first time-domain waveform of the shooting scene is obtained by acquiring the time-domain signal of the light source in the shooting scene; a first frequency-domain waveform is obtained by performing a Fourier transform on the first time-domain waveform; a reference frequency is determined based on the first frequency-domain waveform; if only the first frequency is determined based on the reference frequency, an image is captured using a first target exposure method; wherein the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency; if the first frequency and at least one second frequency are determined based on the reference frequency, an image is captured using a second target exposure method; wherein the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy period of at least one second frequency. Thus, even if there are at least two light sources in the shooting scene, the scheme disclosed in this application can eliminate the flicker of at least two light sources, avoid stripes in the captured image, and improve image quality. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating the shooting method provided in some embodiments of this application;
[0022] Figure 2 This is a schematic diagram of a first time-domain waveform provided in some embodiments of this application;
[0023] Figure 3 This is a schematic diagram of a first frequency domain waveform provided in some embodiments of this application;
[0024] Figure 4 This is a schematic diagram of a second frequency domain waveform provided in some embodiments of this application;
[0025] Figure 5 These are schematic diagrams illustrating the exposure time matching method provided in some embodiments of this application;
[0026] Figure 6 These are schematic diagrams illustrating the fixed frame rate elimination method provided in some embodiments of this application;
[0027] Figure 7 These are schematic diagrams of the shooting preview interface provided in some embodiments of this application;
[0028] Figure 8 These are schematic diagrams illustrating the display of light source information of a shooting scene provided in some embodiments of this application;
[0029] Figure 9 These are schematic diagrams of the imaging device provided in some embodiments of this application;
[0030] Figure 10 These are schematic diagrams of the structure of an electronic device provided in some embodiments of this application;
[0031] Figure 11 These are schematic diagrams of the hardware structure of electronic devices provided in some embodiments of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0033] The terms "first," "second," etc., used in this application's specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects have an "or" relationship.
[0034] The terminology used in the implementation section of this application is only for explaining specific embodiments of this application and is not intended to limit this application. The terminology involved in the embodiments of this application is explained below.
[0035] A time-domain signal is a signal whose amplitude changes over time.
[0036] Frequency domain signals are mathematical representations that describe signals in the frequency domain.
[0037] The Fourier Transform is a mathematical operation that transforms a signal from the time domain to the frequency domain, and it is widely used in signal processing, image analysis, quantum mechanics, and other fields. Its core idea is to decompose a complex signal into a superposition of sine or cosine waves of different frequencies.
[0038] An extreme point is the x-coordinate of the maximum or minimum value within a certain interval of the graph of a function.
[0039] A control (also called a part, component, widget, or control) is a graphical user interface element and a basic building block of the user interface. It is a window or text box that is displayed in the program interface of any application. Controls can be buttons, text boxes, labels, etc., and are used to control all the data processed by each application and the interactive operations on that data.
[0040] The following description, in conjunction with the accompanying drawings, details the shooting method, apparatus, and equipment provided in the embodiments of this application through specific examples and application scenarios.
[0041] The shooting method provided in this application embodiment can be applied to shooting scenarios where there is at least one light source. One specific application scenario is a stage shooting scenario, in which the stage shooting scenario includes electronic screen light source and lamp light source or only electronic screen light source; another specific application scenario is a shopping mall shooting scenario, in which the shopping mall shooting scenario includes electronic screen light source and lamp light source.
[0042] It should be noted that the above application scenarios are only examples, and other application scenarios can be included in actual applications. For example, outdoor shooting scenarios and indoor shooting scenarios in users' homes. Outdoor shooting scenarios include building lighting and shop billboard lighting, while indoor shooting scenarios in users' homes include television lighting and lamp lighting.
[0043] Figure 1 This is a schematic flowchart of a shooting method provided in some embodiments of this application. The shooting method may include:
[0044] Step 101: Obtain the time-domain signal of the light source in the shooting scene to obtain the first time-domain waveform of the shooting scene;
[0045] In some embodiments of this application, before step 101, the shooting method provided in this application may further include: receiving shooting input. The shooting input in this application includes, but is not limited to, touch input, specific gesture input, and voice input by the user via a touch device such as a finger or stylus; wherein, touch input includes, but is not limited to, click input and swipe input, and click input can be single-click input, double-click input, or any number of clicks, and can also be long-press input or short-press input; specific gesture input can be any one of single-click gesture, swipe gesture, drag gesture, long-press gesture, area change gesture, double-press gesture, and double-click gesture. The shooting input in this application can be set and modified adaptively according to actual needs.
[0046] In some embodiments of this application, the first time-domain waveform is a waveform of the light source signal of the shooting scene in the time domain. Once the light source time-domain signal of the shooting scene is obtained, the first time-domain waveform of the shooting scene can be obtained. For example, as... Figure 2 As shown, Figure 2 This is a schematic diagram of a first time-domain waveform provided in some embodiments of this application.
[0047] Step 102: Perform a Fourier transform on the first time-domain waveform to obtain the first frequency-domain waveform;
[0048] In some embodiments of this application, a frequency domain waveform can be obtained by performing a Fourier transform on the time domain waveform.
[0049] In some embodiments of this application, before step 102, the shooting method provided in this application may further include: performing waveform preprocessing on the first time-domain waveform to filter out interference waveforms and obtain a second time-domain waveform; correspondingly, step 102 may include: performing Fourier transform on the second time-domain waveform to obtain a first frequency-domain waveform.
[0050] In some embodiments of this application, waveform preprocessing may include at least one of the following:
[0051] Spike filtering, DC filtering, and motion filtering.
[0052] In some embodiments of this application, when performing spike filtering on a time-domain waveform, spikes can be filtered out for small count data in the raw domain of the time-domain waveform. Within a sliding window, if the difference between the maximum and minimum values of the data within the sliding window is less than the counting threshold, it is considered that the data change within the sliding window is very small, and the data of the entire sliding window can be directly replaced by statistical quantities such as the median or average value of the sliding window, thereby achieving the purpose of smoothing noise or filtering out small fluctuations.
[0053] In some embodiments of this application, the Delta Filter algorithm can be used when performing DC filtering on the time-domain waveform.
[0054] In some embodiments of this application, an improved version of the Delta filtering algorithm, namely the Delta Squared Filter (DSE), can be used when performing motion filtering on the time-domain waveform. When performing motion filtering on the time-domain waveform using the Delta Squared Filter algorithm, it is possible to count whether there are multiple consecutively increasing or decreasing data points in the sliding window. When multiple consecutively increasing or decreasing data points exist in the sliding window, it is considered that there is movement in the current shooting device or shooting scene, and thus the waveform is filtered out.
[0055] After preprocessing the first time-domain waveform to filter out interference waveforms and obtain the second time-domain waveform, perform a Fourier transform on the second time-domain waveform to obtain the first frequency-domain waveform.
[0056] For example, such as Figure 3 As shown, Figure 3 This is a schematic diagram of a first frequency domain waveform provided in some embodiments of this application. Wherein, Figure 3 The first frequency domain waveform shown is a... Figure 2 The frequency domain waveform is obtained by performing Fourier transform on the first time domain waveform diagram shown after waveform preprocessing.
[0057] Step 103: Determine the reference frequency based on the first frequency domain waveform diagram;
[0058] In some embodiments of this application, step 103 may include: determining at least two candidate frequencies based on a plurality of extreme points in a first frequency domain waveform; and determining a reference frequency from the at least two candidate frequencies.
[0059] In some embodiments of this application, determining at least two candidate frequencies based on multiple extreme points in the first frequency domain waveform may include: if the amplitude of the first extreme point is greater than the amplitudes of N points on both sides of the first extreme point, or if the second extreme point is an integer multiple of 10 and the amplitudes of the second extreme point and the N points on both sides satisfy an increasing or decreasing condition, then the frequency corresponding to the first extreme point or the frequency corresponding to the second extreme point is determined as a candidate frequency; wherein, the first extreme point and the second extreme point are extreme points among multiple extreme points, and N is a positive integer.
[0060] In some embodiments of this application, N can be set according to actual needs, for example, N is 2.
[0061] For example, when the amplitude of a certain extreme point is greater than the amplitudes of the two points to its left and right, the extreme point is used as a candidate frequency.
[0062] In some embodiments of this application, in order to include more integer multiples of frequencies in the candidate frequencies, when a certain extreme point is an integer multiple of 10 and the amplitude of the extreme point and the two points on the left and right sides meet the increasing or decreasing condition, the extreme point is also used as a candidate frequency.
[0063] For example, Figure 3 The extreme points "60 Hz, 100 Hz, 120 Hz, 360 Hz and 540 Hz" in the first frequency domain waveform diagram shown are all candidate frequencies.
[0064] In some embodiments of this application, determining a reference frequency from at least two candidate frequencies may include: determining the first candidate frequency as the reference frequency when the amplitude of the first candidate frequency is greater than twice the amplitude of the Mth point on the left and right sides of the first candidate frequency and the first candidate frequency is the smallest frequency among a plurality of candidate frequencies with a harmonic relationship; wherein the first candidate frequency is any one of at least two candidate frequencies, and M is a positive integer.
[0065] In some embodiments of this application, M can be set according to actual needs; for example, M is 3.
[0066] For example, in Figure 3 In this context, the amplitude of 60 Hz is greater than the amplitude of the third point on its left and right sides, and 60 Hz is the smallest frequency among the multiple candidate frequencies "60 Hz, 120 Hz, 360 Hz and 540 Hz" with a harmonic relationship. Therefore, 60 Hz is determined as the reference frequency.
[0067] Step 104: If only a first frequency is determined based on the reference frequency, an image is captured using a first target exposure method; if both the first frequency and at least one second frequency are determined based on the reference frequency, an image is captured using a second target exposure method; wherein, the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy cycle of the first frequency; the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy cycle of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy cycle of at least one second frequency;
[0068] In some embodiments of this application, after step 103, the imaging method provided in this application may further include: superimposing the amplitude of a candidate frequency that has a harmonic relationship with the reference frequency onto the amplitude of the reference frequency; setting the amplitude of the candidate frequency that has a harmonic relationship with the reference frequency to 0 to obtain a second frequency domain waveform; taking the frequency with the largest amplitude in the second frequency domain waveform as the first frequency; and taking the other candidate frequencies with non-zero amplitudes other than the first frequency in the second frequency domain waveform as the second frequency.
[0069] For example, in conjunction with the above Figure 3 As an example, the amplitudes of 120 Hz, 360 Hz, and 540 Hz are superimposed on the amplitude of 60 Hz, and the amplitudes of 120 Hz, 360 Hz, and 540 Hz are set to 0, resulting in the second frequency domain waveform. The second frequency domain waveform is shown below. Figure 4 As shown, Figure 4 This is a schematic diagram of a second frequency domain waveform provided in some embodiments of this application.
[0070] exist Figure 4 In this calculation, 60 Hz has the largest amplitude, so 60 Hz is taken as the first frequency, and 100 Hz is taken as the second frequency. The first frequency can be called the main frequency, and the second frequency can be called the secondary frequency or auxiliary frequency.
[0071] In some embodiments of this application, when only a first frequency is determined based on a reference frequency, the exposure time is adjusted to an integer multiple of the energy cycle of the first frequency before shooting.
[0072] For example, assuming that only a first frequency is determined based on the reference frequency, the first frequency is 60 Hz, and its energy cycle is 16.67 milliseconds, then the exposure time can be adjusted to 16.67 milliseconds, 33.34 milliseconds, 50.01 milliseconds, etc.
[0073] In some embodiments of this application, when a first frequency and at least one second frequency are determined based on a reference frequency, the exposure time is adjusted to an integer multiple of the energy cycle of the first frequency and the inter-frame interval time is adjusted to an integer multiple of the energy cycle of at least one second frequency before shooting.
[0074] For example, assuming a first frequency and a second frequency are determined based on a reference frequency, wherein the first frequency is 60 Hz with an energy period of 16.67 milliseconds and the second frequency is 100 Hz with an energy period of 10 milliseconds, then the exposure time can be adjusted to 16.67 milliseconds, 33.34 milliseconds, 50.01 milliseconds, etc., and the inter-frame interval time can be adjusted to 10 milliseconds, 20 milliseconds, 30 milliseconds, etc.
[0075] For example, suppose a first frequency and two second frequencies are determined based on a reference frequency, wherein the first frequency is 60 Hz with an energy period of 16.67 milliseconds, and the two second frequencies are 80 Hz and 100 Hz, respectively, with the 80 Hz energy period of 12.5 milliseconds and the 100 Hz energy period of 10 milliseconds. Then the exposure time can be adjusted to 16.67 milliseconds, 33.34 milliseconds, 50.01 milliseconds, etc., and the inter-frame interval can be adjusted to 50 milliseconds, 100 milliseconds, etc.
[0076] In some embodiments of this application, adjusting the exposure time to an integer multiple of the energy cycle of a certain frequency is called the exposure time matching method, and adjusting the inter-frame interval time to an integer multiple of the energy cycle of the frequency is called the fixed frame rate elimination method.
[0077] For example, the elimination of flicker at a first frequency of 100 Hz will be used as an example for illustration. Figure 5 As shown, Figure 5 This is a schematic diagram of the exposure time matching method provided in some embodiments of this application.
[0078] exist Figure 5 In the image, the gray area represents the integrated energy of one frame. When the current exposure time is an integer multiple of the energy period of 100 Hz (10 milliseconds), the energy of each half-sine wave is the same, and the brightness of each frame is consistent, without producing bright and dark bands. When the current exposure time is not an integer multiple of 10 milliseconds, the energy of each half-sine wave is different, resulting in bright and dark bands.
[0079] For example, the elimination of flicker at a second frequency of 100 Hz will be used as an example for illustration. Figure 6 As shown, Figure 6 This is a schematic diagram of a fixed frame rate elimination method provided in some embodiments of this application.
[0080] exist Figure 6In the image, the gray area represents the integrated energy of one frame. The current exposure time is 8 milliseconds. Since the current exposure time is not an integer multiple of the 10-millisecond energy cycle of 100 Hz, the fixed frame rate elimination method is used to eliminate the flicker of 100 Hz. For example, if the fixed frame rate is 25 frames per second (FPS), then the interval between two adjacent frames is 40 milliseconds. The brightness change within each frame is the same. Between different frames, the exposure start point of the same sequence is the same, and the integration accumulation time is also the same, that is, the energy is the same, which can eliminate the slight flickering phenomenon.
[0081] The following describes the shooting method provided in the embodiments of this application with specific examples.
[0082] When a user attends a concert and uses their mobile phone to film the stage, and there are electronic screen light sources and artificial light sources on the stage, the user launches the camera app on their phone and clicks the record or photo control. At this time, the phone acquires the time-domain signal of the light source of the stage scene, obtaining a time-domain waveform of the stage scene. A Fourier transform is performed on this time-domain waveform to obtain a frequency-domain waveform. Based on multiple extreme points in this frequency-domain waveform, candidate frequencies of 60 Hz, 100 Hz, 120 Hz, 360 Hz, and 540 Hz are determined. The frequencies of 120 Hz, 360 Hz, and 540 Hz are then... The 0 Hz amplitude is superimposed on the 60 Hz amplitude, and the amplitudes of 120 Hz, 360 Hz, and 540 Hz are set to 0, resulting in a new frequency domain waveform. Based on this new frequency domain waveform, the main frequency is determined to be 60 Hz and the secondary frequency to be 100 Hz. The exposure time is adjusted to an integer multiple of 16.67 milliseconds, for example, 16.67 milliseconds. The interval between two adjacent frames is adjusted to 40 milliseconds. Then, the image is taken. At this time, the flicker of the 60 Hz electronic screen light source and the flicker of the 100 Hz lamp light source can be eliminated.
[0083] In this embodiment, a first time-domain waveform of the shooting scene is obtained by acquiring the time-domain signal of the light source in the shooting scene; a first frequency-domain waveform is obtained by performing a Fourier transform on the first time-domain waveform; a reference frequency is determined based on the first frequency-domain waveform; if only the first frequency is determined based on the reference frequency, an image is captured using a first target exposure method; wherein the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency; if the first frequency and at least one second frequency are determined based on the reference frequency, an image is captured using a second target exposure method; wherein the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy period of at least one second frequency. Thus, even if there are at least two light sources in the shooting scene, the scheme disclosed in this application can eliminate the flicker of at least two light sources, avoid stripes in the captured image, and improve image quality.
[0084] In some embodiments of this application, during shooting, the light source information of the shooting scene can also be displayed on the shooting preview interface of the electronic device. The light source information includes the primary frequency and the secondary frequency.
[0085] When the user launches the camera, controls can be displayed on the shooting preview screen to trigger the display of light source information of the shooting scene, such as... Figure 7 As shown, Figure 7 This is a schematic diagram of a shooting preview interface provided in some embodiments of this application. When the user clicks... Figure 7 After the light source information control 701 in the middle, the following is displayed: Figure 8 The interface shown. Figure 8 This is a schematic diagram illustrating the display of light source information of a shooting scene provided in some embodiments of this application.
[0086] exist Figure 8 In the image, the light source information for the shooting scene is that the main frequency of the shooting scene is 60 Hz and the secondary frequency is 100 Hz.
[0087] exist Figure 8 The system can also display multiple exposure time settings for users to choose from, such as low, medium, and high exposure times. When users want to capture fast-moving scenes, they can choose the low exposure time, which will produce images with strong black bars but can cover large-scale high-speed motion. When users want to capture slow-moving scenes, they can choose the medium exposure time, which will produce images with weak black bars but can cover medium-scale medium-speed motion. When users want to capture slow-moving or static scenes, they can choose the high exposure time, which will produce images without black bars but can cover small-scale low-speed motion or no motion.
[0088] In some embodiments of this application, the default exposure time for the low exposure setting is shorter than the default exposure time for the medium exposure setting, and the default exposure time for the medium exposure setting is shorter than the default exposure time for the high exposure setting. For example, the default exposure time for the low exposure setting is 1 millisecond, the default exposure time for the medium exposure setting is 5 milliseconds, and the default exposure time for the high exposure setting is 10 milliseconds.
[0089] In some embodiments of this application, when selecting an exposure time level, the user can also set the exposure time of that exposure time level. For example, the user selects the low exposure time level and sets the exposure time of the low exposure time level to 2 milliseconds.
[0090] The shooting method provided in this application can be executed by a shooting device. This application uses a shooting device executing the shooting method as an example to illustrate the shooting device provided in this application.
[0091] Figure 9 These are schematic diagrams of the imaging device provided in some embodiments of this application; the imaging device 900 may include:
[0092] The acquisition module 901 is used to acquire the time-domain signal of the light source of the shooting scene and obtain the first time-domain waveform of the shooting scene;
[0093] The transformation module 902 is used to perform a Fourier transform on the first time-domain waveform to obtain the first frequency-domain waveform.
[0094] The determination module 903 is used to determine the reference frequency based on the first frequency domain waveform diagram;
[0095] The imaging module 904 is used to capture an image using a first target exposure method when only a first frequency is determined based on a reference frequency; and to capture an image using a second target exposure method when both the first frequency and at least one second frequency are determined based on the reference frequency; wherein the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy cycle of the first frequency; and the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy cycle of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy cycle of at least one second frequency.
[0096] In this embodiment, a first time-domain waveform of the shooting scene is obtained by acquiring the time-domain signal of the light source in the shooting scene; a first frequency-domain waveform is obtained by performing a Fourier transform on the first time-domain waveform; a reference frequency is determined based on the first frequency-domain waveform; if only the first frequency is determined based on the reference frequency, an image is captured using a first target exposure method; wherein the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency; if the first frequency and at least one second frequency are determined based on the reference frequency, an image is captured using a second target exposure method; wherein the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy period of at least one second frequency. Thus, even if there are at least two light sources in the shooting scene, the scheme disclosed in this application can eliminate the flicker of at least two light sources, avoid stripes in the captured image, and improve image quality.
[0097] In some embodiments of this application, the determining module 903 is specifically used for:
[0098] At least two candidate frequencies are determined based on multiple extreme points in the first frequency domain waveform; a reference frequency is determined from the at least two candidate frequencies.
[0099] In some embodiments of this application, the determining module 903 is specifically used for:
[0100] If the amplitude of the first extreme point is greater than the amplitudes of the N points to the left and right of the first extreme point, or if the amplitude of the second extreme point is an integer multiple of 10 and the amplitudes of the second extreme point and the N points to the left and right satisfy the increasing or decreasing condition, then the first extreme point or the second extreme point is determined as a candidate frequency; where the first extreme point and the second extreme point are extreme points among multiple extreme points, and N is a positive integer.
[0101] In some embodiments of this application, the determining module 903 is specifically used for:
[0102] If the amplitude of the first candidate frequency is greater than twice the amplitude of the Mth point to the left and right of the first candidate frequency, and the first candidate frequency is the smallest frequency among a plurality of candidate frequencies with a harmonic relationship, the first candidate frequency is determined as the reference frequency; wherein, the first candidate frequency is any one of at least two candidate frequencies, and M is a positive integer.
[0103] In some embodiments of this application, the determining module 903 is further configured to:
[0104] The amplitude of the candidate frequency that has a harmonic relationship with the reference frequency is superimposed on the amplitude of the reference frequency.
[0105] The amplitude of the candidate frequency that has a harmonic relationship with the reference frequency is set to 0 to obtain the second frequency domain waveform.
[0106] The frequency with the largest amplitude in the second frequency domain waveform is taken as the first frequency.
[0107] If there are other candidate frequencies besides the first frequency with non-zero amplitude in the second frequency domain waveform diagram, the other candidate frequencies with non-zero amplitude shall be used as the second frequency.
[0108] In some embodiments of this application, the imaging device 900 provided in this application further includes:
[0109] The preprocessing module is used to preprocess the first time-domain waveform, filter out interference waveforms, and obtain the second time-domain waveform.
[0110] Accordingly, the transformation module 902 is specifically used for:
[0111] Perform a Fourier transform on the second time-domain waveform to obtain the first frequency-domain waveform.
[0112] In some embodiments of this application, waveform preprocessing includes at least one of the following:
[0113] Spike filtering, DC filtering, and motion filtering.
[0114] The shooting device in this application embodiment can be an electronic device or a component of an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope.
[0115] The shooting device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems, and this application embodiment does not specifically limit it.
[0116] The imaging device provided in this application embodiment can achieve... Figures 1 to 8 The various processes implemented in the shooting method embodiment will not be described again here to avoid repetition.
[0117] Optionally, such as Figure 10 As shown, this application embodiment also provides an electronic device 1000, including a processor 1001 and a memory 1002. The memory 1002 stores a program or instructions that can run on the processor 1001. When the program or instructions are executed by the processor 1001, they implement the various steps of the shooting method embodiment provided in this application embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0118] Figure 11 These are schematic diagrams of the hardware structure of electronic devices according to some embodiments of this application.
[0119] The electronic device 1100 includes, but is not limited to, components such as: radio frequency unit 1101, network module 1102, audio output unit 1103, input unit 1104, sensor 1105, display unit 1106, user input unit 1107, interface unit 1108, memory 1109, and processor 1110.
[0120] Those skilled in the art will understand that the electronic device 1100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 11 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0121] The processor 1110 is configured to: acquire the time-domain signal of the light source of the shooting scene to obtain a first time-domain waveform of the shooting scene; perform a Fourier transform on the first time-domain waveform to obtain a first frequency-domain waveform; determine a reference frequency based on the first frequency-domain waveform; and, if only the first frequency is determined based on the reference frequency, capture an image using a first target exposure method; wherein the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency; and, if the first frequency and at least one second frequency are determined based on the reference frequency, capture an image using a second target exposure method; wherein the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy period of at least one second frequency.
[0122] In this embodiment, the time-domain signal of the light source in the shooting scene is acquired to obtain a first time-domain waveform of the shooting scene; a Fourier transform is performed on the first time-domain waveform to obtain a first frequency-domain waveform; a reference frequency is determined based on the first frequency-domain waveform; if only the first frequency is determined based on the reference frequency, an image is captured using a first target exposure method; wherein, the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency; if the first frequency and at least one second frequency are determined based on the reference frequency, an image is captured using a second target exposure method; wherein, the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy period of at least one second frequency. Thus, even if there are at least two light sources in the shooting scene, the scheme disclosed in this application can eliminate the flicker of at least two light sources, avoid stripes in the captured image, and improve image quality.
[0123] In some embodiments of this application, the processor 1110 is specifically used for:
[0124] At least two candidate frequencies are determined based on multiple extreme points in the first frequency domain waveform; a reference frequency is determined from the at least two candidate frequencies.
[0125] In some embodiments of this application, the processor 1110 is specifically used for:
[0126] If the amplitude of the first extreme point is greater than the amplitudes of the N points to the left and right of the first extreme point, or if the amplitude of the second extreme point is an integer multiple of 10 and the amplitudes of the second extreme point and the N points to the left and right satisfy the increasing or decreasing condition, then the first extreme point or the second extreme point is determined as a candidate frequency; where the first extreme point and the second extreme point are extreme points among multiple extreme points, and N is a positive integer.
[0127] In some embodiments of this application, the processor 1110 is specifically used for:
[0128] If the amplitude of the first candidate frequency is greater than twice the amplitude of the Mth point to the left and right of the first candidate frequency, and the first candidate frequency is the smallest frequency among a plurality of candidate frequencies with a harmonic relationship, the first candidate frequency is determined as the reference frequency; wherein, the first candidate frequency is any one of at least two candidate frequencies, and M is a positive integer.
[0129] In some embodiments of this application, the processor 1110 is also used for:
[0130] The amplitude of the candidate frequency that has a harmonic relationship with the reference frequency is superimposed on the amplitude of the reference frequency.
[0131] The amplitude of the candidate frequency that has a harmonic relationship with the reference frequency is set to 0 to obtain the second frequency domain waveform.
[0132] The frequency with the largest amplitude in the second frequency domain waveform is taken as the first frequency.
[0133] If there are other candidate frequencies besides the first frequency with non-zero amplitude in the second frequency domain waveform diagram, the other candidate frequencies with non-zero amplitude shall be used as the second frequency.
[0134] In some embodiments of this application, the processor 1110 is also used for:
[0135] The first time-domain waveform is preprocessed to filter out interference waveforms, resulting in the second time-domain waveform. The second time-domain waveform is then subjected to a Fourier transform to obtain the first frequency-domain waveform.
[0136] In some embodiments of this application, waveform preprocessing includes at least one of the following:
[0137] Spike filtering, DC filtering, and motion filtering.
[0138] It should be understood that, in this embodiment, the input unit 1104 may include a graphics processing unit (GPU) 11041 and a microphone 11042. The GPU 11041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1106 may include a display panel 11061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1107 includes at least one of a touch panel 11071 and other input devices 11072. The touch panel 11071 is also called a touch screen. The touch panel 11071 may include a touch detection device and a touch controller. Other input devices 11072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0139] The memory 1109 can be used to store software programs and various data. The memory 1109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1109 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0140] Processor 1110 may include one or more processing units; optionally, processor 1110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1110.
[0141] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the shooting method provided in this application and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0142] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0143] This application also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the shooting method provided in this application and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0144] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0145] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the shooting method embodiment provided in this application, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0146] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0147] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0148] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A shooting method, characterized in that, The method includes: Acquire the time-domain signal of the light source in the shooting scene to obtain the first time-domain waveform of the shooting scene; Perform a Fourier transform on the first time-domain waveform to obtain the first frequency-domain waveform; Determine the reference frequency based on the first frequency domain waveform diagram; When only a first frequency is determined based on the reference frequency, an image is captured using a first target exposure method; wherein, the first target exposure method includes: adjusting the exposure time to an integer multiple of the energy cycle of the first frequency; When a first frequency and at least one second frequency are determined based on the reference frequency, an image is captured using a second target exposure method; wherein the second target exposure method includes: adjusting the exposure time to an integer multiple of the energy period of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy period of the at least one second frequency.
2. The method according to claim 1, characterized in that, Determining the reference frequency based on the first frequency domain waveform includes: At least two candidate frequencies are determined based on multiple extreme points in the first frequency domain waveform diagram; The reference frequency is determined from the at least two alternative frequencies.
3. The method according to claim 2, characterized in that, The step of determining at least two candidate frequencies based on multiple extreme points in the first frequency domain waveform includes: If the amplitude of the first extreme point is greater than the amplitudes of the N points on either side of the first extreme point, or the frequency corresponding to the second extreme point is an integer multiple of 10, and the amplitudes of the second extreme point and the N points on either side satisfy an increasing or decreasing condition, then the frequency corresponding to the first extreme point or the frequency corresponding to the second extreme point is determined as the candidate frequency; wherein, the first extreme point and the second extreme point are extreme points among the plurality of extreme points, and N is a positive integer.
4. The method according to claim 2, characterized in that, Determining the reference frequency from the at least two candidate frequencies includes: If the amplitude of the first candidate frequency is greater than twice the amplitude of the Mth point to the left and right of the first candidate frequency, and the first candidate frequency is the smallest frequency among a plurality of candidate frequencies with a harmonic relationship, the first candidate frequency is determined as the reference frequency; wherein, the first candidate frequency is any one of the at least two candidate frequencies, and M is a positive integer.
5. The method according to claim 1, characterized in that, After determining the reference frequency based on the first frequency domain waveform, the method includes: The amplitudes of candidate frequencies that have a harmonic relationship with the reference frequency are superimposed on the amplitude of the reference frequency; The amplitude of the candidate frequencies that have a harmonic relationship with the reference frequency is set to 0 to obtain the second frequency domain waveform. The frequency with the largest amplitude in the second frequency domain waveform is taken as the first frequency; If there are other candidate frequencies besides the first frequency with non-zero amplitude in the second frequency domain waveform diagram, the other candidate frequencies shall be used as the second frequency.
6. The method according to any one of claims 1 to 5, characterized in that, Before performing a Fourier transform on the first time-domain waveform to obtain the first frequency-domain waveform, the method further includes: The first time-domain waveform is preprocessed to filter out interference waveforms, resulting in a second time-domain waveform. The step of performing a Fourier transform on the first time-domain waveform to obtain the first frequency-domain waveform includes: Perform a Fourier transform on the second time-domain waveform to obtain the first frequency-domain waveform.
7. The method according to claim 6, characterized in that, The waveform preprocessing includes at least one of the following: Spike filtering, DC filtering, and motion filtering.
8. A shooting device, characterized in that, The device includes: The acquisition module is used to acquire the time-domain signal of the light source of the shooting scene and obtain the first time-domain waveform of the shooting scene; The transformation module is used to perform a Fourier transform on the first time-domain waveform to obtain a first frequency-domain waveform. The module determines the reference frequency based on the first frequency domain waveform diagram; The imaging module is configured to capture an image using a first target exposure method when only a first frequency is determined based on the reference frequency; and to capture an image using a second target exposure method when both the first frequency and at least one second frequency are determined based on the reference frequency; wherein the first target exposure method includes adjusting the exposure time to an integer multiple of the energy cycle of the first frequency; and the second target exposure method includes adjusting the exposure time to an integer multiple of the energy cycle of the first frequency and adjusting the inter-frame interval time to an integer multiple of the energy cycle of the at least one second frequency.
9. The apparatus according to claim 8, characterized in that, The determining module is specifically used for: At least two candidate frequencies are determined based on multiple extreme points in the first frequency domain waveform diagram; The reference frequency is determined from the at least two alternative frequencies.
10. The apparatus according to claim 9, characterized in that, The determining module is specifically used for: If the amplitude of the first extreme point is greater than the amplitudes of the N points on either side of the first extreme point, or the frequency corresponding to the second extreme point is an integer multiple of 10, and the amplitudes of the second extreme point and the N points on either side satisfy an increasing or decreasing condition, then the frequency corresponding to the first extreme point or the frequency corresponding to the second extreme point is determined as the candidate frequency; wherein, the first extreme point and the second extreme point are extreme points among the plurality of extreme points, and N is a positive integer.
11. The apparatus according to claim 9, characterized in that, The determining module is specifically used for: If the amplitude of the first candidate frequency is greater than twice the amplitude of the Mth point to the left and right of the first candidate frequency, and the first candidate frequency is the smallest frequency among a plurality of candidate frequencies with a harmonic relationship, the first candidate frequency is determined as the reference frequency; wherein, the first candidate frequency is any one of the at least two candidate frequencies, and M is a positive integer.
12. The apparatus according to claim 8, characterized in that, The determining module is also used for: The amplitudes of candidate frequencies that have a harmonic relationship with the reference frequency are superimposed on the amplitude of the reference frequency; The amplitude of the candidate frequencies that have a harmonic relationship with the reference frequency is set to 0 to obtain the second frequency domain waveform. The frequency with the largest amplitude in the second frequency domain waveform is taken as the first frequency; If there are other candidate frequencies besides the first frequency with non-zero amplitude in the second frequency domain waveform diagram, the other candidate frequencies shall be used as the second frequency.
13. The apparatus according to any one of claims 8 to 12, characterized in that, The device further includes: The preprocessing module is used to perform waveform preprocessing on the first time-domain waveform diagram, filter out interference waveforms, and obtain the second time-domain waveform diagram. The transformation module is specifically used for: Perform a Fourier transform on the second time-domain waveform to obtain the first frequency-domain waveform.
14. The apparatus according to claim 13, characterized in that, The waveform preprocessing includes at least one of the following: Spike filtering, DC filtering, and motion filtering.
15. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the shooting method as described in any one of claims 1-7.