WO2022213683A1 - 一种拍照方法、电子设备及存储介质 - Google Patents

一种拍照方法、电子设备及存储介质 Download PDF

Info

Publication number
WO2022213683A1
WO2022213683A1 PCT/CN2021/144038 CN2021144038W WO2022213683A1 WO 2022213683 A1 WO2022213683 A1 WO 2022213683A1 CN 2021144038 W CN2021144038 W CN 2021144038W WO 2022213683 A1 WO2022213683 A1 WO 2022213683A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
electronic device
exposure
photographing
duration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/144038
Other languages
English (en)
French (fr)
Inventor
崔瀚涛
张作超
李光源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to US18/020,251 priority Critical patent/US12170851B2/en
Priority to EP21935899.1A priority patent/EP4178196B1/en
Publication of WO2022213683A1 publication Critical patent/WO2022213683A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/745Detection of flicker frequency or suppression of flicker wherein the flicker is caused by illumination, e.g. due to fluorescent tube illumination or pulsed LED illumination
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/56Cameras or camera modules comprising electronic image sensors; Control thereof provided with illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/72Combination of two or more compensation controls
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/74Circuitry for compensating brightness variation in the scene by influencing the scene brightness using illuminating means
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/743Bracketing, i.e. taking a series of images with varying exposure conditions

