Shooting methods, electronic devices, and storage media
By acquiring and processing light source frequency data in the shooting device and adjusting the exposure time to eliminate banding, the problem of flicker sensors being unable to accurately detect light source frequency is solved, thus improving image quality and user experience.
Patent Information
- Application Number
- CN202410040086.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-01-09
AI Technical Summary
In existing technologies, flicker sensors cannot accurately detect the frequency of light sources in some scenarios, which makes it impossible to effectively eliminate banding in captured images and affects image quality.
By acquiring light source frequency data collected by the flicker sensor, the N light source frequencies with the largest amplitude are determined. Combined with the frequency threshold, it is determined whether the current shooting scene is the target scene. The camera's exposure time is adjusted according to the target frequency to filter out the flicker frequencies and eliminate banding.
It improves the accuracy and stability of light source frequency identification, effectively eliminates banding, and enhances image quality and user shooting experience.
Smart Images

Figure CN119255111B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a shooting method, electronic device, and storage medium. Background Technology
[0002] With the rapid development of smart devices, camera functionality has become an essential feature. Users' demands and experiences regarding camera (photos and / or videos) on smart devices are also constantly increasing.
[0003] When there are light sources of a certain frequency in the shooting environment, images captured by cameras of electronic devices such as cameras, mobile phones, and drones will exhibit banding. Banding refers to the presence of stripes of varying brightness in the captured image. Currently, the method to eliminate banding involves using a flicker sensor to identify the light source signal in the shooting environment, obtaining the frequency of the identified light source signal (i.e., the light source frequency), and then adjusting the exposure time according to the light source frequency. However, this method has limitations in some scenarios. For example, when the sampling frequency of the flicker sensor is low, or when the flicker sensor cannot detect or cannot accurately detect the light source frequency, it will not effectively eliminate banding. Summary of the Invention
[0004] This application provides a shooting method, electronic device, and storage medium that can effectively eliminate banding, improve image quality, and enhance the user's shooting experience.
[0005] In a first aspect, this application provides a shooting method applied to an electronic device, the electronic device including a flicker sensor and a camera, the method comprising: acquiring a first sequence of data collected by the flicker sensor in a current shooting scene; determining N light source frequencies with the largest amplitude based on the first sequence of data, where N is an integer greater than or equal to 2; determining whether the current shooting scene is a target scene based on a frequency threshold and the N light source frequencies; when the current shooting scene is a target scene, determining a target frequency among the N light source frequencies based on a first frequency value and a frequency threshold; assigning the frequency value of the target frequency as the first frequency value to obtain the flicker frequency; and adjusting the exposure time of the camera based on the flicker frequency.
[0006] This application's solution determines whether the current shooting scene is a target scene by using a frequency threshold and N light source frequencies. Since the target scene may contain light source frequencies that the flicker sensor cannot detect or cannot accurately detect, when the current shooting scene is the target scene, the target frequency is determined from the N light source frequencies based on a first frequency value and a frequency threshold. Specifically, the target frequency that is a multiple of the first frequency value is selected. The first frequency value is related to the light source frequencies in the target scene, and the target frequency is assigned as the first frequency value to obtain the flicker frequency. This flicker frequency allows for adjustment of the camera's exposure time, effectively eliminating banding.
[0007] When the dimming frequency and / or refresh rate of the subject reach a certain level, causing the flicker sensor to be unable to accurately and stably detect the light source frequency of the subject, the light source frequency of the subject (such as the target frequency) can be identified based on the light source frequency detected by the flicker sensor. This improves the accuracy and stability of identifying the light source frequency of the subject. Furthermore, the flicker frequency can be obtained based on the detected light source frequency of the subject. Adjusting the exposure time of the electronic device according to the flicker frequency is more conducive to eliminating banding, improving image quality, and enhancing the user's shooting experience.
[0008] In one possible implementation, the flicker frequency is obtained by assigning the target frequency value as the first frequency value. This includes: when the maximum target frequency with the largest amplitude among the target frequencies is the first frequency, the frequency value of the first frequency is assigned as the first frequency value to obtain the flicker frequency, where the first frequency is the frequency with the largest amplitude among the N light source frequencies.
[0009] In one possible implementation, assigning the target frequency value as the first frequency value to obtain the flashing frequency further includes: when the maximum target frequency is not the first frequency, determining whether the first frequency matches the standard AC frequency; if so, determining the first frequency value as the second or third frequency value to obtain the flashing frequency; if not, assigning the maximum target frequency value as the first frequency value to obtain the flashing frequency.
[0010] In one possible implementation, before assigning the frequency value of the first frequency to the first frequency value, the method further includes: inputting the frequencies of N light sources into a frequency multiplier to obtain a frequency after frequency multiplication; inputting the frequency after frequency multiplication into a mixer to obtain a frequency after frequency mixing; performing sidelobe processing on the first frequency obtained after frequency mixing and outputting the first frequency after sidelobe processing; when the maximum target frequency with the largest amplitude among the target frequencies is the first frequency, assigning the frequency value of the first frequency to the first frequency value includes: when the maximum target frequency with the largest amplitude among the target frequencies is the first frequency after sidelobe processing, assigning the frequency value of the first frequency after sidelobe processing to the first frequency value; the flicker frequency includes the assigned first frequency, or the assigned first frequency and the second frequency after frequency mixing, wherein the second frequency is the frequency with the second largest amplitude among the N light source frequencies.
[0011] In one possible implementation, before determining the frequency value of the first frequency as the second or third frequency value, the method further includes: inputting N light source frequencies into a frequency multiplier to obtain a frequency after frequency multiplication; inputting the frequency after frequency multiplication into a mixer to obtain a frequency after frequency mixing; performing sidelobe processing on the first frequency obtained after frequency mixing and outputting the first frequency after sidelobe processing; determining the frequency value of the first frequency as the second or third frequency value includes: determining the frequency value of the first frequency after sidelobe processing as the second or third frequency value; assigning the frequency value of the maximum target frequency as the first frequency value; the flicker frequency includes the assigned first frequency and the assigned maximum target frequency.
[0012] In one possible implementation, the method further includes: when the current shooting scene is not the target scene, determining whether the first frequency with the largest amplitude among the N light source frequencies matches the standard AC frequency; if so, determining the frequency value of the first frequency as the second frequency value or the third frequency value to obtain the flicker frequency; if not, when the frequency value of the first frequency is a multiple of the first frequency value, assigning the frequency value of the first frequency as the first frequency value to obtain the flicker frequency.
[0013] In one possible implementation, the first frequency value is less than the second frequency value, and the first frequency value is less than the third frequency value.
[0014] In one possible implementation, the first frequency value is 60Hz, the second frequency value is 100Hz, and the third frequency value is 120Hz.
[0015] In one possible implementation, determining the target frequency among N light source frequencies based on the first frequency value and the frequency threshold includes: selecting light source frequencies among the N light source frequencies whose frequency values are greater than or equal to the frequency threshold as candidate light source frequencies; and determining the light source frequencies among the candidate light source frequencies whose frequency values are 2*M times the first frequency value as the target frequency, where M is an integer greater than or equal to 1.
[0016] In one possible implementation, the method further includes: for each of the N light source frequencies, determining whether the frequency value of the light source frequency is greater than or equal to a frequency threshold; when there is a light source frequency among the N light source frequencies whose frequency value is greater than or equal to the frequency threshold, determining the current shooting scene as the target scene.
[0017] In one possible implementation, the frequency threshold is any value between 500 Hz and 4 kHz.
[0018] In one possible implementation, the target scenario includes a camera capturing a screen that is turned on, and the screen's dimming frequency or refresh rate is greater than or equal to 500Hz and less than or equal to 4kHz.
[0019] In one possible implementation, adjusting the camera's exposure time based on the flicker frequency includes: when the flicker frequency includes one frequency, adjusting the camera's exposure time based on the flicker frequency; when the flicker frequency includes two or more frequencies, performing frequency multiplication on the two or more frequencies to obtain a frequency multiplication flicker frequency, and adjusting the camera's exposure time based on the frequency multiplication flicker frequency.
[0020] Secondly, this application provides an electronic device including a processor and a memory, the processor and the memory being coupled together, the memory being used to store a computer program, and when the computer program is executed by the processor, causing the electronic device to perform any of the methods described above.
[0021] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform any of the methods described above. Attached Figure Description
[0022] Figures 1A to 1F This is a schematic diagram of an application scenario provided by an embodiment of this application.
[0023] Figures 2A to 2C This is a schematic diagram illustrating another application scenario provided by an embodiment of this application.
[0024] Figures 3A to 3C This is a schematic diagram illustrating another application scenario provided by an embodiment of this application.
[0025] Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.
[0026] Figure 5 This is a schematic diagram of an electronic device software architecture provided in an embodiment of this application.
[0027] Figure 6 This is a flowchart illustrating a shooting method provided in an embodiment of this application.
[0028] Figure 7A This is a schematic diagram of the raw data collected by the scintillation sensor provided in the embodiments of this application.
[0029] Figure 7B This is a schematic diagram of the spectrum obtained by frequency domain transformation of the original data, as provided in an embodiment of this application.
[0030] Figure 8 This is a flowchart illustrating a method for determining a target frequency, as provided in an embodiment of this application.
[0031] Figure 9 This is a flowchart illustrating a method for determining the flicker frequency provided in an embodiment of this application.
[0032] Figure 10 This is a flowchart illustrating a frequency processing method provided in an embodiment of this application.
[0033] Figure 11 This is a flowchart illustrating another shooting method provided in an embodiment of this application.
[0034] Figures 12A to 12F In order to be in Figures 1A to 1F A schematic diagram illustrating the effect of using the shooting method described in this application scenario.
[0035] Figures 13A to 13C In order to be in Figures 1A to 1F A schematic diagram illustrating the effect of using the shooting method described in this application scenario. Detailed Implementation
[0036] 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 limitation, 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.
[0037] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0038] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0039] Where there is no conflict, the following embodiments and features can be combined with each other.
[0040] This application can be applied to electronic devices that include image acquisition devices (such as cameras) and flicker sensors. These electronic devices can be mobile phones, tablets, desktop computers, laptops, handheld computers, notebook computers, Super-Mobile Personal Computers (SMPCs), Personal Digital Assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, and smart home devices. They can also be professional shooting equipment such as digital cameras, SLR / mirrorless cameras, action cameras, gimbal cameras, and drones. This application does not impose any special limitations on the specific type of electronic device.
[0041] The subjects photographed by electronic devices include, but are not limited to, devices with displays such as large-screen devices, electronic billboards, mobile phones, tablets, and laptops. This application embodiment does not impose any special restrictions on the specific type of the subject photographed.
[0042] The large-screen devices can include large-screen TVs, airport displays, high-speed rail displays, and other similar equipment. Airport displays include, but are not limited to, flight information displays that provide information such as flight schedules, flight status, and gate locations. High-speed rail displays include, but are not limited to, originating train displays that provide information such as destination and departure time, as well as ticket information displays that provide information such as train number, departure time, and platform.
[0043] Electronic billboards can be displays projected onto building facades, airports, and high-speed rail stations.
[0044] In some embodiments, the dimming frequency of the display screen of the subject is higher than 500Hz.
[0045] This application applies to scenarios where a certain frequency of light source exists during shooting, causing banding phenomena in the preview screen or captured image or video. For example, when a certain frequency of light source exists in the shooting scene, and the camera is opened to take a picture or record video, the real-time preview screen displayed on the electronic device's screen may exhibit uneven brightness, or scrolling or fixed horizontal stripes of light and dark may appear in the preview screen. Another example is when the camera button on a mobile phone is triggered, banded stripes appear in the image captured or the video recorded by the phone, where the camera button includes, but is not limited to, controls for indicating whether to take a picture (such as...). Figure 1B The "Photo Mode" control 327D), and controls for indicating video recording (such as...) Figure 1D Recording start control 131), controls for indicating snapshot capture (such as...) Figure 1E (The capture control 142). Banding is the presence of stripes of varying brightness in the preview screen, captured image, or recorded video. Because the positions of the bright and dark stripes may change in different images, scrolling bright and dark stripes may appear in the preview screen or video recording of an electronic device, which is the banding phenomenon.
[0046] The following example uses a mobile phone as the electronic device and a large-screen device as the subject to illustrate the banding phenomenon in the shooting scenario.
[0047] In the shooting scenario, the display screen of the subject (large-screen device) shows corresponding information. The user can point the camera of the electronic device at the display screen of the subject to take a picture of it. The user can instruct the electronic device 100 to open the camera application to take a picture of the display screen of the large-screen device by touching specific controls on the display screen of the electronic device 100, pressing specific physical buttons or button combinations, inputting voice, or using air gestures.
[0048] Figure 1A This demonstrates one way a user can open the camera application. The electronic device 100 can display a desktop 110, which shows multiple application icons, such as the camera application icon 111 and the gallery application icon 112.
[0049] like Figure 1A As shown, electronic device 100 receives input (e.g., a click) from a user on camera application icon 111, and in response to this input, electronic device 100 can display as shown in the image. Figure 1B The shooting interface shown is 120.
[0050] The shooting interface 120 may include a display control 121, a shooting control 122, a camera switching control 123, a preview frame, and one or more shooting mode controls (e.g., "Night Scene Mode" control 327A, "Portrait Photography Mode" control 327B, "Large Aperture Mode" control 327C, "Photo Mode" control 327D, "Video Mode" control 327E, "Pro Mode" control 327F, and more mode controls 327G).
[0051] The echo control 121 can be used to display the captured image. The shooting control 122 can be used to trigger the saving of the image captured by the camera. The camera switching control 123 can be used to switch the shooting camera. The shooting mode control can be used to trigger the image processing flow corresponding to the shooting mode. For example, the "night scene mode" control 327A can be used to trigger the increase of brightness and color richness in the captured image.
[0052] The camera of electronic device 100 captures images from the large-screen device. The preview box is used to display the image stream currently captured by the camera of electronic device 100. The preview box displays a preview screen 124, which is the image frame in the image stream of the large-screen device currently captured by the camera of electronic device 100.
[0053] like Figure 1B As shown, the image of the large-screen device displayed in the preview screen on the shooting interface 120 has bright and dark stripes. In some embodiments, scrolling bright and dark stripes appear in the preview screen on the shooting interface 120. The shooting interface 120 indicates that the shooting mode currently selected by the user is "photo mode". The electronic device 100 receives input from the user on the "photo mode" control 327D, and in response to the input, the electronic device 100 takes a picture, thereby acquiring the photo corresponding to the large-screen device (e.g., ...). Figure 3C (As shown). The electronic device 100 displays the following after taking a picture: Figure 1C The shooting interface shown is 120.
[0054] like Figure 1C As shown, the electronic device 100 receives user input on the "recording mode" control 327E, and in response to this input, the electronic device 100 switches from "photo mode" to "recording mode". The electronic device 100 can display as shown below. Figure 1D The video preview interface 130 is shown. The difference between the video preview interface 130 and the shooting interface 120 is that the video preview interface 130 replaces the shooting control 122 with the recording start control 131. The preview screen 132 displayed on the preview box of the video preview interface 130 is the image frame in the image stream currently captured by the camera of the electronic device 100.
[0055] like Figure 1DAs shown, the image of the large-screen device displayed on the preview screen 132 of the video preview interface 130 has bright and dark stripes. In some embodiments, scrolling bright and dark stripes appear in the preview screen on the video preview interface 130. The electronic device 100 receives input from the user on the recording start control 131, and in response to the input, the electronic device 100 starts recording video and displays as shown. Figure 1E The video recording interface shown is 140.
[0056] Figure 1E The recording interface 140 can display a recording end control 141, a snapshot control 142, recording time information 143, and a recording screen 144. The recording end control 141 can be used to trigger the electronic device 100 to stop recording the original video. The snapshot control 142 can be used in response to user input to trigger the electronic device 100 to save the first frame of the original video captured by its camera at the time of input as an image, thus capturing an image during the recording process. The recording time information 143 indicates that 1 second of video is currently being recorded. The recording interface 140 is used to display the image stream from the large-screen device captured in real time by the camera of the electronic device 100. The recording screen 144 is used to display image frames from the captured image stream from the large-screen device.
[0057] like Figure 1E As shown, the image of the large-screen device displayed on the recording screen 144 of the recording interface 140 has bright and dark stripes. In some embodiments, scrolling bright and dark stripes appear in the recording screen 144 of the recording interface 140. The electronic device 100 receives input from the user acting on the capture control 142, and in response to the input, the electronic device 100 captures an image of the large-screen device (such as...). Figure 3B (As shown). The electronic device 100 displays the video recording interface 140 after capturing the image.
[0058] like Figure 1F As shown, three seconds after recording begins, the electronic device 100 receives input from the user onto the recording end control 141, and in response, the electronic device 100 ends recording, obtaining the video from the large-screen device (e.g., ...). Figure 3A (As shown).
[0059] After shooting, users can view the captured images and / or videos.
[0060] like Figure 2A As shown, the electronic device 100 can display a desktop 110. A textual description of this desktop 110 can be found in the preceding text. Figure 1A The embodiments shown are not described in detail here.
[0061] Electronic device 100 receives input from a user acting on the gallery application icon 112, and in response to the input, electronic device 100 can display, for example... Figure 2B The image gallery application interface 210 is shown.
[0062] like Figure 2B As shown, the gallery application interface 210 can display one or more albums (e.g., camera album 211, video album, all photos album, etc.). The camera album 211 includes images and videos captured by the electronic device 100. The electronic device 100 can display a gallery menu 212 at the bottom of the gallery application interface 210. The gallery menu 212 includes corresponding controls, such as photo controls, album controls, time controls, and discovery controls.
[0063] Electronic device 100 can receive user input to camera album 211, and in response to the input, electronic device 100 can display, for example... Figure 2C The camera interface 310 is shown. Camera interface 310 includes one or more thumbnails of photos and one or more videos. Option 311 corresponds to... Figure 1F The video captured on the large-screen device, option 311 includes a thumbnail of the first image frame in the video and a duration indicator 312. Option 313 corresponds to... Figure 1E The image captured from the large-screen device. (Option 314 corresponds to this.) Figure 1B Images of the large-screen device obtained by taking a picture.
[0064] Electronic device 100 can receive user input on option 311 and, in response to that input, display as shown below. Figure 3A The video interface 410 is shown. The video interface 410 includes a video display area 411 and a progress bar 412. When the video display area 411 receives user input (e.g., a click), the electronic device 100 can play or pause the original video. The progress bar 412 indicates that the video is playing, currently at the 1st second, and the total video duration is 3 seconds. Figure 3A As shown, the video displayed on the video interface 410 has bright and dark stripes. In some embodiments, the video displayed on the video interface 410 shows scrolling bright and dark stripes.
[0065] Electronic device 100 can receive user input on option 312 and, in response to that input, display as shown below. Figure 3B The image interface 510 is shown. Image interface 510 includes a captured image display area 511 and a menu 512. Menu 512 may include a share button, a favorite button, an edit button, a delete button, and a more button. Figure 3B As shown, the images of the large-screen device displayed in the image capture display area 511 have bright and dark stripes.
[0066] Electronic device 100 can receive user input on option 313 and, in response to that input, display as follows: Figure 3CThe graphical interface 610 is shown. Graphical interface 610 includes a captured image display area 611 and a menu 612. The contents of menu 612 are similar to those of menu 512 and will not be repeated here. Figure 3C As shown, the image of the large-screen device displayed in the snapshot image display area 611 has bright and dark stripes.
[0067] Currently, scintillation sensors can identify the frequency of light sources in the shooting environment and eliminate banding by adjusting the exposure time to an integer multiple of the light source frequency period.
[0068] In implementing the embodiments of this application, the inventors discovered that when the flicker sensor cannot detect or accurately detect the light source frequency, it cannot effectively eliminate the banding phenomenon. It is understood that the light source frequency of the photographed object is related to its dimming frequency and / or refresh rate. Specifically, when the dimming frequency and / or refresh rate of the photographed object reaches a certain level, the flicker sensor collects the light source signal of the photographed object. Due to the low sampling frequency of the flicker sensor, it cannot detect (or accurately detect) the light source frequency of the light source signal, resulting in the inability to effectively eliminate the banding phenomenon.
[0069] Therefore, the shooting method and electronic device provided in this application can determine the frequency of the light source causing flicker in the current shooting scene based on the detected light source frequency, obtain the flicker frequency based on the flickering light source frequency, and then adjust the exposure time of the electronic device according to the flicker frequency, effectively achieving the effect of eliminating banding. In particular, for situations where the dimming frequency and / or refresh rate of the subject reaches a certain level, causing the flicker sensor to be unable to accurately and stably detect the light source frequency of the subject, the light source frequency of the subject can be identified based on the light source frequency detected by the flicker sensor, improving the accuracy and stability of identifying the light source frequency of the subject. Furthermore, obtaining the flicker frequency based on the detected light source frequency of the subject and adjusting the exposure time of the electronic device according to the flicker frequency is more conducive to eliminating banding, improving image quality, and enhancing the user's shooting experience.
[0070] The shooting method described in this application can be applied to scenarios where an electronic device takes photos or videos in different shooting modes after activating the camera application, as well as scenarios where other applications call the camera application to take photos. Scenarios where other applications call the camera application to take photos can include scenarios where the photo / video function is invoked.
[0071] Specifically, during the process of taking photos or recording videos, the electronic device displays a preview image in real time, which can eliminate banding phenomena appearing in the preview image, such as eliminating... Figure 1B Preview screen 124 and Figure 1DThe preview screen 132 displays the image of the large-screen device with bright and dark stripes. When the electronic device's camera control is triggered, the electronic device can capture a clear image to reduce the brightness difference between bright and dark stripes in the image when banding occurs, such as eliminating... Figure 1B The photos taken Figure 3C Bright and dark stripes in an image. When the electronic device's capture control is triggered, the device can capture a clear image to mitigate the brightness difference between bright and dark stripes in the captured image when banding occurs. For example, it can eliminate... Figure 1E The photos taken Figure 3B Bright and dark stripes in an image can also be eliminated in captured images. When the recording start control of an electronic device is triggered, the device can record clear video, thus reducing the brightness difference between bright and dark stripes in the video when banding occurs. This can be achieved by eliminating... Figure 1F The photos taken Figure 3A The light and dark stripes in the video.
[0072] Please see Figure 4 The present application provides an example of the hardware structure of an electronic device 100.
[0073] like Figure 4 As shown, the electronic device 100 may include: a processor 101, an external memory interface 102, an internal memory 103, a display screen 104, an antenna 1, an antenna 2, a mobile communication module 105, a wireless communication module 106, a sensor module 107, a camera 108, etc. The sensor module 107 includes, but is not limited to, a flash sensor 107A.
[0074] Processor 101 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. The different processing units may be independent devices or integrated into one or more processors.
[0075] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0076] The processor 101 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 101 is a cache memory. This memory can store instructions or data that the processor 101 has just used or that are used repeatedly. If the processor 101 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 101, and thus improves the efficiency of the system.
[0077] In some embodiments, the processor 101 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, and / or a universal serial bus (USB) interface, etc.
[0078] Electronic device 100 implements display functions through a GPU, display screen 104, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 104 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 101 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0079] Display screen 104 is used to display images, videos, etc. Display screen 104 includes a display panel. The display panel can be a Liquid Crystal Display (LCD). The display panel can also be manufactured using Organic Light-Emitting Diode (OLED), Active-Matrix Organic Light-Emitting Diode (AMOLED), Flexible Light-Emitting Diode (FLED), Quantum Dot Light-Emitting Diodes (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 104, where N is a positive integer greater than 1.
[0080] Display screen 104 can be used for display Figures 1A to 1F , Figures 2A to 2C as well as Figures 3A to 3C The interface shown.
[0081] Electronic device 130 can perform shooting functions through ISP, camera 108, video codec, GPU, display 104 and application processor.
[0082] The ISP (Image Signal Processor) is used to process data fed back from the camera 108. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set within the camera 108.
[0083] Camera 108 is used to capture images or videos. It can be activated via application commands to perform shooting functions, such as capturing images of any scene or recording videos of any scene. Camera 108 may include components such as an imaging lens 108A, a filter (not shown), and an image sensor 108B. Light emitted or reflected by objects enters lens 108A, passes through the filter, and finally converges onto image sensor 108B. Lens 108 is used to converge and image the light emitted or reflected by all objects in the shooting scene (i.e., all subjects). The filter is mainly used to filter out excess light waves (such as infrared waves other than visible light) in the light. Image sensor 108B is used to perform photoelectric conversion on the received light signal, converting it into an electrical signal, and then transmitting the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, and other formats.
[0084] The image sensor 108B can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. For photosensitive sensors such as CCD and CMOS, tiny photosensitive materials, i.e., pixels, are embedded on their photosensitive surfaces. The photosensitive sensor converts the light images on each pixel on its photosensitive surface into electrical signals.
[0085] In some embodiments, the electronic device 100 may include one or N cameras 108, where N is a positive integer greater than 1.
[0086] As in Figures 1A to 1FIn the scene, images and / or videos are acquired in real time through camera 108.
[0087] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0088] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0089] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0090] The external storage interface 102 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 101 through the external storage interface 102 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0091] Internal memory 103 can be used to store executable program code, which includes instructions. Processor 101 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 103. Internal memory 103 may include a program storage area and a data storage area.
[0092] The flicker sensor 107A can be used to acquire light source signals in the shooting scene and detect the period of brightness change of ambient light, so that the electronic device can adjust the exposure time of the image sensor based on the period of brightness change of ambient light. In some embodiments, the electronic device samples the frequency value of the light source signal in the shooting scene through the flicker sensor 107A.
[0093] Similar to the aforementioned photosensitive sensors, flicker sensors also convert the light images on each pixel of their photosensitive surface into electrical signals. The difference from photosensitive sensors includes that flicker sensors have only one pixel and no filter; therefore, the electrical signal output by a flicker sensor is simply the electrical signal converted from the light image of that single pixel. In other words, the electrical signal output by a flicker sensor can be used to represent the current ambient brightness; that is, the electrical signal output by the flicker sensor can be considered the current ambient brightness. After the flicker sensor is activated, it can sense the various light source signals in the current shooting scene and convert the light images on each pixel of its photosensitive surface into electrical signals.
[0094] It should be understood that the location of the flicker sensor 107A is not specifically limited in the embodiments of this application. For example, the flicker sensor 107A can be integrated into the camera 108. Or, the flicker sensor 107A can be set independently.
[0095] It should also be understood that the embodiments described in this application are only exemplified by a flicker sensor, and the embodiments of this application are not limited thereto. In fact, the flicker sensor can also be replaced by other devices that have the function of a flicker sensor.
[0096] It should also be understood that the term "flicker sensor" is used to describe the device in this application, but the application is not limited to this. In fact, flicker sensor can also have other names, such as anti-flicker sensor.
[0097] In some embodiments, the electronic device 100 may also include other sensors, such as a gyroscope sensor, an accelerometer sensor, etc.
[0098] In some embodiments, the electronic device 100 may further include an audio module, a speaker, a receiver, a microphone, and a headphone jack, through which audio functions are implemented, such as audio recording during video recording.
[0099] Understandable. Figure 4 The electronic device 100 shown is merely an example. The electronic device 100 can have more than... Figure 4 The more or fewer components shown can be combined into two or more components, or they can have different component configurations. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0100] Please see Figure 5 The software architecture of the electronic device provided in the embodiments of this application is described by way of example.
[0101] like Figure 5 As shown, a layered architecture divides the operating system of an electronic device into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. For example, the operating system can be divided into five layers, from top to bottom: the application layer, the application framework layer, the hardware abstraction layer, the kernel layer, and the hardware layer.
[0102] The application layer can include a series of application packages. Application packages can include cameras, photo galleries, etc.
[0103] The application framework layer provides an Application Programming Interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0104] For example, the application framework layer may include a camera access interface and a gallery access interface, wherein the camera access interface may include camera management and camera devices. The camera access interface is used to provide application programming interfaces and a programming framework for camera applications. The gallery access interface is used to provide application programming interfaces and a programming framework for gallery applications.
[0105] The Hardware Abstraction Layer (HAL) is an interface layer located between the operating system kernel and upper-level software. Its purpose is to abstract hardware and provide a virtual hardware platform for the operating system. The HAL is an abstract interface for device kernel drivers, used to provide application programming interfaces (APIs) for accessing the underlying devices to higher-level Java API frameworks. The HAL contains multiple library modules, such as the Camera Hardware Abstraction Layer (Camera HAL), Display, Bluetooth, and Audio. Each library module implements an interface for a specific type of hardware component. When the system framework layer API requests access to the portable device's hardware, the operating system loads the library module for that hardware component.
[0106] In this embodiment, the hardware abstraction layer may include a camera algorithm library and a camera hardware abstraction layer. The camera hardware abstraction layer includes multiple camera devices. The camera algorithm library includes a flicker frequency output module and an autoexposure (AE) module.
[0107] The blink frequency output module is used to execute the shooting method provided in the embodiments of this application to determine the blink frequency, and output the determined blink frequency to the AE module.
[0108] The AE module can be used to automatically adjust exposure parameters. The AE module automatically adjusts exposure parameters based on the flicker frequency, including but not limited to: flicker sensor gain and shutter speed (or exposure time).
[0109] The basic principle behind automatic exposure in an After Effects (AE) module includes adjusting exposure and gain based on the current image brightness to stabilize the image brightness within a suitable range. Specifically, the AE module eliminates bright and dark stripes in the image by adjusting the exposure time to an integer multiple of the flash frequency period.
[0110] It is understandable that if the exposure time is an integer multiple of the flicker frequency period, the image displayed by the electronic device will not show bright and dark stripes. If the exposure time is not an integer multiple of the flicker frequency period, the image displayed by the electronic device will show bright and dark stripes. Since the positions of the bright and dark stripes may change in different images, scrolling bright and dark stripes, i.e., banding, may appear in the preview screen or the recorded image of the electronic device.
[0111] In this application, exposure time refers to the time required for an electronic device to expose one row of pixels in a frame of an image. Generally, the exposure time for different rows of pixels in the same frame of an image is the same.
[0112] It is understood that the line period can be determined by the sensor's capabilities. Different sensors may have different line periods, and therefore different electronic devices may also have different line periods. This application does not limit the value of the line period described above.
[0113] In some embodiments, the flicker frequency output module and / or the automatic exposure module may be arranged in the camera hardware abstraction layer.
[0114] The driver layer is used to drive hardware resources. The driver layer can include multiple driver modules. As shown in Figure 3, the driver layer includes camera device drivers, digital signal processor drivers, and graphics processor drivers, etc.
[0115] The hardware layer includes sensors, image signal processors, digital signal processors, and graphics processors. The sensors include multiple sensors, a Time-of-Flight (TOF) camera, a multispectral sensor, and a scintillation sensor.
[0116] The following section describes the software modules and interactions between them involved in the shooting method in this application embodiment, in conjunction with the aforementioned hardware and system structures.
[0117] Step 1: In response to a user opening the camera application or another application invoking the camera application, the camera application at the application layer can send a shooting request to the camera access interface at the application framework layer. The shooting request may include parameters such as the camera identifier (ID) corresponding to the current shooting scene, the frame rate range (including the maximum and minimum frame rates), and the shooting mode.
[0118] Step 2: The camera access interface can directly transmit shooting requests to the camera HAL in the HAL layer.
[0119] Step 3: After receiving the shooting request, the camera HAL can send parameters such as the camera ID corresponding to the current shooting scene to the camera driver.
[0120] Step 4: The camera driver can determine the sensitivity of the current camera (i.e., the camera indicated by the camera ID) based on parameters such as the camera ID corresponding to the current shooting scene, and can send the sensitivity to the camera HAL. The camera driver can then open the corresponding camera based on the camera ID corresponding to the current shooting scene. For example, if the first camera is opened, image sensor 1 will be activated.
[0121] Step 5: The activated camera can collect image data through the image sensor and report the image data to the camera HAL through the camera device driver so that the camera HAL can obtain the brightness statistics of the image data.
[0122] Step 6: The camera HAL can also acquire the light source frequency collected by the scintillator sensor.
[0123] It's understandable that the flicker sensor can be activated after the camera is turned on. The flicker sensor continuously collects the light source frequency and reports it to its corresponding driver, which in turn continuously reports the light source frequency to the camera's HAL (Hyperlight Algorithm). In this way, the camera's HAL can acquire information such as the light source frequency. The camera's HAL can then send these parameters, including the light source frequency, to the flicker frequency output module in the camera's algorithm library.
[0124] Step 7: The AE module determines the flashing frequency based on the light source frequency collected by the flashing sensor and outputs the determined flashing frequency to the AE module.
[0125] Step 8: In the AE module, the camera exposure can be determined based on the flicker frequency, and thus the exposure parameters (exposure time and gain) can be determined. Then, the exposure time and gain can be sent to the camera device driver so that the camera driver can configure the exposure time and gain for the camera.
[0126] The following describes a shooting method provided by an embodiment of this application, using flowcharts and functional module diagrams.
[0127] It should be noted that the execution order of multiple steps in the methods or flowcharts disclosed in the embodiments of this application can be interchanged, and some steps can also be deleted.
[0128] Please see Figure 6 This application provides an exemplary shooting method, which is applied to an electronic device. The electronic device may include a camera and a flash sensor, and may include steps S601 to S609.
[0129] Step S601: Obtain the first sequence of data collected by the scintillator sensor in the current shooting scene.
[0130] In this embodiment, the electronic device can activate a flicker sensor in response to user input. The flicker sensor collects light source signals from the current shooting scene to obtain a first sequence of data for the current shooting scene.
[0131] Specifically, after the scintillation sensor is activated, it samples the signals of each light source in the current shooting scene and outputs the time of each sample and the corresponding electrical signal. It can be understood that the scintillation sensor outputs a first sequence of data, which is the time-domain signal of each light source signal in the current shooting scene. This time-domain signal indicates the ambient brightness and the time of each sample. Therefore, the first sequence of data is a one-dimensional time series.
[0132] It is understood that the sampling frequency of the flicker sensor can be set according to actual needs, and this application does not impose any restrictions on it. For example, the sampling frequency of the flicker sensor is 2kHz, that is, the flicker sensor samples once every 0.5 milliseconds (ms).
[0133] In this application embodiment, the electronic device activates the flashing sensor in response to user input, including but not limited to the following situations:
[0134] In scenario one, the electronic device responds to user input by activating its camera or video recording function and triggering the flash sensor. For example, the electronic device may activate its camera or video recording function in response to user input to the camera application or the triggering of the shutter button, thus activating the camera and the flash sensor.
[0135] Scenario 2: The electronic device activates the flicker cancellation function in response to user input. In response to activating the flicker cancellation function, the flicker sensor is activated. For example, if an flicker cancellation function is provided in the electronic device, the device will activate the flicker sensor in response to the user activating the flicker cancellation function.
[0136] In the current shooting scene, the number of lighting devices providing light source signals can be greater than or equal to one. Lighting devices include, but are not limited to, the subject mentioned above. In the current shooting scene, if the subject provides the light source signal, the light source signal collected by the flicker sensor can come from the display screen that is turned on by the subject; that is, the light source frequency of the collected light source signal can be related to the dimming frequency or refresh rate of the subject's display screen.
[0137] In some embodiments, when the subject or other lighting equipment is powered by AC power at a frequency of 50Hz or 60Hz, the brightness of the subject or other lighting equipment changes periodically, exhibiting a rapid flickering state.
[0138] It is understood that when the lighting device is connected to 50Hz AC power, the waveform of the light source signal converted by the device is a periodically changing envelope with a frequency of 100Hz. When the lighting device is connected to 60Hz AC power, the waveform of the light source signal converted by the device is a periodically changing envelope with a frequency of 120Hz. A flicker sensor can generally detect light source frequencies of 100Hz and 120Hz. However, when the dimming frequency or refresh rate of the subject reaches a certain level, the flicker sensor may not be able to detect or accurately detect the light source frequency of the subject. It is understood that step S601 can obtain the light source signal of the current shooting scene through a flicker sensor or other similar sensors. When such other sensors cannot accurately and stably identify the light source signal of the subject, the banding phenomenon can also be eliminated through the shooting method provided in this application.
[0139] Step S601 continues until a detection end command is detected. For example, before the electronic device is detected to have exited the shooting or recording function, or before the flicker elimination function is detected to be turned off, the flicker sensor continuously acquires the light source signal of the current shooting scene, and the electronic device continuously acquires the first sequence of data acquired by the flicker sensor in the current shooting scene. Until the electronic device is detected to have exited the shooting or recording function, or before the flicker elimination function is detected to be turned off, the flicker sensor is turned off, and the acquisition of the first sequence of data acquired by the flicker sensor stops.
[0140] Step S602: Based on the first sequence data, determine the N light source frequencies with the largest amplitudes, where N is an integer greater than or equal to 2.
[0141] In this embodiment, the electronic device converts the first sequence of data from the time domain to the frequency domain to obtain the light source frequencies corresponding to each light source signal in the current shooting scene.
[0142] Specifically, the electronic device performs a Fourier transform or a Fast Fourier Transform on the first sequence of data, converting the first sequence of data from the time domain to the frequency domain, thus obtaining a spectrum, which is denoted as Spectrum1 (the first spectrum). It can be understood that the horizontal axis of the spectrum represents frequency, and the vertical axis represents amplitude (signal amplitude intensity). Amplitude can represent brightness (i.e., the ambient brightness of the current shooting scene). According to the Fourier principle, any continuously measured time series or signal can be represented as an infinite superposition of sine wave signals of different frequencies. In the embodiments provided in this application, after converting the time series of ambient brightness to the frequency domain, the resulting spectrum (Spectrum1) consists of multiple sine waves. The N light source frequencies with the largest amplitudes are determined from the multiple sine waves in the first spectrum. For example, when N is 2, the two light source frequencies with the largest and second largest amplitudes in the first spectrum can be determined. When N is 4, four light source frequencies can be determined in the first spectrum in descending order of amplitude, such as the first frequency, the second frequency, the third frequency, and the fourth frequency, where the amplitudes of the first to fourth frequencies are ordered from largest to smallest.
[0143] It is understood that the first sequence data can also be converted from the time domain to the frequency domain through calculation methods such as discrete Fourier transform, but this application does not specifically limit this.
[0144] Step S603: Determine whether the current shooting scene is the target scene based on the frequency threshold and the frequencies of N light sources.
[0145] The frequency threshold is related to the frequency of the light source that the flicker sensor cannot detect (or cannot accurately detect). The frequency threshold can be any value between 500Hz and 4kHz, such as 510Hz, 530Hz, or 550Hz. The frequency threshold can be set according to actual conditions, and this application embodiment does not specifically limit it.
[0146] Among them, the target scene can indicate that there is a light source signal in the current shooting scene where the flicker sensor cannot accurately detect the light source frequency.
[0147] In some embodiments, the target scene can be a scene where an electronic device is capturing a picture of a display screen of the subject that is turned on. Specifically, the target scene includes a camera capturing a picture of a display screen of the subject that is turned on, and the dimming frequency or refresh rate of the display screen is greater than or equal to 500Hz and less than or equal to 4kHz. Based on the dimming frequency or refresh rate of the display screen being greater than or equal to 500Hz and less than or equal to 4kHz, the flicker sensor cannot detect (or cannot accurately detect) the light source frequency of the light source signal of the display screen.
[0148] Specifically, for each of the N light source frequencies determined in step S602, it is determined whether the frequency value of that light source frequency is greater than or equal to a frequency threshold. When any one or more of the N light source frequencies have a frequency value greater than or equal to the frequency threshold, the current shooting scene is determined to be the target scene. When the frequency values of all N light source frequencies are less than the frequency threshold, the current shooting scene is determined not to be the target scene.
[0149] If the result of step S603 is yes, proceed to steps S604 and S605. If the result of step S603 is no, proceed to step S606.
[0150] Step S604: When the current shooting scene is the target scene, determine the target frequency among the N light source frequencies based on the first frequency value and the frequency threshold.
[0151] In this embodiment, the relationship between the first frequency value, the frequency threshold, and the target frequency is as follows: the target frequency is a multiple of the first frequency value, and the target frequency is greater than or equal to the frequency threshold. The light source frequency of the target scene determined based on the frequency threshold is related to the first frequency value, and the frequency of most light source signals in the target scene is a multiple of the first frequency value. In other words, when there is a light source signal in the shooting scene whose frequency is a multiple of the first frequency value, the shooting scene can be determined as the target scene.
[0152] The first frequency value of the embodiments of this application is described in detail below.
[0153] In implementing the embodiments of this application, the inventors discovered that in the target scene, the flicker sensor of the electronic device cannot detect (or cannot accurately detect) the light source frequency of the light source signal, and thus cannot effectively eliminate the banding phenomenon. Specifically, after performing a Matrix Laboratory (MATLAB) simulation on the light source signal in the target scene, the inventors observed that the light source signal in the target scene contains multiple frequency signals, and found that the frequency of most of the light source signals in the target scene is a multiple of the first frequency value.
[0154] For example, the light source signal in the target scene is collected to obtain... Figure 7A The original data shown. Figure 7A The original data shown is obtained by performing a Fast Fourier Transform (FFT). Figure 7B The spectrum shown. Figure 7B Therefore, the frequency value of frequency A is approximately 960Hz. Since 960Hz is a multiple of 60Hz, the first frequency value is 60Hz.
[0155] Please see Figure 8Step S604 may specifically include the following steps:
[0156] Step S801: Select the light source frequencies whose frequency values are greater than or equal to the frequency threshold from among the N light source frequencies as candidate light source frequencies.
[0157] In other words, the candidate light source frequency is the light source frequency with a frequency value greater than or equal to 530Hz among N light source frequencies.
[0158] Step S802: Determine the target frequency as the light source frequency whose frequency value is 2*M times the first frequency value among the candidate light source frequencies, where M is an integer greater than or equal to 1.
[0159] For example, taking a frequency threshold of 530Hz, a first frequency value of 60Hz, and N of 4 as an example. The four light source frequencies determined in step S602 are A, B, C, and D, where the frequency values of A, B, C, and D are 960Hz, 540Hz, 120Hz, and 570Hz, respectively. Candidate light source frequencies with a frequency value greater than or equal to 530Hz are selected from these four light source frequencies A, B, C, and D, and are designated as light source frequencies A, B, and D. From the candidate light source frequencies A, B, and D, a light source frequency with a frequency value 2*M times the first frequency value is selected as light source frequency A, and light source frequency A is the target frequency.
[0160] In some other embodiments, step S604 can be implemented as follows: selecting the light source frequency whose frequency value is 2*M times the first frequency value from among the N light source frequencies as the candidate frequency, and then selecting the light source frequency whose frequency value is greater than or equal to the frequency threshold from among the candidate frequencies as the target frequency.
[0161] Step S605: Assign the target frequency value to the first frequency value to obtain the flashing frequency.
[0162] If the target frequency determined in step S604 is greater than or equal to the frequency threshold, then the target frequency can be considered to be a frequency that the scintillation sensor cannot detect or cannot detect accurately. Furthermore, since the target frequency is a multiple of the first frequency value, the target frequency can be assigned the first frequency value.
[0163] In this embodiment, a unique identifier for the frequency is determined, and then the frequency value is assigned a corresponding numerical value based on the unique identifier. The unique identifier for the frequency includes, but is not limited to, the frequency's location. Specifically, a unique identifier for the target frequency is determined, and then the target frequency value is assigned a first frequency value based on the unique identifier. Therefore, the flashing frequency includes the assigned target frequency.
[0164] In the target scene, light source frequencies greater than or equal to a frequency threshold are considered high frequencies, while those less than the threshold are considered low frequencies. In this scenario, if the dimming frequency or refresh rate of the subject's display screen reaches a certain level, the light source signals provided by the screen will all be high frequencies. Therefore, the flicker sensor cannot detect these high-frequency signals. For example, if the subject's light source frequency is 960Hz, the flicker sensor may not be able to accurately detect it. In this case, the shooting method of this application can identify this 960Hz frequency as the subject's light source frequency. It is understood that the dimming frequency and refresh rate of the subject's display screen are related to its flicker, and thus, when the electronic device photographs the subject's display screen, it can capture the flicker effect. By assigning a value of 60Hz to this light source frequency, the flicker effect of the captured subject's display screen can be eliminated.
[0165] Please see Figure 9 Step S605 may specifically include:
[0166] Step S901: Determine whether the maximum target frequency is the first frequency, where the first frequency is the frequency with the largest amplitude among the N light source frequencies, and the maximum target frequency is the frequency with the largest amplitude among the target frequencies.
[0167] If the judgment result of step S901 is yes, proceed to step S902. If the judgment result of step S901 is no, proceed to step S903. In step S902, when the maximum target frequency is the first frequency, assign the frequency value of the first frequency to the first frequency value to obtain the flashing frequency. The flashing frequency includes the first frequency after assignment.
[0168] Step S903: When the maximum target frequency is not the first frequency, determine whether the first frequency matches the standard AC frequency.
[0169] If the result of step S903 is yes, proceed to step S904. If the result of step S903 is no, proceed to step S905.
[0170] Step S904: Determine the frequency value of the first frequency as either the second or third frequency value to obtain the flashing frequency. The flashing frequency includes the first frequency, which is either the second or third frequency value.
[0171] Step S905: Assign the maximum target frequency value as the first frequency value to obtain the flashing frequency. The flashing frequency includes the assigned maximum target frequency.
[0172] The standard AC frequency can include: the domestic lighting AC frequency of 50 Hz or the international lighting AC frequency of 60 Hz. If the first frequency matches the standard AC frequency, it can be characterized as the first frequency being the same as the standard energy frequency corresponding to that standard AC frequency.
[0173] For example, the standard energy frequency corresponding to the standard AC frequency of 50Hz is 100Hz. When the first frequency matches the standard AC frequency of 50Hz, the frequency value of the first frequency can be determined as the second frequency value (i.e., 100Hz). The standard energy frequency corresponding to the standard AC frequency of 60Hz is 120Hz. When the first frequency matches the standard AC frequency of 60Hz, the frequency value of the first frequency can be determined as the third frequency value (i.e., 120Hz).
[0174] In this embodiment, the first frequency value is different from the standard energy frequency corresponding to the standard alternating current frequency; that is, the first frequency value is different from both the second and third frequency values. The first frequency value is less than the second frequency value, and the first frequency value is less than the third frequency value.
[0175] In some embodiments, the first frequency value is 60Hz, the second frequency value is 100Hz, and the third frequency value is 120Hz.
[0176] In some embodiments, please refer to Figure 10 Before proceeding to step S605, the following may also be included:
[0177] Step S101: Input the frequencies of N light sources into the frequency multiplier to obtain the frequency after frequency multiplication.
[0178] The frequency multiplier is used to multiply the frequency it receives.
[0179] In this embodiment of the application, when performing frequency doubling processing, the frequency of the multiplied light source among the N light source frequencies is determined, and then the minimum frequency value among the multiplied frequency of the multiplied light source frequencies is assigned to the light source frequency with the largest amplitude among the multiplied frequency of the multiplied light source frequencies.
[0180] For example, the frequency multiplier acquires four light source frequencies, which are ordered from largest to smallest amplitude as frequencies A, B, C, and D, with frequency values of 360Hz, 120Hz, 240Hz, and 570Hz, respectively. Since frequencies A, B, and C are multiples of each other, they are frequency multiplied by each other. The smallest frequency among these multiples is assigned a value of 120Hz, and the frequency with the largest amplitude is frequency A, which is also assigned a value of 120Hz. Therefore, after frequency multiplication, frequencies A and D are obtained, with values of 120Hz and 570Hz, respectively.
[0181] Step S102: Input the frequency after frequency multiplication into the mixer to obtain the frequency after frequency mixing.
[0182] The mixer is used to perform frequency mixing on the received frequencies. As in the example above, frequencies A and D are input to the mixer.
[0183] For details on frequency multiplication and mixing, please refer to relevant technologies; they will not be elaborated upon here.
[0184] Step S103: Perform sidelobe processing on the first frequency obtained after mixing, and output the first frequency after sidelobe processing.
[0185] In this embodiment of the application, when performing sidelobe processing on the first frequency, frequency values within a first range can be eliminated based on the frequency value of the first frequency. The first range can be greater than or less than 15Hz.
[0186] For example, if the first frequency is 530Hz, then frequencies within the range of 515Hz to 545Hz near the first frequency can be eliminated. In other words, frequencies within the range of 515Hz to 545Hz near the first frequency can be considered as the first frequency.
[0187] In this embodiment, steps S101 to S103 are executed before step S605. Specifically, when the maximum target frequency with the largest amplitude among the target frequencies is the first frequency, assigning the frequency value of the first frequency as the first frequency value can include: when the maximum target frequency with the largest amplitude among the target frequencies is the first frequency after sidelobe processing, assigning the frequency value of the first frequency after sidelobe processing as the first frequency value. The flicker frequency includes the assigned first frequency, or the assigned first frequency and the second frequency after mixing processing, where the second frequency is the frequency with the second largest amplitude among the N light source frequencies.
[0188] In some embodiments, before determining the frequency value of the first frequency as the second or third frequency value, steps S101 to S103 described above may be performed. Determining the frequency value of the first frequency as the second or third frequency value then includes: determining the frequency value of the first frequency after sidelobe processing as the second or third frequency value; and assigning the frequency value of the maximum target frequency as the first frequency value. Therefore, the flicker frequency may include the first frequency, which is the second or third frequency value, and the assigned maximum target frequency.
[0189] In some embodiments, before assigning the maximum target frequency value as the first frequency value, the above steps S101 to S103 may be performed. Then, assigning the maximum target frequency value as the first frequency value includes: assigning the maximum target frequency value after the above steps S101 to S103 as the first frequency value.
[0190] Step S606: When the current shooting scene is not the target scene, determine whether the first frequency with the largest amplitude among the N light source frequencies matches the standard AC frequency.
[0191] The information regarding the first frequency and the standard AC frequency can be found above.
[0192] If the result of step S606 is yes, proceed to step S607. If the result of step S606 is no, proceed to step S608.
[0193] Step S607: Determine the frequency value of the first frequency as the second frequency value or the third frequency value to obtain the flashing frequency.
[0194] The relevant content of step S607 can be referred to in step S904. The flashing frequency includes a first frequency with a frequency value of a second frequency value or a third frequency value, and may also include a second frequency. In step S608, when the frequency value of the first frequency is a multiple of the first frequency value, the frequency value of the first frequency is assigned as the first frequency value to obtain the flashing frequency.
[0195] In some embodiments, step S608 further includes, when the frequency value of the first frequency is not a multiple of the first frequency value, outputting the first frequency for which steps S101 to S103 have been performed, to obtain the flashing frequency. The flashing frequency includes the assigned first frequency and may also include a second frequency.
[0196] Step S609: Adjust the camera's exposure time according to the flicker frequency.
[0197] In this embodiment, the exposure time is adjusted to an integer multiple of the flicker frequency's cycle based on the flicker frequency. This allows for flicker elimination via an auto flicker detected (AFD) sensor, improving the user experience during shooting.
[0198] In this embodiment, when the flicker frequency includes one frequency, the camera's exposure time is adjusted according to the flicker frequency, that is, the exposure time is adjusted to an integer multiple of the flicker frequency's cycle. When the flicker frequency includes two or more frequencies, the two or more frequencies are multiplied to obtain a multiplied flicker frequency. The camera's exposure time is adjusted according to the multiplied flicker frequency, that is, the exposure time is adjusted to an integer multiple of the multiplied flicker frequency's cycle. For example, if the obtained flicker frequencies are a first frequency with a first frequency value and a second frequency with a frequency value of 120Hz, the exposure time is adjusted to an integer multiple of the multiplied flicker frequency (60Hz)'s cycle.
[0199] In some embodiments, when the flicker frequency includes two or more frequencies, and if the exposure time cannot be adjusted to an integer multiple of one of the flicker frequency cycles (such as the first frequency cycle), the exposure time can be adjusted to an integer multiple of another flicker frequency cycle. This can at least eliminate the bright and dark stripes caused by one light source and minimize the impact of banding on the image display.
[0200] In the solution provided in this application, if the exposure time cannot be adjusted to eliminate the bright and dark stripes caused by the light source in the shooting environment, only the frame interval can be adjusted, which can also reduce the banding phenomenon.
[0201] In some embodiments, the electronic device may simply adjust the frame interval to an integer multiple of one flicker frequency period while continuing to use the exposure time adjusted by the automatic exposure system. It is understood that the electronic device may also adjust the exposure time in other ways, and this application does not limit this.
[0202] Please see Figure 11 This document provides an exemplary embodiment of another shooting method flow provided by this application. This shooting method is applied to an electronic device and may include steps S1101 to S1119. Steps S1101 to S1102 can refer to step S601 above, steps S1103 to S1104 can refer to step S602 above, step S1105 can refer to step S603 above, steps S1106 to S1107 can refer to step S604 above, and steps S1109 to S1111 can refer to steps S101 to S103 above.
[0203] Step S1101: In response to the first operation, the flashing sensor is activated.
[0204] The first operation can be used to instruct the electronic device to activate the shooting or recording function, or it can be used to instruct the activation of the flicker elimination function.
[0205] Step S1102: Obtain the first sequence of data collected by the scintillation sensor.
[0206] Step S1103: Convert the first sequence data from the time domain to the frequency domain to obtain the first spectrum.
[0207] Step S1104: Determine the N light source frequencies with the largest amplitudes based on the first spectrum.
[0208] Step S1105: Determine whether there is a frequency value greater than or equal to the frequency threshold among the N light source frequencies.
[0209] If the result of step S1105 is yes, proceed to steps S1106 to S1119. If the result of step S1105 is no, proceed to steps S1109 to S1119. That is, if any one or more of the N light source frequencies are greater than or equal to the frequency threshold, the current shooting scene is determined to be the target scene, and steps S1106 to S1119 are executed. If the frequency values of all N light source frequencies are less than the frequency threshold, the current shooting scene is determined not to be the target scene, and steps S1109 to S1119 are executed.
[0210] Step S1106: Select the light source frequencies whose frequency values are greater than or equal to the frequency threshold from among the N light source frequencies as candidate light source frequencies.
[0211] Step S1107: Determine the target frequency as the light source frequency whose frequency value is 2*M times the first frequency value among the candidate light source frequencies.
[0212] Step S1108: Record the position of the maximum target frequency with the largest amplitude among the target frequencies as the first position.
[0213] When there is only one target frequency, the position of that target frequency is recorded as the first position. When there are two or more target frequencies, the position of the frequency with the largest amplitude among the two or more target frequencies is recorded as the first position.
[0214] In some embodiments, in addition to recording the location of the frequency, the frequency with the largest amplitude in the target frequency can also be recorded in other ways, and this application does not specifically limit this.
[0215] Step S1109: Input the frequencies of N light sources into the frequency multiplier to obtain the frequency after frequency multiplication.
[0216] Step S1110: Input the frequency after frequency multiplication into the mixer to obtain the frequency after frequency mixing.
[0217] Step S1111: Perform sidelobe processing on the first frequency obtained after mixing, and output the first frequency after sidelobe processing.
[0218] Step S1112: Determine whether the frequency of the first position is the first frequency after sidelobe processing.
[0219] It is understandable that when step S1111 is executed, if the first frequency is not processed by sidelobe, then step S1112 can determine whether the frequency at the first position is the first frequency. That is, step S1112 determines whether the frequency with the largest assigned value among the target frequencies is the first frequency (or the first frequency after sidelobe processing).
[0220] If the result of step S1112 is yes, proceed to step S1113. If the result of step S1112 is no, proceed to step S1114.
[0221] It is understandable that if the judgment result in step S1105 is negative, and no first position is recorded when executing steps S1109 to S1112, then the judgment result in step S1112 can be determined to be negative. That is, if the current shooting scene is not the target scene, proceed directly to step S1114.
[0222] Step S1113: Assign the frequency value of the first frequency after sidelobe processing to the first frequency value.
[0223] Step S1113 can refer to the relevant content of step S605.
[0224] Step S1114: Determine whether the first frequency matches the standard AC frequency.
[0225] Step S1114 can refer to the relevant content of step S606.
[0226] If the result of step S1114 is yes, proceed to steps S1115 and S1116. If the result of step S1114 is no, proceed to step S1117.
[0227] Step S1115: Determine the frequency value of the first frequency as the second frequency value or the third frequency value.
[0228] Step S1115 can refer to the relevant content of step S607.
[0229] Step S1116: Assign the maximum target frequency value to the first frequency value.
[0230] In some embodiments, step S1116 can be replaced by determining the frequency value of the second frequency. That is, determining the second frequency after steps S1109 to S1110.
[0231] Step S1117: When the frequency value of the first frequency is a multiple of the first frequency value, the frequency value of the first frequency is assigned as the first frequency value.
[0232] Step S1118: Obtain the flashing frequency.
[0233] Step S1118, obtaining the flicker frequency, includes the following scenarios:
[0234] Scenario 1: After executing step S1113, the obtainable flashing frequency includes a first frequency assigned a first frequency value, and may also include a second frequency output after the above processing.
[0235] Scenario 2: After executing step S1116, the flicker frequencies that can be obtained include: a first frequency with a frequency value of a second frequency value or a third frequency value and a maximum target frequency with a value of the first frequency value. At this time, the maximum target frequency can be any light source frequency other than the first frequency among N light source frequencies.
[0236] Scenario 2: After executing step S1117, the available flashing frequencies include the first frequency assigned a first frequency value, or the first frequency and the second frequency after the above processing.
[0237] Step S1119: Adjust the camera's exposure time according to the flicker frequency.
[0238] Step S1119 can refer to the relevant content of step S608 above.
[0239] For ease of understanding, the following is combined with Figures 12A to 12F The interface example is described below. Figures 12A to 12F This is a schematic diagram illustrating the effect of an embodiment of this application. For example... Figure 12B ( Figure 12C As shown in the figure, compared to Figure 1B ( Figure 1C The preview image shown in the figure, obtained in photo mode using the shooting method of this application embodiment, does not exhibit banding. Figure 12D As shown, compared to Figure 1D The preview screen shown, obtained in video recording mode using the shooting method of this application embodiment, does not exhibit banding. Figure 12E ( Figure 12F As shown in the figure, compared to Figure 1E ( Figure 1FThe images shown in the figure, obtained during the video recording process using the shooting method of the embodiments of this application, do not exhibit banding.
[0240] The following combination Figures 13A to 13C The interface example is described below. (13A to...) Figure 13C This is a schematic diagram illustrating the effect of an embodiment of this application. For example... Figure 13A As shown, compared to Figure 3A The video shown, after being filmed using the shooting method of this application embodiment, does not exhibit banding. For example... Figure 13B As shown, compared to Figure 3B The captured images shown in the figure, obtained using the shooting method of this application embodiment, do not exhibit banding. Figure 13C As shown, compared to Figure 3C The images shown in the figure, obtained by using the shooting method of the embodiments of this application, do not exhibit banding.
[0241] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0242] This application also provides an electronic device, which includes at least a processor and a memory, the processor and the memory being coupled together. The memory is used to store a computer program, and when the computer program is executed by the processor, the electronic device can instruct the shooting method described above.
[0243] This application also provides a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to execute the shooting method described above.
[0244] This application also provides a computer storage medium including computer instructions, which, when executed on an electronic device, cause the electronic device to perform the shooting method as described in the above embodiments.
[0245] In this application, the electronic device, computer storage medium, or chip system provided in the embodiments are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0246] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0247] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0248] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.
[0249] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0250] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0251] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.
Claims
1. A shooting method, characterized in that, Applied to an electronic device, the electronic device including a flash sensor and a camera, the method includes: Acquire the first sequence of data collected by the flash sensor in the current shooting scene; The first sequence data is transformed from the time domain to the frequency domain to obtain the spectrum; N light source frequencies are determined according to the amplitude of the spectrum from largest to smallest, where N is an integer greater than or equal to 2; the amplitude represents the brightness. When there is a light source frequency among the N light source frequencies that is greater than or equal to a frequency threshold, a target frequency is determined among the N light source frequencies, wherein the target frequency is greater than or equal to the frequency threshold, and the target frequency is a multiple of a first frequency value; the first frequency value is 60Hz. When the first frequency is the light source frequency with the largest amplitude among the target frequencies, the first frequency is assigned the first frequency value, and the exposure time of the camera is adjusted according to the first frequency value; the first frequency is the light source frequency with the largest amplitude among the N light source frequencies; When the first frequency is not the light source frequency with the largest amplitude among the target frequencies, and the first frequency is a standard energy frequency corresponding to the standard AC frequency, the exposure time of the camera is adjusted according to the standard energy frequency.
2. The method according to claim 1, characterized in that, Before assigning the first frequency to the first frequency value, the method further includes: The frequencies of the N light sources are input into a frequency multiplier to obtain the frequency after frequency multiplication. The frequency after the frequency multiplication process is input into the mixer to obtain the frequency after the frequency mixing process; The first frequency obtained after mixing is subjected to sidelobe processing, and the first frequency after sidelobe processing is output. When the first frequency is the light source frequency with the largest amplitude among the target frequencies, assigning the first frequency as the first frequency value includes: When the first frequency after sidelobe processing is the light source frequency with the largest amplitude among the target frequencies, the first frequency after sidelobe processing is assigned the first frequency value.
3. The method according to claim 1, characterized in that, The method further includes: When all N light source frequencies are less than the frequency threshold, and the light source frequency with the largest amplitude among the N light source frequencies is the standard energy frequency corresponding to the standard AC frequency, the exposure time of the camera is adjusted according to the standard energy frequency.
4. The method according to any one of claims 1 to 3, characterized in that, The target frequency is 2*M times the first frequency value, where M is an integer greater than or equal to 1.
5. The method according to any one of claims 1 to 3, characterized in that, The frequency threshold is any value between 500 Hz and 4 kHz.
6. An electronic device, characterized in that, The device includes a processor and a memory coupled together, the memory being used to store a computer program that, when executed by the processor, causes the electronic device to perform the method as described in any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Shooting parameter setting method and device, terminal equipment and readable storage medium
CN110248110A
Exposure time control method of camera and electronic device
CN110855901A