Photographing method and device, computer readable medium and electronic device
By acquiring and analyzing the ambient light distribution image, determining the light source flicker type and selecting the corresponding anti-flicker method, the light source flicker problem under various light source flicker frequencies is solved and the video picture quality is improved.
Patent Information
- Application Number
- CN202210976169.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-15
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-08-15
AI Technical Summary
The existing technology cannot effectively eliminate the light source flicker phenomenon under various light source flicker frequencies, resulting in poor video quality.
By obtaining the ambient light distribution image in the shooting scene, the image area is divided, the light source flicker type in each area is determined, and the corresponding anti-flicker method is selected according to the type to eliminate light source flicker.
It improves the accuracy of light source flicker elimination and video picture quality, and can effectively handle the light source flicker phenomenon under various light source flicker frequencies.
Smart Images

Figure CN115514899B
Abstract
Description
Background Art
[0002] As people's living standards continue to improve, the quality of captured images has received more and more attention. Light source flicker refers to the intermittent flickering of a certain light source. When the flickering frequency is faster than any shutter movement opportunity, it may cause banded shadows or partial discoloration on the image captured by the camera.
[0003] Currently, related solutions for eliminating light source flicker generally use a frame difference method to detect the light source flicker frequency in an image. However, the method of detecting the light source flicker frequency using a frame difference method not only has a low accuracy rate, but also cannot eliminate the light source flicker in scenes with multiple light source flicker frequencies, resulting in poor quality of the captured video. Summary of the invention
[0004] The purpose of the present disclosure is to provide a shooting method, a shooting device, a computer-readable medium and an electronic device, thereby at least to a certain extent solving the problem in the related art that light source flicker elimination is impossible in scenes with multiple light source flicker frequencies, and improving the accuracy of light source flicker elimination.
[0005] According to a first aspect of the present disclosure, there is provided a photographing method, comprising:
[0006] Acquire an ambient light distribution image in a shooting scene, wherein the ambient light distribution image includes at least two image areas;
[0007] Determining the flicker type of the light source in each of the image areas through the ambient light distribution image;
[0008] Determining a target anti-flicker mode for each of the image areas according to the light source flicker type;
[0009] Based on the target anti-flicker method, light source flicker elimination is performed on the image frames collected in the shooting scene to obtain image frames after light source flicker elimination.
[0010] According to a second aspect of the present disclosure, there is provided a photographing device, comprising:
[0011] An ambient light image acquisition module, used to acquire an ambient light distribution image in a shooting scene, wherein the ambient light distribution image includes at least two image areas;
[0012] a light source flicker type determination module, configured to determine the light source flicker type of each of the image regions through the ambient light distribution image;
[0013] an anti-flicker mode determination module, used to determine a target anti-flicker mode for each of the image areas according to the light source flicker type;
[0014] The light source flicker elimination module is used to eliminate light source flicker on the image frames collected in the shooting scene based on the target anti-flicker method to obtain the image frames after the light source flicker is eliminated.
[0015] According to a third aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.
[0016] According to a fourth aspect of the present disclosure, there is provided an electronic device, characterized in that it includes:
[0017] Multi-window anti-flicker sensor;
[0018] Processor; and
[0019] The memory is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the above method.
[0020] A shooting method provided by an embodiment of the present disclosure can obtain an ambient light distribution image in a shooting scene, and the ambient light distribution image can include at least two image areas. The light source flicker type of each image area can be determined through the ambient light distribution image, and then the target anti-flicker method of each image area can be determined according to the light source flicker type. Finally, the image frame collected in the shooting scene can be subjected to light source flicker elimination based on the target anti-flicker method to obtain the image frame after the light source flicker is eliminated. The ambient light distribution image can be divided into at least two image areas, and the target anti-flicker method corresponding to each image area can be determined respectively according to the determined light source flicker type, and then the corresponding anti-flicker method can be used for the light source flicker phenomenon distributed at different positions in the shooting scene, so as to effectively suppress the light source flicker phenomenon in the multi-light source shooting scene, improve the accuracy of the processing results, and improve the quality of the camera preview screen or the shot video screen.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0023] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;
[0024] Figure 2 A schematic diagram schematically illustrates a principle of generating a light source flickering phenomenon in an exemplary embodiment of the present disclosure;
[0025] Figure 3 A schematic diagram schematically illustrates a flow chart of a photographing method in an exemplary embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram schematically shows the principle of a multi-window anti-flicker sensor collecting an ambient light distribution image in an exemplary embodiment of the present disclosure;
[0027] Figure 5 A schematic diagram of a process for determining a light source flicker type in an exemplary embodiment of the present disclosure is schematically shown;
[0028] Figure 6 A schematic diagram schematically illustrates a light source flicker frequency obtained by converting ambient light data in an exemplary embodiment of the present disclosure;
[0029] Figure 7 A schematic diagram of a process for eliminating light source flicker by a first anti-flicker method in an exemplary embodiment of the present disclosure is schematically shown;
[0030] Figure 8 A schematic diagram schematically shows a principle of eliminating light source flickering phenomenon by adjusting exposure time in an exemplary embodiment of the present disclosure;
[0031] Fig. 9 A schematic diagram of a process for eliminating light source flicker by a second anti-flicker method in an exemplary embodiment of the present disclosure is schematically shown;
[0032] Fig.10 A schematic diagram schematically showing a core area and a non-core area in an exemplary embodiment of the present disclosure;
[0033] Fig.11 A schematic diagram of a process for eliminating light source flickering in an exemplary embodiment of the present disclosure is schematically shown;
[0034] Fig.12 A schematic diagram schematically shows the composition of a photographing device in an exemplary embodiment of the present disclosure;
[0035] Fig.13 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION
[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0037] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0038] Figure 1 A schematic diagram of a system architecture of an exemplary application environment in which a photographing method and apparatus according to an embodiment of the present disclosure can be applied is shown.
[0039] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with image acquisition and ambient light acquisition functions, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0040] The shooting method provided in the embodiment of the present disclosure is generally executed by the terminal devices 101, 102, and 103, and accordingly, the shooting device is generally arranged in the terminal devices 101, 102, and 103. However, it is easy for those skilled in the art to understand that the shooting method provided in the embodiment of the present disclosure can also be executed by the server 105, and accordingly, the shooting device can also be arranged in the server 105, which is not particularly limited in the present exemplary embodiment. For example, in an exemplary embodiment, the user can collect the ambient light distribution image in the shooting scene through the terminal devices 101, 102, and 103, and then upload the ambient light distribution image to the server 105. After the server determines the target anti-flicker mode of different image areas through the shooting method provided in the embodiment of the present disclosure, the target anti-flicker mode is transmitted to the terminal devices 101, 102, and 103 to eliminate the light source flicker, thereby effectively reducing the amount of calculation of the terminal devices 101, 102, and 103.
[0041] Due to the intermittent flickering of one or more light sources in the shooting scene, banded shadows or partial color changes may appear on the images captured by the camera. Figure 2 As shown, the flickering frequency of the light source can be abstracted as a periodically distributed vertical bar, and the time is represented by the horizontal axis, and then the existence of the light source flickering frequency 210 in the shooting scene can be abstracted by a chart. When the camera of the terminal device shoots an image, due to the working principle of the camera's electronic rolling shutter, that is, the image sensor is reset line by line to achieve the effect of moving the front curtain, and then the rear curtain plays the role of reading line by line. It takes tens of milliseconds to read the entire image sensor line by line. Therefore, the electronic shutter takes a long time to move the curtain slit. Therefore, when the flickering frequency of the light source is faster than the shutter movement timing, such as the light source flickering frequency 210, the exposure time of the camera is less than one cycle of the light source flickering frequency 210, and the image frame 220 can be captured. The image frame 220 has a more obvious banded shadow. When previewing the picture or shooting a video, rolling black and white stripes will be generated, that is, the light source flicker Flicker.
[0042] In a related technology, the flicker frequency of the light source in the current scene can be detected by the frame difference method, by graying the consecutive front and back image frames, and then making a difference between the front and back to determine the change in the banded shadow in the image frame, and then determining the flicker frequency of the light source in the current scene. However, the detection result obtained by this scheme not only has a low accuracy rate, but also because there are many interference factors in the shooting scene, the frame difference method has poor anti-interference ability for light source flicker frequency detection, resulting in poor robustness of the detection result.
[0043] In another related technology, the flicker frequency of the light source in the shooting scene can be detected by a device that directly detects the frequency of the AC light source. However, the current solution is generally designed with a single-window detection device, which makes it impossible to effectively analyze the frequency spatial distribution of multiple light source flicker frequencies, thereby failing to effectively decide the main frequency, and failing to effectively suppress the light source flicker phenomenon in different areas by partitioning, resulting in poor light source flicker elimination results.
[0044] Based on one or more problems in the related art, the present disclosure first provides a shooting method. The shooting method of an exemplary embodiment of the present disclosure is specifically described below by taking a terminal device equipped with a shooting device to execute the method as an example.
[0045] Figure 3 A schematic flow chart of a photographing method in this exemplary embodiment is shown, which may include the following steps S310 to S340:
[0046] In step S310, an ambient light distribution image in a shooting scene is acquired, where the ambient light distribution image includes at least two image areas.
[0047] In an exemplary embodiment, the ambient light distribution image refers to an image composed of ambient light data in a shooting scene acquired by an ambient light acquisition device. The field of view of the ambient light acquisition device can be the same as the field of view of a camera image sensor, that is, the size of the ambient light distribution image can be the same as the size of the image acquired by the image sensor, so that it can be ensured that the ambient light data in the ambient light distribution image corresponds to the area in the acquired image frame. Of course, the field of view of the ambient light acquisition device can also be slightly smaller or slightly larger than the field of view of the camera image sensor, and this exemplary embodiment does not specifically limit this.
[0048] An image area refers to an area divided in an ambient light distribution image. For example, two image areas can be divided in the ambient light distribution image, one of which is a core area, which may be an area within a certain range of the center of the ambient light distribution image, and the other may be a non-core area, that is, an image area other than the core area in the ambient light distribution image; the ambient light distribution image may also be divided into four image areas, namely, an upper left corner area, an upper right corner area, a lower left corner area, and a lower right corner area; of course, the ambient light distribution image may also be divided into multiple image areas in other ways, and the specific division may be customized according to the actual application situation, and the present embodiment is not limited thereto.
[0049] In step S320, the flicker type of the light source in each of the image areas is determined through the ambient light distribution image.
[0050] In an exemplary embodiment, the light source flicker type refers to a pre-set type for describing the light source flicker frequency distribution in an image area. For example, the light source flicker type may include a no light source flicker type, a single light source flicker type, and a multiple light source flicker type, wherein the no light source flicker type may indicate that there is no light source flicker frequency in the image area; the single light source flicker type may indicate that there is a unique type of light source flicker frequency in the image area, such as if the image area only contains a light source flicker frequency of 60 Hz, then the image area can be determined to be a single light source flicker type; the multiple light source flicker type may indicate that there are multiple types of light source flicker frequencies in the image area, such as if the image area contains light source flicker frequencies of 60 Hz, 100 Hz, and 200 Hz, then the image area can be determined to be a multiple light source flicker type; of course, the light source flicker type may also include other types, which can be customized, and the present embodiment is not limited thereto.
[0051] By setting the distribution of light source flicker frequency to different light source flicker types, the distribution of light source flicker frequency in the image area can be quickly determined, which facilitates the analysis of complex light source shooting scenes and effectively improves analysis efficiency.
[0052] In step S330, a target anti-flicker mode for each of the image regions is determined according to the light source flicker type.
[0053] In an exemplary embodiment, the target anti-flicker mode refers to a processing method for eliminating the light source flicker phenomenon existing in the image area. For example, if the image area is a type without light source flicker, then the target anti-flicker mode of the image area is no processing; if the image area is a type with single light source flicker, then the target anti-flicker mode of the image area is to set the exposure time with the flicker frequency of the only type of light source as the target light source flicker frequency, and adjust the exposure time to make the exposure time an integer multiple of the light source flicker frequency cycle to eliminate the flicker of the only type of light source; if the image area is a type with multiple light source flicker, then the target anti-flicker mode of the image area is to determine the main light source flicker frequency among the multiple types of light source flicker frequencies, and set the exposure time with the main light source flicker frequency as the target light source flicker frequency, and first perform global light source flicker elimination on the image area by adjusting the exposure time, and then for the local areas where the other types of light source flicker frequencies are located, the light source flicker elimination is achieved by superimposing multiple frames. Of course, the target anti-flicker mode can also be other anti-flicker processing methods, which are specifically related to the determined light source flicker type and can be customized according to actual needs. This exemplary embodiment does not make special restrictions on this.
[0054] In step S340, light source flicker elimination is performed on the image frames collected in the shooting scene based on the target anti-flicker method to obtain image frames after light source flicker elimination.
[0055] In an exemplary embodiment, after determining the light source flicker type of different image areas, the light source flicker elimination strategy acting on the image area, that is, the target anti-flicker method, can be determined according to the light source flicker type. Then, according to the target anti-flicker method of different image areas, different light source flicker suppression can be implemented for different image areas, which can effectively improve the accuracy of the light source flicker elimination results and improve the quality of the camera preview screen or the video taken by the camera in the shooting scene.
[0056] By setting different image areas to distinguish different types of light source flicker frequencies in the shooting scene and performing anti-flicker processing respectively, the light source flicker of all light source flicker frequencies in the shooting scene can be eliminated, thereby improving the accuracy of the processing results; by collecting the ambient light distribution image in the shooting scene, and then determining all light source flicker frequencies in the current scene, compared with the method of determining the light source flicker frequency by the frame difference method in the related art, it can effectively improve the accuracy and anti-interference of the detection results, improve the robustness of the light source flicker elimination results, and ensure the quality of the camera preview screen or the video taken by the camera in the shooting scene.
[0057] Steps S310 to S340 are described in detail below.
[0058] In an exemplary embodiment, an ambient light distribution image in a shooting scene can be acquired by an ambient light collection device, wherein the ambient light collection device can be an anti-flicker sensor (Flickersensor) or other sensors or devices capable of collecting ambient light data, but this exemplary embodiment is not limited thereto.
[0059] An ambient light distribution image in a shooting scene can be acquired through a preset multi-window anti-flicker sensor; wherein the multi-window anti-flicker sensor may include an anti-flicker sensor array consisting of at least two anti-flicker sensors, and the anti-flicker sensor array generates ambient light data corresponding to at least two detection window areas.
[0060] Figure 4 The schematic diagram schematically shows the principle of collecting an ambient light distribution image by a multi-window anti-flicker sensor in an exemplary embodiment of the present disclosure.
[0061] refer to Figure 4As shown, the multi-window anti-flicker sensor may include multiple anti-flicker sensors 410, and the anti-flicker sensors 410 are arranged in space according to a preset number of columns and rows to obtain an anti-flicker sensor. Specifically, the multiple anti-flicker sensors 410 may be arranged in an M*N array to form an anti-flicker sensor array 420. For example, M may be preset to 10, and N may be preset to 10. Then the multi-window anti-flicker sensor may include 100 anti-flicker sensors 410, and these 100 anti-flicker sensors 410 are arranged in space to obtain a 10*10 anti-flicker sensor array. Of course, the specific M and N may be customized according to the actual application scenario, and this exemplary embodiment does not specifically limit this.
[0062] When the camera is started in a shooting scene, a multi-window anti-flicker sensor having a spatial structure of an M*N anti-flicker sensor array 420 collects ambient light data in the shooting scene to obtain an ambient light distribution image 440 having M*N detection window areas 430. The ambient light data in each detection window area 430 can reflect the light source flicker frequency of various light sources in the shooting scene.
[0063] In an exemplary embodiment, the Figure 5 The steps in the method are used to determine the flicker type of the light source in each image area through the ambient light distribution image. Figure 5 As shown, it may specifically include:
[0064] Step S510, obtaining ambient light data corresponding to each of the detection window areas;
[0065] Step S520, performing fast Fourier transform on the ambient light data to obtain the light source flicker frequency corresponding to each detection window area;
[0066] Step S530: determining the light source flicker type of the image area according to the light source flicker frequency.
[0067] Among them, each image area in the ambient light distribution image can correspond to multiple detection window areas, that is, multiple detection window areas constitute an image area. Optionally, one detection window area can also be used as an image area, and this example embodiment does not make any special limitation on this.
[0068] Ambient light data refers to the sampled signal data obtained by the multi-window anti-flicker sensor to collect the light source signal in the shooting scene. Fast Fourier Transform (Fast Fourier Transform) is an efficient and fast calculation method using a computer to calculate Discrete Fourier Transform (Discrete Fourier Transform, DFT). Discrete Fourier Transform is the most basic method of signal analysis, and Fourier Transform is the core of Fourier analysis. Through discrete Fourier Transform, the signal can be transformed from the time domain to the frequency domain, and then the spectral structure and change law of the signal can be studied.
[0069] The ambient light data (sampling signal) corresponding to the detection window area can be converted into the light source flicker frequency corresponding to each detection window area through fast Fourier transform, and then the light source flicker type of the image area can be determined through the light source flicker frequency corresponding to each detection window area.
[0070] Figure 6 The diagram schematically shows a light source flicker frequency obtained by converting ambient light data in an exemplary embodiment of the present disclosure.
[0071] refer to Figure 6 As shown, the ambient light data corresponding to the detection window area can be subjected to a fast Fourier transform, and a data chart 600 corresponding to the light source flicker frequency and the light source flicker frequency intensity corresponding to each detection window area can be output. The horizontal axis of the data chart 600 can represent the light source flicker frequency, and the vertical axis of the data chart 600 can represent the light source flicker frequency intensity. According to the data chart 600, it can be determined that the first light source flicker frequency 610 collected in the detection window area is 100Hz, and the corresponding light source flicker frequency intensity is 10500, and the second light source flicker frequency 620 collected is 210Hz, and the corresponding light source flicker frequency intensity is 1800. Since the intensity of other collected light source flicker frequencies is relatively small, they can be eliminated in actual use and treated as interference waves. Based on this, the light source flicker frequency and the light source flicker frequency intensity of each detection window area can be obtained.
[0072] Optionally, the light source flicker type in this embodiment may include a no light source flicker type, a single light source flicker type, and a multiple light source flicker type. If it is determined that there is no light source flicker frequency in the image area, the light source flicker type of the image area may be determined to be a no light source flicker type; if it is determined that there is only one type of light source flicker frequency in the image area, the light source flicker type of the image area may be determined to be a single light source flicker type; if it is determined that there are multiple types of light source flicker frequencies in the image area, the light source flicker type of the image area may be determined to be a multiple light source flicker type.
[0073] In an exemplary embodiment, the target anti-flicker mode may include a first anti-flicker mode. If it is determined that the light source flicker type of the image area is a single light source flicker type, it may be determined that the first anti-flicker mode is used to eliminate the light source flicker in the image area.
[0074] Specifically, you can Figure 7 The steps in the first anti-flicker method are used to eliminate light source flicker in the image area. Figure 7 As shown, it may specifically include:
[0075] Step S710, determining a first exposure time corresponding to the image area according to the light source flickering frequency corresponding to the image area, wherein the first exposure time is an integer multiple of the light source flickering frequency period;
[0076] Step S720: Eliminate light source flicker in the image area by using the first exposure time.
[0077] Among them, when it is determined that there is only one type of light source flickering frequency in the image area, the first exposure time can be determined according to the light source flickering frequency. Specifically, the first exposure time can be determined by the period of the light source flickering frequency, that is, the first exposure time can be set to an integer multiple of the light source flickering frequency period. For example, the light source flickering frequency period can be 1 / 50 second, then the camera exposure time can be set to 1 / 50 second, 1 / 25 second, 3 / 50 second, etc., as long as the first exposure time can be set to an integer multiple of the light source flickering frequency period, this example embodiment does not make any special limitation on this.
[0078] Figure 8 The schematic diagram schematically shows a principle of eliminating light source flickering phenomenon by adjusting exposure time in an exemplary embodiment of the present disclosure.
[0079] refer to Figure 8 As shown, the flickering frequency of the light source in the image area can be abstracted as periodically distributed vertical bars, and time is represented by the horizontal axis, and then the light source flickering frequency 800 in the image area can be abstractly represented by a chart. When the camera of the terminal device captures an image, the light source flickering frequency of the AC light source is generally faster than the shutter movement timing, that is, the camera's common exposure time 810 is less than one cycle of the light source flickering frequency 800, and at this time, an image frame 820 with the light source flickering phenomenon can be captured.
[0080] At this time, the camera exposure time 830 can be re-determined according to the frequency value of the light source flickering frequency 800. The exposure time 830 can be an integer multiple of the period of the light source flickering frequency. The exposure time 830 in the figure is a light source flickering frequency period. The image frame 840 can be captured by adjusting the exposure time 830. Compared with the image frame 820, the light source flickering phenomenon is effectively suppressed to obtain an image frame with better quality.
[0081] In an exemplary embodiment, the target anti-flicker method may include a second anti-flicker method. If it is determined that the light source flicker type of the image area is a multi-light source flicker type, it may be determined that the second anti-flicker method is used to eliminate light source flicker in the image area.
[0082] Specifically, you can Fig. 9 The steps in the second anti-flicker method are used to eliminate light source flicker in the image area. Fig. 9 As shown, it may specifically include:
[0083] Step S910, determining the flickering frequency of the main light source corresponding to the image area;
[0084] Step S920, determining a second exposure time according to the flicker frequency of the main light source, and performing global light source flicker elimination on the image area by using the second exposure time; and
[0085] Step S930, determining a target detection window area in the image area where there is a light source flicker frequency other than the main light source flicker frequency, and performing multi-frame overlay processing on the image content in the target detection window area to eliminate local light source flicker in the image area.
[0086] Among them, the main light source flicker frequency refers to the light source flicker frequency with the highest proportion in the image area. For example, the image area may include 10 detection window areas, of which there are 5 detection window areas with a light source flicker frequency of 100 Hz, 3 detection window areas with a light source flicker frequency of 200 Hz, and 2 detection window areas with a light source flicker frequency of 60 Hz. At this time, the light source flicker frequency of 100 Hz occupies the highest proportion in the image area, so the light source flicker frequency of 100 Hz can be used as the main light source flicker frequency of the image area.
[0087] The second exposure time can be determined according to the flicker frequency of the main light source, and then the global light source flicker can be eliminated in the image area through the second exposure time. Then, a target detection window area in the image area having a light source flicker frequency other than the main light source flicker frequency is determined, and multi-frame superposition processing is performed on the image content in the target detection window area to achieve local light source flicker elimination in the image area.
[0088] For shooting scenes with multiple light sources, the flicker phenomenon of light sources with different spatial distributions is differentiated and suppressed. The second exposure time is first determined by the flicker frequency of the main light source with a higher occupancy rate, and the light source flicker is globally eliminated in the image area. The flicker of the light source with the most light sources in the image area is preliminarily eliminated, and then the flicker phenomenon of light sources with other light source flicker frequencies is eliminated by superimposing multiple frames. This can effectively improve the accuracy of the light source flicker elimination results and improve the robustness of the results.
[0089] It should be noted that the "first" and "second" in the "first exposure time" and "second exposure time" in the embodiments of the present disclosure are only used to distinguish the exposure times in different anti-flicker modes and do not have any special meaning and should not impose any special limitations on this example embodiment.
[0090] Specifically, when it is determined that the light source flicker type of the image area is the no-light source flicker type, light source flicker elimination may not be performed on the image area.
[0091] In an exemplary embodiment, at least two image areas may include a core area and a non-core area, the core area corresponds to a first detection window area, and the non-core area corresponds to a second detection window area; specifically, the light source flicker type of the core area can be determined based on the light source flicker frequency corresponding to the first detection window area; the light source flicker type of the non-core area can be determined based on the light source flicker frequency corresponding to the second detection window area.
[0092] Optionally, the core area may be a central area corresponding to the ambient light distribution image, and the non-core area may be an edge area corresponding to the ambient light distribution image. For example, the geometric center of the ambient light distribution image may be taken as the center point, and a preset geometric shape (such as a rectangle, circle, etc.) may be used as the area boundary to determine the central area in the ambient light distribution image, and the area other than the central area in the ambient light distribution image may be taken as the edge area. Of course, the position corresponding to the bright light source in a small area in the ambient light distribution image may also be taken as the center point of the central area to ensure that the central area can include the light source facing the camera in the shooting scene, and the present example embodiment is not limited to this.
[0093] Fig.10 A schematic diagram schematically illustrates a core area and a non-core area in an exemplary embodiment of the present disclosure.
[0094] refer to Fig.10As shown, it is assumed that the shooting scene 1010 includes light sources 1011, 1012, 1013, 1014 and 1015 with different light source flickering frequencies, wherein, since light source 1011 is the light source facing the camera, the light source has a greater impact on the imaging process of the image sensor, and the light source flickering frequency generated by light source 1011 needs to be given priority. Therefore, the area where the light source 1011 that may face the camera is located can be taken as the core area 1021 of the ambient light distribution image 1020, and the areas where other light sources are located can be taken as non-core areas 1022.
[0095] It is understandable that although Fig.10 The core area 1021 shown in the figure is the central area determined by the geometric center position of the ambient light distribution image 1020, and the non-core area 1022 is the edge area of the ambient light distribution image 1020, but the core area can also be the central area determined by determining the position of the light source 1011 facing the camera in the ambient light distribution image 1020; of course, the core area and the non-core area can also be image areas divided in other ways in the brightness distribution image, and the present example embodiment is not limited to this.
[0096] Specifically, an ambient light distribution image having multiple detection window areas Wij (i=1, 2, ..., m; j=1, 2, ..., n) can be acquired by a multi-window anti-flicker sensor, such as Fig.10 , taking m=8, n=6 as an example, the core area 1021 may correspond to the first detection window area, such as the first detection window area may include detection window area W22, detection window area W23, ... detection window area W74 and detection window area W75, and the non-core area 1022 may include detection window area W11, detection window area W12, ... detection window area W85 and detection window area W86.
[0097] By dividing the ambient light distribution image into a core area and a non-core area, and performing light source elimination processing on the core area or the non-core area respectively, the interference of the light source in the non-core area on the light source flicker elimination result in the core area can be avoided, thereby effectively improving the robustness of the light source flicker elimination result, further ensuring the accuracy of the light source flicker elimination result, and improving the quality of the image frame after the light source flicker is eliminated.
[0098] Fig.11 A schematic diagram of a process for eliminating light source flickering in an exemplary embodiment of the present disclosure is schematically shown.
[0099] refer to Fig.11 As shown, in step S1110, the multi-window anti-flicker sensor detects ambient light data; the ambient light distribution image in the shooting scene can be obtained through the multi-window anti-flicker sensor;
[0100] Step S1120, statistics and analysis of light source flicker frequency: the ambient light data of each detection window area in the ambient light distribution image may be subjected to fast Fourier transform to obtain the light source flicker frequency;
[0101] Step S1130, determining whether there is a light source flickering frequency in the image area, if there is a light source flickering frequency, executing step S1140, if there is no light source flickering frequency, determining that the image area is a type without light source flickering, and terminating the current process;
[0102] Step S1140, determining whether there are multiple types of light source flicker frequencies in the image area, if there are multiple types of light source flicker frequencies, determining that the image area is a multi-light source flicker type and executing step S1160, otherwise determining that the image area is a single light source flicker type and executing step S1150;
[0103] Step S1150, for the main light source flicker frequency in the scene with one type of light source flicker frequency or multiple types of light source flicker frequencies, an anti-flicker mode (global) of adjusting the exposure time is adopted;
[0104] Step S1160, determining whether the current light source flickering frequency is the main light source flickering frequency, if yes, executing step S1150, otherwise executing step S1170;
[0105] Step S1170, the detection window area corresponding to the flicker frequency of other light sources except the flicker frequency of the main light source is subjected to a multi-frame superposition anti-flicker method (local), and the current process ends.
[0106] In summary, in this exemplary embodiment, an ambient light distribution image in a shooting scene can be obtained, and the ambient light distribution image can include at least two image areas. The light source flicker type of each image area can be determined through the ambient light distribution image, and then the target anti-flicker method of each image area can be determined according to the light source flicker type. Finally, the image frames collected in the shooting scene can be subjected to light source flicker elimination based on the target anti-flicker method to obtain image frames after light source flicker elimination. The ambient light distribution image can be divided into at least two image areas, and the target anti-flicker method corresponding to each image area can be determined respectively according to the determined light source flicker type, and then the corresponding anti-flicker method can be used for light source flickers distributed at different positions in the shooting scene, effectively suppressing the light source flicker phenomenon in a multi-light source shooting scene, improving the accuracy of the processing results, and improving the quality of the camera preview screen or the captured video screen.
[0107] The disclosed embodiment introduces a multi-window anti-flicker sensor device to obtain regional AC light source flicker frequency data, thereby enabling targeted frequency evaluation and screening of different image areas. This can adapt to complex scenes with multiple light sources, effectively eliminate or greatly reduce light source flicker phenomena in extremely complex light source scenes, and provide better quality video images or preview images.
[0108] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0109] For further reference, Fig.12 As shown, in the embodiment of this example, a shooting device 1200 is also provided, including an ambient light image acquisition module 1210, a light source flicker type determination module 1220, an anti-flicker mode determination module 1230 and a light source flicker elimination module 1240. Among them:
[0110] The ambient light image acquisition module 1210 is used to acquire an ambient light distribution image in a shooting scene, wherein the ambient light distribution image includes at least two image areas;
[0111] The light source flicker type determination module 1220 is used to determine the light source flicker type of each image area through the ambient light distribution image;
[0112] The anti-flicker mode determination module 1230 is used to determine a target anti-flicker mode for each of the image areas according to the light source flicker type;
[0113] The light source flicker elimination module 1240 is used to eliminate light source flicker on the image frames collected in the shooting scene based on the target anti-flicker method to obtain image frames after light source flicker elimination.
[0114] In an exemplary embodiment, the ambient light image acquisition module 1210 may be used to:
[0115] Acquire an ambient light distribution image in a shooting scene through a preset multi-window anti-flicker sensor;
[0116] The multi-window anti-flicker sensor includes an anti-flicker sensor array composed of at least two anti-flicker sensors, and the anti-flicker sensor array is used to generate ambient light data corresponding to at least two detection window areas.
[0117] In an exemplary embodiment, the light source flicker type determination module 1220 may be used to:
[0118] Acquire the ambient light data corresponding to each of the detection window areas;
[0119] Performing a fast Fourier transform on the ambient light data to obtain a light source flicker frequency corresponding to each detection window area;
[0120] The light source flicker type of each of the image regions is determined according to the light source flicker frequency.
[0121] In an exemplary embodiment, the light source flicker type determination module 1220 may be used to:
[0122] If it is determined that there is no light source flicker frequency in the image area, determining that the light source flicker type of the image area is a no light source flicker type;
[0123] If it is determined that there is one type of light source flicker frequency in the image area, determining that the light source flicker type of the image area is a single light source flicker type;
[0124] If it is determined that there are multiple types of light source flicker frequencies in the image area, then the light source flicker type of the image area is determined to be a multiple light source flicker type.
[0125] In an exemplary embodiment, the light source flicker type determination module 1220 may be used to:
[0126] If the light source flicker type of the image area is a single light source flicker type, determining to use a first anti-flicker method to eliminate light source flicker in the image area;
[0127] If the light source flicker type of the image area is a multiple light source flicker type, it is determined to adopt a second anti-flicker method to eliminate the light source flicker of the image area.
[0128] In an exemplary embodiment, the light source flicker type determination module 1220 may be used to:
[0129] Determine a first exposure time corresponding to the image area according to a light source flickering frequency corresponding to the image area, wherein the first exposure time is an integer multiple of a period of the light source flickering frequency;
[0130] Light source flicker elimination is performed on the image area using the first exposure time.
[0131] In an exemplary embodiment, the light source flicker type determination module 1220 may be used to:
[0132] Determine the flicker frequency of the main light source corresponding to the image area;
[0133] Determining a second exposure time according to the flicker frequency of the main light source, and performing global light source flicker elimination on the image area by using the second exposure time; and
[0134] A target detection window area in the image area having a light source flicker frequency other than the main light source flicker frequency is determined, and a multi-frame overlay process is performed on the image content in the target detection window area to eliminate local light source flicker in the image area.
[0135] In an exemplary embodiment, the at least two image regions may include a core region and a non-core region, the core region may correspond to a first detection window region, and the non-core region may correspond to a second detection window region;
[0136] The light source flicker type determination module 1220 may be used to:
[0137] Determining the light source flicker type of the core area according to the light source flicker frequency corresponding to the first detection window area;
[0138] The flicker type of the light source in the non-core area is determined according to the flicker frequency of the light source corresponding to the second detection window area.
[0139] In an exemplary embodiment, the core area may include a central area of the ambient light distribution image, and the non-core area may include an edge area of the ambient light distribution image.
[0140] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0141] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0142] The exemplary embodiment of the present disclosure also provides an electronic device. The electronic device may be the above-mentioned terminal devices 101, 102, 103 and server 105. Generally, the electronic device may include a multi-window anti-flicker sensor, a processor and a memory, the multi-window anti-flicker sensor is used to obtain an ambient light distribution image in a shooting scene, the memory is used to store executable instructions of the processor, and the processor is configured to execute the above-mentioned shooting method by executing the executable instructions.
[0143] Below Fig.13 The mobile terminal 1300 in FIG. 1 is taken as an example to exemplify the structure of the electronic device. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Fig.13The construction in can also be applied to fixed type equipment.
[0144] like Fig.13 As shown, the mobile terminal 1300 may specifically include: a processor 1301, a memory 1302, a bus 1303, a mobile communication module 1304, an antenna 1, a wireless communication module 1305, an antenna 2, a display screen 1306, a camera module 1307, an audio module 1308, a power module 1309 and a sensor module 1310.
[0145] The processor 1301 may include one or more processing units, for example, the processor 1301 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc. The shooting method in this exemplary embodiment may be executed by an AP, a GPU or a DSP. When the method involves processing related to a neural network, it may be executed by an NPU, for example, the NPU may load neural network parameters and execute algorithm instructions related to the neural network.
[0146] The encoder can encode (i.e. compress) an image or video to reduce the data size for easy storage or transmission. The decoder can decode (i.e. decompress) the encoded data of the image or video to restore the image or video data. The mobile terminal 1300 can support one or more encoders and decoders, for example: image formats such as JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), BMP (Bitmap), and video formats such as MPEG (Moving Picture Experts Group) 1, MPEG10, H.1063, H.1064, and HEVC (High Efficiency Video Coding).
[0147] The processor 1301 may be connected to the memory 1302 or other components via a bus 1303 .
[0148] The memory 1302 may be used to store computer executable program codes, which may include instructions. The processor 1301 executes various functional applications and data processing of the mobile terminal 1300 by running the instructions stored in the memory 1302. The memory 1302 may also store application data, such as images, videos, and other files.
[0149] The communication function of the mobile terminal 1300 can be implemented by the mobile communication module 1304, antenna 1, wireless communication module 1305, antenna 2, modem processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 1304 can provide 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 1300. The wireless communication module 1305 can provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. applied to the mobile terminal 1300.
[0150] The display screen 1306 is used to implement display functions, such as displaying a user interface, images, videos, etc. The camera module 1307 is used to implement shooting functions, such as shooting images, videos, etc. The audio module 1308 is used to implement audio functions, such as playing audio, collecting voice, etc. The power module 1309 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc.
[0151] The sensor module 1310 may include one or more sensors for implementing corresponding sensing detection functions. For example, the sensor module 1310 may include a multi-window anti-flicker sensor for collecting an ambient light distribution image in a shooting scene when detecting that the mobile terminal 1300 starts the camera.
[0152] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.
[0153] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0154] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0155] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0156] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0157] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A shooting method, It is characterized in that include: Acquire an ambient light distribution image in a shooting scene, wherein the ambient light distribution image includes at least two image areas, and the ambient light distribution image refers to an image formed by ambient light data in the shooting scene acquired by an ambient light acquisition device, wherein the field of view of the ambient light acquisition device is the same as the field of view of the camera image sensor; Determine the light source flicker type of each of the image areas through the ambient light distribution image, wherein the light source flicker type includes a no light source flicker type, a single light source flicker type, and a multiple light source flicker type; Determining a target anti-flicker mode for each of the image areas according to the light source flicker type; Based on the target anti-flicker method, light source flicker elimination is performed on the image frames collected in the shooting scene to obtain image frames after light source flicker elimination; The step of acquiring an ambient light distribution image in a shooting scene includes: Acquire an ambient light distribution image in a shooting scene through a preset multi-window anti-flicker sensor; Wherein, the multi-window anti-flicker sensor comprises an anti-flicker sensor array composed of at least two anti-flicker sensors, and the anti-flicker sensor array is used to generate ambient light data corresponding to at least two detection window areas; The determining the light source flicker type of each image area by using the ambient light distribution image includes: Acquire the ambient light data corresponding to each of the detection window areas; Performing a fast Fourier transform on the ambient light data to obtain a light source flicker frequency corresponding to each detection window area; The light source flicker type of each image area is determined according to the number of types of the light source flicker frequency of each image area.
2. The method according to claim 1, It is characterized in that The determining the light source flicker type of each image area according to the number of types of the light source flicker frequency of each image area includes: If it is determined that there is no light source flicker frequency in the image area, determining that the light source flicker type of the image area is a no light source flicker type; If it is determined that there is one type of light source flicker frequency in the image area, determining that the light source flicker type of the image area is a single light source flicker type; If it is determined that there are multiple types of light source flicker frequencies in the image area, then the light source flicker type of the image area is determined to be a multiple light source flicker type.
3. The method according to claim 2, It is characterized in that The step of determining a target anti-flickering mode for each of the image areas according to the light source flickering type includes: If the light source flicker type of the image area is a single light source flicker type, determining to use a first anti-flicker method to eliminate light source flicker in the image area; If the light source flicker type of the image area is a multiple light source flicker type, it is determined to adopt a second anti-flicker method to eliminate the light source flicker of the image area.
4. The method according to claim 3, It is characterized in that The step of eliminating light source flicker in the image area by using a first anti-flicker method includes: Determine a first exposure time corresponding to the image area according to a light source flickering frequency corresponding to the image area, wherein the first exposure time is an integer multiple of a period of the light source flickering frequency; Light source flicker elimination is performed on the image area using the first exposure time.
5. The method according to claim 3, It is characterized in that The adopting the second anti-flickering method to eliminate light source flicker in the image area includes: Determine the flicker frequency of the main light source corresponding to the image area; Determining a second exposure time according to the flicker frequency of the main light source, and performing global light source flicker elimination on the image area by using the second exposure time; and A target detection window area in the image area having a light source flicker frequency other than the main light source flicker frequency is determined, and a multi-frame overlay process is performed on the image content in the target detection window area to eliminate local light source flicker in the image area.
6. The method according to any one of claims 1 to 5, It is characterized in that The at least two image regions include a core region and a non-core region, the core region corresponds to a first detection window region, and the non-core region corresponds to a second detection window region; The determining the light source flicker type of each image area according to the number of types of the light source flicker frequency of each image area includes: Determine the light source flicker type of the core area according to the number of types of light source flicker frequencies corresponding to the first detection window area; The light source flicker type of the non-core area is determined according to the number of types of light source flicker frequencies corresponding to the second detection window area.
7. The method according to claim 6, It is characterized in that The core area includes a central area of the ambient light distribution image, and the non-core area includes an edge area of the ambient light distribution image.
8. A photographing device, It is characterized in that include: An ambient light image acquisition module is used to acquire an ambient light distribution image in a shooting scene, wherein the ambient light distribution image includes at least two image areas, and the ambient light distribution image refers to an image formed by ambient light data in the shooting scene acquired by an ambient light acquisition device, wherein the field of view of the ambient light acquisition device is the same as the field of view of the camera image sensor; a light source flicker type determination module, configured to determine the light source flicker type of each of the image areas through the ambient light distribution image, wherein the light source flicker type includes a no light source flicker type, a single light source flicker type, and a multiple light source flicker type; an anti-flicker mode determination module, used to determine a target anti-flicker mode for each of the image areas according to the light source flicker type; A light source flicker elimination module, configured to eliminate light source flicker from the image frames collected in the shooting scene based on the target anti-flicker method, to obtain image frames after light source flicker elimination; The ambient light image acquisition module is used for: Acquire an ambient light distribution image in a shooting scene through a preset multi-window anti-flicker sensor; Wherein, the multi-window anti-flicker sensor comprises an anti-flicker sensor array composed of at least two anti-flicker sensors, and the anti-flicker sensor array is used to generate ambient light data corresponding to at least two detection window areas; The light source flicker type determination module is used for: Acquire the ambient light data corresponding to each of the detection window areas; Performing a fast Fourier transform on the ambient light data to obtain a light source flicker frequency corresponding to each detection window area; The light source flicker type of each image area is determined according to the number of types of the light source flicker frequency of each image area.
9. A computer readable medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device, It is characterized in that include: Multi-window anti-flicker sensor; processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