Definitions

  • the embodiments of the present application relate to the technical field of optical imaging, and in particular, to a photographing method, an electronic device, and a storage medium.
  • the camera application runs on the electronic device, and when the camera application is in the capture mode, the capture key of the electronic device is triggered to capture the image of the target object.
  • the electronic device can capture an image of the moving moment of the target object.
  • the principle of the electronic device capturing the instantaneous image of the target object is that the electronic device adopts a high-speed shutter to shorten the exposure time, so that the electronic device can capture a clear image of the instantaneous state of the target object. Understandably, due to the short exposure time, the electronic device needs to be in a well-lit environment, so that the electronic device can capture a clear image of the instantaneous state of the target object.
  • the shooting environment of the electronic device when the shooting environment of the electronic device is an outdoor scene with sufficient light, the natural light in the outdoor scene can meet the exposure requirement of the electronic device.
  • illumination is provided by the lighting device, and sufficient illumination in the indoor place can also meet the exposure requirements of the electronic device.
  • lighting equipment generally works under the driving of alternating current, and under the influence of alternating current, the lighting equipment has a flicker phenomenon. That is, the brightness of the lighting device is affected by the alternating current, and with the periodic change of the amplitude of the alternating current, the brightness of the lighting device also changes accordingly. For example, if a lighting device is driven by 50 hertz (Hz) alternating current, the lighting device strobes 100 times per second.
  • Hz hertz
  • the exposure time of the camera is short. Therefore, the stroboscopic phenomenon of the lighting equipment will affect the exposure of the electronic equipment, which in turn affects the exposure of the images collected by the electronic equipment, causing the stroboscopic phenomenon of the preview image in the preview interface. .
  • the capture key of the electronic device is triggered, and the image is captured by row-by-row exposure. If the exposure duration is less than the duration of one stroboscopic flash, the different stages within the stroboscopic duration corresponding to each exposure duration of the electronic device will make the brightness of the preview images continuously collected by the electronic device inconsistent, and the preview image displayed by the electronic device will appear Flicker phenomenon. Further, if the exposure duration is not an integer multiple of the duration of one stroboscopic flash, when the capture button is triggered and the electronic device captures the image of the target object, the exposure will be inconsistent row by row, and banding will appear on the captured image by the electronic device. , that is, there are streaks of different brightness on the image.
  • the present application provides a photographing method, electronic device and storage medium, which can eliminate the stroboscopic phenomenon in the preview image of the electronic device during the process of capturing the image by the electronic device, and reduce the light and dark stripes in the image when the band-like stripe phenomenon occurs in the image captured by the electronic device. difference in brightness.
  • the present application provides a photographing method, which can be applied to an electronic device having a photographing function.
  • the lighting device provides lighting for the shooting scene of the electronic device, and the lighting device provides stroboscopic light.
  • the method may include the electronic device running a camera application and determining that the lighting in the shooting scene is a stroboscopic shot. Based on this, the electronic device captures the image according to the first exposure mode.
  • the first exposure mode instructs the electronic device to interleave exposure according to the first exposure duration and the second exposure duration, and the electronic device can generate a first photographing queue and a second photographing queue, the first photographing queue includes at least one first image, and the second photographing queue
  • the photographing queue includes at least one second image.
  • the first photographing queue is an image collected by the electronic device during the first exposure duration
  • the second photographing queue is an image collected by the electronic device during the second exposure duration.
  • the first exposure duration is greater than or equal to the stroboscopic duration
  • the second exposure duration is shorter than the stroboscopic duration.
  • the photographing interface includes a preview image and a photographing button, and the preview image is generated according to the image collected in the first exposure mode. Further, in response to the capture key being triggered, the electronic device may generate a captured image according to at least one first image and at least one second image, and display the captured image.
  • the electronic device uses two exposure durations to capture images.
  • the first image is obtained by collecting at the first exposure time
  • the second image is obtained by collecting at the second exposure time.
  • the fluorescent lamp when the electronic device takes a picture, if the fluorescent lamp provides illumination, the fluorescent lamp has a stroboscopic phenomenon, and the stroboscopic phenomenon of the fluorescent lamp will affect the image captured by the electronic device.
  • the first photographing queue ie at least one first image
  • the second photographing queue ie at least one second image
  • the first exposure duration is greater than the second exposure duration
  • the first exposure duration may be an integer multiple of the stroboscopic duration of the lighting device
  • the second exposure duration is shorter than the stroboscopic duration of the lighting device.
  • the first exposure duration is an integer multiple of the stroboscopic duration of the lighting device, the brightness of adjacent frame images in the first image stream obtained by the electronic device is uniform. If the first image stream is used as a preview image, it can effectively Eliminate flickering in preview images.
  • the first exposure duration is an integer multiple of the stroboscopic duration
  • the above-mentioned preview image is generated according to an image collected by the first exposure manner.
  • the stroboscopic times corresponding to the exposure duration of each frame of the first image in the first photographing queue are the same. Therefore, the difference in brightness value of each frame of the first image in the first photographing queue is smaller than the preset brightness threshold.
  • the electronic device uses the first photographing queue as the preview image, the brightness of the preview image displayed by the electronic device is uniform.
  • the electronic device when the electronic device collects an image according to the first exposure mode, the electronic device collects the image according to the first frequency.
  • the electronic device may acquire images in the first photographing queue according to the second frequency, and acquire images in the second photographing queue according to the third frequency, and the sum of the second frequency and the third frequency is the first frequency.
  • the electronic device outputs images at a frame rate of 60fps.
  • the electronic device outputs images in the first photographing queue at a frame output rate of 30 fps, and outputs images in the second photographing queue at a frame output rate of 30 fps.
  • generating a captured image according to at least one first image and at least one second image including:
  • the electronic device determines that the moment when the shooting key is triggered is the shutter moment; the electronic device determines at least one first image in the first photographing queue whose image acquisition time is close to the shutter moment. The image with the highest brightness in the at least one first image is used as the reference frame; the electronic device determines at least one second image whose image acquisition time of the second photographing queue is close to the reference frame acquisition time; and the at least one second image is used as the auxiliary frame , and generate the captured image based on the reference frame and the auxiliary frame.
  • the electronic device may acquire the collected image log, where the image log includes the generation time of the image, and the electronic device may select the image generation time and the shutter moment to be close to the first image.
  • generating a captured image according to at least one first image and at least one second image including:
  • the electronic device determines that the moment when the shooting key is triggered is the shutter moment; the electronic device determines at least one first image in the first photographing queue whose image acquisition time is close to the shutter moment.
  • the image with the highest brightness in at least one first image is used as a reference frame; the electronic device determines at least one second image whose image acquisition time of the second photographing queue is close to the reference frame acquisition time; the electronic device determines at least one second image in the second image.
  • the image with the highest brightness is the auxiliary frame, and the captured image is generated according to the reference frame and the auxiliary frame.
  • the above-mentioned generation of the captured image according to the reference frame and the auxiliary frame includes:
  • the first threshold in the reference frame is determined based on the band detection, and the first threshold represents the banding degree of the reference frame; if the first threshold is greater than the preset threshold, a captured image is generated according to the auxiliary frame; if the first threshold is less than or equal to the preset threshold, A captured image is generated from the reference frame and the auxiliary frame.
  • the captured image is generated according to the reference frame and the auxiliary frame, including:
  • the non-moving area refers to the part of the non-moving object in the image
  • the moving area refers to the part of the image where the target object is located
  • pixel fusion is performed according to the auxiliary frame to weaken the
  • the band-like phenomenon in the non-moving area is used to generate the processed non-moving area
  • the gamma coefficient of the moving area is adjusted to reduce the band-like phenomenon in the moving area, and the processed moving area is generated
  • the image fusion algorithm is used to combine the processed moving area. Regions and processed non-motion regions are fused to generate captured images.
  • generating the captured image according to the auxiliary frame includes: using a preset image deblurring algorithm to process the auxiliary frame, reducing the motion blur phenomenon of the auxiliary frame, to generate the captured image.
  • the electronic device runs the camera application, and the electronic device determines that the light in the shooting scene is a stroboscopic light, including:
  • the electronic device runs the camera application, the electronic device collects images according to the second exposure mode, and the second exposure mode instructs the electronic device to expose according to the third exposure duration.
  • the electronic device continuously acquires multiple images, and calculates the brightness of each image in the multiple images. If the difference in brightness between each two of the multiple images is greater than the preset difference in brightness, it is determined that the light in the shooting scene is a stroboscopic light.
  • the method further includes: if the electronic device detects that the shooting scene has changed, the electronic device captures the image according to a second exposure mode, and the second exposure mode instructs the electronic device to expose according to the third exposure duration.
  • the method further includes: the electronic device determines the exposure mode switching delay, and when the switching delay ends, the electronic device switches from the first exposure mode to The second exposure method.
  • the third exposure duration is equal to the first exposure duration, or the third exposure duration is equal to the second exposure duration.
  • the present application further provides an electronic device, the electronic device includes: a camera for capturing images, and a display screen for displaying an interface.
  • the lighting device provides lighting for the shooting scene of the electronic device, and the lighting device provides stroboscopic lighting, and the duration of the lighting device flashing once is the stroboscopic duration.
  • one or more processors a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by an electronic device, cause the electronic device Implement the following method:
  • the electronic device runs the camera application and determines that the lighting in the shooting scene is a stroboscopic shot. Based on this, the electronic device captures the image according to the first exposure mode.
  • the first exposure mode instructs the electronic device to interleave exposure according to the first exposure duration and the second exposure duration, and the electronic device can generate a first photographing queue and a second photographing queue, the first photographing queue includes at least one first image, and the second photographing queue
  • the photographing queue includes at least one second image.
  • the first photographing queue is an image collected by the electronic device during the first exposure duration
  • the second photographing queue is an image collected by the electronic device during the second exposure duration.
  • the first exposure duration is greater than or equal to the stroboscopic duration
  • the second exposure duration is shorter than the stroboscopic duration.
  • the photographing interface includes a preview image and a photographing button, and the preview image is generated according to the image collected in the first exposure mode. Further, in response to the capture key being triggered, the electronic device may generate a captured image according to at least one first image and at least one second image, and display the captured image.
  • the first exposure duration is an integer multiple of the stroboscopic duration
  • the above-mentioned preview image is generated according to an image collected by the first exposure manner.
  • the stroboscopic times corresponding to the exposure duration of each frame of the first image in the first photographing queue are the same. Therefore, the difference in brightness value of each frame of the first image in the first photographing queue is smaller than the preset brightness threshold.
  • the electronic device uses the first photographing queue as the preview image, the brightness of the preview image displayed by the electronic device is uniform.
  • the electronic device when the electronic device collects the image according to the first exposure mode, the electronic device collects the image according to the first frequency.
  • the electronic device may acquire images in the first photographing queue according to the second frequency, and acquire images in the second photographing queue according to the third frequency, and the sum of the second frequency and the third frequency is the first frequency.
  • a captured image is generated according to at least one first image and at least one second image, and the electronic device is further configured to perform the following operations: the electronic device determines that the moment when the capture key is triggered is the shutter moment; The electronic device determines at least one first image in the first photographing queue whose image acquisition time is close to the shutter moment. The image with the highest brightness in the at least one first image is used as the reference frame; the electronic device determines at least one second image whose image acquisition time of the second photographing queue is close to the reference frame acquisition time; and the at least one second image is used as the auxiliary frame , and generate the captured image based on the reference frame and the auxiliary frame.
  • a captured image is generated according to at least one first image and at least one second image, and the electronic device is further configured to perform the following operations: the electronic device determines that the moment when the capture key is triggered is the shutter moment; The electronic device determines at least one first image in the first photographing queue whose image acquisition time is close to the shutter moment. The image with the highest brightness in at least one first image is used as a reference frame; the electronic device determines at least one second image whose image acquisition time of the second photographing queue is close to the reference frame acquisition time; the electronic device determines at least one second image in the second image. The image with the highest brightness is the auxiliary frame, and the captured image is generated according to the reference frame and the auxiliary frame.
  • Another possible design method of the second aspect is to generate a captured image according to the reference frame and the auxiliary frame.
  • the electronic device specifically performs: determining a first threshold in the reference frame based on the band detection, where the first threshold represents the banding degree of the reference frame; if the first threshold is greater than a preset threshold, a captured image is generated according to the auxiliary frame; if the first threshold is less than or Equal to the preset threshold, the captured image is generated according to the reference frame and the auxiliary frame.
  • a captured image is generated according to the reference frame and the auxiliary frame, and the electronic device is specifically configured to perform: determining the non-motion area and the motion area in the reference frame , the non-motion area refers to the part of the non-moving object in the image, and the motion area refers to the part of the image where the target object is located; for the non-motion area, pixel fusion is performed according to the auxiliary frame to reduce the band-like phenomenon in the non-motion area, and the generation process After the non-motion area; adjust the gamma coefficient of the motion area to reduce the banding phenomenon of the motion area, and generate the processed motion area; use the image fusion algorithm to fuse the processed motion area and the processed non-motion area, to generate the captured image.
  • the captured image is generated according to the auxiliary frame
  • the electronic device is specifically configured to perform: using a preset image deblurring algorithm to process the auxiliary frame, weaken the auxiliary frame of motion blur to generate captured images.
  • the electronic device runs the camera application, the electronic device determines that the light in the shooting scene is a stroboscopic light, and the electronic device is specifically used to execute: the electronic device runs the camera application, and the electronic device follows the second exposure method.
  • the image is collected, and the second exposure mode instructs the electronic device to expose for a long time according to the third exposure time.
  • the electronic device continuously acquires multiple images, and calculates the brightness of each image in the multiple images. If the difference in brightness between each two of the multiple images is greater than the preset difference in brightness, it is determined that the light in the shooting scene is a stroboscopic light.
  • the electronic device is further configured to perform the following operations: if the electronic device detects that the shooting scene has changed, the electronic device captures the image according to the second exposure mode, and the second exposure mode instructs the electronic device to follow the third exposure mode. Exposure time long exposure.
  • the electronic device if the electronic device detects that the shooting scene has changed, the electronic device is further configured to perform the following operations: the electronic device determines the exposure mode switching delay, and when the switching delay ends, the electronic device starts from the first The first exposure mode is switched to the second exposure mode.
  • the third exposure duration is the first exposure duration, or the third exposure duration is the second exposure duration.
  • the present application further provides an electronic device, comprising: a camera for capturing images; a display screen for displaying an interface; one or more processors; a memory; and one or more computer programs, wherein one or more A plurality of computer programs are stored in the memory, and one or more computer programs include instructions, which when executed by the electronic device, cause the electronic device to execute the photographing method in the first aspect and any possible design manners thereof.
  • the present application also provides a computer-readable storage medium, which is characterized by comprising computer instructions, when the computer instructions are run on a computer, the computer is made to execute the first aspect and any possible design methods thereof. How to take pictures.
  • an embodiment of the present application provides a computer program product that, when the computer program product runs on a computer, enables the computer to execute the method for executing the electronic device in the first aspect and any possible design thereof.
  • an embodiment of the present application provides a chip system, and the chip system is applied to an electronic device.
  • the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by lines; the interface circuit is used for receiving signals from the memory of the electronic device and sending signals to the processor, and the signals are included in the memory Stored computer instructions; when the processor executes the computer instructions, it causes the electronic device to perform the method in the first aspect and any possible designs thereof.
  • the electronic device of the second aspect can be understood that the electronic device of the third aspect, the computer-readable storage medium of the fourth aspect, the computer program product of the fifth aspect, and the chip system of the sixth aspect can be
  • the beneficial effects achieved reference may be made to the beneficial effects in the first aspect and any possible design manners thereof, which will not be repeated here.
  • FIG. 1 is a schematic diagram of a photographing scene provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a photographed image provided by an embodiment of the present application.
  • FIG. 3 is an exposure timing diagram provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a system architecture of an electronic device according to an embodiment of the present application.
  • FIG. 6 is a block diagram of the interaction between the hardware abstraction layer and the framework layer provided by an embodiment of the present application.
  • FIG. 7 is a flowchart of a photographing method provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a display interface of a photographing mode provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of capturing an image in an exposure mode corresponding to a snapshot mode provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of image processing for generating a snapshot image by an electronic device in a photographing method provided by an embodiment of the present application;
  • FIG. 11 is a schematic diagram of modules corresponding to a photographing method provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an electronic device according to an embodiment of the application.
  • FIG. 14 is a schematic diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of a chip system provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
  • a feature defined as “first” or “second” may expressly or implicitly include one or more of that feature.
  • plural means two or more.
  • the embodiments of the present application provide a photographing method, which can be applied to electronic devices.
  • the display screen can display the preview images in real time, the brightness of the images in the preview image stream is uniform, and the phenomenon of stroboscopic images of the preview images is eliminated.
  • the shooting button of the electronic device is triggered, the electronic device can capture a clear image including the target object, so as to reduce the brightness difference between light and dark stripes in the image when the band-like stripe phenomenon occurs in the image captured by the electronic device.
  • FIG. 1 is a schematic diagram of a scene of a photographing method provided by an embodiment of the present application.
  • the target object 100 is moving in an indoor place
  • the indoor lighting device electric lamp
  • the electronic device 200 runs a camera application
  • the electronic device 200 collects an image including the target object in real time.
  • Preview image of target object 100 When viewing the preview image on the display screen of the electronic device 200, if the user wants to capture the image of the moving moment of the target object, just click the shooting control on the shooting interface.
  • the shooting key of the electronic device 200 is triggered, the electronic device 200 can capture the image of the moving moment of the target object.
  • the target object may be a person or an animal, a vehicle, a robot, or the like.
  • the target object is a character as an example.
  • the target object is exercising in an indoor place, it can be a person playing badminton, table tennis, practicing yoga, etc. indoors.
  • the target object in the shooting angle of view of the electronic device may be one person or multiple persons.
  • the use of lighting equipment in indoor places provides light, and the lighting equipment can work under the driving of alternating current.
  • the working principle of the fluorescent lamp is that under the action of high-voltage current, the inert gas in the lamp tube is discharged, and the electrons generated by the discharge reach the lamp tube of the fluorescent lamp to make the fluorescent lamp emit light.
  • the working voltage of the fluorescent lamp as 50Hz alternating current as an example, when the fluorescent lamp works under the driving of alternating current, the alternating current of 50 Hz makes the fluorescent lamp strobe 100 times in 1s. That is to say, the duration of the strobe flash of the fluorescent lamp is 1/100s.
  • the display screen of the electronic device can display a preview image
  • the photographing button of the electronic device when the photographing button of the electronic device is triggered, the electronic device generates a snapshot image (also referred to as a photographed image).
  • the electronic device captures the moment of movement of the target object.
  • the flicker of the fluorescent lamp will affect the image collected by the image sensor. If the exposure time is not set properly, the images in the preview image stream may appear stroboscopic, or the images captured by the electronic device may appear banding.
  • a preview image stream is generated on the electronic device, and the preview image stream is displayed on the display screen to form a preview image, so that the user can view the preview image through the display screen.
  • the exposure duration set by the electronic device is less than the duration of one stroboscopic flash of the fluorescent lamp (for example, the image is captured with an exposure duration of 1/50s)
  • the electronic device acquires the images in the preview image stream, the number of strobes included in the exposure of each image different, so that the brightness of the images in the preview image stream obtained by the electronic device is different.
  • the electronic device displays the preview image stream because the brightness of the two images is different, the user thinks that the brightness of the display screen of the electronic device changes. This phenomenon is called a stroboscopic phenomenon.
  • the image sensor captures the image by line-by-line exposure. Due to the stroboscopic fluorescent light, in the process of the image sensor exposing the image line by line, if the fluorescent light flickers, the exposure of different lines in a frame of image will be different, resulting in the phenomenon of bright and dark stripes on the image generated by the electronic device, that is, "Banding" Phenomenon. As shown in Figure 2, it is a schematic diagram of an image including the Banding phenomenon, because the brightness changes during exposure, so that there are bright and dark stripes in the image.
  • the exposure conditions of the images collected by the electronic device are shown. Taking the exposure duration of 1/50s and the exposure duration of 1/200s as examples, the exposure conditions of the images collected by the electronic device are described.
  • the duration of one stroboscopic flash of the fluorescent lamp is 1/100s.
  • the time corresponding to the rising edge of the fluorescent lamp is the time when the fluorescent lamp starts to emit light
  • the time corresponding to the falling edge is the time when the fluorescent lamp ends.
  • the rising edge represents the time when it changes from low level to high level
  • the falling edge represents the time when it changes from high level to low level.
  • the exposure duration is twice the duration of one stroboscopic flash. That is to say, the fluorescent lamp will flicker once during the exposure time, so that the brightness of the image captured by each exposure is the same.
  • each image is a normal exposure frame image, and the brightness of each image is the same.
  • the exposure time is half of the time of one stroboscopic flash. That is to say, when exposing, if the fluorescent lamp is in the light-emitting period, the pixel can be exposed normally; if the fluorescent lamp is in the non-illuminating period, the pixel will not be exposed normally. When the pixels cannot be properly exposed, the resulting image is the abnormally exposed frame image.
  • P1 is the image formed after the first exposure
  • the first exposure duration only corresponds to the stroboscopic light-emitting period of the fluorescent lamp
  • the image P1 formed under this exposure is a normal exposure image
  • P2 is the image formed after the second exposure
  • the duration of the second exposure corresponds to the stroboscopic lighting time period of the fluorescent lamp and the time period that the fluorescent lamp does not emit light.
  • the image P2 formed under this exposure is an abnormal exposure image.
  • P3 is an image formed after the third exposure, and the duration of the third exposure corresponds to the light-emitting period of the fluorescent lamp stroboscopically and the time period when the fluorescent lamp does not emit light.
  • the image P3 formed under this exposure is an abnormally exposed image.
  • P4 is the image formed after the fourth exposure.
  • the duration of the fourth exposure only corresponds to the light-emitting period of the fluorescent lamp stroboscopic. Based on the same problem as the above image P1, the image P4 formed under this exposure is a normal exposure image.
  • the exposure time of 1/200s represents the exposure time of each pixel, that is to say, under this exposure time, the exposure time of each pixel is constant during line-by-line exposure.
  • the exposure time of each pixel includes the same number of stroboscopic flashes, that is, the brightness of the light collected by each pixel exposure is the same, so the image is also a normally exposed image.
  • the image sensor of the electronic device in order to solve the stroboscopic phenomenon of the preview image when the electronic device is in the photographing mode.
  • Set the image sensor of the electronic device to output frames at a high frame rate to eliminate the stroboscopic phenomenon of the preview image. For example, set the exposure duration of 1/200s, and set the image sensor to output image frames at a speed of 120fps (frames per second), and the electronic device buffers the captured image stream.
  • the following processing is performed for each frame of image: the image brightness of each frame is merged with the previous frame and the next frame, so that the brightness of each frame image is the same as the image brightness of the two frames before and after. In this way, after each frame of image is processed, the brightness of each frame of image in the image stream is equal, which reduces the stroboscopic phenomenon of the image in the image stream.
  • the electronic device performs frame extraction processing on the image stream, extracts the frame of the 120fps image stream to obtain the 30fps image stream, and the electronic device displays the 30fps image stream, so that the user can see the preview image through the electronic device.
  • a preview image stream with a high frame rate needs to be collected, thus limiting the exposure time of each frame of image.
  • the frame rate is increased, the noise in the image will be higher, thus affecting the display effect of the preview image.
  • the image sensor operates at a high frame rate, the captured image resolution is limited. It should be noted that the resolutions of the images collected by the existing image sensors are all below 1080P. If a high frame rate is used to output frames, the electronic device cannot capture images with high resolution.
  • an image algorithm in order to solve the Banding phenomenon in the image captured by the electronic device, an image algorithm can be used to reduce the Banding phenomenon in the image. It should be understood that no special algorithm is currently set to eliminate the Banding phenomenon in the image. Generally speaking, the banding phenomenon in the image can be reduced by adjusting the gamma curve in the camera, or adjusting the local tone mapping in the image sensor. However, this processing method will reduce the contrast in the image captured by the electronic device, which affects the display effect of the image.
  • a longer exposure time can be used to reduce the effect of fluorescent light flicker on the image.
  • the exposure duration is set to an integer multiple of 1/100s, the banding phenomenon will not occur in the images captured under this exposure duration.
  • a method of overlapping exposures with multiple exposure durations is used to improve the dynamic range of the video image.
  • different exposure durations form corresponding image streams.
  • overlapping exposures with three exposure durations produces long-frame, mid-frame, and short-frame images.
  • Electronic devices use ISP to synthesize long-frame, mid-frame and short-frame images to form HDR images.
  • a hardware mechanical shutter can be used to solve the problem of the Banding phenomenon in the image.
  • the mechanical shutter can control all the pixels in the image sensor to be exposed at the same time, instead of row by row, this exposure method can eliminate the Banding phenomenon on the image.
  • an embodiment of the present application provides a photographing method, and the method in the embodiment of the present application can be applied to a scene in which an instantaneous state of a target object is captured. It can effectively eliminate the stroboscopic phenomenon of the preview image and generate the Banding phenomenon on the captured image.
  • sports games such as basketball games, swimming games, etc.
  • sports games are played in indoor scenes.
  • users can use electronic devices to capture wonderful moments during the game.
  • a lighting device when an activity is performed in an outdoor venue, a lighting device is used to provide light when the outdoor sunlight is insufficient, such as an outdoor parent-child activity, an outdoor football match, and the like.
  • the use of electronic devices can capture the best moments during the event or competition.
  • the exposure mode corresponding to the snapshot mode includes two exposure durations, and the two exposure durations are staggered for exposure, and the electronic device can obtain an image stream corresponding to each exposure duration.
  • the electronic device may separately store the images captured under each exposure duration for generating a preview image, and generating a snapshot image in response to the capture key being triggered.
  • the electronic device collects the first image stream corresponding to the first exposure duration (ie, multiple frames of first images), and the second image stream corresponding to the second exposure duration (ie, multiple frames of second images).
  • the first exposure duration is greater than the second exposure duration
  • the first exposure duration may be an integer multiple of the stroboscopic duration of the lighting device
  • the second exposure duration is shorter than the stroboscopic duration of the lighting device.
  • the first exposure duration is an integer multiple of the stroboscopic duration of the lighting device, the brightness of adjacent frame images in the first image stream obtained by the electronic device is uniform. If the first image stream is used as a preview image, it can effectively Eliminate flickering in preview images.
  • the electronic device when the electronic device displays the preview image, it can directly display the first image stream as the preview image.
  • the electronic device may generate a preview image stream according to the first image stream and the second image stream acquired by real-time processing, and display the preview image stream through the display screen. Due to the high definition of the images in the second image stream, the images in the first image stream and the images in the second image stream are used for de-banding and deblurring processing, so that a high-quality preview image stream can be obtained, which improves the performance of electronic equipment. The quality of the displayed preview image stream to provide users with a good preview experience.
  • the electronic device may process the image corresponding to the moment when the capture key is triggered in the second image stream to obtain a captured image and display the captured image.
  • the electronic device may process the first image and the second image at the moment when the capture key is triggered to obtain a snapshot image and display the snapshot image. Since the second exposure duration is less than the duration of one stroboscopic flash of the fluorescent lamp, the image in the second image stream is of high definition, and the image in the second image stream is used as a reference frame, and the image in the first image stream is used as an auxiliary frame.
  • the auxiliary frame and the reference frame are used for image processing algorithm to generate a snapped image that does not include the banding phenomenon, and the snapped image has high definition.
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device 200 may include a processor 210 , an external memory interface 220 , an internal memory 221 , a universal serial bus (USB) interface 230 , a charge management module 240 , a power management module 241 , and a battery 242 , sensor module 280, key 290, motor 291, indicator 292, camera 293, display screen 294 and so on.
  • the sensor module 280 may include a pressure sensor, a gyro sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a temperature sensor, a touch sensor, an ambient light sensor, and the like.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the controller may be the nerve center and command center of the electronic device 200 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the processor 210 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI) and/or general-purpose input/output (GPIO) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 200 .
  • the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 240 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the power management module 241 is used to connect the battery 242 , the charging management module 240 and the processor 210 .
  • the power management module 241 receives input from the battery 242 and/or the charge management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the like.
  • the power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 294 is used to display images, videos, and the like.
  • Display screen 294 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 200 may include one or N display screens 294 , where N is a positive integer greater than one.
  • the electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor.
  • the ISP is used to process the data fed back by the camera 293 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 293 .
  • Camera 293 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 200 may include 1 or N cameras 293 , where N is a positive integer greater than 1.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 200 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, and the like.
  • the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 .
  • the internal memory 221 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 200 and the like.
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the keys 290 include a power-on key, a volume key, and the like. Keys 290 may be mechanical keys. It can also be a touch key.
  • the electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200 .
  • Motor 291 can generate vibrating cues.
  • the motor 291 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 291 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 294 .
  • the indicator 292 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the software system of the electronic device 200 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the operating system of the electronic device may include but is not limited to (Symbian), (Android), (iOS), (Blackberry), Harmony and other operating systems are not limited in this application.
  • the embodiments of the present application take an Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device 200 .
  • FIG. 5 is a block diagram of a software structure of an electronic device 200 according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the Android system is divided into five layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, a hardware abstraction layer, and a driver layer.
  • the application layer can include a series of application packages.
  • the application package can include applications such as camera, gallery, calendar, phone, map, video, short message and so on.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include an interface corresponding to the camera application, a window manager, a content provider, a view system, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • Content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example: camera service, media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • Media Libraries Media Libraries
  • 3D graphics processing library eg: OpenGL ES
  • 2D graphics engine eg: SGL
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the hardware abstraction layer includes a camera component (Camera Device3), an image pipeline mode component (Image Pipeline) and a software application component (Image Stream Callback MGR), and the driver layer includes an image sensor (sensor), image processing unit front-end nodes (Front End, ISP-FE), image processing unit back-end node (Back End, ISP-BE), etc.
  • the camera application in the application layer can be displayed on the screen of the electronic device in the form of an icon.
  • the electronic device runs the camera application.
  • the camera application runs on the electronic device, and the electronic device can send corresponding touch events to the kernel layer according to the user's operation.
  • the kernel layer converts touch events into raw input events, which are stored in the kernel layer.
  • the touch screen receives a touch event
  • the camera application is started, and then the camera is started by invoking the kernel layer.
  • the electronic device is in the capture mode in the camera application.
  • Image Pipeline includes zero delay processor (zero shutter lag Manager, ZSL Manager), FE node (Node), BE-Streaming backend image stream node (Node), BE-Snapshot backend image snapshot node (Node), Internet Protocol Suite (IPS) (or understood as the pipeline filtering model in the pipeline mode), the memory that carries the platform algorithm, etc.
  • zero delay processor zero shutter lag Manager, ZSL Manager
  • FE node node
  • BE-Streaming backend image stream node Node
  • BE-Snapshot backend image snapshot node Node
  • IPS Internet Protocol Suite
  • the ZSL processor is used to provide a preview image when the camera application is running, and the ZSL processor is set in the historical frame holder of the raw domain image.
  • ZSL Manager can be used to manage the preview image stream acquired by ZSL, and can configure, queue, and select frames for the preview image stream.
  • FE Node is the root node of the pipeline mode, that is, the original node of all image processing collected by electronic equipment, and can be used as the front-end processor of the hardware ISP chip.
  • the back-end image streaming node (BE-Streaming-Node) is used to process the preview image stream. For example, a preview image stream when the electronic device is in a snapshot mode, and a preview image stream when the electronic device is in a recording state, etc.
  • an IPS can also be mounted, ie the backend image stream section can access the preview images processed by the ISP. Mounting refers to the process by which an operating system allows an electronic device to access files on a storage device.
  • the back-end snapshot node (BE-Snapshot-Node) is used to process snapshot-related images. For example, a snapshot image is generated according to the first image and the second image.
  • an IPS can also be mounted, i.e. the backend snapshot nodes can access the snapshot images processed by the ISP.
  • IPS is a pipeline filtering model of the HAL layer. Plug-ins can be set in the IPS, and the plug-ins can be used to access the storage algorithm of the storage device. After the IPS access algorithm can be used to take over the camera preview, camera action and data in video mode, etc. In some embodiments, the IPS may interact with the camera's framework layer and HAL to implement corresponding functions.
  • Algo is an image processing algorithm module that can be mounted by IPS.
  • Algo may include an algorithm processing module, and when Algo calls the algorithm processing module, processors such as CPU, GPU, and NPU can be accessed when running the algorithm.
  • the image sensor (sensor) is used to acquire images, is responsible for the power-on or power-off timing diagram of the hardware sensor, and is also used for matching control, real-time image sensor configuration and reset functions.
  • the staggered exposure mode of the two exposure durations corresponding to the exposure mode of the snapshot mode can be realized by setting an image sensor.
  • the electronic device is in the capture mode in the camera application
  • the camera application calls the corresponding interface in the application framework layer
  • starts the camera driver by calling the kernel layer turns on the camera of the electronic device, and captures images through the camera.
  • the exposure mode corresponding to the snapshot mode is staggered exposure of the first exposure duration and the second exposure duration
  • the camera of the electronic device is exposed according to the exposure mode corresponding to the snapshot mode
  • the image sensor collects images.
  • the first image stream corresponding to the first exposure duration and the second image stream corresponding to the second exposure duration are stored in the ZSL Manager.
  • the FE Node in the electronic device can process the first image stream in the ZSL Manager to generate a preview image stream, and the electronic device displays the preview image stream.
  • the BE-Snapshot Node will generate a snapshot image according to the first image (auxiliary frame) and the second image (reference frame), and display the snapshot image on the display screen.
  • the electronic device in the embodiment of the present application may be a mobile phone with a camera function, a sports camera (GoPro), a digital camera, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, a vehicle-mounted device, a super mobile Personal computers (ultra-mobile personal computer, UMPC), netbooks, and cellular phones, personal digital assistants (personal digital assistants, PDA), augmented reality (augmented reality, AR) ⁇ virtual reality (virtual reality, VR) devices, etc.
  • the specific form of the electronic device is not particularly limited in the application embodiments.
  • the electronic device includes a snapshot mode, and in the snapshot mode, the electronic device can capture images according to the first exposure duration and the second exposure staggered exposure (ie, the first exposure mode). As shown in FIG. 6 , it shows the flow of generating the snapshot image by the electronic device.
  • the photographing process of the electronic device is run between the hardware abstraction layer and the framework layer.
  • the framework layer includes camera application (APP1), camera service (camera service), display synthesis system (surface flinger); hardware abstraction layer (HAL) includes camera driver 3 (camera device3), first exposure method, software Application Stream (APP Stream), FE Node (Node), BE-Streaming Backend Image Stream Node (Node) and ZSL Processor.
  • the camera application is triggered, the camera application issues a camera operation request, and the photographing mode of the camera application is snapshot.
  • the camera service in the framework layer is triggered and drives the camera corresponding to the camera in the hardware abstraction layer.
  • the camera driver invokes the first exposure method, and the first exposure method submits a photographing request to the FE node.
  • the ZSL processor includes two photographing queues, VC0 and VC1.
  • the first exposure mode instructs the electronic device to interleave exposure according to the first exposure duration and the second exposure duration. When the electronic device forms a VC0 photographing queue according to the images collected under the first exposure duration, When the electronic device forms a VC1 photographing queue according to the images collected under the second exposure duration.
  • the FE node transmits the captured photo queue to the BE-Streaming back-end image stream node.
  • the ZSL processor transmits the VC0 image queue to the image pipeline, which streams the image queue to the framework layer through the software application.
  • the framework layer receives the feedback data from the hardware abstraction layer, and displays the image on the display screen through the display synthesis system.
  • the electronic device is a mobile phone as an example, and a camera application is installed in the mobile phone.
  • FIG. 7 is a flowchart of a photographing method provided by an embodiment of the present application. As shown in FIG. 7 , the method includes steps 701 to 702 .
  • the mobile phone runs a camera application, and the mobile phone takes a picture in a snapshot mode in the camera application.
  • the embodiments of the present application illustrate the photographing method provided by the embodiments of the present application by taking the lighting device providing illumination in the photographing environment and the mobile phone in the capture mode of the camera collecting images as an example.
  • the snapshot mode in the camera only corresponds to using the first exposure mode to acquire images. In practical applications, the capture mode may not be set in the camera.
  • the mobile phone detects that the current shooting environment is illuminated by a fluorescent lamp, and the illumination provided by the fluorescent lamp is a stroboscopic light, the electronic device acquires the image according to the snapshot mode (ie, the first exposure mode is used).
  • Step 701 the mobile phone is in the snapshot mode in the camera application, and the mobile phone displays a preview image.
  • the camera application may include multiple photographing modes.
  • the effects of the images obtained by different photographing modes are different.
  • camera applications include portrait mode, snapshot mode, night scene mode, etc.
  • the images obtained in portrait mode have obvious facial features, and the images obtained in snapshot mode can capture the movement of the target object at the moment of movement. Image clarity is high.
  • Each mode is also used in the corresponding scenario.
  • the embodiments of the present application take the snapshot mode as an example to describe the photographing methods provided by the embodiments of the present application. It is understandable that this photographing method is not only applicable to the snapshot mode.
  • the mobile phone when the mobile phone runs the camera application, the mobile phone displays the camera interface as shown in FIG. 8 .
  • the photographing interface includes multiple photographing modes applied by the camera, such as time-lapse shooting mode 81 , night scene shooting mode 82 , portrait shooting mode 83 , snapshot shooting mode 84 , video shooting mode 85 , and professional shooting mode 86 .
  • the shooting key 87 indicates the current shooting mode. As shown in FIG. 8 , the shooting key 87 indicates that the current shooting mode is the snapshot shooting mode 84 .
  • the snapshot mode refers to generating an image of the moving moment of the target object when the mobile phone captures the target object.
  • the mobile phone is in the snapshot mode in the camera application, and the mobile phone exposes according to the exposure mode corresponding to the snapshot mode.
  • the exposure mode is that the first exposure duration and the second exposure duration are alternately exposed, and the first exposure duration is longer than the second exposure duration.
  • the first exposure duration and the second exposure duration are interleaved, so that the mobile phone can capture two image streams.
  • the first exposure duration corresponds to the first image stream
  • the second exposure duration corresponds to the second image stream.
  • FIG. 9 is a schematic diagram of an exposure manner in which a mobile phone adopts a snapshot mode.
  • Expo L corresponds to the first exposure duration
  • Expo S corresponds to the second exposure duration
  • SOFL represents the moment when the frame image starts to be read out after the first exposure duration exposure
  • EOF L means after the first exposure duration exposure
  • SOFS represents the time when the frame image is read out after the second exposure time is long exposed
  • EOF S is the time when the frame image is read out after the second exposure time is finished.
  • the mobile phone can read the first image corresponding to the first exposure duration (that is, a frame of images in the first photographing queue), that is, the first image.
  • the readout time of the image From the SOF S time to the EOF S time, the mobile phone can read the second image corresponding to the second exposure duration (that is, a frame of image in the second camera queue), that is, the readout duration of the second image.
  • the time between the end readout time of the previous frame of the first image and the start readout time of the next frame image is the idle time between the two frames of images (Vertical Blank, VB ).
  • the start reading time of the first image and the end reading time of the second image represent the duration of a first image and a second image collected by the mobile phone, or called a complete frame length (Frame Length).
  • the first exposure duration is 1/50s
  • the second exposure duration is 1/200s.
  • the exposures were overlapped for the two exposure durations, and one frame of image was acquired for each exposure.
  • the long-exposure image stream VC0 is displayed to eliminate the stroboscopic phenomenon in the preview image.
  • the mobile phone acquires the first photographing queue VC0, and the mobile phone displays the first photographing queue VC0 as a preview image.
  • the mobile phone uses the second photographing queue VC1 as a reference frame, and processes each frame of the image in the second photographing queue VC1 according to the image in the first photographing queue VC0 to generate a preview image and display it on the display screen of the mobile phone.
  • the preview image is a reference frame, and processes each frame of the image in the second photographing queue VC1 according to the image in the first photographing queue VC0 to generate a preview image and display it on the display screen of the mobile phone.
  • Step 702 After receiving the trigger operation of the capture key, the mobile phone generates a snapshot image and displays the snapshot image.
  • VC0 and VC1 collected for the above-mentioned exposure duration are continued as examples.
  • a high-speed shutter is set in the mobile phone. When the high-speed shutter is triggered, the mobile phone captures the image of the moving moment of the target object.
  • the mobile phone caches a reference frame, and the reference frame is an effective exposure image collected under the second exposure duration. Further, the mobile phone caches at least one auxiliary frame, and the auxiliary frame is an image collected under the first exposure duration.
  • the mobile phone performs image processing according to the at least one auxiliary frame and the reference frame to obtain a snapshot image, and the mobile phone displays the snapshot image. This enables users to view the captured images through their mobile phones.
  • the phone can obtain the exposure duration and ISO of each frame of the image through the image log (ISP LOG) in the ISP processor.
  • ISP LOG image log
  • the log of the image collected by the mobile phone with the first exposure duration in the first exposure is: 07-15 10:11:34.534[974.717864][cpu0][I/FW] ⁇ fast_scheduie_hdr_merge_core_exec, 218> iso_frame.
  • the log of the image collected by the mobile phone during the second exposure duration in the first exposure is: 07-15 10:11:34.534[974.717864][cpu0][I/FW] ⁇ fast_scheduie_hdr_merge_core_exec, 218>100,100.
  • the log of the image collected by the mobile phone with the first exposure duration in the second exposure is: 07-15 10:11:34.534[974.717895][cpu0][I/FW] ⁇ fast_scheduie_hdr_merge_core_exec, 219>expo_frame.
  • the log of the image collected by the mobile phone with the second exposure duration is: 07-15 10:11:34.534[974.717895][cpu0][I/FW] ⁇ fast_scheduie_hdr_merge_core_exec, 218>10000,2500.
  • the mobile phone can use the first image stream as the preview image stream, and the processor processes the collected first image stream and displays it as the preview image.
  • the mobile phone when the mobile phone uses the first exposure duration to capture the image, the mobile phone can output the image at a frame output speed of 60 frames per second (f/s). For example, under the first exposure duration, the mobile phone can output the first image stream at a frame rate of 30 frames/second (f/s); under the second exposure duration, the mobile phone can also output the first image stream at a frame rate of 30 frames/second (f/s). ) to output the second image stream.
  • the ZSL processor can prepare two buffers for buffering the first image stream and the second image stream.
  • the frame output speeds of the first exposure duration and the second exposure duration are the same.
  • the mobile phone when the mobile phone receives the operation that the shooting button is triggered, the mobile phone can generate a snapshot image according to the historical frame images cached in the ZSL processor and the images collected by the mobile phone at the moment when the shooting button is triggered.
  • the mobile phone when the mobile phone receives the operation of the shooting button being triggered, the wonderful action of the target object photographed by the mobile phone is taking place, or the wonderful action of the target object has already occurred.
  • This phenomenon is a shutter lag phenomenon.
  • the mobile phone can generate a snapshot image according to the historical frames cached by the ZSL processor. Wherein, when the mobile phone selects the historical frame image in the ZSL processor, it can select the image frame cached by the mobile phone when the shutter of the mobile phone is exposed, or can select the image frame cached before the shutter exposure time of the mobile phone.
  • the mobile phone can capture a clear image at the moment of the movement of the target object.
  • the second exposure duration is less than the duration of the stroboscopic flash of the lighting device, there may be uneven exposure in the reference frames cached by the mobile phone.
  • the mobile phone can use the image frames in the first image stream collected according to the first exposure duration as a reference. frame, and exposure processing is performed on the image frames in the second image stream, so as to eliminate the phenomenon of uneven exposure of the image frames in the second image stream.
  • the mobile phone can select a frame of VC1(n) from the VC1 cached by ZSL as a reference frame, and the frame images before and after VC1(n) (ie, VC1(n-1) and VC1(n+1)) as auxiliary frames, and The image frame in VC0 with the timestamp closest to VC1(n) (eg, VC0(n)), the mobile phone processes VC0(n), reference frame and auxiliary frame to generate a snapshot image.
  • the mobile phone may select at least two images of the image frames before and after the reference frame as auxiliary frames.
  • the selected cached image frames can be transmitted from the FE node to the BE node, and the format of the image frame is converted from the original raw domain image to the YUV format (an image format) image, so that the mobile phone can process these selected cached images. , to generate a snapshot image.
  • YUV format an image format
  • FIG. 10 is a schematic diagram of a mobile phone generating a snapshot image according to the first image stream and the second image stream.
  • the image sensor in the mobile phone is exposed in a manner of interleaving the first exposure duration and the second exposure duration, and the images collected by the image sensor are cached in the ZSL processor.
  • the ZSL processor caches 6 frames of images of VC0 and 6 frames of images of VC1. Assuming that the shooting button of the mobile phone is triggered and the mobile phone detects that the wonderful action of the target object has occurred, the mobile phone can select VC1(n) in VC1 as the reference frame, and VC1(n-1) and VC1(n+1) as auxiliary frames.
  • the mobile phone can also select the VC0(n) image with the closest timestamp to VC1(n) in VC0, and the mobile phone will strip VC1(n) according to VC0(n), VC1(n-1) and VC1(n+1). processing, and image deblurring (deblur) to denoise the image to improve the image quality, thereby generating a snapshot image.
  • the image in the FE node is a raw domain image
  • the image in the BE node is a YUV format image.
  • the log of the mobile phone starting to be in the snapshot mode in the camera application is: Cam/HBC:[acquireBufferSets]rRequiredStreams:Image(0):Meta(0).
  • the mobile phone is in the snapshot mode, and after the mobile phone displays the preview image for a period of time, the log of the images corresponding to the first exposure duration and the second exposure duration is cached in the ZSL processor:
  • cv 0 available(7) corresponds to the cached image of the first image stream
  • cv1available(7) corresponds to the cached image of the second image stream.
  • the mobile phone can read the log of some cached images from ZSL, I Cam/ZslMgr:[selectBuf_Locked]-:Get enough buffer from HBC(reqFrameSz_cv1:3,reqFrameSz_cv0:1,, req:40,policy:0x30001).
  • the ZSL processor receives the log of reading the cached image and the request to read the image is pending: I Cam/ZslMgr:[operator()][submitZslRequest][requestNo:113]:successfully process pending request(reqNo:40).
  • the log of the corresponding cached image output by the ZSL processor is: remove from pending list[pendingSz(0)].
  • the mobile phone when the mobile phone is in the capture mode in the camera application, the mobile phone can first detect the lighting in the shooting environment, and determine whether there is a stroboscopic lighting device in the shooting environment of the mobile phone to provide lighting. If there is no stroboscopic lighting device in the shooting environment to provide light, the mobile phone can use an exposure method with an exposure time to obtain a snapshot image. If there is a stroboscopic lighting device in the shooting environment to provide light, the mobile phone can acquire the captured image by using the above-mentioned exposure method including the first exposure duration and the second exposure duration.
  • VC1 includes multiple frames of images, for example, including 1 frame of reference frame and N frames of auxiliary frames.
  • VC1(n) is a reference frame
  • VC1(n-1) and VC1(n+1) are auxiliary frames.
  • Detect the degree of banding in the reference frame such as the first threshold. If the first threshold is less than or equal to the preset threshold, it means that the preset algorithm in the mobile phone can reduce the degree of banding in the reference frame; if the first threshold is greater than the preset threshold, it means that the preset algorithm in the mobile phone cannot handle the banding in the reference frame.
  • the preset de-banding algorithm in the mobile phone can reduce the banding in the reference frame, and the mobile phone can perform image segmentation based on the reference frame of VC1.
  • the reference frame is divided into motion regions and non-motion regions.
  • Gamma processing is performed on the motion regions in the reference frame to reduce the banding phenomenon in the motion regions.
  • Image fusion is performed on the non-motion area in the reference frame and the reference frame, and the banding is fused with the help of the banding distribution of adjacent reference frames to reduce the banding phenomenon in the non-motion area.
  • Image fusion is performed on the moving area after banding processing and the non-moving area after image fusion to obtain the captured image.
  • the image frame in the VCO can be used as an auxiliary frame, so as to reduce the degree of banding in the non-motion area.
  • the de-banding algorithm in the mobile phone cannot reduce the banding in the reference frame, and the mobile phone uses the preset de-blurring algorithm to process the VC0 of a single frame. to get the captured image.
  • the mobile phone when the mobile phone detects whether there is a stroboscopic lighting device in the shooting environment to provide light, the light in the shooting environment of the mobile phone can be determined by the light sensor.
  • the mobile phone uses a short-time exposure to collect at least two images, and judges whether there is a stroboscopic lighting device to provide light through the images.
  • the environment where the mobile phone is located is also the environment where the target object is located, therefore, the lighting situation in the shooting environment can be determined by the light sensor.
  • the mobile phone is in a snapshot mode in the camera application, which may include natural light shooting scenes and fluorescent light shooting scenes, and the mobile phone can obtain the user's selection of shooting scenes to determine the exposure mode to be adopted.
  • other ways may also be used to determine the illumination in the shooting environment in the specific implementation, which will not be illustrated here.
  • the mobile phone when the mobile phone runs the camera application, the mobile phone can capture images according to the second exposure duration, and the second exposure duration instructs the mobile phone to capture images according to the third exposure duration.
  • the mobile phone collects at least two images according to the second exposure duration, and the mobile phone calculates the brightness of each acquired image. If the brightness difference between the two images is greater than the preset brightness difference, it means that the current shooting environment of the mobile phone is a frequent Flash photo. If the mobile phone collects multiple consecutive frames of images, the mobile phone calculates the brightness of each image, and calculates the brightness difference between two adjacent images.
  • the environment is strobe light.
  • the third exposure duration may be equal to the first exposure duration, or the third exposure duration may be equal to the second exposure duration.
  • the mobile phone exposes according to the light in the shooting environment and according to the exposure mode corresponding to the light.
  • the mobile phone can detect the light in the environment again, and determine whether to switch the exposure mode according to the result of the detected light.
  • the current shooting environment of the mobile phone is natural light, the light is weak, artificially increases the light through fluorescent lamps, and the mobile phone detects that the light intensity in the environment has changed greatly, that is, the increase in the light intensity exceeds the preset light change threshold, and the mobile phone detects the current shooting environment.
  • the mobile phone can switch the exposure mode.
  • the mobile phone can also set a preset detection duration. When the mobile phone is in the snapshot mode, after the preset detection duration, the mobile phone determines the illumination in the current shooting environment once. In this way, it can be ensured that when the mobile phone captures an image, the exposure mode of the mobile phone can meet the current shooting needs.
  • the mobile phone when the mobile phone runs the camera application, the mobile phone may be exposed first according to the second exposure mode.
  • the process of switching the exposure mode is shown.
  • the mobile phone can first determine whether the current shooting scene is a high-brightness environment, and if it is a high-brightness environment, an image is collected according to the second exposure method. If it is not a bright environment (eg, a low-light environment), the mobile phone continues to detect whether the current environment includes stroboscopic lighting.
  • the mobile phone determines that the current shooting environment includes stroboscopic flash photos, the mobile phone collects images according to the first exposure mode; if the mobile phone determines that the current shooting environment does not include stroboscopic flash photos, the mobile phone captures images according to the second exposure mode.
  • the mobile phone when the mobile phone is in the shooting state, the mobile phone can continue to detect the change of the shooting scene. If the mobile phone detects that the shooting scene has changed, the mobile phone can collect images according to the second exposure method; if the mobile phone does not detect that the shooting scene has changed, the mobile phone Continue to acquire images according to the first exposure mode.
  • the first exposure mode outputs images at a frame output speed of 60 fps
  • the first exposure duration outputs images at a frame output speed of 30 fps
  • the second exposure duration outputs images at a frame output speed of 30 fps.
  • the mobile phone In the second exposure mode corresponding to the third exposure duration, the mobile phone outputs an image at a frame rate of 30 fps based on the third exposure duration.
  • the mobile phone may switch the first exposure mode to the second exposure mode after the switching duration is completed. For example, if the switching duration is set to 5s (seconds), when the mobile phone determines to switch from the first exposure duration to the second exposure duration, the mobile phone will start the switching timing, and after the switching timing has elapsed for 5s, the mobile phone will switch the first exposure method to the second exposure method . Similarly, if the mobile phone determines to switch from the second exposure mode to the first exposure mode, the mobile phone can change the exposure mode after the switching period.
  • the mobile phone can be divided into modules so that the mobile phone can obtain the captured image.
  • the mobile phone may include a collection module 1001 , a detection module 1002 , a deblurring module 1003 , a stripping module 1004 and an output module 1005 .
  • the process in which the mobile phone obtains the captured image is described by taking the process in which the mobile phone is in the snapshot mode and the capture button is triggered and the mobile phone generates the snapshot image as an example.
  • the acquisition module 1001 is used to acquire images in the exposure mode of the snapshot mode.
  • the mobile phone acquires the image by interleaving the first exposure duration and the second exposure duration.
  • the mobile phone acquires the triggering operation of the shooting key by the user, and the acquisition module 1001 can transmit the acquired image to the detection module 1002.
  • the acquisition module 1001 can use the image acquired by the mobile phone when the shooting key is triggered as a reference frame, and at least one auxiliary frame can be transmitted to the detection module 1002 .
  • the detection module 1002 can be used to detect the degree of banding in the reference frame transmitted by the acquisition module 1001 . If the value of the banding in the reference frame is less than the preset banding threshold, the detection module 1002 sends the reference frame to the deblurring module 1003 . If the value of the banding phenomenon in the reference frame is greater than or equal to the preset banding threshold, the detection module 1002 sends the reference frame and at least one auxiliary frame of the frame to the de-banding module 1004 .
  • the deblurring module 1003 is used for deblurring the reference frame.
  • the deblurring module 1003 is provided with a deblurring algorithm program, so that the deblurring module 1003 can perform a deblurring operation on the reference frame image.
  • the deblurring module 1003 outputs the deblurred image to the output module 1005 .
  • the deblurring module 1003 generates a snapshot image after deblurring, and transmits the snapshot image to the output module.
  • the stripping module 1004 is used to segment the moving subject with reference to the frame, and the moving subject is generally a shooting object in a captured scene.
  • the captured scene is the scene of a basketball game, and the subject of the movement is the basketball player.
  • the reference frame is segmented into a moving area (ie, the area where the target object is located in the image) and a non-moving area.
  • the motion area is de-banded according to the auxiliary frame, and the pixels of the non-motion area are fused according to the auxiliary frame and the reference frame in the first image stream buffered by the acquisition module 1001 to realize the de-banding of the non-motion area.
  • the de-banded moving area and the non-moving area are fused to generate a de-banded image.
  • the debanding module 1004 transmits the debanded image to the output module 1005 .
  • the deblurring module 1003 generates a snapshot image after de-banding processing, and transmits the snapshot image to the output module.
  • the auxiliary frame is an image frame adjacent to the reference frame, and the timestamp of the auxiliary frame in the first image stream is closest to the timestamp of the reference frame.
  • the de-banding module 1004 de-bands the reference frame by adopting multi-frame fusion, which can effectively reduce the noise in the reference frame. Since the timestamps of the auxiliary frames in the first image stream are close to the timestamps of the reference frames, and the first image stream is acquired under the first exposure time, and the exposure time of the auxiliary frames in the first image stream is longer, the The noise in the auxiliary frame is small. Therefore, using the auxiliary frame in the first image stream can effectively reduce the noise in the reference frame and improve the image quality.
  • the output module 1005 can display the captured image on the display screen.
  • the output module 1005 can be used to perform image format conversion on the de-banded image, so that the screen of the mobile phone can display the captured image.
  • the output module 1005 can perform format conversion on the deblurred image, so that the screen shot of the mobile phone can directly display the captured image.
  • the target object can be identified for the reference frame including a single target object to realize the segmentation of the moving subject, and the complex scene including multiple target objects in the reference image can be used.
  • the optical flow method realizes the segmentation of moving subjects.
  • a special recognition algorithm can be used to identify the target object in the reference frame, so as to realize the segmentation of the moving subject in the reference frame.
  • the reference frame includes multiple target objects, for example, it includes multiple people and multiple moving subjects.
  • the target subject in the reference frame is small.
  • the moving subject and the non-moving area can be segmented by means of optical flow, so as to realize the segmentation of the moving subject in the reference frame.
  • the optical flow method to segment the moving subject is to separate the moving subject (ie, the target object) from the surrounding environment, and perform secondary processing on the surrounding environment, so that the display effect of the captured image is better.
  • the capture method in the embodiments of the present application can also be applied to high dynamic range imaging (High Dynamic Range Imaging, HDR) recording.
  • HDR High Dynamic Range Imaging
  • an exposure method in which the first exposure duration and the second exposure duration overlap is adopted during video HDR recording, so that the electronic device can capture long frames, medium frames and short frames.
  • ISP to synthesize video images, in this way, the dynamic range of the video can be improved.
  • the electronic device can first perform de-banding processing on the image captured by the second exposure duration (ie, short exposure), and then perform de-banding processing on the first exposure.
  • the image stream corresponding to the duration and the image stream corresponding to the second exposure duration are fused to improve the sharpness of the image in the video and the clarity of the video.
  • the de-banding algorithm can generate a frame of display image based on multiple frames of images, but it may cause video delay during the operation of the algorithm. Therefore, in the process of shooting video HDR in the way of interlaced exposure, if the preview image can guarantee real-time, then the saved image stream can improve the effect. That is to say, when shooting in real time, the preview video shows a smooth video picture, and when the video HDR recording is completed, the electronic device obtains the recorded file.
  • the recording file is a high-definition video image.
  • the performance requirement of the multi-frame algorithm can be set to take less than 33ms for the asynchronous call to ensure a frame rate of 30fps for the Record stream.
  • the staggered exposure method is applied to the video HDR recording, and the high-speed shutter can form a short frame to solve the problem of motion smear of the target object in the frame, so that the sharpness of each frame image can be improved, thereby improving the overall video quality. clarity.
  • the electronic device provided by the embodiments of the present application includes corresponding hardware structures and/or software modules for executing each function.
  • the embodiments of the present application can be implemented in hardware or a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled persons may use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the embodiments of the present application.
  • the electronic device may be divided into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • FIG. 14 shows a possible schematic structural diagram of the electronic device involved in the above embodiment.
  • the electronic device 200 includes: a processing unit 1101 , a display unit 1102 and a storage unit 1103 .
  • the processing unit 1101 is used to manage the actions of the electronic device.
  • the processing unit 1101 can control the exposure mode of the electronic device in the snapshot mode, and the processing unit 1101 can also control the display content of the display screen of the electronic device, and the like.
  • the display unit 1102 is used to display the interface of the electronic device.
  • the display unit 1102 may be used to display the main interface of the electronic device in the snapshot mode, and the display unit 1102 may be used to display a preview image of the snapshot mode, and the like.
  • the storage unit 1103 is used for storing program codes and data of the electronic device 200 .
  • the storage unit 1103 may cache the preview image of the electronic device, and the storage unit 1103 is further configured to store the image processing algorithm in the snapshot mode and the like.
  • the unit modules in the above electronic device 200 include, but are not limited to, the above processing unit 1101 , the display unit 1102 and the storage unit 1103 .
  • the electronic device 200 may further include a sensor unit, a communication unit, and the like.
  • the sensor unit may include a light sensor to collect light intensity in the environment where the electronic device is located.
  • the communication unit is used to support communication between the electronic device 200 and other devices.
  • the processing unit 1101 may be a processor or a controller, for example, a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC) ), field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
  • the processors may include application processors and baseband processors. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure.
  • the processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
  • the storage unit 1103 may be a memory. Audio units may include microphones, speakers, receivers, and the like.
  • the communication unit may be a transceiver, a transceiver circuit, a communication interface, or the like.
  • the processing unit 1101 is a processor (the processor 210 shown in FIG. 4 ), and the display unit 1102 may be a display screen (the display screen 294 shown in FIG. 4 , the display screen 294 may be a touch screen, and the touch screen may The display panel and the touch panel are integrated), and the storage unit 1103 may be a memory (the internal memory 221 shown in FIG. 4 ).
  • the chip system includes at least one processor 1201 and at least one interface circuit 1202 .
  • the processor 1201 and the interface circuit 1202 may be interconnected by wires.
  • the interface circuit 1202 may be used to receive signals from other devices, such as the memory of an electronic device.
  • the interface circuit 1202 may be used to send signals to other devices (eg, the processor 1201).
  • the interface circuit 1202 may read the instructions stored in the memory and send the instructions to the processor 1201 .
  • the electronic device can be caused to perform the various steps in the above-mentioned embodiments.
  • the chip system may also include other discrete devices, which are not specifically limited in this embodiment of the present application.
  • Embodiments of the present application further provide a computer storage medium, where the computer storage medium includes computer instructions, when the computer instructions are executed on the above-mentioned electronic device, the electronic device is made to perform various functions or steps performed by the mobile phone in the above-mentioned method embodiments .
  • Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, enables the computer to perform various functions or steps performed by the mobile phone in the above method embodiments.
  • the disclosed apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Landscapes

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

Abstract

本申请实施例提供一种拍照方法、电子设备及存储介质,涉及光学成像技术领域。可以在电子设备抓拍图像的过程中,消除电子设备预览图像中频闪现象,减轻电子设备抓拍的图像上出现的带状条纹现象。该方法应用于照明设备提供光照的拍摄场景中,照明设备提供频闪光照,其中,照明设备频闪一次的时长为频闪时长。该方法包括:电子设备运行相机应用,确定拍摄场景中的光照是频闪光照,按照第一曝光方式采集图像,第一曝光方式指示电子设备按照第一曝光时长和第二曝光时长交错曝光。响应于拍摄键被触发,电子设备基于第一曝光方式采集得到至少一张第一图像,以及至少一张第二图像。根据第一图像和第二图像生成拍摄图像,并显示拍摄图像。

Description

一种拍照方法、电子设备及存储介质
本申请要求于2021年04月06日提交国家知识产权局、申请号为202110365586.1、发明名称为“一种拍照方法、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及光学成像技术领域,尤其涉及一种拍照方法、电子设备及存储介质。
背景技术
相机应用运行在电子设备,相机应用处于抓拍模式时,电子设备的拍摄键被触发可以抓拍到目标对象的图像。特别的,当目标对象处于运动状态,电子设备可以抓拍到目标对象运动瞬间的图像。电子设备抓拍目标对象瞬间图像的原理为,电子设备采用高速快门缩短曝光时长,使得电子设备可以抓拍到目标对象瞬间状态的清晰图像。可以理解的,由于曝光时间较短,需要电子设备处于光线充足的环境中,以便电子设备可以抓拍到目标对象瞬间状态的清晰图像。
其中,当电子设备的拍摄环境为光线充足的户外场景时,户外场景中的自然光可以满足电子设备的曝光需求。当拍摄环境为室内场所时,由照明设备提供光照,室内场所充足的光照也可以满足电子设备的曝光需求。但是,照明设备一般是在交流电的驱动下工作的,受到交流电的影响,照明设备存在频闪(Flicker)现象。即照明设备的亮度受到交流电的影响,随着交流电幅值的周期性变化,照明设备的亮度也发生相应的变化。例如,照明设备在50赫兹(Hz)交流电的驱动下工作,则每秒钟照明设备频闪100次。在高速快门的控制下摄像头的曝光时间较短,因此,照明设备的频闪现象会影响电子设备的曝光,进而影响电子设备采集到的图像的曝光,使得预览界面中的预览图像出现频闪现象。
需要说明的,电子设备的拍摄键被触发,通过逐行曝光的方式采集图像。如果曝光时长小于频闪一次的时长,则电子设备每次曝光时长对应的频闪时长内的不同阶段,会使得电子设备连续采集的预览图像亮度不一致,则电子设备显示的预览图像出现Flicker现象。进一步的,如果曝光时长不是频闪一次时长的整数倍,当拍摄键被触发,电子设备抓拍目标对象的图像时,导致逐行曝光不一致,电子设备抓拍的图像上出现带状条纹(banding)现象,即图像上存在明亮程度不同的条纹。
发明内容
本申请提供一种拍照方法、电子设备及存储介质,可以在电子设备抓拍图像的过程中,消除电子设备预览图像中频闪现象,减轻电子设备抓拍的图像上出现带状条纹现象时图像中明暗条纹的亮度差异。
为实现上述技术目的,本申请采用如下技术方案:
第一方面,本申请提供一种拍照方法,该方法可以应用于具备拍照功能的电子设备。当电子设备拍照的过程中,照明设备为电子设备的拍摄场景提供光照,照明设备 提供频闪光照,照明设备频闪一次的时长为频闪时长。该方法可以包括:电子设备运行相机应用,并确定拍摄场景中的光照是频闪光照。基于此,电子设备按照第一曝光方式采集图像。其中,第一曝光方式指示电子设备按照第一曝光时长和第二曝光时长交错曝光,电子设备可以生成第一拍照队列和第二拍照队列,第一拍照队列包括至少一张第一图像,第二拍照队列包括至少一张第二图像。第一拍照队列是电子设备在第一曝光时长下采集的图像,第二拍照队列是电子设备在第二曝光时长下采集的图像。第一曝光时长大于或等于频闪时长,第二曝光时长小于频闪时长。
当电子设备显示拍照界面,拍照界面包括预览图像和拍摄键,预览图像是根据第一曝光方式采集得到的图像生成的。进一步的,响应于拍摄键被触发,电子设备可以根据至少一张第一图像和至少一张第二图像生成拍摄图像,并显示该拍摄图像。
可以理解的,电子设备采用两个曝光时长采集图像。在第一曝光时长下采集得到第一图像,在第二曝光时长下采集得到第二图像。
特别的,由于电子设备拍照时,如果是日光灯提供光照,日光灯存在频闪现象,日光灯频闪现象会影响电子设备拍摄得到的图像。电子设备采集到的第一曝光时长对应的第一拍照队列(即至少一张第一图像),以及第二曝光时长对应的第二拍照队列(即至少一张第二图像)。其中,这两个曝光时长中,第一曝光时长大于第二曝光时长,第一曝光时长可以是照明设备频闪时长的整数倍,第二曝光时长小于照明设备频闪时长。这样,由于第一曝光时长是照明设备频闪时长的整数倍,则电子设备获取到的第一图像流中相邻帧图像的亮度是均匀的,如果将第一图像流作为预览图像,可以有效消除预览图像中的频闪现象。
第一方面另一种可能的设计方式,第一曝光时长是频闪时长的整数倍,上述预览图像是根据第一曝光方式采集得到的图像生成的。
其中,由于第一曝光时长是频闪时长的整数倍,则第一拍照队列中每帧第一图像的曝光时长对应的频闪次数相同。因此,第一拍照队列中每帧第一图像的亮度值差异小于预设亮度阈值。当电子设备将第一拍照队列作为预览图像,电子设备显示的预览图像亮度均匀。
第一方面另一种可能的设计方式,电子设备按照第一曝光方式采集图像时,电子设备按照第一频率采集得到图像。
其中,电子设备可以按照第二频率采集得到第一拍照队列中的图像,并且,按照第三频率采集得到第二拍照队列中的图像,第二频率和第三频率之和为第一频率。
示例性的,电子设备以60fps的出帧率输出图像。其中,电子设备以30fps的出帧率输出第一拍照队列中的图像,以30fps的出帧率输出第二拍照队列中的图像。
第一方面另一种可能的设计方式,根据至少一张第一图像和至少一张第二图像生成拍摄图像,包括:
电子设备确定拍摄键被触发时刻为快门时刻;电子设备确定第一拍照队列中图像采集时间与快门时刻接近的至少一张第一图像。将至少一张第一图像中亮度最高的图像作为参考帧;电子设备确定第二拍照队列图像采集时间与参考帧采集时间接近的至少一张第二图像;将至少一张第二图像作为辅助帧,根据参考帧和辅助帧生成拍摄图像。
示例性的,电子设备可以获取采集的图像日志,图像日志包括该图像的生成时间,电子设备可以选择图像生成时间与快门时刻接近第一图像。
第一方面另一种可能的设计方式,根据至少一张第一图像和至少一张第二图像生成拍摄图像,包括:
电子设备确定拍摄键被触发时刻为快门时刻;电子设备确定第一拍照队列中图像采集时间与快门时刻接近的至少一张第一图像。将至少一张第一图像中亮度最高的图像作为参考帧;电子设备确定第二拍照队列图像采集时间与参考帧采集时间接近的至少一张第二图像;电子设备确定至少一张第二图像中亮度最高的图像为辅助帧,根据参考帧和辅助帧生成拍摄图像。
第一方面另一种可能的设计方式,上述根据参考帧和辅助帧生成拍摄图像,包括:
基于带状检测确定参考帧中第一阈值,第一阈值表征参考帧的带状程度;若第一阈值大于预设阈值,根据辅助帧生成拍摄图像;若第一阈值小于或等于预设阈值,根据参考帧和辅助帧生成拍摄图像。
第一方面另一种可能的设计方式,上述若第一阈值小于或等于预设阈值,根据参考帧和辅助帧生成拍摄图像,包括:
确定参考帧中非运动区域和运动区域,非运动区域是指图像中非运动的物体的部分,运动区域是指图像中目标对象所在的部分;针对非运动区域,根据辅助帧进行像素融合,减弱非运动区域的带状现象,生成处理后的非运动区域;调整运动区域的灰度系数,以减弱运动区域的带状现象,生成处理后的运动区域;采用图像融合算法,将处理后的运动区域和处理后的非运动区域融合,以生成拍摄图像。
第一方面另一种可能的设计方式,上述若第一阈值大于预设阈值,根据辅助帧生成拍摄图像,包括:采用预设的图像去模糊算法处理辅助帧,减弱辅助帧的运动模糊现象,以生成拍摄图像。
第一方面另一种可能的设计方式,电子设备运行相机应用,电子设备确定拍摄场景中的光照是频闪光照,包括:
电子设备运行相机应用,电子设备按照第二曝光方式采集图像,第二曝光方式指示电子设备按照第三曝光时长曝光。电子设备连续采集得到多张图像,并计算多张图像中每张图像的亮度。多张图像中每两张的图像亮度差值大于预设亮度差值,确定拍摄场景中的光照是频闪光照。
第一方面另一种可能的设计方式,方法还包括:若电子设备检测到拍摄场景发生改变,电子设备按照第二曝光方式采集图像,第二曝光方式指示电子设备按照第三曝光时长曝光。
第一方面另一种可能的设计方式,若电子设备检测到拍摄场景发生改变之后,方法还包括:电子设备确定曝光方式切换延时,当切换延时结束,电子设备从第一曝光方式切换至第二曝光方式。
第一方面另一种可能的设计方式,第三曝光时长等于第一曝光时长,或者,第三曝光时长等于第二曝光时长。
第二方面,本申请还提供一种电子设备,该电子设备包括:摄像头,用于采集图像,显示屏,用于显示界面。当电子设备拍照的过程中,照明设备为电子设备的拍摄 场景提供光照,照明设备提供频闪光照,照明设备频闪一次的时长为频闪时长。一个或多个处理器,存储器;以及一个或多个计算机程序,其中一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令,当指令被电子设备执行时,使得电子设备实现如下方法:
电子设备运行相机应用,并确定拍摄场景中的光照是频闪光照。基于此,电子设备按照第一曝光方式采集图像。其中,第一曝光方式指示电子设备按照第一曝光时长和第二曝光时长交错曝光,电子设备可以生成第一拍照队列和第二拍照队列,第一拍照队列包括至少一张第一图像,第二拍照队列包括至少一张第二图像。第一拍照队列是电子设备在第一曝光时长下采集的图像,第二拍照队列是电子设备在第二曝光时长下采集的图像。第一曝光时长大于或等于频闪时长,第二曝光时长小于频闪时长。
当电子设备显示拍照界面,拍照界面包括预览图像和拍摄键,预览图像是根据第一曝光方式采集得到的图像生成的。进一步的,响应于拍摄键被触发,电子设备可以根据至少一张第一图像和至少一张第二图像生成拍摄图像,并显示该拍摄图像。
第二方面另一种可能的设计方式,第一曝光时长是频闪时长的整数倍,上述预览图像是根据第一曝光方式采集得到的图像生成的。
其中,由于第一曝光时长是频闪时长的整数倍,则第一拍照队列中每帧第一图像的曝光时长对应的频闪次数相同。因此,第一拍照队列中每帧第一图像的亮度值差异小于预设亮度阈值。当电子设备将第一拍照队列作为预览图像,电子设备显示的预览图像亮度均匀。
第二方面另一种可能的设计方式,电子设备按照第一曝光方式采集图像时,电子设备按照第一频率采集得到图像。
其中,电子设备可以按照第二频率采集得到第一拍照队列中的图像,并且,按照第三频率采集得到第二拍照队列中的图像,第二频率和第三频率之和为第一频率。
第二方面另一种可能的设计方式,根据至少一张第一图像和至少一张第二图像生成拍摄图像,电子设备还用于执行如下操作:电子设备确定拍摄键被触发时刻为快门时刻;电子设备确定第一拍照队列中图像采集时间与快门时刻接近的至少一张第一图像。将至少一张第一图像中亮度最高的图像作为参考帧;电子设备确定第二拍照队列图像采集时间与参考帧采集时间接近的至少一张第二图像;将至少一张第二图像作为辅助帧,根据参考帧和辅助帧生成拍摄图像。
第二方面另一种可能的设计方式,根据至少一张第一图像和至少一张第二图像生成拍摄图像,电子设备还用于执行如下操作:电子设备确定拍摄键被触发时刻为快门时刻;电子设备确定第一拍照队列中图像采集时间与快门时刻接近的至少一张第一图像。将至少一张第一图像中亮度最高的图像作为参考帧;电子设备确定第二拍照队列图像采集时间与参考帧采集时间接近的至少一张第二图像;电子设备确定至少一张第二图像中亮度最高的图像为辅助帧,根据参考帧和辅助帧生成拍摄图像。
第二方面另一种可能的设计方式,根据参考帧和辅助帧生成拍摄图像。电子设备具体执行:基于带状检测确定参考帧中第一阈值,第一阈值表征参考帧的带状程度;若第一阈值大于预设阈值,根据辅助帧生成拍摄图像;若第一阈值小于或等于预设阈值,根据参考帧和辅助帧生成拍摄图像。
第二方面另一种可能的设计方式,上述若第一阈值小于或等于预设阈值,根据参考帧和辅助帧生成拍摄图像,电子设备具体用于执行:确定参考帧中非运动区域和运动区域,非运动区域是指图像中非运动的物体的部分,运动区域是指图像中目标对象所在的部分;针对非运动区域,根据辅助帧进行像素融合,减弱非运动区域的带状现象,生成处理后的非运动区域;调整运动区域的灰度系数,以减弱运动区域的带状现象,生成处理后的运动区域;采用图像融合算法,将处理后的运动区域和处理后的非运动区域融合,以生成拍摄图像。
第二方面另一种可能的设计方式,上述若第一阈值大于预设阈值,根据辅助帧生成拍摄图像,电子设备具体用于执行:采用预设的图像去模糊算法处理辅助帧,减弱辅助帧的运动模糊现象,以生成拍摄图像。
第二方面另一种可能的设计方式,电子设备运行相机应用,电子设备确定拍摄场景中的光照是频闪光照,电子设备具体用于执行:电子设备运行相机应用,电子设备按照第二曝光方式采集图像,第二曝光方式指示电子设备按照第三曝光时长曝光。电子设备连续采集得到多张图像,并计算多张图像中每张图像的亮度。多张图像中每两张的图像亮度差值大于预设亮度差值,确定拍摄场景中的光照是频闪光照。
第二方面另一种可能的设计方式,电子设备还用于执行如下操作:若电子设备检测到拍摄场景发生改变,电子设备按照第二曝光方式采集图像,第二曝光方式指示电子设备按照第三曝光时长曝光。
第二方面另一种可能的设计方式,若电子设备检测到拍摄场景发生改变之后,电子设备还用于执行如下操作:电子设备确定曝光方式切换延时,当切换延时结束,电子设备从第一曝光方式切换至第二曝光方式。
第二方面另一种可能的设计方式,第三曝光时长为第一曝光时长,或者,第三曝光时长为第二曝光时长。
第三方面,本申请还提供一种电子设备,包括:摄像头,用于采集图像;显示屏,用于显示界面;一个或多个处理器;存储器;以及一个或多个计算机程序,其中一个或多个计算机程序被存储在存储器中,一个或多个计算机程序包括指令,当指令被电子设备执行时,使得电子设备执行上述第一方面及其任一种可能的设计方式中的拍照方法。
第四方面,本申请还提供一种计算机可读存储介质,其特征在于,包括计算机指令,当计算机指令在计算机上运行时,使得计算机执行第一方面及其任一种可能的设计方式中的拍照方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述第一方面及其任一种可能的设计中电子设备执行的方法。
第六方面,本申请实施例提供了一种芯片系统,该芯片系统应用于电子设备。该芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行上述第一方面及其任一种可能的设计中的方法。
可以理解的是,上述本申请提供的第二方面的电子设备,第三方面的电子设备,第四方面的计算机可读存储介质,第五方面的计算机程序产品和第六方面的芯片系统所能达到的有益效果,可参考如第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种拍照场景的示意图;
图2为本申请实施例提供的一种拍照图像的示意图;
图3为本申请实施例提供的一种曝光时序图;
图4为本申请实施例提供的一种电子设备的结构示意图;
图5为本申请实施例提供的一种电子设备的系统架构示意图;
图6为本申请实施例提供的硬件抽象层和框架层交互的框图;
图7为本申请实施例提供的一种拍照方法的流程图;
图8为本申请实施例提供的一种拍照模式的显示界面示意图;
图9为本申请实施例提供的一种抓拍模式对应的曝光方式下采集图像的示意图;
图10为本申请实施例提供的一种拍照方法中电子设备生成抓拍图像的图像处理示意图;
图11为本申请实施例提供的一种拍照方法对应的模块示意图;
图12为本申请实施例提供的一种拍照方法对应的流程框图;
图13为本申请实施例提供的一种电子设备的结构示意图;
图14为本申请实施例提供的一种电子设备的示意图;
图15为本申请实施例提供的一种芯片系统的结构示意图。
具体实施方式
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本申请实施例提供一种拍照方法,该方法可以应用于电子设备。电子设备在抓拍图像过程中,显示屏可以实时显示预览图像,预览图像流中画面亮度均匀,消除预览图像频闪的现象。当电子设备的拍摄键被触发,电子设备可以抓拍到包括目标对象的清晰图像,以减轻电子设备抓拍的图像上出现带状条纹现象时图像中明暗条纹的亮度差异。
请参考图1,为本申请实施例提供的拍照方法的场景示意图。如图1所示,目标对象100在室内场所运动,室内照明设备(电灯)提供照明,电子设备200运行相机应用,电子设备200采集包括目标对象的图像的过程中,显示屏上可以实时显示包括目标对象100的预览图像。用户在查看电子设备200显示屏的预览图像时,如果想要抓拍目标对象运动瞬间的图像,点击拍摄界面的拍摄控件即可。当电子设备200的拍摄键被触发,电子设备200可以抓拍到目标对象运动瞬间的图像。
可以理解的,目标对象可以是人物也可以是动物、车辆、机器人等。本申请实施例以目标对象是人物为例。例如,目标对象在室内场所运动,可以是人在室内打羽毛 球、打乒乓球、练习瑜伽等。其中,电子设备的拍摄视角中的目标对象可以是一个人,也可以是多个人。
另外,室内场所的使用照明设备提供光照,照明设备可以在交流电的驱动下工作。以照明设备是日光灯为例,日光灯的工作原理是在高压电流的作用下,灯管内的惰性气体放电,放电产生的电子到达日光灯的灯管使得日光灯发光。以日光灯的工作电压是50Hz交流电为例,当日光灯在交流电的驱动下工作时,50Hz的交流电使得日光灯在1s中频闪100次。也就是说,日光灯频闪一次的时长为1/100s。
可以明白的,电子设备处于拍照模式,电子设备的显示屏可以显示预览图像,当电子设备的拍摄键被触发,电子设备生成抓拍图像(也可被称为拍摄图像)。当电子设备抓拍目标对象的运动瞬间的过程,也是如此。其中,日光灯的频闪会影响图像传感器采集的图像。如果曝光时间设置不当,可能会使得预览图像流中的图像出现频闪现象,或者,使得电子设备采集的图像出现Banding现象。
其一,在电子设备生成预览图像流,并将该预览图像流显示在显示屏,形成预览图像,使得用户可以通过显示屏观看预览图像。如果电子设备设置的曝光时长小于日光灯频闪一次的时长(例如,以1/50s的曝光时长采集图像),在电子设备获取预览图像流中的图像时,每张图像曝光时包括的频闪次数不同,使得电子设备获取到的预览图像流中的图像间的亮度不同。当电子设备显示该预览图像流,由于两张图像的亮度不同,使得用户以为电子设备的显示屏的亮度发生变化,这种现象称为频闪现象。
其二,在电子设备的拍摄键被触发,电子设备生成拍摄图像时,图像传感器通过逐行曝光的方式采集图像。由于日光灯频闪,在图像传感器逐行曝光采集图像的过程中,如果日光灯发生闪烁,会使得一帧图像中不同行的曝光不同,导致电子设备生成的图像上存在明暗条纹现象,即“Banding”现象。如图2所示,为包括Banding现象的图像示意图,因为曝光时亮度发生改变,使得图像中存在明暗条纹。
示例性的,如图3所示,以在不同曝光时长的情况下,电子设备采集得到的图像的曝光情况示意。以1/50s的曝光时长和1/200s的曝光时长为例,说明电子设备采集的图像的曝光状况。如图3所示,日光灯的频闪一次的时长为1/100s,日光灯的时序图中上升沿对应的时刻是日光灯开始发光的时刻,下降沿对应的时刻是日光灯结束发光的时刻。其中,上升沿表示从低电平变化到高电平的时刻,下降沿表示从高电平变化为低电平的时刻。
其中,当电子设备采用1/50s的曝光时长获取图像时,由于曝光时长是频闪一次时长的二倍。也就是说,曝光时长内,日光灯会频闪一次,这样一来,每次曝光采集得到的图像的亮度是相同的。在这种情况下,每张图像都是正常曝光帧图像,且每张图像的亮度是相同的。当电子设备采用1/200s的曝光时长获取图像时,由于曝光时长是频闪一次时长的一半。也就是说,在曝光的时候,如果日光灯处于发光时长内,像素可以正常曝光;如果日光灯处于不发光时长内,像素将不能正常曝光。当像素不能正常曝光时,生成的图像就是异常曝光帧图像。
例如,以在第二曝光时长下发生4次曝光为例。每次曝光采集得到对应的图像,P1为第一次曝光后形成的图像,第一曝光时长仅对应日光灯频闪的发光时间段,在这种曝光下形成的图像P1是正常曝光图像。P2为第二次曝光后形成的图像,第二次曝 光时长对应日光灯频闪的发光时间段和日光灯不发光的时间段,在这种曝光下形成的图像P2是非正常曝光图像。P3为第三次曝光后形成的图像,第三次曝光时长对应日光灯频闪的发光时间段以及日光灯不发光的时间段。在逐行曝光的过程中,日光灯不发光时间段曝光的像素不能采集到颜色,因此,在这种曝光下形成的图像P3是非正常曝光图像。P4为第四次曝光后形成的图像,第四次曝光时长仅对应日光灯频闪的发光时间段,基于与上述图像P1存在相同的问题,在这种曝光下形成的图像P4是正常曝光图像。
需要理解的,1/200s的曝光时长表示的是每个像素的曝光时长,也就是说,在这个曝光时长下,逐行曝光时,每个像素曝光时间是恒定的。例如,1/50s的曝光时长下,每个像素的曝光时间内都包括相同的频闪次数,即每个像素曝光采集的光照亮度是相同的,因而图像也就是正常曝光的图像。
由此可以看出,曝光时长的设置会影响拍照模式下预览图像的质量,以及拍摄图像的质量。
在第一种实现中,为了解决电子设备处于拍照模式下,预览图像的频闪现象。设置电子设备的图像传感器按照高帧率出帧,以消除预览图像的频闪现象。例如,设置1/200s的曝光时长,以及设置图像传感器按照120fps(帧每秒)的速度输出图像帧,电子设备缓存采集到的图像流。针对每一帧图像进行如下处理:将每一帧与前一帧、后一帧进行图像亮度融合,以使每一帧图像的亮度与前后两帧的图像亮度相同。由此处理完每一帧图像之后,图像流中的每一帧图像的亮度就都是相等的,减轻了图像流中图像的频闪现象。
进一步的,电子设备对图像流进行抽帧处理,将120fps的图像流抽帧以得到30fps的图像流,电子设备显示30fps的图像流,使得用户通过电子设备看到预览图像。
采用这种实现方式消除预览图像的频闪现象时,需要采集高帧率的预览图像流,这样,就限制了每帧图像的曝光时间。在提高出帧率时,会使得图像中的噪声较高,从而影响预览图像的显示效果。同时,图像传感器在高帧率下运行时,采集到的图像分辨率会受到限制。需要说明的,现有的图像传感器采集的图像的分辨率都在1080P以下,如果采用高帧率出帧则电子设备无法拍摄得到分辨率高的图像。
第二种实现中,为了解决电子设备抓拍的图像中存在Banding现象,可以通过图像算法减弱图像中Banding现象。需要明白的,当前并未设置专门的算法消除图像中的Banding现象。一般而言,可以通过调节摄像头中的伽马(Gamma)曲线,或者,调整图像传感器中的局部色调映射(local tone mapping)的方式,以减弱图像中的Banding现象。但是,这种处理方式会造成电子设备拍摄的图像中对比度降低,影响图像的显示效果。
示例性的,可以使用较长的曝光时间来减弱日光灯频闪对图像的影响。如,设置曝光时长为1/100s的整数倍,在这种曝光时长下采集的图像中将不会产生Banding现象。
但是,在采用这种方式消除Banding现象的同时,延长的曝光时长,使得在曝光的过程中目标对象还在产生运动。因而生成的图像上会出现目标对象运动模糊的图像,无法实现抓拍目标对象运动瞬间的图像。也就是说,拍摄得到的图像中目标对象的图 像不清晰。
第三种实现中,当电子设备生成高动态范围图像(High-Dynamic Range,HDR)视频时,采用多个曝光时长交叠曝光的方式,以提升视频图像的动态范围。其中,不同的曝光时长形成对应的图像流。如,采用三个曝光时长交叠曝光产生长帧、中帧和短帧图像。电子设备采用ISP合成长帧、中帧和短帧图像以形成HDR图像。
当电子设备采用这种方式在日光灯提供照明的场所获取HDR视频时,日光灯的频闪也会影响拍摄图像,使得短帧图像流中的图像出现Banding现象,影响HDR图像的显示效果。
第四种实现中,当电子设备是数码相机时,可以采用硬件的机械快门解决图像出现Banding现象的问题。其中,机械快门可以控制图像传感器中的全部像素同时曝光,而不是逐行曝光,这种曝光方式可以消除图像上出现Banding现象。
但是,采用这种方式需要在电子设备上增设机械快门,会增大摄像头模组的尺寸,进而增大电子设备的尺寸。而且,这种方式会增加电子设备的成本。
基于此,本申请实施例提供一种拍照方法,本申请实施例中的方法可以应用于抓拍目标对象瞬间状态的场景中。能够有效消除预览图像的频闪现象,以及生成抓拍图像上的Banding现象。
例如,在室内场景进行体育比赛,如,篮球比赛、游泳比赛等。用户观看篮球赛时,可以使用电子设备抓拍比赛过程中的精彩瞬间。
又例如,在室外场地进行活动时,室外阳光光照不足的情况下使用照明设备提供光照,如,室外亲子活动、室外足球比赛等。在这种情况下,使用电子设备可以抓拍活动或比赛过程中的精彩瞬间。
本申请实施例提供的拍照方法中,抓拍模式对应的曝光方式包括两个曝光时长,两个曝光时长交错曝光,电子设备可以获取每个曝光时长对应的图像流。电子设备可以分别存储每个曝光时长下采集的图像,用于生成预览图像,以及响应于拍摄键被触发生成抓拍图像。
可以理解的,电子设备采集到的第一曝光时长对应的第一图像流(即多帧第一图像),以及第二曝光时长对应的第二图像流(即多帧第二图像)。其中,这两个曝光时长中,第一曝光时长大于第二曝光时长,第一曝光时长可以是照明设备频闪时长的整数倍,第二曝光时长小于照明设备频闪时长。这样,由于第一曝光时长是照明设备频闪时长的整数倍,则电子设备获取到的第一图像流中相邻帧图像的亮度是均匀的,如果将第一图像流作为预览图像,可以有效消除预览图像中的频闪现象。
具体地说,电子设备显示预览图像时,可以直接将第一图像流作为预览图像显示。或者,电子设备可以根据实时处理获取的第一图像流和第二图像流,生成预览图像流,通过显示屏显示预览图像流。由于第二图像流中图像的清晰度较高,采用第一图像流中的图像和第二图像流中的图像进行去带状和去模糊处理,可以得到高质量的预览图像流,提高电子设备显示的预览图像流的质量,进而为用户提供良好的预览体验。
在拍摄键接收到触发操作的情况下,电子设备可以处理第二图像流中的拍摄键被触发时刻对应的图像,以得到抓拍图像并显示该抓拍图像。或者,电子设备可以处理拍摄键被触发时刻的第一图像和第二图像,以得到抓拍图像并显示该抓拍图像。由于 第二曝光时长小于日光灯频闪一次时长,则第二图像流中的图像清晰度较高,采用第二图像流中的图像作为参考帧,第一图像流中的图像作为辅助帧。采用辅助帧和参考帧进行图像处理算法,以生成不包括banding现象的抓拍图像,且抓拍图像的清晰度较高。
请参考图4,为本申请实施例提供的一种电子设备的结构示意图。
如图4所示,电子设备200可以包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294等。其中传感器模块280可以包括压力传感器,陀螺仪传感器,加速度传感器,距离传感器,接近光传感器,温度传感器,触摸传感器,环境光传感器等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI)和/或通用输入输出(general-purpose input/output,GPIO)接口等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备200的结构限定。在本申请另一些实施例中,电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理 模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器,显示屏294和摄像头293等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。
电子设备200通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备200可以包括1个或N个显示屏294,N为大于1的正整数。
电子设备200可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。
ISP用于处理摄像头293反馈的数据。例如,电子设备拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头293中。
摄像头293用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备200可以包括1个或N个摄像头293,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备200在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备200的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备200使用过程中所创建的数据(比如 音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。电子设备200可以接收按键输入,产生与电子设备200的用户设置以及功能控制有关的键信号输入。
马达291可以产生振动提示。马达291可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏294不同区域的触摸操作,马达291也可对应不同的振动反馈效果。
指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
电子设备200的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。需要说明的,本申请实施例中,电子设备的操作系统可以包括但不限于
Figure PCTCN2021144038-appb-000001
(Symbian)、
Figure PCTCN2021144038-appb-000002
(Android)、
Figure PCTCN2021144038-appb-000003
(iOS)、
Figure PCTCN2021144038-appb-000004
(Blackberry)、鸿蒙(Harmony)等操作系统,本申请不限定。
本申请实施例以分层架构的Android系统为例,示例性说明电子设备200的软件结构。
图5是本申请实施例的电子设备200的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,硬件抽象层以及驱动层。
应用程序层可以包括一系列应用程序包。
如图5所示,应用程序包可以包括相机,图库,日历,电话,地图,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图5所示,应用程序框架层可以包括相机应用对应的接口,窗口管理器,内容提供器,视图系统等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:相机服务,媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
下面结合本申请提供的拍照方法,示例性说明电子设备200的工作流程。以图5所示的系统结构示意图为例,说明电子设备200拍照的流程。
如图5所示,硬件抽象层包括摄像头组件(Camera Device3)、图像管道模式组件(Image Pipeline)和软件应用组件(Image Stream Callback MGR),驱动层包括图像传感器(sensor)、图像处理单元前端节点(Front End,ISP-FE)、图像处理单元后端节点(Back End,ISP-BE)等。
应用程序层中的相机应用可以以图标的方式显示显示在电子设备的屏幕上,当相机应用的图标被触发,电子设备运行相机应用。相机应用运行在电子设备上,电子设备可以根据用户的操作,向内核层发送相应的触摸事件。内核层将触摸事件转换为原始输入事件,原始输入事件被存储在内核层中。由此一来,当触摸屏接收到触摸事件,启动相机应用,进而通过调用内核层启动摄像头,响应于用户的操作,电子设备处于相机应用中的抓拍模式。
如图5所示,Image Pipeline包括零延时处理器(zero shutter lag Manager,ZSL Manager),FE节点(Node),BE-Streaming后端图像流节点(Node),BE-Snapshot后端图像快照节点(Node),互联网协议族(Internet Protocol Suite,IPS)(或理解为管道模式中的管道过滤模型),承载平台算法的存储器等。
其中,ZSL处理器用于在相机应用运行时提供预览图像,ZSL处理器设置在raw域图像的历史帧容留器中。ZSL Manager可以用于管理ZSL获取的预览图像流,并可以对预览图像流进行配置、排队,选帧等操作。
FE Node是管道模式的根节点,即电子设备采集的所有图像处理的原始节点,可以作为硬件ISP芯片的前端处理器。
后端图像流节点(BE-Streaming-Node)用于处理预览图像流。例如,电子设备处于抓拍模式下的预览图像流,以及电子设备处于录像状态时的预览图像流等。在一些实施例中,还可以挂载IPS,即后端图像流节可以访问ISP处理的预览图像。挂载是指操作系统允许电子设备访问存储设备上的文件的过程。
后端快照节点(BE-Snapshot-Node)用于处理抓拍相关的图像。如,根据第一图像和第二图像生成抓拍图像。在一些实施例中,还可以挂载IPS,即后端快照节点可 以访问ISP处理的快照图像。
IPS是HAL层的管道过滤模型,IPS中可以设置插件,插件可以用于访问存储设备存储的算法。IPS访问算法后可以用于接管相机预览、相机拍照动作和录像模式下的数据等。在一些实施例中,IPS可以与相机的框架层和HAL交互,以实现对应的功能。
Algo是一种图像处理算法的模块,可以供IPS挂载。在一些实施例中,Algo中可以包括算法处理模块,当Algo调用算法处理模块,运行算法时可以访问CPU、GPU和NPU等处理器。
图像传感器(sensor)用于采集图像,用于负责硬件传感器的上电或下电时序图、还用于匹配控制、实时图像传感器配置和复位功能。其中,抓拍模式的曝光方式对应的两个曝光时长交错曝光的方式可以通过设置图像传感器实现。
示例性的,电子设备处于相机应用中的抓拍模式,相机应用调用应用框架层中对应的接口,通过调用内核层启动摄像头驱动,开启电子设备的摄像头,并通过摄像头采集图像。其中,抓拍模式对应的曝光方式为第一曝光时长和第二曝光时长交错曝光,电子设备的摄像头按照抓拍模式对应的曝光方式曝光,图像传感器采集图像。ZSL Manager中保存第一曝光时长对应的第一图像流,以及第二曝光时长对应的第二图像流。电子设备中的FE Node可以处理ZSL Manager中的第一图像流,以生成预览图像流,电子设备显示预览图像流。当电子设备拍摄键(或拍摄控件)接收到触发操作,BE-Snapshot Node将根据第一图像(辅助帧)和第二图像(参考帧)生成抓拍图像,通过显示屏显示该抓拍图像。
需要说明的,本申请实施例中的电子设备可以是具有拍照功能的手机、运动相机(GoPro)、数码相机、平板电脑、桌面型、膝上型、手持计算机、笔记本电脑、车载设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备等,本申请实施例对该电子设备的具体形态不作特殊限制。
示例性的,以电子设备包括抓拍模式,抓拍模式下电子设备可以按照第一曝光时长和第二曝光交错曝光(即第一曝光方式)采集图像。如图6所示,其示出电子设备生成抓拍图像的流程。
如图6所示,将电子设备的拍照流程在硬件抽象层和框架层之间的运行过程。其中,框架层(framework)包括相机应用(APP1),相机服务(camera service),显示合成系统(surface flinger);硬件抽象层(HAL)包括相机驱动3(camera device3),第一曝光方式,软件应用流(APP Stream),FE节点(Node),BE-Streaming后端图像流节点(Node)和ZSL处理器。
其中,相机应用被触发,相机应用下发相机运行请求,且相机应用的拍照模式为抓拍。框架层中的相机服务被触发,并向硬件抽象层中相机对应的相机驱动。相机驱动调用第一曝光方式,第一曝光方式提交拍照请求至FE节点。ZSL处理器中包括VC0和VC1两个拍照队列,第一曝光方式指示电子设备按照第一曝光时长和第二曝光时长交错曝光,当电子设备按照第一曝光时长下采集的图像形成VC0拍照队列,当电子设 备按照第二曝光时长下采集的图像形成VC1拍照队列。
以电子设备显示预览图像的过程为例,FE节点将采集得到的拍照队列传输至BE-Streaming后端图像流节点。ZSL处理器将VC0图像队列传输至图像管道,图像管道将图像队列通过软件应用流传输至框架层。这样一来,框架层接收到来自硬件抽象层的反馈数据,通过显示合成系统将图像显示在显示屏。
以下实施例中的方法均可以在具备上述硬件结构的电子设备中实现。
本申请实施例以电子设备是手机为例,手机中安装相机应用。请参考图7,为本申请实施例提供的拍照方法的流程图。如图7所示,该方法包括步骤701-步骤702。
其中,手机运行相机应用,手机采用相机应用中的抓拍模式拍照。本申请实施例以拍摄环境中照明设备提供光照,手机处于相机中的抓拍模式下采集图像为例,说明本申请实施例提供的拍照方法。
需要说明的,相机中的抓拍模式仅是对应采用第一曝光方式获取图像。在实际应用中,相机中可以不设置抓拍模式。当手机检测到当前的拍摄环境中由日光灯提供光照,日光灯提供的光照是频闪光照,则电子设备按照抓拍模式(即采用第一曝光方式)获取图像。
步骤701:手机处于相机应用中的抓拍模式,手机显示预览图像。
需要说明的,当手机运行相机应用,相机应用可以包括多种拍照模式。不同的拍照模式得到的图像的效果不同。例如,相机应用包括人像模式,抓拍模式和夜景模式等,人像模式下得到的图像中人物的面部特征明显,抓拍模式下得到的图像中可以抓拍到目标对象运动瞬间的动作,夜景模式下得到的图像清晰度高。每种模式也是在对应的场景下使用的。本申请实施例以抓拍模式为例,说明本申请实施例提供的拍照方法。可以理解的是,该拍照方法并不是仅适用于抓拍模式。
示例性的,当手机运行相机应用,手机显示如图8所示的拍照界面。其中,该拍照界面包括相机应用的多种拍照模式,如,延时拍摄模式81、夜景拍摄模式82、人像拍摄模式83、抓拍拍摄模式84、录像拍摄模式85和专业拍摄模式86等。拍摄键87指示当前的拍摄模式,如图8所示,拍摄键87指示当前的拍摄模式是抓拍拍摄模式84。
其中,抓拍模式是指手机拍摄目标对象时,生成目标对象运动瞬间的图像。手机处于相机应用中的抓拍模式,手机按照抓拍模式对应的曝光方式曝光。该曝光方式为第一曝光时长和第二曝光时长交错曝光,第一曝光时长大于第二曝光时长。
可以理解的,手机采用该抓拍模式的曝光方式采集图像的过程中,第一曝光时长和第二曝光时长交错曝光,使得手机可以采集到两个图像流。第一曝光时长对应第一图像流,第二曝光时长对应第二图像流。
示例性的,请参考图9,为手机采用抓拍模式的曝光方式示意图。如图9所示,Expo L对应第一曝光时长,Expo S对应第二曝光时长,SOF L表示采用第一曝光时长曝光后开始读出帧图像的时刻,EOF L表示采用第一曝光时长曝光之后结束读出帧图像的时刻;SOF S表示采用第二曝光时长曝光后开始读出帧图像的时刻,EOF S表示采用第二曝光时长曝光之后结束读出帧图像的时刻。
其中,如图9所示,从SOF L时刻开始到EOF L时刻结束,手机可以读取到第一 曝光时长对应的第一图像(即第一拍照队列中的一帧图像),也就是第一图像的读出时长。从SOF S时刻开始到EOF S时刻结束,手机可以读取到第二曝光时长对应的第二图像(即第二拍照队列中的一帧图像),也就是第二图像的读出时长。其中,当采用第一曝光时长曝光,前一帧第一图像的结束读出时刻到下一帧图像的起始读出时刻,中间的时间为两帧图像之间的空闲时间(Vertical Blank,VB)。第一图像的起始读出时刻,到第二图像的结束读出时刻表示手机采集到一个第一图像和一个第二图像的时长,或称为完整帧时长(Frame Length)。
具体地说,第一曝光时长为1/50s,第二曝光时长为1/200s。在两种曝光时长交叠曝光,每次曝光采集一帧图像。第一曝光时长对应的长曝光图像流VC0,第二曝光时长对应的短曝光图像流VC1。当手机显示预览图像时,显示长曝光图像流VC0,以消除预览图像中的频闪现象。
示例性的,手机获取到第一拍照队列VC0,手机将第一拍照队列VC0作为预览图像进行显示。又示例性的,手机以第二拍照队列VC1作为参考帧,根据第一拍照队列VC0中的图像处理第二拍照队列VC1中的每帧图像,以生成预览图像,并在手机的显示屏上显示该预览图像。
步骤702:接收到拍摄键的触发操作,手机生成抓拍图像,并显示该抓拍图像。
可以理解的,继续以上述曝光时长采集的VC0和VC1为例。手机中设置高速快门,当高速快门被触发,手机抓拍到目标对象的运动瞬间的图像。
具体地说,当手机的拍摄键被触发,手机缓存参考帧,参考帧是第二曝光时长下采集到的有效曝光图像。进一步的,手机缓存至少一张辅助帧,辅助帧是在第一曝光时长下采集到的图像。手机根据至少一张辅助帧和参考帧进行图像处理,以得到抓拍图像,手机显示该抓拍图像。使得用户可以通过手机查看抓拍图像。
在一些实现中,手机可以通过ISP处理器中的图像日志(ISP LOG)获取每帧图像的曝光时长和ISO。
示例性的,以两个连续的曝光为例,第一曝光中的第一曝光时长手机采集得到的图像的日志为:07-15 10:11:34.534[974.717864][cpu0][I/FW]<fast_scheduie_hdr_merge_core_exec,218>iso_frame。
第一曝光中第二曝光时长手机采集的图像的日志为:07-15 10:11:34.534[974.717864][cpu0][I/FW]<fast_scheduie_hdr_merge_core_exec,218>100,100。
第二曝光中第一曝光时长手机采集的图像的日志为:07-15 10:11:34.534[974.717895][cpu0][I/FW]<fast_scheduie_hdr_merge_core_exec,219>expo_frame。
第二曝光中第二曝光时长手机采集的图像的日志为:07-15 10:11:34.534[974.717895][cpu0][I/FW]<fast_scheduie_hdr_merge_core_exec,218>10000,2500。
可以理解的,为了避免预览图像出现频闪,手机可以将第一图像流作为预览图像流,处理器处理采集得到的第一图像流,并作为预览图像显示。
示例性的,当手机采用第一曝光时长采集图像时,手机可以按照60帧/秒(f/s)的出帧速度输出图像。如,在第一曝光时长下,手机可以按照30帧/秒(f/s)的出帧速度输出第一图像流;在第二曝光时长下,手机还可以按照30帧/秒(f/s)的出帧速度输出第二图像流。ZSL处理器可以准备两路缓存区,用于缓存第一图像流和第二图 像流。
其中,由于第一曝光方式下第一曝光时长和第二曝光时长交错曝光,则第一曝光时长和第二曝光时长的出帧速度相同。
具体而言,手机接收到拍摄键被触发的操作,手机可以根据ZSL处理器中缓存的历史帧图像,以及拍摄键被触发的瞬间手机采集的图像,生成抓拍图像。
需要理解的,当手机接收到拍摄键被触发的操作,手机拍摄的目标对象的精彩动作正在发生,或者,目标对象的精彩动作已经发生了,这种现象为快门迟滞(shutter lag)现象。为了保证手机可以在接收到拍摄键被触发的瞬间抓拍到目标对象的精彩动作,手机可以根据ZSL处理器缓存的历史帧,生成抓拍图像。其中,手机选择ZSL处理器中的历史帧图像时,可以选择手机快门曝光的时刻手机缓存的图像帧,或者,可以选择手机快门曝光时刻之前缓存的图像帧。
其中,由于第二曝光时长较短,使得手机可以抓拍到目标对象运动瞬间清晰的图像。但是,因为第二曝光时长小于照明设备频闪一次的时长,使得手机缓存的参考帧中可能存在曝光不均匀的现象,手机可以根据第一曝光时长采集的第一图像流中的图像帧作为参考帧,对第二图像流中的图像帧曝光处理,以消除第二图像流中图像帧曝光不均匀的现象。如,手机可以从ZSL缓存的VC1中选择一帧VC1(n)作为参考帧,VC1(n)的前后帧图像(即VC1(n-1)和VC1(n+1))作为辅助帧,以及VC0中时间戳与VC1(n)最接近的图像帧(如,VC0(n)),手机处理VC0(n)、参考帧和辅助帧,以生成抓拍图像。其中,手机确定参考帧之后可以选择参考帧前后的图像帧中,至少两帧的图像作为辅助帧。
可以理解的,被选中的缓存图像帧可以从FE节点传输至BE节点,将图像帧的格式从原始raw域图像转换为YUV格式(一种图像格式)图像,以便手机处理这些被选中的缓存图像,生成抓拍图像。
请参考图10,为手机根据第一图像流和第二图像流生成抓拍图像的示意图。如图10所示,手机中的图像传感器采用第一曝光时长和第二曝光时长交错的方式曝光,图像传感器采集的图像被缓存在ZSL处理器中。如图10所示,ZSL处理器缓存VC0的6帧图像,以及VC1的6帧图像。假设手机的拍摄键被触发,手机检测到目标对象的精彩动作已经发生,手机可以选择VC1中的VC1(n)作为参考帧,VC1(n-1)和VC1(n+1)作为辅助帧。手机还可以选择VC0中时间戳与VC1(n)最接近的VC0(n)图像,手机根据VC0(n)、VC1(n-1)和VC1(n+1)对VC1(n)去带状处理,以及图像去模糊处理(deblur)等对图像去噪,以提高图像质量,从而生成抓拍图像。其中,FE节点中的图像为raw域图像,BE节点中的图像为YUV格式图像。
其中,上述过程中,手机开始处于相机应用中的抓拍模式的日志为:Cam/HBC:[acquireBufferSets]rRequiredStreams:Image(0):Meta(0)。
手机处于抓拍模式,手机显示预览图像一段时间之后,ZSL处理器中缓存了第一曝光时长和第二曝光时长对应的图像的日志为:I Cam/HBC:[getAvailableRequestList]total(14)cv 0 available(7):[0:98];[1:100];[2:102];[3:104];[4:106];[5:108];[6:110];cv1available(7):[0:99];[1:101];[2:103];[3:105];[4:107];[5:109];[6:111]。其中,cv 0 available(7)对应第一图像流的缓存图像,cv1available(7)对应第二图像流的缓存图像。
可以理解的,手机的拍摄键被触发,手机可以从ZSL中读出部分缓存图像的日志为,I Cam/ZslMgr:[selectBuf_Locked]-:Get enough buffer from HBC(reqFrameSz_cv1:3,reqFrameSz_cv0:1,,req:40,policy:0x30001)。
ZSL处理器接收到读出缓存图像,读取图像的请求被挂起的日志:I Cam/ZslMgr:[operator()][submitZslRequest][requestNo:113]:successfully process pending request(reqNo:40)。
ZSL处理器输出对应的缓存图像的日志为:remove from pending list[pendingSz(0)]。
示例性的,手机处于相机应用中的抓拍模式,手机可以先检测拍摄环境中的光照,判断手机的拍摄环境中是否存在频闪的照明设备提供光照。如果拍摄环境中不存在频闪的照明设备提供光照,手机可以采用一个曝光时长的曝光方式获取抓拍图像。如果拍摄环境中存在频闪的照明设备提供光照,手机可以采用上述包括第一曝光时长和第二曝光时长的曝光方式获取抓拍图像。
手机按照模块划分之后,可以通过调用不同的模块实现上述过程。如图11所示,VC1中包括多帧图像,如包括1帧参考帧和N帧辅助帧。示例性的,VC1(n)为参考帧,VC1(n-1)和VC1(n+1)为辅助帧。检测参考帧中的banding程度,如第一阈值。如果第一阈值小于等于预设阈值,说明手机中的预设算法可以减弱参考帧中的banding程度;如果第一阈值大于预设阈值,说明手机中的预设算法无法处理参考帧中的banding。
如图11所示,当检测到参考帧中的banding程度小于或等于预设阈值,手机中预设的去带状算法可以减弱参考帧中的banding,手机可以基于VC1的参考帧进行图像分割。如,将参考帧分割为运动区域和非运动区域。对参考帧中的运动区域进行伽马处理,以减弱运动区域中的banding现象。对参考帧中的非运动区域与参考帧进行图像融合,借助相邻参考帧的banding分布不同程度,融合banding,以减弱非运动区域的banding现象。将banding处理后的运动区域和图像融合后的非运动区域进行图像融合,以得到拍摄图像。
可以理解的,处理参考帧的非运动区域时,可以借助VC0中的图像帧作为辅助帧,以便减轻非运动区域banding程度。
如图11所示,当检测到参考帧中的banding程度大于预设阈值,手机中的去带状算法无法减弱参考帧中的banding,手机采用预设去模糊算法对单帧的VC0进行处理,以得到拍摄图像。
其中,手机检测拍摄环境中是否存在频闪的照明设备提供光照时,可以通过光照传感器确定手机的拍摄环境中的光照。或者,手机采用短时曝光采集至少2张图像,通过图像判断是否存在频闪的照明设备提供光照。一般而言,手机所在的环境也是目标对象所在的环境,因此,通过光照传感器可以确定出拍摄环境中的光照情况。在一些实施例中,手机处于相机应用中的抓拍模式,该模式下可以包括自然光拍摄场景和日光灯拍摄场景,手机可以获取用户对拍摄场景的选择,以确定采用的曝光方式。当然,具体实施中还可以采用其他方式确定拍摄环境中的光照,此处不予一一示例。
示例性的,当手机运行相机应用,手机可以按照第二曝光时长的方式采集图像,第二曝光时长指示手机按照第三曝光时长采集图像。其中,手机按照第二曝光时长采 集到至少两张图像,手机计算采集得到的每张图像的亮度,如果两张图像的亮度差值大于预设亮度差值,则说明手机当前的拍摄环境是频闪光照。如果手机采集到连续多帧图像,手机计算每张图像的亮度,并计算相邻两张图像的亮度差值,如果存在两张图像的亮度差值大于预设亮度差值,说明手机当前的拍摄环境是频闪光照。
其中,第三曝光时长可以与第一曝光时长相等,或者,第三曝光时长与第二曝光时长相等。
需要说明的,手机根据拍摄环境中的光照,并按照该光照对应的曝光方式曝光。在手机处于抓拍模式下,如果手机检测到拍摄环境中光照强度变化量超过预设光照变化阈值,手机可以再次检测环境中的光照,并根据检测的光照的结果判断是否切换曝光方式。例如,当前手机的拍摄环境为自然光,光线较弱,人为通过日光灯增加光照,手机检测到环境中的光照强度发生较大变化,即光照强度增加超过预设光照变化阈值,手机检测到当前拍摄环境中存在频闪的照明设备(日光灯)提供光照,手机可以切换曝光方式。另外,手机还可以设置预设检测时长,当手机处于抓拍模式,经过预设检测时长手机确定一次当前拍摄环境中的光照。这样,可以确保手机抓拍图像时,手机的曝光方式可以满足当前的拍摄需求。
示例性的,当手机运行相机应用,手机可以首先按照第二曝光方式曝光。如图12所示,为本申请实施例提供的一种拍照方式下,切换曝光方式的流程。如图12所示,手机可以先判断当前的拍摄场景是否为高亮环境,如果是高亮环境,则按照第二曝光方式采集图像。如果不是高亮环境(如,弱光环境),手机继续检测当前的环境是否包括频闪光照。如果手机确定当前的拍摄环境包括频闪光照,手机按照第一曝光方式采集图像;如果手机确定当前的拍摄环境不包括频闪光照,手机按照第二曝光方式采集图像。
其中,手机在处于拍摄状态时,手机还可以继续检测拍摄场景的变化,如果手机检测到拍摄场景发生改变,手机可以按照第二曝光方式采集图像;如果手机没有检测到拍摄场景发生改变,则手机继续按照第一曝光方式采集图像。
例如,第一曝光方式是以60fps的出帧速度输出图像,第一曝光方式下第一曝光时长以30fps的出帧速度输出图像,第二曝光时长以30fps的出帧速度输出图像。第二曝光方式下对应第三曝光时长,手机基于第三曝光时长以30fps的出帧速度输出图像。
需要说明的,如果手机确定从第一曝光方式切换至第二曝光方式,手机可以在切换时长完成之后,将第一曝光方式切换为第二曝光方式。如,设置切换时长为5s(秒),当手机确定从第一曝光时长切换至第二曝光时长,则手机进行切换计时,切换计时经过5s之后,手机将第一曝光方式切换为第二曝光方式。同理,如果手机确定从第二曝光方式切换至第一曝光方式,手机可以在经过切换时长之后,改变曝光方式。
示例性的,可以对手机进行模块化划分,使手机得到抓拍图像。如图13所示,手机可以包括采集模块1001、检测模块1002、去模糊模块1003、去带状模块1004和输出模块1005。其中,以手机处于抓拍模式拍摄键被触发,手机生成抓拍图像的过程为例,说明手机得到抓拍图像的过程。
如图13所示,采集模块1001用于在抓拍模式的曝光方式下获取图像。例如,手机采用第一曝光时长和第二曝光时长交错曝光的方式,获取图像。手机获取到用户对 拍摄键的触发操作,采集模块1001可以将采集得到的图像传输至检测模块1002。其中,采集模块1001可以将拍摄键被触发瞬间手机采集的图像作为参考帧,以及至少一帧的辅助帧传输至检测模块1002。
检测模块1002,可以用于检测采集模块1001传输的参考帧中带状现象的程度,如果参考帧的带状现象的数值小于预设带状阈值,检测模块1002向去模糊模块1003发送参考帧。如果参考帧中带状现象的数值大于或等于预设带状阈值,检测模块1002向去带状模块1004发送参考帧和至少一帧的辅助帧。
去模糊模块1003,用于对参考帧进行去模糊处理。其中,去模糊模块1003中设置有去模糊算法的程序,使得去模糊模块1003可以对参考帧图像进行去模糊操作。去模糊模块1003将去模糊处理后的图像输出值输出模块1005。在一些实施例中,去模糊模块1003去模糊处理后生成抓拍图像,向输出模块传输抓拍图像。
去带状模块1004,用于参考帧进行运动主体分割,运动主体一般是抓拍场景中的拍摄对象。例如,抓拍场景为篮球比赛现场,运动主体就是篮球运动员。对参考帧进行运动主体分割之后,参考帧被分割为运动区域(即图像中目标对象所在的区域)和非运动区域。根据辅助帧对运动区域进行去带状处理,根据采集模块1001缓存的第一图像流中的辅助帧、以及参考帧对非运动区域的像素进行融合,实现非运动区域的去带状处理。对去带状处理后的运动区域和非运动区域融合,生成去带状处理后的图像。去带状模块1004将去带状处理后的图像传输至输出模块1005。在一些实施例中,去模糊模块1003去带状处理后生成抓拍图像,向输出模块传输抓拍图像。
其中,辅助帧是与参考帧相邻的图像帧,第一图像流中辅助帧的时间戳与参考帧的时间戳最接近。去带状模块1004采用多帧融合的方式对参考帧去带状,可以有效降低参考帧中的噪声。由于第一图像流中的辅助帧的时间戳与参考帧的时间戳接近,且第一图像流是在第一曝光时长下采集得到,第一图像流中的辅助帧曝光时间较长,则该辅助帧中的噪声小。因此,采用第一图像流中的辅助帧可以有效减小参考帧中的噪声,提高图像质量。
输出模块1005,可以将抓拍图像显示在显示屏上。在一些实施例中,输出模块1005可以用于对去带状处理后的图像进行图像格式转换,以便手机的显示屏显示抓拍图像。或者,输出模块1005可以对去模糊处理后的图像进行格式转换,以便手机的显示屏直接显示抓拍图像。
需要说明的,上述对参考帧中的图像进行分割算法时,对于参考帧中包括单个目标对象可以识别出目标对象以实现运动主体分割,对于参考图像中包括多个目标对象的复杂场景中可以采用光流方式实现运动主体分割。
示例性的,以单个目标对象为人、宠物、车辆或机器人等,可以采用专门的识别算法识别参考帧中的目标对象,以便实现参考帧运动主体分割。
又示例性的,对于参考帧中包括多个目标对象的情况,如,包括多人、多运动主体。又或者,参考帧中目标主体较小。可以采用光流方式分割运动主体和非运动区域,以实现参考帧运动主体分割。
其中,光流方式分割运动主体是将运动主体(即目标对象)与周围环境分割开,对周围环境进行二次处理,以使得抓拍图像的显示效果更好。
可以理解的,本申请实施例中的抓拍方式也可以应用于高动态范围成像(High Dynamic Range Imaging,HDR)录制中。其中,视频HDR录制时采用第一曝光时长和第二曝光时长交叠的曝光方式,使得电子设备可以采集到长帧、中帧和短帧。采用ISP合成视频图像,这样,可以提升视频的动态范围。特别的,如果视频HDR录制时环境中存在频闪的照明设备,电子设备可以先对第二曝光时长(即短曝光)采集的图像进行去带状(de-banding)处理,之后对第一曝光时长对应的图像流和第二曝光时长对应的图像流融合,提升视频中图像的锐度(sharpness)以及视频的清晰度。
其中,de-banding算法可以根据多帧图像生成一帧显示图像,但是,在算法运行过程中可能会造成视频的时延。因此,在采用交错曝光的方式拍摄视频HDR的过程中,如果预览图像可以保证实时性,那么,保存的图像流可以提升效果。也就是说,当实时拍摄时,预览视频展示流畅的视频画面,当视频HDR录制完成后,电子设备得到录制文件。其中,该录制文件为高清晰的视频画面。在具体实施中,可以设置多帧算法的性能要求异步调用耗时为33ms以内,以保证Record流30fps的帧率。
可以理解的,交错曝光的方式应用在视频HDR录制时,高速快门可以形成短帧,解决帧内目标对象产生运动拖影的问题,使得每一帧图像中锐度得以提升,进而提升整体视频的清晰度。
可以理解的是,本申请实施例提供的电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请实施例的范围。
本申请实施例可以根据上述方法示例对上述电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
在采用集成的单元的情况下,图14示出了上述实施例中所涉及的电子设备的一种可能的结构示意图。该电子设备200包括:处理单元1101、显示单元1102和存储单元1103。
处理单元1101,用于对电子设备的动作进行管理。例如,处理单元1101可以控制电子设备处于抓拍模式下的曝光方式,处理单元1101还可以控制电子设备显示屏的显示内容等。
显示单元1102,用于显示电子设备的界面。例如,显示单元1102可以用于显示电子设备处于抓拍模式下的主界面,显示单元1102用于显示抓拍模式的预览图像等。
存储单元1103用于保存电子设备200的程序代码和数据。例如,电子设备处于抓拍模式下,存储单元1103可以缓存电子设备预览图像,存储单元1103还用于存储抓拍模式中的图像处理算法等。
当然,上述电子设备200中的单元模块包括但不限于上述处理单元1101、显示单元1102和存储单元1103。例如,电子设备200中还可以包括传感器单元、通信单元等。传感器单元可以包括光照传感器,以采集电子设备所在环境中的光照强度。通信单元用于支持电子设备200与其他装置的通信。
其中,处理单元1101可以是处理器或控制器,例如可以是中央处理器(central processing unit,CPU),数字信号处理器(digital signal processor,DSP),专用集成电路(application-specific integrated circuit,ASIC),现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。处理器可以包括应用处理器和基带处理器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。存储单元1103可以是存储器。音频单元可以包括麦克风、扬声器、受话器等。通信单元可以是收发器、收发电路或通信接口等。
例如,处理单元1101为处理器(如图4所示的处理器210),显示单元1102可以为显示屏(如图4所示的显示屏294,该显示屏294可以为触摸屏,该触摸屏中可以集成显示面板和触控面板),存储单元1103可以为存储器(如图4所示的内部存储器221)。
本申请实施例还提供一种芯片系统,如图15所示,该芯片系统包括至少一个处理器1201和至少一个接口电路1202。处理器1201和接口电路1202可通过线路互联。例如,接口电路1202可用于从其它装置(例如电子设备的存储器)接收信号。又例如,接口电路1202可用于向其它装置(例如处理器1201)发送信号。示例性的,接口电路1202可读取存储器中存储的指令,并将该指令发送给处理器1201。当所述指令被处理器1201执行时,可使得电子设备执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在上述电子设备上运行时,使得该电子设备执行上述方法实施例中手机执行的各个功能或者步骤。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中手机执行的各个功能或者步骤。
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (14)

  1. 一种拍照方法,其特征在于,应用于电子设备,照明设备为所述电子设备的拍摄场景提供光照,所述照明设备提供频闪光照,所述照明设备频闪一次的时长为频闪时长;
    所述方法包括:
    所述电子设备运行相机应用,所述电子设备确定拍摄场景中的光照是频闪光照;
    所述电子设备按照第一曝光方式采集图像,所述第一曝光方式指示所述电子设备按照第一曝光时长和第二曝光时长交错曝光,生成第一拍照队列和第二拍照队列,所述第一拍照队列包括至少一张第一图像,所述第二拍照队列包括至少一张第二图像,其中,所述第一拍照队列是所述电子设备在所述第一曝光时长下采集的图像,所述第二拍照队列是所述电子设备在所述第二曝光时长下采集的图像,所述第一曝光时长大于所述频闪时长,所述第二曝光时长小于所述频闪时长;
    所述电子设备显示拍照界面,所述拍照界面包括预览图像和拍摄键,所述预览图像是根据所述第一拍照队列生成的;
    响应于所述拍摄键被触发,所述电子设备根据所述至少一张第一图像和所述至少一张第二图像生成拍摄图像,并显示所述拍摄图像。
  2. 根据权利要求1所述的方法,其特征在于,所述第一曝光时长是所述频闪时长的整数倍;其中,所述电子设备基于第一曝光时长采集得到的至少一张第一图像组成所述第一拍照队列,所述第一拍照队列中每帧第一图像的曝光时长对应的频闪次数相同,所述第一拍照队列中每帧第一图像的亮度值差异小于预设亮度阈值,使得所述预览图像的显示亮度接近。
  3. 根据权利要求1或2所述的方法,其特征在于,所述电子设备按照第一曝光方式采集图像时,所述电子设备按照第一频率采集得到图像;
    所述电子设备按照第一频率采集得到图像,包括:所述电子设备按照第二频率采集得到第一拍照队列中的图像,所述电子设备按照第三频率采集得到第二拍照队列中的图像,所述第二频率和所述第三频率之和是所述第一频率。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述至少一张第一图像和所述至少一张第二图像生成拍摄图像,包括:
    所述电子设备确定所述拍摄键被触发时刻为快门时刻;
    所述电子设备确定所述第一拍照队列中图像采集时间与所述快门时刻接近的至少一张第一图像;
    将所述至少一张第一图像中亮度最高的图像作为参考帧;
    所述电子设备确定所述第二拍照队列图像采集时间与所述参考帧采集时间接近的至少一张第二图像;
    将所述至少一张第二图像作为辅助帧,根据所述参考帧和所述辅助帧生成拍摄图像。
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述至少一张第一图像和所述至少一张第二图像生成拍摄图像,包括:
    所述电子设备确定所述拍摄键被触发时刻为快门时刻;
    所述电子设备确定所述第一拍照队列中图像采集时间与所述快门时刻接近的至少一张第一图像;
    将所述至少一张第一图像中亮度最高的图像作为参考帧;
    所述电子设备确定所述第二拍照队列图像采集时间与所述参考帧采集时间接近的至少一张第二图像;
    所述电子设备确定所述至少一张第二图像中亮度最高的图像为辅助帧,根据所述参考帧和所述辅助帧生成拍摄图像。
  6. 根据权利要求4或5所述的方法,其特征在于,所述根据所述参考帧和所述辅助帧生成拍摄图像,包括:
    基于带状检测确定所述参考帧中第一阈值,所述第一阈值表征所述参考帧的带状程度;
    若所述第一阈值大于预设阈值,根据所述辅助帧生成所述拍摄图像;
    若所述第一阈值小于或等于所述预设阈值,根据所述参考帧和所述辅助帧生成所述拍摄图像。
  7. 根据权利要求6所述的方法,其特征在于,所述若所述第一阈值小于或等于所述预设阈值,根据所述参考帧和所述辅助帧生成拍摄图像,包括:
    确定所述参考帧中非运动区域和运动区域,所述非运动区域是指图像中非运动的物体的部分,所述运动区域是指图像中目标对象所在的部分;
    针对所述非运动区域,根据所述辅助帧进行像素融合,减弱所述非运动区域的带状现象,生成处理后的非运动区域;
    调整所述运动区域的灰度系数,以减弱所述运动区域的带状现象,生成处理后的运动区域;
    采用图像融合算法,将所述处理后的运动区域和所述处理后的非运动区域融合,以生成拍摄图像。
  8. 根据权利要求6所述的方法,其特征在于,所述若所述第一阈值大于预设阈值,根据所述辅助帧生成拍摄图像,包括:
    采用预设的图像去模糊算法处理所述辅助帧,减弱所述辅助帧的运动模糊现象,以生成拍摄图像。
  9. 根据权利要求1-2、4-5、7-8任一项所述的方法,其特征在于,所述电子设备运行相机应用,所述电子设备确定拍摄场景中的光照是频闪光照,包括:
    所述电子设备运行相机应用,所述电子设备按照第二曝光方式采集图像,所述第二曝光方式指示所述电子设备按照第三曝光时长曝光;
    所述电子设备连续采集得到多张图像,并计算所述多张图像中每张图像的亮度;
    所述多张图像中每两张的图像亮度差值大于预设亮度差值,确定拍摄场景中的光照是频闪光照。
  10. 根据权利要求1-2、4-5、7-8任一项所述的方法,其特征在于,所述方法还包括:
    若所述电子设备检测到拍摄场景发生改变,所述电子设备按照第二曝光方式采集图像,所述第二曝光方式指示所述电子设备按照第三曝光时长曝光。
  11. 根据权利要求10所述的方法,其特征在于,所述若所述电子设备检测到拍摄场景发生改变之后,所述方法还包括:
    所述电子设备确定曝光方式切换延时,当所述切换延时结束,所述电子设备从所述第一曝光方式切换至所述第二曝光方式。
  12. 根据权利要求9所述的方法,其特征在于,所述第三曝光时长等于所述第一曝光时长或等于所述第二曝光时长。
  13. 一种电子设备,其特征在于,包括:摄像头,用于采集图像;
    显示屏,用于显示界面;
    一个或多个处理器;
    存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行如权利要求1-12中任一项所述的拍照方法。
  14. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在计算机上运行时,使得所述计算机执行如权利要求1-12中任一项所述的拍照方法。
PCT/CN2021/144038 2021-04-06 2021-12-31 一种拍照方法、电子设备及存储介质 Ceased WO2022213683A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US18/020,251 US12170851B2 (en) 2021-04-06 2021-12-31 Photographing method, electronic device, and storage medium
EP21935899.1A EP4178196B1 (en) 2021-04-06 2021-12-31 Photographing method, electronic device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110365586.1A CN112738414B (zh) 2021-04-06 2021-04-06 一种拍照方法、电子设备及存储介质
CN202110365586.1 2021-04-06

Publications (1)

Publication Number Publication Date
WO2022213683A1 true WO2022213683A1 (zh) 2022-10-13

Family

ID=75596484

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/144038 Ceased WO2022213683A1 (zh) 2021-04-06 2021-12-31 一种拍照方法、电子设备及存储介质

Country Status (4)

Country Link
US (1) US12170851B2 (zh)
EP (1) EP4178196B1 (zh)
CN (1) CN112738414B (zh)
WO (1) WO2022213683A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240196101A1 (en) * 2021-07-28 2024-06-13 Vivo Mobile Communication Co., Ltd. Image generation method and electronic device

Families Citing this family (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116886810A (zh) * 2020-11-20 2023-10-13 华为终端有限公司 摄像头调用方法、系统及电子设备
CN112738414B (zh) * 2021-04-06 2021-06-29 荣耀终端有限公司 一种拍照方法、电子设备及存储介质
CN113472980B (zh) * 2021-06-15 2022-12-09 展讯通信(上海)有限公司 一种图像处理方法、装置、设备、介质和芯片
CN115484392B (zh) 2021-06-16 2023-12-19 荣耀终端有限公司 一种拍摄视频的方法及电子设备
CN113592887B (zh) * 2021-06-25 2022-09-02 荣耀终端有限公司 视频拍摄方法、电子设备及计算机可读存储介质
CN113596344B (zh) * 2021-07-26 2023-10-24 艾酷软件技术(上海)有限公司 拍摄处理方法、装置、电子设备和可读存储介质
CN113824873B (zh) * 2021-08-04 2022-11-15 荣耀终端有限公司 一种图像处理的方法及相关电子设备
CN115776532B (zh) * 2021-09-07 2023-10-20 荣耀终端有限公司 一种录像中抓拍图像的方法及电子设备
CN115842962A (zh) * 2021-09-17 2023-03-24 荣耀终端有限公司 Hdr图像处理方法及电子设备
CN113840090B (zh) * 2021-09-27 2024-07-02 维沃移动通信有限公司 快门调整方法、装置、设备和存储介质
CN113992852A (zh) * 2021-10-26 2022-01-28 维沃移动通信有限公司 运动抓拍图像的修正方法、装置和电子设备
CN116188279B (zh) * 2021-11-25 2026-03-27 华为技术有限公司 图像处理及模型训练方法及电子设备
CN116193269B (zh) * 2021-11-26 2025-08-29 荣耀终端股份有限公司 一种曝光模式切换方法及相关设备
CN114173064B (zh) * 2021-12-07 2024-04-09 天地伟业技术有限公司 一种多重曝光方法、装置及电子设备
CN116261041A (zh) * 2021-12-08 2023-06-13 华为技术有限公司 拍摄方法、装置、设备及存储介质
CN114710626B (zh) * 2022-03-07 2024-05-14 北京千方科技股份有限公司 图像采集的方法、装置、电子设备及介质
CN114529729B (zh) * 2022-04-22 2022-08-23 珠海视熙科技有限公司 频闪检测及消除方法、装置、相机及存储介质
US12160670B2 (en) * 2022-05-13 2024-12-03 Qualcomm Incorporated High dynamic range (HDR) image generation using a combined short exposure image
CN115082350B (zh) * 2022-07-06 2025-07-04 维沃移动通信有限公司 频闪图像处理方法、装置、电子设备和可读存储介质
CN115499579B (zh) * 2022-08-08 2023-12-01 荣耀终端有限公司 基于零秒延迟zsl的处理方法和装置
CN117651221B (zh) * 2022-08-09 2024-11-01 荣耀终端有限公司 视频处理的方法及电子设备
CN116055857B (zh) * 2022-08-24 2023-11-24 荣耀终端有限公司 拍照方法及电子设备
CN116055890B (zh) * 2022-08-29 2024-08-02 荣耀终端有限公司 生成高动态范围视频的方法和电子设备
CN115514901B (zh) * 2022-09-09 2024-10-25 维沃移动通信有限公司 曝光时间调整方法及其电路
CN116320783B (zh) * 2022-09-14 2023-11-14 荣耀终端有限公司 一种录像中抓拍图像的方法及电子设备
CN116744120B (zh) * 2022-09-15 2024-04-12 荣耀终端有限公司 图像处理方法和电子设备
CN116708751B (zh) * 2022-09-30 2024-02-27 荣耀终端有限公司 一种拍照时长的确定方法、装置和电子设备
CN115412678B (zh) * 2022-10-20 2023-05-26 荣耀终端有限公司 曝光处理方法、装置及电子设备
CN116055894B (zh) * 2023-01-28 2023-08-15 荣耀终端有限公司 基于神经网络的图像去频闪方法和装置
CN117135268B (zh) * 2023-02-23 2024-06-21 荣耀终端有限公司 拍摄的方法和电子设备、芯片、存储介质
CN116916148B (zh) * 2023-05-15 2024-04-16 荣耀终端有限公司 一种图像处理方法、电子设备及可读存储介质
CN119233104B (zh) * 2023-06-30 2025-12-30 北京小米移动软件有限公司 图像处理方法及装置、电子设备及存储介质
CN119342354A (zh) * 2023-07-19 2025-01-21 北京小米移动软件有限公司 拍摄方法、装置及存储介质
CN118474528B (zh) * 2023-09-15 2025-01-28 荣耀终端有限公司 相机资源管理方法及相关设备
CN117615248B (zh) * 2023-11-24 2024-09-06 北京东舟技术股份有限公司 一种vr显示屏内容的拍摄方法、装置、设备及存储介质
CN120282018B (zh) * 2023-12-29 2026-02-27 荣耀终端股份有限公司 图像拍摄方法、电子设备以及计算机可读存储介质
CN120321501A (zh) * 2024-01-05 2025-07-15 荣耀终端股份有限公司 一种拍摄方法、电子设备及存储介质
CN117692786B (zh) * 2024-02-01 2024-07-30 荣耀终端有限公司 一种拍摄方法、电子设备和存储介质
CN119255093A (zh) * 2024-02-19 2025-01-03 荣耀终端有限公司 一种帧预览方法、装置、电子设备及存储介质
CN120568192A (zh) * 2024-02-20 2025-08-29 荣耀终端股份有限公司 一种图像处理方法及电子设备
CN120704811B (zh) * 2024-03-25 2026-04-03 华为技术有限公司 一种图像处理方法、装置和电子设备
CN119094883B (zh) * 2024-09-03 2025-05-30 深圳市易天科技有限公司 一种安卓设备的摄像头控制方法、电子设备及存储介质
CN119299861B (zh) * 2024-09-27 2026-03-06 北京空间机电研究所 一种红外面阵探测器图像多模式融合系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060152598A1 (en) * 2005-01-13 2006-07-13 Masahiro Kawarada Electronic still camera, image capturing method, program, and storage medium
JP2017143404A (ja) * 2016-02-10 2017-08-17 三星電子株式会社Samsung Electronics Co.,Ltd. 撮像装置及び撮像方法
CN108353130A (zh) * 2015-11-24 2018-07-31 索尼公司 图像处理器、图像处理方法和程序
CN108462837A (zh) * 2018-03-13 2018-08-28 中兴通讯股份有限公司 拍摄方法及装置
JP2020028080A (ja) * 2018-08-16 2020-02-20 キヤノン株式会社 撮像装置及びその制御方法、プログラム、記憶媒体
CN112235505A (zh) * 2020-09-24 2021-01-15 浙江大华技术股份有限公司 去除图像闪烁的方法及其相关装置
CN112738414A (zh) * 2021-04-06 2021-04-30 荣耀终端有限公司 一种拍照方法、电子设备及存储介质

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR3005543A1 (fr) * 2013-10-14 2014-11-14 St Microelectronics Grenoble 2 Procede de compensation de scintillement utilisant deux images
KR20150109177A (ko) * 2014-03-19 2015-10-01 삼성전자주식회사 촬영 장치, 그 제어 방법, 및 컴퓨터 판독가능 기록매체
US9407832B2 (en) * 2014-04-25 2016-08-02 Himax Imaging Limited Multi-exposure imaging system and method for eliminating rolling shutter flicker
JP6543787B2 (ja) 2014-09-09 2019-07-17 ハンファテクウィン株式会社 画像処理装置および画像処理方法
US9843739B2 (en) 2015-10-07 2017-12-12 Mediatek Singapore Pte. Ltd. Method for correcting flickers in a single-shot multiple-exposure image and associated apparatus
KR102615091B1 (ko) 2016-01-13 2023-12-19 삼성전자주식회사 촬영 장치 및 그 동작 방법
CN106131445A (zh) 2016-07-08 2016-11-16 深圳天珑无线科技有限公司 一种拍摄方法和装置
US10992876B2 (en) 2016-10-18 2021-04-27 Texas Instruments Incorporated WDR imaging with LED flicker mitigation
JP6759089B2 (ja) 2016-12-21 2020-09-23 キヤノン株式会社 画像処理装置、撮像装置、制御方法
CN108322650B (zh) * 2018-02-08 2020-03-27 Oppo广东移动通信有限公司 视频拍摄方法和装置、电子设备、计算机可读存储介质
US11012634B2 (en) 2018-06-29 2021-05-18 Canon Kabushiki Kaisha Image pickup apparatus capable of performing image pickup with reduced flicker influence, method for controlling the same, and storage medium
CN114679537B (zh) * 2019-05-22 2023-04-28 华为技术有限公司 一种拍摄方法及终端
CN111163270A (zh) * 2019-12-30 2020-05-15 Oppo广东移动通信有限公司 消除闪烁的方法、电子装置和存储介质
CN111866401A (zh) 2020-08-31 2020-10-30 维沃移动通信有限公司 拍摄方法、装置及电子设备
CN112351216B (zh) * 2020-10-10 2022-04-05 深圳开阳电子股份有限公司 检测和消除视频闪烁的方法及图像处理设备
CN112383718A (zh) * 2020-11-16 2021-02-19 维沃移动通信(杭州)有限公司 图像曝光方法、装置和电子设备
CN112492227B (zh) * 2020-12-15 2022-02-08 维沃移动通信有限公司 曝光方法、摄像模组和电子设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060152598A1 (en) * 2005-01-13 2006-07-13 Masahiro Kawarada Electronic still camera, image capturing method, program, and storage medium
CN108353130A (zh) * 2015-11-24 2018-07-31 索尼公司 图像处理器、图像处理方法和程序
JP2017143404A (ja) * 2016-02-10 2017-08-17 三星電子株式会社Samsung Electronics Co.,Ltd. 撮像装置及び撮像方法
CN108462837A (zh) * 2018-03-13 2018-08-28 中兴通讯股份有限公司 拍摄方法及装置
JP2020028080A (ja) * 2018-08-16 2020-02-20 キヤノン株式会社 撮像装置及びその制御方法、プログラム、記憶媒体
CN112235505A (zh) * 2020-09-24 2021-01-15 浙江大华技术股份有限公司 去除图像闪烁的方法及其相关装置
CN112738414A (zh) * 2021-04-06 2021-04-30 荣耀终端有限公司 一种拍照方法、电子设备及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4178196A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20240196101A1 (en) * 2021-07-28 2024-06-13 Vivo Mobile Communication Co., Ltd. Image generation method and electronic device

Also Published As

Publication number Publication date
EP4178196B1 (en) 2025-03-05
US12170851B2 (en) 2024-12-17
CN112738414A (zh) 2021-04-30
CN112738414B (zh) 2021-06-29
EP4178196A4 (en) 2023-12-06
US20230276136A1 (en) 2023-08-31
EP4178196A1 (en) 2023-05-10

Similar Documents

Publication Publication Date Title
EP4178196B1 (en) Photographing method, electronic device and storage medium
CN113592887B (zh) 视频拍摄方法、电子设备及计算机可读存储介质
CN114390213B (zh) 一种拍摄方法及设备
US20250088732A1 (en) Method for capturing image in video recording and electronic device
CN110198417A (zh) 图像处理方法、装置、存储介质及电子设备
US20230043815A1 (en) Image Processing Method and Electronic Device
CN107302664A (zh) 一种拍摄方法及移动终端
WO2023035921A1 (zh) 一种录像中抓拍图像的方法及电子设备
CN116916151B (zh) 拍摄方法、电子设备和存储介质
CN116708753B (zh) 预览卡顿原因的确定方法、设备及存储介质
WO2022083325A1 (zh) 拍照预览方法、电子设备以及存储介质
WO2024021678A1 (zh) 图像处理方法及其相关设备
WO2024193222A1 (zh) 拍照处理方法、电子设备和计算机可读存储介质
CN116347229A (zh) 图像拍摄的方法及电子设备
CN120282018B (zh) 图像拍摄方法、电子设备以及计算机可读存储介质
CN117692753B (zh) 一种拍照方法及电子设备
CN115225822B (zh) 一种数据处理方法及电子设备
CN121711558A (zh) 一种抓拍出帧方法、电子设备及存储介质
WO2025130155A1 (zh) 图像显示方法和电子设备
CN121284303A (zh) 一种视频处理方法、电子设备和存储介质
WO2025060765A1 (zh) 视频处理方法、电子设备和计算机可读存储介质
CN121012900A (zh) 一种视频录制方法和设备
WO2025039537A1 (zh) 拍照参数设置方法及电子设备
WO2026001306A1 (zh) 拍摄方法、电子设备、芯片系统及存储介质
CN121397371A (zh) 一种拍摄方法、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21935899

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021935899

Country of ref document: EP

Effective date: 20230131

NENP Non-entry into the national phase

Ref country code: DE