[go: up one dir, main page]

WO2019071613A1 - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
WO2019071613A1
WO2019071613A1 PCT/CN2017/106176 CN2017106176W WO2019071613A1 WO 2019071613 A1 WO2019071613 A1 WO 2019071613A1 CN 2017106176 W CN2017106176 W CN 2017106176W WO 2019071613 A1 WO2019071613 A1 WO 2019071613A1
Authority
WO
WIPO (PCT)
Prior art keywords
exposure
frame
adjustment
adjusted
camera
Prior art date
Application number
PCT/CN2017/106176
Other languages
French (fr)
Chinese (zh)
Inventor
王军
杜成
敖欢欢
徐荣跃
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2017/106176 priority Critical patent/WO2019071613A1/en
Priority to CN201780081683.XA priority patent/CN110121882B/en
Publication of WO2019071613A1 publication Critical patent/WO2019071613A1/en

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

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
  • Some terminals with camera functions will have different degrees of motion blur when shooting moving objects. If the target moving speed is large, more serious smear will occur.
  • sports scenes such as human motion, object motion, and flower shake are important scenes for users to pay attention to.
  • professional photographers often have expensive large apertures and set the appropriate aperture value and shutter speed to capture moving targets.
  • the mobile phone camera aperture is fixed and cannot be extended by itself. It cannot support adjusting the aperture with high shutter speed for shooting.
  • the camera camera aperture is adjustable, the average user also There is not enough prior knowledge to set the appropriate aperture shutter and other camera parameters in time to shoot.
  • the existing software method for taking pictures against motion blur mainly uses a strategy based on motion detection to reduce the exposure time. This method first performs motion detection, automatically increases the shutter speed when detecting camera or object motion, and increases the shutter speed to reduce the exposure time. In the image imaging stage, the motion blur will decrease with the decrease of the exposure time, but reducing the exposure time will reduce the overall brightness of the image. Therefore, it is necessary to increase the exposure gain in the same proportion while maintaining the overall brightness of the image while reducing the exposure time.
  • the above method of reducing the exposure time and increasing the exposure gain in the same proportion causes the image noise in the dark scene to be excessively large, and the overall quality of the image is lowered. If the image noise level is guaranteed, the intensity of the exposure time is limited, and the anti-motion blur ability is weakened. In summary, reducing the exposure time and increasing the exposure gain are mutually constrained, resulting in insufficient terminal blur reduction motion blur.
  • the present application provides an image processing method and apparatus for solving the problem that when the motion blur is reduced by reducing the exposure time, the strength of the exposure time is limited by weighing the noise level, and the terminal has insufficient ability to reduce the motion blur.
  • an image processing method is provided.
  • the method is: when previewing an image frame collected by a camera in a preview stage, when the captured target object and the terminal have relative motion, the method is as described in the preview state.
  • Adjusting the initial exposure parameters of the camera referred to herein as a first adjustment
  • the first adjustment includes reducing an initial exposure time and increasing an initial exposure gain
  • the terminal after receiving the shooting instruction, the first adjusted
  • the exposure parameter is adjusted again, referred to herein as a second adjustment, the second adjustment includes decreasing the exposure time after the first adjustment and increasing the exposure gain after the first adjustment, the terminal according to the first adjusted
  • the exposure parameter generates a first exposure frame, and generates at least two second exposure frames according to the second adjusted exposure parameter, the terminal fused the first exposure frame and the at least two second exposure frames , output the merged image.
  • the initial exposure time includes the initial exposure time and the initial exposure gain.
  • the first adjusted exposure parameter is second adjusted.
  • the condition may be any one of the following, or may be other conditions.
  • the condition may be that the terminal adjusts the first adjusted exposure parameter when the rate of the relative motion of the target object and the terminal is greater than a set rate threshold; or: the terminal When the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the first adjusted exposure parameter is second adjusted; or: the terminal is in the preview state of the camera When the brightness value LV is less than the set brightness threshold, the first adjusted exposure parameter is second adjusted.
  • the terminal determines that the relative motion rate of the target object and the terminal is not greater than the set rate threshold, only the first adjustment of the initial exposure parameter of the camera in the preview state may be performed, and the imaging process adopts the first adjustment.
  • the subsequent exposure parameter generates an exposure frame, and outputs an image according to the generated exposure frame, that is, a process without second adjustment
  • the terminal determines a ratio of decreasing the exposure time corresponding to the rate of the relative motion according to a relationship between a preset motion rate and a ratio of decreasing the exposure time, and determining to increase the exposure gain.
  • the first adjustment of the initial exposure parameter of the camera in the preview state is performed according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain.
  • the value of the exposure time is adjusted according to the ratio, and the ratio of the reduction of the exposure time can be correlated with the movement rate, and a suitable ratio of reducing the exposure time is selected for the current movement rate to prevent the reduction of the low.
  • Exposure time brings a greater level of noise.
  • a maximum exposure gain threshold is set, and when the exposure parameter of the preview state is first adjusted, the increased exposure gain needs to be less than the set maximum exposure gain threshold.
  • the setting of this method can control the noise level of the preview image by limiting the upper limit of the exposure gain.
  • the terminal performs time domain multi-frame noise reduction fusion on the at least two second exposure frames before fusing the first exposure frame and the at least two second exposure frames. Processed to get a short frame. Since the second exposure frame is generated with a shorter exposure time, a larger exposure gain is increased in proportion, which also brings more noise. With such a processing method, it can help to reduce the second exposure frame. Noise level.
  • the terminal uses the short frame as a reference frame, performs image registration and ghost detection on the first exposure frame and the short frame, and images the image according to the result of ghost detection.
  • the first exposure frame after registration is subjected to de-ghost processing to obtain a long frame after ghosting; according to the result of the ghost detection, the ghost region of the long frame is used as a fusion reference, and the long The frame and the short frame are subjected to frequency domain fusion.
  • the short frame pixel fusion weight is greater than the long frame pixel fusion weight.
  • the long frame pixel fusion weight is greater than the short frame pixel fusion weight
  • the ghost region is the motion region, that is, the target object and the terminal have relative motion.
  • the non-moving area may be considered to be relatively stationary or approximately stationary with the terminal, the moving area is a dithered flower, and the non-moving area is a background such as a sky ground.
  • the brightness information of the long exposure frame can be retained, so that the motion area and the non-motion area of the captured image are more clear, and the problem that the terminal reduces the motion blur due to the limitation of the noise level by reducing the intensity of the exposure time can be effectively avoided.
  • an image processing apparatus having the functionality to implement any of the possible in-design methods of the first aspect and the first aspect described above.
  • the function can be implemented by hardware, or can be executed by hardware.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • the device can be a chip or an integrated circuit.
  • the apparatus includes a camera for acquiring image frames, a processor for executing a set of programs, and the apparatus for performing the first aspect and the first aspect described above when the program is executed The method described in any of the possible designs.
  • the apparatus also includes a memory for storing code executed by the processor.
  • a computer storage medium stored with a computer program comprising instructions for performing the method of any of the first aspect and the first aspect of the first aspect.
  • a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method described in any of the first aspect and the first aspect of the first aspect.
  • FIG. 1 is a schematic structural diagram of a terminal hardware in an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of an image processing method according to an embodiment of the present application.
  • 3a is a schematic diagram showing the relationship between the ratio of reducing the exposure time and the exposure gain in the embodiment of the present application;
  • FIG. 3b is a schematic diagram showing the relationship between the motion rate level and the reduced exposure time in the embodiment of the present application.
  • FIG. 4 is a schematic diagram of multi-frame short frame noise reduction and long and short frame fusion in the embodiment of the present application;
  • FIG. 5 is a schematic flowchart of removing ghost images in a long exposure frame according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of frequency domain fusion of long and short frames in an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of an image processing method in an application scenario according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
  • FIG. 9 is a second schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
  • the terminal involved in the embodiment of the present application may be any electronic device having a photographing function, including but not limited to a personal computer, a server computer, a handheld or laptop device, a mobile phone, a tablet computer, a personal digital assistant, and a media player. , consumer electronics, small computers, large computers.
  • the terminal 100 includes a display device 110, a processor 120, and a memory 130.
  • the memory 130 can be used to store software programs and data, and the processor 120 executes various functional applications and data processing of the terminal 100 by running software programs and data stored in the memory 130.
  • the memory 130 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function, and the like; the storage data area may store data created according to the use of the terminal 100, such as audio. Data, phone book, exchangeable image file EXIF.
  • memory 130 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the processor 120 is a control center of the terminal 100, and connects various parts of the entire terminal by various interfaces and lines, and executes various functions and processing data of the terminal 100 by running or executing software programs and/or data stored in the memory 130. Therefore, the terminal is monitored as a whole.
  • the processor 120 may include one or more general purpose processors, and may also include one or more digital signal processors (digital signal The processor (DSP) is configured to perform related operations to implement the technical solutions provided by the embodiments of the present application.
  • DSP digital signal The processor
  • the processor 120 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
  • the processor 120 may further include a hardware chip.
  • the hardware chip may be an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof.
  • the PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL), or any combination thereof.
  • the memory 130 may include a volatile memory such as a random-access memory (RAM); the memory 130 may also include a non-volatile memory such as a flash memory (flash) Memory), hard disk drive (HDD) or solid state drive (SSD); the memory 130 may also include a combination of the above types of memories.
  • RAM random-access memory
  • non-volatile memory such as a flash memory (flash) Memory), hard disk drive (HDD) or solid state drive (SSD); the memory 130 may also include a combination of the above types of memories.
  • the terminal 100 may further include an input device 140 for receiving input digital information, character information or contact touch/contactless gestures, and generating signal inputs related to user settings and function control of the terminal 100, and the like.
  • the input device 140 can include a touch panel 141.
  • the touch panel 141 also referred to as a touch screen, collects touch operations on or near the user and drives the corresponding connection device according to a preset program.
  • the touch panel 141 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input device 140 may further include other input devices 142, which may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like. One or more of them.
  • the display device 110 includes a display panel 111 for displaying information input by the user or information provided to the user and various menu interfaces of the terminal device 100.
  • the display panel can be configured by using a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • the terminal 100 may further include a power source 150 for powering other modules and a camera 160 for taking photos or videos.
  • the terminal 100 may also include one or more sensors 170, such as an acceleration sensor, a light sensor, a GPS sensor, an infrared sensor, a laser sensor, a position sensor or a lens pointing angle sensor, and the like.
  • the terminal 100 may further include a radio frequency (RF) circuit 180 for performing network communication with the wireless network device, and may further include a WiFi module 190 for performing WiFi communication with other devices.
  • RF radio frequency
  • the image processing method provided by the embodiment of the present application can be executed by the terminal 100 based on the hardware structure of the terminal shown in FIG. 1 .
  • the terminal After the camera is turned on, the terminal enters a preview state.
  • the captured target object may be in a moving state, for example, human body motion, object motion, flower and grass shake, and the like.
  • the photographed target object may be in a stationary state, but the terminal is in a motion state, for example, the user's hand-held terminal is photographed on a traveling train, or the user's hand-held terminal is photographed while exercising, and the like. Regardless of the above state, it can be considered that there is a relative motion relationship between the captured target object and the terminal.
  • the method provided by the embodiment of the present application can help solve the motion blur problem in this application scenario.
  • the flow of the image processing method provided by the embodiment of the present application is as follows.
  • Step 201 During previewing the image frame acquired by the camera, when the captured target object and the terminal have relative motion, the first adjustment of the initial exposure parameter of the camera in the preview state is performed.
  • the first adjustment comprises reducing the initial exposure time and increasing the initial exposure gain.
  • the end In the preview state the camera will generate initial exposure parameters under automatic exposure (AE).
  • the initial exposure time includes the initial exposure time and the initial exposure gain.
  • Step 202 After receiving the shooting instruction, the terminal performs a second adjustment on the first adjusted exposure parameter, and generates a first exposure frame according to the first adjusted exposure parameter, and generates at least two according to the second adjusted exposure parameter. And a second exposure frame, wherein the second adjustment comprises decreasing the exposure time after the first adjustment and increasing the exposure gain after the first adjustment.
  • the first exposure frame generated according to the first adjusted exposure parameter may also be referred to as a long exposure frame, according to The second exposure frame generated by the second adjusted exposure parameter may also be referred to as a short exposure frame.
  • Step 203 The terminal combines the first exposure frame and the at least two second exposure frames to output the fused image.
  • the exposure parameter when a certain condition is satisfied, the exposure parameter needs to be adjusted twice, and the adjustment made to the initial exposure parameter of the camera in the preview state is referred to as the first adjustment.
  • the adjustment made to the first adjusted exposure parameter after receiving the shooting instruction input by the user is referred to as a second adjustment.
  • the exposure parameters involved in the embodiments of the present application include at least an exposure time and an exposure gain.
  • the first adjustment refers to lowering the exposure time and increasing the exposure gain based on the exposure parameter of the camera automatic exposure in the preview state; the second adjustment refers to lowering the exposure time and increasing the exposure gain based on the first adjusted exposure parameter. .
  • the ratio of decreasing the exposure time is the same as increasing the exposure gain, or the ratio of increasing the exposure gain is obtained according to the ratio of decreasing the exposure time.
  • the photographing involved in the embodiments of the present application may be, but is not limited to, a process of photographing using a camera, such as photographing, photographing, and the like.
  • the embodiment of the present application can obtain a shorter exposure time by reducing the exposure time twice, and the motion blur will decrease in proportion with the decrease of the exposure time. Therefore, the shorter exposure time contributes to more effective reduction motion. blurry.
  • the embodiment of the present application adopts a multi-frame fusion method to generate a long exposure frame according to the first adjusted exposure parameter in the imaging stage, and generate a short exposure frame according to the second adjusted exposure parameter. Since long exposure frames employ longer exposure times, long exposure frames have the advantage of higher brightness, and short exposure frames have the advantage of being sharper in the motion area. The combination of the long exposure frame and the short exposure frame preserves the advantages of the long exposure frame and the short exposure frame during the fusion process, and can effectively output a clearer image of the motion region.
  • step 202 the series of actions performed by the terminal is performed during the process in which the terminal receives the user-triggered shooting instruction to output imaging.
  • the terminal generates at least one long exposure frame and at least two short exposure frames in the imaging process.
  • the embodiment of the present application introduces an example of generating one long exposure frame and three short exposure frames.
  • the terminal can also generate four or five short exposure frames in the imaging process, but three short exposure frames are a possible implementation manner due to factors such as calculation amount.
  • the preview image frame is motion-detected to determine whether there is relative motion between the captured target object and the terminal.
  • the embodiment of the present application may perform motion detection on the preview image frame by using any motion detection method in the prior art.
  • the motion detection method generally performs down-sampling of two image frames before and after, and meshes the downsampled image frames.
  • One image frame may be meshed to include multiple image grid blocks.
  • the photographing may be performed according to the normal exposure parameter of the AE convergence. If it is detected that there is relative motion between the captured target object and the terminal, the exposure parameters need to be adjusted. In a possible implementation manner, if the terminal determines that the rate of relative motion of the target object and the terminal is greater than a set rate threshold, performing second adjustment on the first adjusted exposure parameter; if the terminal determines relative motion of the target object and the terminal If the rate is not greater than the set rate threshold, only the initial adjustment of the initial exposure parameter of the camera in the preview state may be performed. The imaging process uses the first adjusted exposure parameter to generate an exposure frame, and outputs an image according to the generated exposure frame, that is, There is no process of second adjustment. Wherein, the set rate threshold is an empirical value.
  • condition for whether or not to perform the second adjustment may be equivalently replaced with the following two or other conditions.
  • Condition 1 When the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the first adjusted exposure parameter is second adjusted, and when the exposure gain in the process of determining the preview image is not greater than the set gain threshold The imaging process uses the first adjusted exposure parameter to generate an exposure frame, and outputs an image according to the generated exposure frame, that is, there is no second adjustment process.
  • the set gain threshold is an empirical value, for example, the set gain threshold is 800.
  • Condition 2 In the preview state, when the light value (LV) of the camera is less than the set brightness threshold, the first adjusted exposure parameter is second adjusted, and the brightness value LV in the process of determining the preview image is not less than
  • the imaging process uses the first adjusted exposure parameter to generate an exposure frame, and outputs an image according to the generated exposure frame, that is, there is no second adjustment process.
  • the LV can be considered as the ambient brightness during the process of previewing the image frame acquired by the camera.
  • Set the brightness threshold to the empirical value. For example, set the brightness threshold to 40 or 20.
  • the general mid-highlight scene selection only performs the first adjustment of the initial exposure parameter of the camera in the preview state, and the frame is framed according to the first adjusted exposure parameter; the second adjustment is performed after the first adjustment is performed in the dark scene, and the combination is performed.
  • Image post processing fuses long and short frames.
  • the ratio of decreasing the exposure time may be related to the rate of relative motion of the target object and the terminal obtained by the motion detection. Specifically, the terminal determines a proportional value of the reduced exposure time corresponding to the rate of the relative motion according to a relationship between the preset motion rate and a ratio of decreasing the exposure time, and determines the increase according to the determined ratio of decreasing the exposure time.
  • the value of the exposure gain in general, increases the ratio of the exposure gain to the same ratio as the exposure time.
  • the initial exposure parameter of the camera in the preview state is adjusted according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain.
  • the relationship between the motion rate and the ratio of decreasing the exposure time may be a linear relationship, that is, as the motion rate increases, the ratio of the exposure time decreases, and the value of the exposure gain increases.
  • the embodiment of the present application sets a maximum exposure gain threshold, and when the exposure parameter of the camera is adjusted in the preview state, the increase is performed.
  • the value of the exposure gain needs to be less than the set maximum exposure gain threshold. If the value after increasing the exposure gain in proportion to decreasing the exposure time is greater than the maximum exposure gain threshold, the ratio of decreasing the exposure time needs to be reduced, at least to such an extent that the increased exposure gain is less than the set maximum exposure gain.
  • Threshold For example, the maximum exposure gain threshold can be 700, 1000. This method can be set by limiting exposure The upper limit of the benefit is to control the noise level of the preview image.
  • the condition of the second motion is determined by whether the rate of the relative motion is greater than the set rate threshold, the ratio of the relative motion rate and the decrease of the exposure time satisfies a certain relationship, and the ratio of the exposure time is substantially reduced.
  • the rate of motion is linear and then invariant. For example, as shown in Figure 3b, a schematic diagram of the first adjustment of the exposure parameters by rate level in the preview state is characterized. It is assumed that the rate of relative motion is divided into several levels, and the different levels correspond to different ratios of decreasing exposure time.
  • the rate of relative motion When the rate of relative motion is 0, it means shooting a still image, and imaging according to the normal exposure parameter of AE convergence; when the rate of relative motion is 1, according to the relationship line, the ratio of exposure time is reduced according to the ratio 1, and Increasing the exposure gain in the same proportion, and imaging according to the adjusted exposure parameters; when the relative motion rate level is 2, according to the relationship graph, the ratio of the exposure time is reduced according to the ratio 2, and the exposure gain is increased in the same proportion, according to the adjustment After the exposure parameter is imaged; when the relative motion rate level is 3, the motion rate at this time is greater than the set rate threshold, and the ratio of the exposure time is decreased according to the ratio 2 in the preview phase, and the exposure gain is increased in the same proportion, according to The adjusted exposure parameter is imaged; when the relative motion rate level is greater than 3, the motion rate at this time is greater than the set rate threshold, and the ratio of the exposure time is decreased according to the ratio 2 in the preview phase, and the exposure gain is increased in proportion. Imaging is performed according to the adjusted exposure parameters.
  • the following focuses on how to fuse at least two short exposure frames and at least one long exposure frame during the image post-processing stage.
  • three short exposure frames and one long exposure frame are generated by merging three short exposure frames and one long exposure frame in the imaging stage, and the fused images are output.
  • the process of the fusion is roughly divided into: after the image signal processing unit (ISP) of the terminal outputs three short exposure frames and one long exposure frame, after step 401 and step 402, the final output fusion is performed. As a result, the fused image is output.
  • ISP image signal processing unit
  • Step 401 Perform time domain multi-frame noise reduction fusion processing on the three short exposure frames, and refer to a frame obtained by the time domain multi-frame noise reduction fusion processing as a short frame.
  • the short frame here refers to the result of the noise reduction fusion process of three short exposure frames, and in particular, may be one of three short exposure frames.
  • Step 402 Combine a short frame obtained in step 401 with a long exposure frame.
  • the same scene is shot at least twice, since the noise is randomly fluctuated between frames, the signal It is fixed.
  • the noise variance of each frame is ⁇ 2
  • the noise variance of the resulting frame is reduced to ⁇ 2 /N.
  • the signal-to-noise ratio is increased by 6dB. Therefore, in theory, the 4-frame time domain noise reduction can be improved by 6dB.
  • three-frame short exposure frame fusion noise reduction is used.
  • the three-frame short exposure frame is represented by Frame0, Frame1, and Frame2.
  • the time domain average may be misaligned, introducing ghosts or blurring, so image registration and ghosting need to be added before multi-frame time domain averaging. Detection.
  • step 401 can include several specific implementation steps.
  • Image registration Feature extraction is performed on the input reference frame Frame0 and the to-be-registered frame Frame1, respectively, and a series of feature points are obtained, and each feature point is characterized. According to the feature description, the feature points of the two frames of images are matched, and a series of feature point pairs are obtained.
  • the transformation matrix of the two frames of images is obtained by matching the pair of feature points obtained, that is, the projection transformation is a matrix H of 3 ⁇ 3.
  • Frame1 obtains an image aligned with Frame0 through H matrix transformation, which can be called the registration result of Frame1.
  • the same method to get the image of Frame2 and Frame0 alignment can be called the registration of Frame2 result.
  • Ghost detection The reference frame Frame0 is compared with the registration results of Frame1 and Frame2, respectively, to obtain the difference value of each pixel, that is, the diff diagram. Gaussian smoothing of the diff image to remove noise effects. The diff is compared with the corresponding ghost threshold to determine whether it is a ghost point. Eliminate isolated points (noise) with corrosion expansion and get the final ghost mask, the ghost shadow.
  • Time domain multi-frame noise reduction fusion Determine whether the ghost area of ghost detection is less than 1/3 of the full image. If no, the data of Frame0 is directly output, that is, the process of merging is omitted, and Frame0 is directly used as the short frame to participate in the subsequent long and short frame fusion. If yes, the ghost image is weighted according to the ghost Mask to remove the ghost, and the fusion result is output, wherein the ghost frame reference frame pixel fusion weight is greater than the corresponding pixel of the other registration frame, that is, in the ghost region for reference The pixel of the frame is the result of the fusion.
  • Step 402 can include several specific implementation steps.
  • the short frame and the long exposure frame obtained in step 401 are subjected to image registration, ghost detection and removal, and the long frame and the short frame from which the ghost is removed are subjected to frequency domain fusion.
  • the same image registration and ghost detection method in the process of multiframe short frame noise reduction is used before the long and short frame fusion, and the ghost is removed.
  • the influence of the shadow is similar to the above image registration method.
  • the ghost image is used as a weight, and the registration results of the short frame and the long exposure frame after multi-frame noise reduction are combined to obtain a long exposure frame after ghosting.
  • the long-exposure frame obtained after de-ghosting is referred to as a long frame.
  • the ghost frame region of the long frame is used as the fusion reference, and the long frame and the short frame are frequency domain fused, wherein the ghost component short frame pixel fusion weight is greater than the long frame corresponding pixel, and the non-ghost region is long.
  • the frame pixel fusion weight is greater than the short frame corresponding pixel.
  • FIG. 5 a schematic diagram of the process of removing ghosts for long exposure frames.
  • the input is a short frame obtained in step 401 and a long exposure frame after registration.
  • the ghost image detected by the ghost is weighted, and the two input images are weighted and fused.
  • the morphological expansion and smoothing operation is to remove the ghost and edge smoothness of the ghost Mask and improve the image fusion effect.
  • the long exposure frame after the ghosting is outputted may be referred to as a long frame in this embodiment.
  • the ghost area of the long and short frame image accounts for more than a set threshold (eg, 10%) in the entire image, It indicates that the maximum ghost threshold that can be processed by the algorithm is exceeded.
  • a set threshold eg, 10%
  • the frequency domain reflects the intensity of the image in the spatial gray scale, that is, the speed of the image gray, or the gradient of the image.
  • the edge part of the image is a mutated part, and the change is faster, so the reaction is a high frequency component in the frequency domain; the noise of the image is a high frequency part in most cases; and the low frequency component is a gradual change part of the image. That is to say, the Fourier transform provides a way to freely convert from the airspace to the frequency to observe the image, and the image can be transformed from the grayscale distribution to the frequency distribution to observe the characteristics of the image.
  • the direct relationship between image and frequency low frequency is mostly image contour, medium frequency is mostly image edge, texture and other details, high frequency is mostly image noise, while Fourier spectrum center bright point represents the gray level mean of the image.
  • the ghost region of the long frame is used as a fusion reference, and the long frame and the short frame are fused in the frequency domain to achieve the long frame brightness and non-motion.
  • the purpose of the area detail information and the short-frame motion area definition information is used.
  • FIG. 6 a schematic flowchart of frequency domain fusion for long frames and short frames is shown.
  • the input is: short frame after multi-frame noise reduction and long frame with ghost removal.
  • Step 601 Downsampling the short frame after the multi-frame noise reduction fusion and the long frame removing the ghost, respectively, to reduce the calculation amount.
  • Step 602 After downsampling the long frame, the upsampling is calculated and the loss error map of the original image is used to restore image detail loss caused by downsampling after image fusion.
  • Step 603 Perform fast Fourier transform on the two input frames after down-sampling to obtain respective Fourier spectra, and calculate corresponding amplitudes.
  • step 604 the two input Fourier spectra are fused with the magnitude of the weight.
  • the highlight of the long-frame Fourier spectrum is protected, and the value in the 10x10 region centered on the bright spot is assigned to the fused Fourier spectrum, thereby preserving the average luminance information of the long frame.
  • Step 605 Perform inverse Fourier transform on the fused spectrum to obtain a fused image.
  • Step 606 Add the error image calculated by the fused image and the long frame down sampling to recover the loss caused by the down sampling.
  • the final fusion result is output.
  • the embodiment of the present application reduces the exposure time by the preview state for the first time, reduces the exposure time for the second time in the imaging process, and performs multi-frame short frame noise reduction fusion and long-short frame frequency domain fusion processing in the image post-processing stage to improve The ability to reduce motion blur when shooting at the terminal.
  • the above image processing method is further described in detail below in conjunction with a specific application scenario, and it is assumed that the application scenario is taking a photo through a camera.
  • Step 701 The terminal receives an instruction to open the camera, starts the camera, and enters a preview state.
  • Step 702 Perform down sampling on the preview image data.
  • Step 703 Perform motion detection on the downsampled image data.
  • the motion detection is performed by analyzing the preview images of two frames before and after, and the detection result is outputted immediately, for example, the motion state and the velocity level can be output, and the greater the motion rate, the larger the rate grade.
  • the rate level is 0, indicating that there is no motion at rest, and the rate of motion indicated by rate levels 1, 2, and 3 is increasing.
  • step 704 to step 705 are performed; if motion is detected, step 706 is performed.
  • Step 704 When the camera application end issues a photographing command, the photograph is taken according to the normal exposure parameter of the AE convergence, that is, the sensor sensor is framed according to the normal exposure parameter.
  • Step 705 outputting and storing an image.
  • Step 706 Determine whether the motion rate level is greater than the set rate threshold, or determine whether the exposure gain is greater than the set gain threshold, or determine whether the LV value is less than the set brightness threshold; if yes, perform steps 710 to 714, otherwise Steps 707 to 709 are performed.
  • Step 707 Adjust the exposure parameter on the preview.
  • the exposure time is reduced by a preset ratio based on the motion speed level, and the exposure gain is increased in proportion to maintain the overall brightness of the image.
  • Step 708 When the camera application end issues a photographing command, the Sensor deframes according to the adjusted exposure parameter.
  • Step 709 outputting and storing an image.
  • Step 710 Adjust the exposure parameter on the preview.
  • the exposure time is reduced by a preset ratio based on the motion speed level, and the exposure gain is increased in proportion to maintain the overall brightness of the image.
  • Step 711 When the camera command is issued by the camera application end, firstly, according to the adjusted preview exposure parameter, the exposure time is decreased again and the exposure gain is increased according to the set ratio.
  • Step 712 The Sensor generates three short exposure frames according to the reduced exposure time and the increased exposure gain, and presses A long exposure frame is generated based on the first adjusted preview exposure parameter. Image post-processing is performed after ISP processing.
  • step 713 the short frame multi-frame noise reduction and the long and short frame fusion are performed in the image post-processing, and the details of the short-frame motion area and the details of the long-frame non-motion area are reserved.
  • Step 714 output and save the final fused image.
  • the exposure time is reduced twice by the imaging stage to obtain a higher shutter speed
  • the long exposure frame is generated by using the parameter for reducing the exposure time for the first time
  • the second time is adopted.
  • the parameter for reducing the exposure time generates at least two short exposure frames
  • the long-short exposure multi-frame is fused in the post-processing stage of the image.
  • the short-frame pixel fusion weight is greater than the long-frame pixel fusion weight, and the long-frame pixel fusion weight in other regions. It is larger than the short-frame pixel fusion weight, and the ghost region is the motion region, that is, the partial region where the target object and the terminal have relative motion.
  • the non-moving region can be considered as relatively stationary or relatively stationary with the terminal, and the motion region is a jittery flower and a non-motion region. For the sky and other backgrounds. In this way, the brightness information of the long exposure frame can be retained, so that the motion area and the non-motion area of the captured image are more clear, and the problem that the terminal reduces the motion blur due to the limitation of the noise level by reducing the intensity of the exposure time can be effectively avoided.
  • the imaging imaging delay can be effectively shortened, and the exposure time can be reduced again after the shooting command is issued, which can more effectively reduce the motion blur, and the multi-frame short frame is performed in the image post-processing section.
  • the time domain multi-frame noise reduction process can help reduce the noise caused by increasing the exposure gain, thereby having stronger anti-motion blur and better anti-motion blur effect.
  • the embodiment of the present application further provides an image processing apparatus 800 for performing the image processing shown in FIG. 2.
  • the image processing apparatus 800 includes:
  • the adjusting unit 801 is configured to perform a first adjustment on the initial exposure parameter of the camera in the preview state, in the process of previewing the image frame acquired by the camera, when the captured target object and the device have relative motion, the first adjustment includes reducing the initial The exposure time and increase the initial exposure gain.
  • the adjusting unit 801 is further configured to perform a second adjustment on the first adjusted exposure parameter after receiving the shooting instruction, wherein the second adjusting comprises decreasing the first adjusted exposure time and increasing the first adjusted exposure gain.
  • the generating unit 802 is configured to generate a first exposure frame according to the first adjusted exposure parameter, and generate at least two second exposure frames according to the second adjusted exposure parameter.
  • the merging unit 803 is configured to fuse the first exposure frame generated by the generating unit 802 and the at least two second exposure frames to output the fused image.
  • the adjusting unit 801 when performing the second adjustment of the first adjusted exposure parameter, is configured to: when the rate of the relative motion of the target object and the device is greater than the set rate threshold, the first adjusted exposure parameter Performing a second adjustment; or, when the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the second adjusted exposure parameter is second adjusted; or, in the preview state, the brightness value of the camera is less than LV When the brightness threshold is set, the first adjusted exposure parameter is second adjusted.
  • the adjusting unit 801 when performing the first adjustment of the initial exposure parameter of the camera in the preview state, is configured to determine the rate of the relative motion according to a relationship between the preset motion rate and the ratio of decreasing the exposure time. Correspondingly decreasing the ratio of the exposure time, and determining the value of increasing the exposure gain; performing a first adjustment on the initial exposure parameter of the camera in the preview state according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain.
  • the merging unit 803 is further configured to perform time domain multi-frame noise reduction fusion processing on the at least two second exposure frames to obtain a short frame.
  • the fusion unit 803 is configured to be short when the first exposure frame and the at least two second exposure frames are merged.
  • the frame is a reference frame
  • the first exposure frame and the short frame are subjected to image registration and ghost detection, and according to the result of the ghost detection, the first exposure frame after the image registration is de-ghosted to obtain a ghost image.
  • the ghost frame area of the long frame is used as a fusion reference, and the long frame and the short frame are frequency domain fused.
  • the embodiment of the present application further provides another image processing apparatus 900, including a camera 901 and a processor 902.
  • the camera 901 is configured to acquire an image frame
  • the processor 902 is configured to execute a set of codes, and when the code is executed, enable the image processing apparatus to execute the image processing method shown in FIG. 2.
  • the similarities of the methods are not described here.
  • the image processing device 900 can be the terminal 100 shown in FIG.
  • the terminal 100 shown in FIG. 1 can be used to perform the image processing method shown in FIG. 2, the camera 160 performs the functions performed by the camera 901, and the processor 120 executes the functions performed by the processor 902.
  • the camera 160 is used to acquire image frames; the processor 120 is configured to execute the details of the image processing method shown in FIG. 2.
  • the function module adjusting unit 801, the generating unit 802, and the merging unit 803 in FIG. 8 can all be implemented by the processor 902 in the image processing apparatus 900, that is, can also be implemented by the processor 120 in the terminal 100 shown in FIG. .
  • the embodiment of the present application provides a computer storage medium, which stores a computer program, and the computer program includes an image processing method shown in FIG. 2.
  • An embodiment of the present application provides a computer program product comprising instructions that, when run on a computer, cause the computer to perform the image processing method illustrated in FIG. 2.
  • Any of the image processing apparatuses provided in the embodiments of the present application may also be a system chip.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

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

Abstract

An image processing method and device used for reducing motion blur, the method comprising: a terminal, while previewing an image frame acquired by means of a camera, performs a first adjustment on initial exposure parameters of the camera at preview state when a captured target object moves relative to the terminal, the first adjustment comprising reduction of the Initial exposure time and increasing the initial exposure gain; the terminal, when receiving a photographing instruction, performs a second adjustment on the exposure parameters after the first adjustment, generates a first exposure frame according to the exposure parameters after the first adjustment, and generates at least two second exposure frames according to the exposure parameters after the second adjustment, wherein the second adjustment comprises reduction of the exposure time after the first adjustment and increasing the exposure gain after the first adjustment; and the terminal fuses the first exposure frame and the at least two second exposure frames so as to output a fused image.

Description

一种图像处理方法及装置Image processing method and device 技术领域Technical field
本申请涉及图像处理技术领域,特别涉及一种图像处理方法及装置。The present application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
背景技术Background technique
一些具有拍照功能的终端在拍摄运动物体时,都会存在不同程度的运动模糊,如果被拍摄的目标运动速度较大,则会出现较为严重的拖影现象。然而人体运动、物体运动、花草抖动等运动场景是用户拍照关注的重要场景。专业摄影师为了提升拍摄运动物体的清晰度,常常配备昂贵的大光圈,设置合适的光圈值和快门速度来捕获运动目标。但对于无时无刻,随时随地都在拍照的手机用户来说:首先手机相机光圈是固定的且无法自行扩展,无法支持调整光圈配合高快门速度进行拍摄;其次,即使手机相机光圈可调节,一般用户也没有足够的先验知识及时设置合适的光圈快门等相机参数进行拍摄。Some terminals with camera functions will have different degrees of motion blur when shooting moving objects. If the target moving speed is large, more serious smear will occur. However, sports scenes such as human motion, object motion, and flower shake are important scenes for users to pay attention to. In order to improve the clarity of moving objects, professional photographers often have expensive large apertures and set the appropriate aperture value and shutter speed to capture moving targets. But for mobile phone users who are taking pictures anytime, anywhere, the mobile phone camera aperture is fixed and cannot be extended by itself. It cannot support adjusting the aperture with high shutter speed for shooting. Secondly, even if the camera camera aperture is adjustable, the average user also There is not enough prior knowledge to set the appropriate aperture shutter and other camera parameters in time to shoot.
近年来,手机图像后处理运算能力提升显著,而改善手机相机硬件成本高,难度大。所以一些软件方法得以发展及应用。现有的拍照抗运动模糊的软件方法主要使用基于运动检测降低曝光时间的策略,这种方法首先进行运动检测,在检测到相机或物体运动时,自动提高快门速度,提高快门速度即降低曝光时间,在图像成像阶段运动模糊会随着曝光时间的降低同比例减弱,但是降低曝光时间会降低图像整体亮度,因此在降低曝光时间的同时还需要同比例增加曝光增益以保持图像整体亮度。In recent years, mobile phone image post-processing computing power has improved significantly, and improving the cost of mobile phone camera hardware is high and difficult. So some software methods have been developed and applied. The existing software method for taking pictures against motion blur mainly uses a strategy based on motion detection to reduce the exposure time. This method first performs motion detection, automatically increases the shutter speed when detecting camera or object motion, and increases the shutter speed to reduce the exposure time. In the image imaging stage, the motion blur will decrease with the decrease of the exposure time, but reducing the exposure time will reduce the overall brightness of the image. Therefore, it is necessary to increase the exposure gain in the same proportion while maintaining the overall brightness of the image while reducing the exposure time.
但是,上述这种降低曝光时间并同比例增加曝光增益的方法会导致暗场景下图像噪声过大,降低图像整体质量。若为保证图像噪声水平,限制降低曝光时间的力度,又会减弱抗运动模糊能力。综上,降低曝光时间和增加曝光增益互相制约,导致终端消减运动模糊能力不足。However, the above method of reducing the exposure time and increasing the exposure gain in the same proportion causes the image noise in the dark scene to be excessively large, and the overall quality of the image is lowered. If the image noise level is guaranteed, the intensity of the exposure time is limited, and the anti-motion blur ability is weakened. In summary, reducing the exposure time and increasing the exposure gain are mutually constrained, resulting in insufficient terminal blur reduction motion blur.
发明内容Summary of the invention
本申请提供一种图像处理方法及装置,用以解决通过降低曝光时间消减运动模糊时,因权衡噪声水平使得降低曝光时间的力度受到限制,导致终端消减运动模糊的能力不足的问题。The present application provides an image processing method and apparatus for solving the problem that when the motion blur is reduced by reducing the exposure time, the strength of the exposure time is limited by weighing the noise level, and the terminal has insufficient ability to reduce the motion blur.
一方面,提供一种图像处理方法,该方法为:终端在预览阶段,预览通过摄像头采集的图像帧的过程中,当所拍摄的目标物体与所述终端存在相对运动时,对预览状态下所述摄像头初始的曝光参数进行调整,这里称为第一调整,所述第一调整包括降低初始的曝光时间和增加初始的曝光增益;所述终端在接收拍摄指令后,对所述第一调整后的曝光参数进行再次调整,这里称为第二调整,所述第二调整包括降低所述第一调整后的曝光时间和增加所述第一调整后的曝光增益,终端根据所述第一调整后的曝光参数生成第一曝光帧,以及根据所述第二调整后的曝光参数生成至少两个第二曝光帧,所述终端将所述第一曝光帧和所述至少两个第二曝光帧进行融合,输出融合后的图像。这样通过成像阶段两次降低曝光时间,能够获得更高的快门速度。通过在预览过程中降低曝光时间,能够有效缩短拍摄成像的时延,在拍摄命令下发后再次降低曝光时间,能够更加有效的消减运动模糊,通过在图像后处理环节对多帧短帧进行时域多帧降噪处理,能够有助于降低因增加曝光增益 带来的噪声,从而具有更强的抗运动模糊能力和更优的抗运动模糊效果。In one aspect, an image processing method is provided. The method is: when previewing an image frame collected by a camera in a preview stage, when the captured target object and the terminal have relative motion, the method is as described in the preview state. Adjusting the initial exposure parameters of the camera, referred to herein as a first adjustment, the first adjustment includes reducing an initial exposure time and increasing an initial exposure gain; the terminal after receiving the shooting instruction, the first adjusted The exposure parameter is adjusted again, referred to herein as a second adjustment, the second adjustment includes decreasing the exposure time after the first adjustment and increasing the exposure gain after the first adjustment, the terminal according to the first adjusted The exposure parameter generates a first exposure frame, and generates at least two second exposure frames according to the second adjusted exposure parameter, the terminal fused the first exposure frame and the at least two second exposure frames , output the merged image. This allows a higher shutter speed to be achieved by reducing the exposure time twice through the imaging phase. By reducing the exposure time during the preview process, the delay of the imaging can be effectively shortened, and the exposure time can be reduced again after the shooting command is issued, which can more effectively reduce the motion blur, by performing the multi-frame short frame in the post-image processing section. Domain multi-frame noise reduction processing can help reduce exposure gain The noise brought by it has stronger anti-motion blur and better anti-motion blur effect.
其中,终端在预览状态下,摄像头会在自动曝光下产生初始的曝光参数。初始的曝光参数中包括初始的曝光时间和初始的曝光增益。Among them, when the terminal is in the preview state, the camera will generate initial exposure parameters under automatic exposure. The initial exposure time includes the initial exposure time and the initial exposure gain.
在一个可能的设计中,所述终端在符合一定条件时,会将所述第一调整后的曝光参数进行第二调整,在条件不符合时,只会进行第一调整,根据第一调整后的曝光参数直接出帧,不会进行第二调整,该条件可以是以下任意一种,也可以是其它条件。条件可以是:所述终端在所述目标物体与所述终端的相对运动的速率大于设定速率阈值时,将所述第一调整后的曝光参数进行第二调整;也可以是:所述终端在预览状态下所述摄像头的初始的曝光增益大于设定增益阈值时,将所述第一调整后的曝光参数进行第二调整;或者还可以是:所述终端在预览状态下所述摄像头的光亮值LV小于设定亮度阈值时,将所述第一调整后的曝光参数进行第二调整。这样,通过根据曝光增益和LV值选择是否进行第二调整,可以灵活选择不同的消减运动模糊的策略,实现对不同环境亮度场景的针对性处理。In a possible design, when the terminal meets certain conditions, the first adjusted exposure parameter is second adjusted. When the condition is not met, only the first adjustment is performed, according to the first adjustment. The exposure parameter is directly out of the frame, and the second adjustment is not performed. The condition may be any one of the following, or may be other conditions. The condition may be that the terminal adjusts the first adjusted exposure parameter when the rate of the relative motion of the target object and the terminal is greater than a set rate threshold; or: the terminal When the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the first adjusted exposure parameter is second adjusted; or: the terminal is in the preview state of the camera When the brightness value LV is less than the set brightness threshold, the first adjusted exposure parameter is second adjusted. In this way, by selecting whether to perform the second adjustment according to the exposure gain and the LV value, different strategies for reducing motion blur can be flexibly selected to achieve targeted processing of different ambient brightness scenes.
在一个可能的设计中,若终端确定目标物体与终端的相对运动速率不大于设定速率阈值,则仅对预览状态下摄像头的初始的曝光参数进行第一调整即可,成像过程采用第一调整后的曝光参数生成曝光帧,根据生成的曝光帧输出图像,即没有第二调整的过程In a possible design, if the terminal determines that the relative motion rate of the target object and the terminal is not greater than the set rate threshold, only the first adjustment of the initial exposure parameter of the camera in the preview state may be performed, and the imaging process adopts the first adjustment. The subsequent exposure parameter generates an exposure frame, and outputs an image according to the generated exposure frame, that is, a process without second adjustment
在一个可能的设计中,所述终端按照预设的运动速率与降低曝光时间的比例值之间的关系,确定所述相对运动的速率对应的降低曝光时间的比例值,以及确定增加曝光增益的值;按照确定的降低曝光时间的比例值以及增加曝光增益的值,对预览状态下所述摄像头的初始的曝光参数进行第一调整。这样通过运动速率的值,按照比例调整降低曝光时间的值,能够将降低曝光时间的比例值与运动速率联系起来,为当前运动速率选择一个合适的降低曝光时间的比例值,防止过低的降低曝光时间带来更大的噪声水平。In a possible design, the terminal determines a ratio of decreasing the exposure time corresponding to the rate of the relative motion according to a relationship between a preset motion rate and a ratio of decreasing the exposure time, and determining to increase the exposure gain. The first adjustment of the initial exposure parameter of the camera in the preview state is performed according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain. In this way, by adjusting the value of the movement rate, the value of the exposure time is adjusted according to the ratio, and the ratio of the reduction of the exposure time can be correlated with the movement rate, and a suitable ratio of reducing the exposure time is selected for the current movement rate to prevent the reduction of the low. Exposure time brings a greater level of noise.
在一个可能的设计中,设置一个最大曝光增益阈值,在对预览状态的曝光参数进行第一调整时,增大后的曝光增益需要小于设定的最大曝光增益阈值。这种方法的设定能够通过限制曝光增益的上限来控制预览图像的噪声水平。In one possible design, a maximum exposure gain threshold is set, and when the exposure parameter of the preview state is first adjusted, the increased exposure gain needs to be less than the set maximum exposure gain threshold. The setting of this method can control the noise level of the preview image by limiting the upper limit of the exposure gain.
在一个可能的设计中,所述终端在将所述第一曝光帧和所述至少两个第二曝光帧进行融合之前,将所述至少两个第二曝光帧进行时域多帧降噪融合处理,获得一个短帧。由于第二曝光帧是采用更短的曝光时间生成的,会同比例增加更大的曝光增益,也就会带来更多的噪声,采用这样的处理方式,能够有助于降低第二曝光帧的噪声水平。In a possible design, the terminal performs time domain multi-frame noise reduction fusion on the at least two second exposure frames before fusing the first exposure frame and the at least two second exposure frames. Processed to get a short frame. Since the second exposure frame is generated with a shorter exposure time, a larger exposure gain is increased in proportion, which also brings more noise. With such a processing method, it can help to reduce the second exposure frame. Noise level.
在一个可能的设计中,所述终端以所述短帧为参考帧,将所述第一曝光帧和所述短帧进行图像配准和鬼影检测,并根据鬼影检测的结果,将图像配准后的第一曝光帧进行去鬼影处理,得到去鬼影后的一个长帧;根据所述鬼影检测的结果,以所述长帧的鬼影区域为融合基准,将所述长帧和所述短帧进行频域融合。具体的,在鬼影区域短帧像素融合权重大于长帧像素融合权重,在其他区域长帧像素融合权重大于短帧像素融合权重,鬼影区域即运动区域,即目标物体与终端存在相对运动的部分区域,非运动区域可以认为与终端相对静止或近似相对静止,运动区域为抖动的花草,非运动区域为天空地面等背景。这样能够保留长曝光帧的亮度信息,使得拍摄图像的运动区域和非运动区域均更加清晰,能够有效避免因权衡噪声水平使得降低曝光时间的力度受到限制导致的终端消减运动模糊的能力不足的问题。In a possible design, the terminal uses the short frame as a reference frame, performs image registration and ghost detection on the first exposure frame and the short frame, and images the image according to the result of ghost detection. The first exposure frame after registration is subjected to de-ghost processing to obtain a long frame after ghosting; according to the result of the ghost detection, the ghost region of the long frame is used as a fusion reference, and the long The frame and the short frame are subjected to frequency domain fusion. Specifically, in the ghost region, the short frame pixel fusion weight is greater than the long frame pixel fusion weight. In other regions, the long frame pixel fusion weight is greater than the short frame pixel fusion weight, and the ghost region is the motion region, that is, the target object and the terminal have relative motion. In some areas, the non-moving area may be considered to be relatively stationary or approximately stationary with the terminal, the moving area is a dithered flower, and the non-moving area is a background such as a sky ground. In this way, the brightness information of the long exposure frame can be retained, so that the motion area and the non-motion area of the captured image are more clear, and the problem that the terminal reduces the motion blur due to the limitation of the noise level by reducing the intensity of the exposure time can be effectively avoided. .
第二方面,提供一种图像处理装置,该装置具有实现上述第一方面和第一方面的任一种可能的设计中方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软 件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a second aspect, there is provided an image processing apparatus having the functionality to implement any of the possible in-design methods of the first aspect and the first aspect described above. The function can be implemented by hardware, or can be executed by hardware. Implementation. The hardware or software includes one or more modules corresponding to the functions described above.
在一个可能的设计中,该装置可以是芯片或者集成电路。In one possible design, the device can be a chip or an integrated circuit.
在一个可能的设计中,该装置包括摄像头和处理器,摄像头用于采集图像帧,处理器用于执行一组程序,当程序被执行时,所述装置可以执行上述第一方面和第一方面的任意一种可能的设计中所述的方法。In one possible design, the apparatus includes a camera for acquiring image frames, a processor for executing a set of programs, and the apparatus for performing the first aspect and the first aspect described above when the program is executed The method described in any of the possible designs.
在一个可能的设计中,该装置还包括存储器,用于存储所述处理器执行的代码。In one possible design, the apparatus also includes a memory for storing code executed by the processor.
第三方面,提供一种计算机存储介质,存储有计算机程序,该计算机程序包括用于执行第一方面和第一方面的任一可能的设计中方法的指令。In a third aspect, a computer storage medium is provided, stored with a computer program comprising instructions for performing the method of any of the first aspect and the first aspect of the first aspect.
第四方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面和第一方面的任一可能的设计中所述的方法。In a fourth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method described in any of the first aspect and the first aspect of the first aspect.
附图说明DRAWINGS
图1为本申请实施例中终端硬件结构示意图;1 is a schematic structural diagram of a terminal hardware in an embodiment of the present application;
图2为本申请实施例中图像处理方法流程示意图;2 is a schematic flowchart of an image processing method according to an embodiment of the present application;
图3a为本申请实施例中降低曝光时间的比例与曝光增益的关系示意图;3a is a schematic diagram showing the relationship between the ratio of reducing the exposure time and the exposure gain in the embodiment of the present application;
图3b为本申请实施例中运动速率等级与降低曝光时间的比例关系示意图;FIG. 3b is a schematic diagram showing the relationship between the motion rate level and the reduced exposure time in the embodiment of the present application; FIG.
图4为本申请实施例中多帧短帧降噪和长短帧融合的示意图;4 is a schematic diagram of multi-frame short frame noise reduction and long and short frame fusion in the embodiment of the present application;
图5为本申请实施例中长曝光帧去除鬼影的流程示意图;FIG. 5 is a schematic flowchart of removing ghost images in a long exposure frame according to an embodiment of the present application; FIG.
图6为本申请实施例中长短帧频域融合的流程示意图;6 is a schematic flowchart of frequency domain fusion of long and short frames in an embodiment of the present application;
图7为本申请实施例中一种应用场景下图像处理方法流程示意图;FIG. 7 is a schematic flowchart of an image processing method in an application scenario according to an embodiment of the present application;
图8为本申请实施例中图像处理装置结构示意图之一;FIG. 8 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
图9为本申请实施例中图像处理装置结构示意图之二。FIG. 9 is a second schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图,对本申请实施例进行详细描述。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
本申请实施例涉及的终端可以是任意具有拍照功能的电子设备,该电子设备包括但不限于个人计算机、服务器计算机、手持式或膝上型设备、移动电话、平板电脑、个人数字助理、媒体播放器、消费型电子设备、小型计算机、大型计算机。The terminal involved in the embodiment of the present application may be any electronic device having a photographing function, including but not limited to a personal computer, a server computer, a handheld or laptop device, a mobile phone, a tablet computer, a personal digital assistant, and a media player. , consumer electronics, small computers, large computers.
参考图1所示,为本申请实施例应用的终端的硬件结构示意图。如图1所示,终端100包括显示设备110、处理器120以及存储器130。存储器130可用于存储软件程序以及数据,处理器120通过运行存储在存储器130的软件程序以及数据,从而执行终端100的各种功能应用以及数据处理。存储器130可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据终端100的使用所创建的数据,比如音频数据、电话本、可交换图像文件EXIF。此外,存储器130可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。处理器120是终端100的控制中心,利用各种接口和线路连接整个终端的各个部分,通过运行或执行存储在存储器130内的软件程序和/或数据,执行终端100的各种功能和处理数据,从而对终端进行整体监控。处理器120可以包括一个或多个通用处理器,还可包括一个或多个数字信号处理器(digital signal  processor,DSP),用于执行相关操作,以实现本申请实施例所提供的技术方案。具体地,处理器120可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。处理器120还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(appJication-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。存储器130可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);存储器130也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(soJid-state drive,SSD);存储器130还可以包括上述种类的存储器的组合。Referring to FIG. 1 , it is a schematic diagram of a hardware structure of a terminal applied to an embodiment of the present application. As shown in FIG. 1, the terminal 100 includes a display device 110, a processor 120, and a memory 130. The memory 130 can be used to store software programs and data, and the processor 120 executes various functional applications and data processing of the terminal 100 by running software programs and data stored in the memory 130. The memory 130 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function, and the like; the storage data area may store data created according to the use of the terminal 100, such as audio. Data, phone book, exchangeable image file EXIF. Moreover, memory 130 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The processor 120 is a control center of the terminal 100, and connects various parts of the entire terminal by various interfaces and lines, and executes various functions and processing data of the terminal 100 by running or executing software programs and/or data stored in the memory 130. Therefore, the terminal is monitored as a whole. The processor 120 may include one or more general purpose processors, and may also include one or more digital signal processors (digital signal The processor (DSP) is configured to perform related operations to implement the technical solutions provided by the embodiments of the present application. Specifically, the processor 120 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor 120 may further include a hardware chip. The hardware chip may be an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general array logic (GAL), or any combination thereof. The memory 130 may include a volatile memory such as a random-access memory (RAM); the memory 130 may also include a non-volatile memory such as a flash memory (flash) Memory), hard disk drive (HDD) or solid state drive (SSD); the memory 130 may also include a combination of the above types of memories.
终端100还可以包括输入设备140,用于接收输入的数字信息、字符信息或接触式触摸操作/非接触式手势,以及产生与终端100的用户设置以及功能控制有关的信号输入等。该输入设备140可以包括触控面板141。触控面板141,也称为触摸屏,可收集用户在其上或附近的触摸操作,并根据预先设定的程式驱动相应的连接装置。触控面板141可以采用电阻式、电容式、红外线以及表面声波等多种类型实现。除了触控面板141,输入设备140还可以包括其他输入设备142,其他输入设备142可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。显示设备110,包括的显示面板111,用于显示由用户输入的信息或提供给用户的信息以及终端设备100的各种菜单界面。可选的,显示面板可以采用液晶显示器(liquid crystal display,LCD)或有机发光二极管(organic light-emitting diode,OLED)等形式来配置显示面板111。The terminal 100 may further include an input device 140 for receiving input digital information, character information or contact touch/contactless gestures, and generating signal inputs related to user settings and function control of the terminal 100, and the like. The input device 140 can include a touch panel 141. The touch panel 141, also referred to as a touch screen, collects touch operations on or near the user and drives the corresponding connection device according to a preset program. The touch panel 141 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 141, the input device 140 may further include other input devices 142, which may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like. One or more of them. The display device 110 includes a display panel 111 for displaying information input by the user or information provided to the user and various menu interfaces of the terminal device 100. Optionally, the display panel can be configured by using a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
除以上之外,终端100还可以包括用于给其他模块供电的电源150以及用于拍摄照片或视频的摄像头160。终端100还可以包括一个或多个传感器170,例如加速度传感器、光线传感器、GPS传感器、红外传感器、激光传感器、位置传感器或镜头指向角度传感器等。终端100还可以包括无线射频(Radio Frequency,RF)电路180,用于与无线网络设备进行网络通信,还可以包括WiFi模块190,用于与其他设备进行WiFi通信。In addition to the above, the terminal 100 may further include a power source 150 for powering other modules and a camera 160 for taking photos or videos. The terminal 100 may also include one or more sensors 170, such as an acceleration sensor, a light sensor, a GPS sensor, an infrared sensor, a laser sensor, a position sensor or a lens pointing angle sensor, and the like. The terminal 100 may further include a radio frequency (RF) circuit 180 for performing network communication with the wireless network device, and may further include a WiFi module 190 for performing WiFi communication with other devices.
基于图1所示的终端的硬件结构,本申请实施例提供的图像处理方法可以由终端100来执行。The image processing method provided by the embodiment of the present application can be executed by the terminal 100 based on the hardware structure of the terminal shown in FIG. 1 .
终端在摄像头开启后,进入预览状态,在预览通过摄像头采集的图像帧的过程中,所拍摄的目标物体可能处于运动状态,例如,人体运动、物体运动、花草抖动等。另外,所拍摄的目标物体可能处于静止状态,但是终端处于运动状态,例如,用户手持终端在行驶列车上拍摄,或者用户手持终端在运动时拍摄,等。无论上述哪种状态,均可以认为所拍摄的目标物体与终端存在相对运动关系。在所拍摄的目标物体与终端存在相对运动的这种应用场景下,终端拍摄的图像就有可能存在运动模糊问题。本申请实施例提供的方法能够有助于解决这种应用场景下的运动模糊问题。After the camera is turned on, the terminal enters a preview state. During previewing the image frame acquired by the camera, the captured target object may be in a moving state, for example, human body motion, object motion, flower and grass shake, and the like. In addition, the photographed target object may be in a stationary state, but the terminal is in a motion state, for example, the user's hand-held terminal is photographed on a traveling train, or the user's hand-held terminal is photographed while exercising, and the like. Regardless of the above state, it can be considered that there is a relative motion relationship between the captured target object and the terminal. In the application scenario where the captured target object and the terminal have relative motion, there may be a motion blur problem in the image captured by the terminal. The method provided by the embodiment of the present application can help solve the motion blur problem in this application scenario.
下面结合附图对本申请实施例提供的图像处理方法的流程做进一步详细介绍。The flow of the image processing method provided by the embodiment of the present application is further described in detail below with reference to the accompanying drawings.
如图2所示,本申请实施例提供的图像处理方法的流程如下所述。As shown in FIG. 2, the flow of the image processing method provided by the embodiment of the present application is as follows.
步骤201、终端在预览通过摄像头采集的图像帧的过程中,当所拍摄的目标物体与终端存在相对运动时,对预览状态下该摄像头的初始的曝光参数进行第一调整。Step 201: During previewing the image frame acquired by the camera, when the captured target object and the terminal have relative motion, the first adjustment of the initial exposure parameter of the camera in the preview state is performed.
其中,该第一调整包括降低初始的曝光时间和增加初始的曝光增益。实际应用中,终 端在预览状态下,摄像头会在自动曝光(automatic exposure,AE)下产生初始的曝光参数。初始的曝光参数中包括初始的曝光时间和初始的曝光增益。Wherein the first adjustment comprises reducing the initial exposure time and increasing the initial exposure gain. In practical applications, the end In the preview state, the camera will generate initial exposure parameters under automatic exposure (AE). The initial exposure time includes the initial exposure time and the initial exposure gain.
步骤202、终端在接收拍摄指令后,对第一调整后的曝光参数进行第二调整,并根据第一调整后的曝光参数生成第一曝光帧,以及根据第二调整后的曝光参数生成至少两个第二曝光帧,其中,第二调整包括降低第一调整后的曝光时间和增加第一调整后的曝光增益。Step 202: After receiving the shooting instruction, the terminal performs a second adjustment on the first adjusted exposure parameter, and generates a first exposure frame according to the first adjusted exposure parameter, and generates at least two according to the second adjusted exposure parameter. And a second exposure frame, wherein the second adjustment comprises decreasing the exposure time after the first adjustment and increasing the exposure gain after the first adjustment.
由于第二调整后的曝光时间比第一调整后的曝光时间更短,因此在本申请实施例中,根据第一调整后的曝光参数生成的第一曝光帧也可以称为长曝光帧,根据第二调整后的曝光参数生成的第二曝光帧也可以称为短曝光帧。Since the second adjusted exposure time is shorter than the first adjusted exposure time, in the embodiment of the present application, the first exposure frame generated according to the first adjusted exposure parameter may also be referred to as a long exposure frame, according to The second exposure frame generated by the second adjusted exposure parameter may also be referred to as a short exposure frame.
步骤203、终端将上述第一曝光帧和至少两个第二曝光帧进行融合,输出融合后的图像。Step 203: The terminal combines the first exposure frame and the at least two second exposure frames to output the fused image.
需要说明的是,本申请实施例中,在一定条件满足时,需要对曝光参数进行两次调整,为作区分,将预览状态下对摄像头的初始的曝光参数所做的调整称为第一调整,将接收到用户输入的拍摄指令后对第一调整后的曝光参数所做的调整称为第二调整。本申请实施例涉及的曝光参数至少包括曝光时间和曝光增益。第一调整是指在预览状态下摄像头自动曝光的曝光参数的基础上降低曝光时间并增加曝光增益;第二调整是指在第一调整后的曝光参数的基础上再次降低曝光时间并增加曝光增益。可选的,第一调整和第二调整的过程中,降低曝光时间的比例和增加曝光增益的比例相同,或者说,按照降低曝光时间的比例来获取相应的增加曝光增益的比例。本申请实施例涉及的拍摄可以但不限于包括拍照、摄像等利用摄像头成像的过程。It should be noted that, in the embodiment of the present application, when a certain condition is satisfied, the exposure parameter needs to be adjusted twice, and the adjustment made to the initial exposure parameter of the camera in the preview state is referred to as the first adjustment. The adjustment made to the first adjusted exposure parameter after receiving the shooting instruction input by the user is referred to as a second adjustment. The exposure parameters involved in the embodiments of the present application include at least an exposure time and an exposure gain. The first adjustment refers to lowering the exposure time and increasing the exposure gain based on the exposure parameter of the camera automatic exposure in the preview state; the second adjustment refers to lowering the exposure time and increasing the exposure gain based on the first adjusted exposure parameter. . Optionally, during the first adjustment and the second adjustment, the ratio of decreasing the exposure time is the same as increasing the exposure gain, or the ratio of increasing the exposure gain is obtained according to the ratio of decreasing the exposure time. The photographing involved in the embodiments of the present application may be, but is not limited to, a process of photographing using a camera, such as photographing, photographing, and the like.
可以看出,本申请实施例通过两次降低曝光时间能够获得更短的曝光时间,运动模糊会随着曝光时间的降低同比例减弱,因此,更短的曝光时间有助于更有效的消减运动模糊。为了弱化降低曝光时间带来的噪声问题,本申请实施例采用多帧融合的方式,在成像阶段根据第一次调整的曝光参数生成长曝光帧,根据第二次调整的曝光参数生成短曝光帧,由于长曝光帧采用的曝光时间较长,因此长曝光帧具有较高亮度的优势,短曝光帧具有在运动区域更加清晰的优势。将长曝光帧和短曝光帧进行融合,在融合过程中保留长曝光帧和短曝光帧各自的优势,能够有效的输出运动区域更加清晰的图像。It can be seen that the embodiment of the present application can obtain a shorter exposure time by reducing the exposure time twice, and the motion blur will decrease in proportion with the decrease of the exposure time. Therefore, the shorter exposure time contributes to more effective reduction motion. blurry. In order to weaken the noise problem caused by reducing the exposure time, the embodiment of the present application adopts a multi-frame fusion method to generate a long exposure frame according to the first adjusted exposure parameter in the imaging stage, and generate a short exposure frame according to the second adjusted exposure parameter. Since long exposure frames employ longer exposure times, long exposure frames have the advantage of higher brightness, and short exposure frames have the advantage of being sharper in the motion area. The combination of the long exposure frame and the short exposure frame preserves the advantages of the long exposure frame and the short exposure frame during the fusion process, and can effectively output a clearer image of the motion region.
下面对图2所示的图像处理方法做一些具体的细节介绍,对有益效果的达成做一些具体的说明。The following is a detailed description of the image processing method shown in Figure 2, and some specific explanations for the achievement of the beneficial effects.
步骤202中,终端所执行的一系列动作是在终端接收到用户触发的拍摄指令到输出成像的过程中执行的。终端在成像过程中生成至少一个长曝光帧,和至少两个短曝光帧,本申请实施例以生成一个长曝光帧和三个短曝光帧为例进行的介绍。可选的,终端还可以在成像过程中生成四个、五个短曝光帧,但是综合计算量等因素,以三个短曝光帧为一种可能的实现方式。In step 202, the series of actions performed by the terminal is performed during the process in which the terminal receives the user-triggered shooting instruction to output imaging. The terminal generates at least one long exposure frame and at least two short exposure frames in the imaging process. The embodiment of the present application introduces an example of generating one long exposure frame and three short exposure frames. Optionally, the terminal can also generate four or five short exposure frames in the imaging process, but three short exposure frames are a possible implementation manner due to factors such as calculation amount.
具体的,终端启动相机后,会将预览的图像帧进行运动检测,以判断所拍摄的目标物体与终端是否存在相对运动。可选的,本申请实施例可以应用现有技术中任意一种运动检测方法对预览的图像帧进行运动检测。例如,一般来说,运动检测方法通常是将前后两个图像帧进行降采样,将降采样后的图像帧网格化,一个图像帧被网格化后可以包括多个图像网格块。通过对前后两个图像帧相应图像网格块内的图像进行模式匹配并计算相关性,判断两帧网格内的图像是否存在运动,若计算得到的相关性大则表示没有运动;相关性小表示两帧网格内的图像发生了相对变化,存在运动。前后两个图像帧用当前帧和相邻帧来 表述,确定相邻帧与当前帧中最相似的图像网格块,通过匹配得到的两个图像网格块之间的距离度量运动速度,图像内目标整体运动速度需要计算全部图像网格块的平均速度获得。Specifically, after the terminal starts the camera, the preview image frame is motion-detected to determine whether there is relative motion between the captured target object and the terminal. Optionally, the embodiment of the present application may perform motion detection on the preview image frame by using any motion detection method in the prior art. For example, in general, the motion detection method generally performs down-sampling of two image frames before and after, and meshes the downsampled image frames. One image frame may be meshed to include multiple image grid blocks. By performing pattern matching on the images in the corresponding image grid blocks of the two image frames before and after, and calculating the correlation, it is determined whether there is motion in the image in the two frame grids, and if the calculated correlation is large, there is no motion; the correlation is small. Indicates that the image in the two-frame grid has changed relatively and there is motion. Two image frames before and after with the current frame and adjacent frames The expression determines the image grid block that is the most similar between the adjacent frame and the current frame, and the distance between the two image grid blocks obtained by the matching measures the motion speed, and the overall motion speed of the target in the image needs to calculate the total image grid block. The average speed is obtained.
若检测到所拍摄的目标物体与终端相对静止,或者近似相对静止,则表明终端当前拍摄的可能是静止图像,按照AE收敛的正常曝光参数进行拍照即可。若检测到所拍摄的目标物体与终端存在相对运动,则需要对曝光参数进行调整。一种可能的实现方式中,若终端确定目标物体与终端的相对运动的速率大于设定速率阈值时,将第一调整后的曝光参数进行第二调整;若终端确定目标物体与终端的相对运动速率不大于设定速率阈值,则仅对预览状态下摄像头的初始的曝光参数进行第一调整即可,成像过程采用第一调整后的曝光参数生成曝光帧,根据生成的曝光帧输出图像,即没有第二调整的过程。其中,设定速率阈值为经验值。If it is detected that the photographed target object is relatively stationary with the terminal, or is relatively stationary, it indicates that the terminal is currently shooting a still image, and the photographing may be performed according to the normal exposure parameter of the AE convergence. If it is detected that there is relative motion between the captured target object and the terminal, the exposure parameters need to be adjusted. In a possible implementation manner, if the terminal determines that the rate of relative motion of the target object and the terminal is greater than a set rate threshold, performing second adjustment on the first adjusted exposure parameter; if the terminal determines relative motion of the target object and the terminal If the rate is not greater than the set rate threshold, only the initial adjustment of the initial exposure parameter of the camera in the preview state may be performed. The imaging process uses the first adjusted exposure parameter to generate an exposure frame, and outputs an image according to the generated exposure frame, that is, There is no process of second adjustment. Wherein, the set rate threshold is an empirical value.
可选的,将是否进行第二调整的条件可以等效的更换为以下两种或者其他条件。Alternatively, the condition for whether or not to perform the second adjustment may be equivalently replaced with the following two or other conditions.
条件一、在预览状态下摄像头的初始的曝光增益大于设定增益阈值时,将第一调整后的曝光参数进行第二调整,在确定预览图像的过程中的曝光增益不大于设定增益阈值时,成像过程采用第一调整后的曝光参数进行生成曝光帧,根据生成的曝光帧输出图像,即没有第二调整的过程。其中,设定增益阈值为经验值,例如,设定增益阈值为800。Condition 1: When the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the first adjusted exposure parameter is second adjusted, and when the exposure gain in the process of determining the preview image is not greater than the set gain threshold The imaging process uses the first adjusted exposure parameter to generate an exposure frame, and outputs an image according to the generated exposure frame, that is, there is no second adjustment process. Wherein, the set gain threshold is an empirical value, for example, the set gain threshold is 800.
条件二、在预览状态下摄像头光亮值(light value,LV)小于设定亮度阈值时,将第一调整后的曝光参数进行第二调整,在确定预览图像的过程中的光亮值LV不小于设定亮度阈值时,成像过程采用第一调整后的曝光参数进行生成曝光帧,根据生成的曝光帧输出图像,即没有第二调整的过程。其中,LV可以认为是终端预览通过摄像头采集的图像帧的过程中的环境亮度。设定亮度阈值为经验值,例如,设定亮度阈值为40、20。Condition 2: In the preview state, when the light value (LV) of the camera is less than the set brightness threshold, the first adjusted exposure parameter is second adjusted, and the brightness value LV in the process of determining the preview image is not less than When the brightness threshold is set, the imaging process uses the first adjusted exposure parameter to generate an exposure frame, and outputs an image according to the generated exposure frame, that is, there is no second adjustment process. Among them, the LV can be considered as the ambient brightness during the process of previewing the image frame acquired by the camera. Set the brightness threshold to the empirical value. For example, set the brightness threshold to 40 or 20.
这样,通过根据曝光增益和LV值选择是否进行第二调整,可以灵活选择不同的消减运动模糊的策略,实现对不同环境亮度场景的针对性处理。例如,一般中高亮场景选择仅在预览状态下对摄像头的初始曝光参数进行第一调整,按照第一调整后的曝光参数出帧;暗场景下选择进行第一调整后再进行第二调整,结合图像后处理将长短帧进行融合。当然,也可以选择在大部分亮度环境下均采用进行第一调整后再进行第二调整,结合图像后处理将长短帧进行融合。In this way, by selecting whether to perform the second adjustment according to the exposure gain and the LV value, different strategies for reducing motion blur can be flexibly selected to achieve targeted processing of different ambient brightness scenes. For example, the general mid-highlight scene selection only performs the first adjustment of the initial exposure parameter of the camera in the preview state, and the frame is framed according to the first adjusted exposure parameter; the second adjustment is performed after the first adjustment is performed in the dark scene, and the combination is performed. Image post processing fuses long and short frames. Of course, it is also possible to select the second adjustment after performing the first adjustment in most of the brightness environments, and combine the image post-processing to merge the long and short frames.
可选的,终端对预览状态下摄像头初始的曝光参数进行调整时,降低曝光时间的比例可以与运动检测所得的目标物体与终端的相对运动的速率有关。具体地,终端按照预设的运动速率与降低曝光时间的比例值之间的关系,确定与相对运动的速率对应的降低曝光时间的比例值,并按照确定的降低曝光时间的比例值来确定增加曝光增益的值,一般来说,增加曝光增益的比例与降低曝光时间的比例相同。按照所确定的降低曝光时间的比例值以及增加曝光增益的值,对预览状态下摄像头初始的的曝光参数进行调整。运动速率与降低曝光时间的比例值之间的关系可以为线性关系,也就是随着运动速率的增大,降低曝光时间的比例值增大,增大曝光增益的值也跟着增大。但是由于增大曝光增益能够带来噪声,因此,可选的,如图3a所示,本申请实施例设置一个最大曝光增益阈值,在对预览状态下摄像头的曝光参数进行调整时,增大后的曝光增益的值需要小于设定的最大曝光增益阈值。如果按照降低曝光时间同比例增大曝光增益后的值大于最大曝光增益阈值,则降低曝光时间的比例值需要减小,至少要减小到使得增大后的曝光增益小于设定的最大曝光增益阈值。例如,最大曝光增益阈值可以为700、1000。这种方法的设定能够通过限制曝光增 益的上限来控制预览图像的噪声水平。Optionally, when the terminal adjusts the initial exposure parameter of the camera in the preview state, the ratio of decreasing the exposure time may be related to the rate of relative motion of the target object and the terminal obtained by the motion detection. Specifically, the terminal determines a proportional value of the reduced exposure time corresponding to the rate of the relative motion according to a relationship between the preset motion rate and a ratio of decreasing the exposure time, and determines the increase according to the determined ratio of decreasing the exposure time. The value of the exposure gain, in general, increases the ratio of the exposure gain to the same ratio as the exposure time. The initial exposure parameter of the camera in the preview state is adjusted according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain. The relationship between the motion rate and the ratio of decreasing the exposure time may be a linear relationship, that is, as the motion rate increases, the ratio of the exposure time decreases, and the value of the exposure gain increases. However, since the increase of the exposure gain can bring noise, therefore, as shown in FIG. 3a, the embodiment of the present application sets a maximum exposure gain threshold, and when the exposure parameter of the camera is adjusted in the preview state, the increase is performed. The value of the exposure gain needs to be less than the set maximum exposure gain threshold. If the value after increasing the exposure gain in proportion to decreasing the exposure time is greater than the maximum exposure gain threshold, the ratio of decreasing the exposure time needs to be reduced, at least to such an extent that the increased exposure gain is less than the set maximum exposure gain. Threshold. For example, the maximum exposure gain threshold can be 700, 1000. This method can be set by limiting exposure The upper limit of the benefit is to control the noise level of the preview image.
若以相对运动的速率是否大于设定速率阈值来判断是否进行第二调整的条件,则相对运动的速率和降低曝光时间的比例值满足一定的变化关系,大致为降低曝光时间的比例值随相对运动的速率呈先线性后不变的关系。例如,如图3b所示,表征了在预览状态下对曝光参数按照速率等级进行第一调整的示意图。假设将相对运动的速率分为几个等级,不同等级对应不同的降低曝光时间的比例值。当相对运动的速率等级为0时,表示拍摄静止图像,按照AE收敛的正常曝光参数进行成像;当相对运动的速率等级为1时,按照关系图线,按照比例1降低曝光时间的比例,并同比例增大曝光增益,按照调整后的曝光参数进行成像;当相对运动的速率等级为2时,按照关系图线,按照比例2降低曝光时间的比例,并同比例增大曝光增益,按照调整后的曝光参数进行成像;当相对运动的速率等级为3时,此时的运动速率大于设定的速率阈值,在预览阶段按照比例2降低曝光时间的比例,并同比例增大曝光增益,按照调整后的曝光参数进行成像;在相对运动的速率等级大于3时,此时的运动速率大于设定的速率阈值,在预览阶段按照比例2降低曝光时间的比例,并同比例增大曝光增益,按照调整后的曝光参数进行成像。If the condition of the second motion is determined by whether the rate of the relative motion is greater than the set rate threshold, the ratio of the relative motion rate and the decrease of the exposure time satisfies a certain relationship, and the ratio of the exposure time is substantially reduced. The rate of motion is linear and then invariant. For example, as shown in Figure 3b, a schematic diagram of the first adjustment of the exposure parameters by rate level in the preview state is characterized. It is assumed that the rate of relative motion is divided into several levels, and the different levels correspond to different ratios of decreasing exposure time. When the rate of relative motion is 0, it means shooting a still image, and imaging according to the normal exposure parameter of AE convergence; when the rate of relative motion is 1, according to the relationship line, the ratio of exposure time is reduced according to the ratio 1, and Increasing the exposure gain in the same proportion, and imaging according to the adjusted exposure parameters; when the relative motion rate level is 2, according to the relationship graph, the ratio of the exposure time is reduced according to the ratio 2, and the exposure gain is increased in the same proportion, according to the adjustment After the exposure parameter is imaged; when the relative motion rate level is 3, the motion rate at this time is greater than the set rate threshold, and the ratio of the exposure time is decreased according to the ratio 2 in the preview phase, and the exposure gain is increased in the same proportion, according to The adjusted exposure parameter is imaged; when the relative motion rate level is greater than 3, the motion rate at this time is greater than the set rate threshold, and the ratio of the exposure time is decreased according to the ratio 2 in the preview phase, and the exposure gain is increased in proportion. Imaging is performed according to the adjusted exposure parameters.
下面重点介绍一下在图像后处理阶段,如何对至少两个短曝光帧和至少一个长曝光帧如何进行融合。为方便说明,以在成像阶段生成三个短曝光帧和一个长曝光帧为例,将三个短曝光帧和一个长曝光帧进行融合,输出融合后的图像。The following focuses on how to fuse at least two short exposure frames and at least one long exposure frame during the image post-processing stage. For convenience of description, three short exposure frames and one long exposure frame are generated by merging three short exposure frames and one long exposure frame in the imaging stage, and the fused images are output.
如图4所示,融合的过程大致分为:终端的图像信号处理单元(image signal processing unit,ISP)输出三个短曝光帧和一个长曝光帧之后,经过步骤401和步骤402,最终输出融合结果,即输出融合后的图像。As shown in FIG. 4, the process of the fusion is roughly divided into: after the image signal processing unit (ISP) of the terminal outputs three short exposure frames and one long exposure frame, after step 401 and step 402, the final output fusion is performed. As a result, the fused image is output.
步骤401:将三个短曝光帧进行时域多帧降噪融合处理,将时域多帧降噪融合处理后获得的一个帧称为短帧。Step 401: Perform time domain multi-frame noise reduction fusion processing on the three short exposure frames, and refer to a frame obtained by the time domain multi-frame noise reduction fusion processing as a short frame.
此处的短帧是指三个短曝光帧进行降噪融合处理后的结果,特别的,可能是三个短曝光帧中的一个。The short frame here refers to the result of the noise reduction fusion process of three short exposure frames, and in particular, may be one of three short exposure frames.
步骤402:将步骤401中获得的一个短帧与长曝光帧进行融合。Step 402: Combine a short frame obtained in step 401 with a long exposure frame.
具体地,在固定国际标准化组织(international standards organization,ISO)规定的感光度和曝光时间的情况下,对同一个场景进行至少两次拍摄,由于噪声在帧与帧之间是随机波动的,信号是固定的,如果每一帧的噪声方差为σ2,进行N帧平均后,结果帧的噪声方差降低为σ2/N。噪声标准差每降低一半,信噪比提升6dB。所以,理论上4帧时域降噪可提升6dB。本申请实施例中使用三帧短曝光帧融合降噪。三帧短曝光帧用Frame0、Frame1、Frame2来表示。Specifically, in the case of fixing the sensitivity and exposure time specified by the international standards organization (ISO), the same scene is shot at least twice, since the noise is randomly fluctuated between frames, the signal It is fixed. If the noise variance of each frame is σ 2 , after the N frame averaging, the noise variance of the resulting frame is reduced to σ 2 /N. For every half of the noise standard deviation, the signal-to-noise ratio is increased by 6dB. Therefore, in theory, the 4-frame time domain noise reduction can be improved by 6dB. In the embodiment of the present application, three-frame short exposure frame fusion noise reduction is used. The three-frame short exposure frame is represented by Frame0, Frame1, and Frame2.
如果拍摄多帧的过程中,发生了手持抖动或者场景内的物体发生了运动,时域平均可能会发生错位,引入鬼影或模糊,因此多帧时域平均前需要加入图像配准和鬼影检测。If a hand-held jitter occurs during the shooting of multiple frames or an object in the scene moves, the time domain average may be misaligned, introducing ghosts or blurring, so image registration and ghosting need to be added before multi-frame time domain averaging. Detection.
因此,步骤401可以包括几个具体的实现步骤。图像配准、鬼影检测、时域多帧降噪融合。其中:Thus, step 401 can include several specific implementation steps. Image registration, ghost detection, time domain multi-frame noise reduction fusion. among them:
图像配准:对输入的参考帧Frame0和待配准帧Frame1进行特征提取,分别得到一系列的特征点,并对每个特征点进行特征描述。根据特征描述匹配两帧图像的特征点,得到一系列特征点对。在匹配得到的特征点对中求解得到两帧图像的变换矩阵,即投影变换,为3x3的矩阵H。Frame1通过H矩阵变换得到与Frame0对齐的图像,可称为Frame1的配准结果。同理,以同样方法得到Frame2与Frame0对齐的图像,可称为Frame2的配准 结果。Image registration: Feature extraction is performed on the input reference frame Frame0 and the to-be-registered frame Frame1, respectively, and a series of feature points are obtained, and each feature point is characterized. According to the feature description, the feature points of the two frames of images are matched, and a series of feature point pairs are obtained. The transformation matrix of the two frames of images is obtained by matching the pair of feature points obtained, that is, the projection transformation is a matrix H of 3×3. Frame1 obtains an image aligned with Frame0 through H matrix transformation, which can be called the registration result of Frame1. Similarly, the same method to get the image of Frame2 and Frame0 alignment, can be called the registration of Frame2 result.
鬼影检测:参考帧Frame0分别与Frame1和Frame2的配准结果求差,得到每个像素点的差异值,即diff图。对diff图像进行高斯平滑,去除噪声影响。通过diff与相应的鬼影阈值比较,判断是否为鬼影点。利用腐蚀膨胀消除孤立点(噪声),得到最终的鬼影掩盖,即鬼影Mask。Ghost detection: The reference frame Frame0 is compared with the registration results of Frame1 and Frame2, respectively, to obtain the difference value of each pixel, that is, the diff diagram. Gaussian smoothing of the diff image to remove noise effects. The diff is compared with the corresponding ghost threshold to determine whether it is a ghost point. Eliminate isolated points (noise) with corrosion expansion and get the final ghost mask, the ghost shadow.
时域多帧降噪融合:判断鬼影检测的鬼影区域面积大小是否小于全图像的1/3。如果否,则直接输出Frame0的数据,也就是省去融合的过程,直接将Frame0作为上述短帧,参与后续的长短帧融合。如果是,则根据鬼影Mask对每个像素点加权去除鬼影,并输出融合结果,其中鬼影Mask区域参考帧像素融合权重大于其他配准帧对应像素,也就是,在鬼影区域以参考帧的像素点为融合结果。Time domain multi-frame noise reduction fusion: Determine whether the ghost area of ghost detection is less than 1/3 of the full image. If no, the data of Frame0 is directly output, that is, the process of merging is omitted, and Frame0 is directly used as the short frame to participate in the subsequent long and short frame fusion. If yes, the ghost image is weighted according to the ghost Mask to remove the ghost, and the fusion result is output, wherein the ghost frame reference frame pixel fusion weight is greater than the corresponding pixel of the other registration frame, that is, in the ghost region for reference The pixel of the frame is the result of the fusion.
步骤402可以包括几个具体的实现步骤。将步骤401获得的短帧与长曝光帧进行图像配准、鬼影检测和去除,将去除鬼影的长帧与短帧进行频域融合。Step 402 can include several specific implementation steps. The short frame and the long exposure frame obtained in step 401 are subjected to image registration, ghost detection and removal, and the long frame and the short frame from which the ghost is removed are subjected to frequency domain fusion.
同样,为避免长曝光帧和短帧之间运动区域鬼影带来的融合错误,长短帧融合前也使用与多帧短帧降噪过程中相同的图像配准和鬼影检测方法,去除鬼影的影响。图像配准的方法与上述图像配准方法类似,将鬼影Mask作为权重,将多帧降噪融合后的短帧与长曝光帧的配准结果进行融合,得到去鬼影后的长曝光帧。为方便叙述,这里将得到的去鬼影后的长曝光帧称为长帧。根据鬼影检测的结果,以长帧的鬼影区域为融合基准,将长帧和短帧进行频域融合,其中,鬼影区域短帧像素融合权重大于长帧对应像素,非鬼影区域长帧像素融合权重大于短帧对应像素。Similarly, in order to avoid the fusion error caused by the ghosting of the motion region between the long exposure frame and the short frame, the same image registration and ghost detection method in the process of multiframe short frame noise reduction is used before the long and short frame fusion, and the ghost is removed. The influence of the shadow. The image registration method is similar to the above image registration method. The ghost image is used as a weight, and the registration results of the short frame and the long exposure frame after multi-frame noise reduction are combined to obtain a long exposure frame after ghosting. . For convenience of description, the long-exposure frame obtained after de-ghosting is referred to as a long frame. According to the result of ghost detection, the ghost frame region of the long frame is used as the fusion reference, and the long frame and the short frame are frequency domain fused, wherein the ghost component short frame pixel fusion weight is greater than the long frame corresponding pixel, and the non-ghost region is long. The frame pixel fusion weight is greater than the short frame corresponding pixel.
如图5所示,为长曝光帧去除鬼影的流程示意图。输入为步骤401中获得的一个短帧和配准后的长曝光帧。以鬼影检测到的鬼影Mask为权重,对两个输入图像进行加权融合,形态学膨胀和平滑操作是为了去除鬼影Mask的空洞和边缘平滑,提高图像融合效果。输出去鬼影后的长曝光帧,在本实施例中可以称为长帧。As shown in FIG. 5, a schematic diagram of the process of removing ghosts for long exposure frames. The input is a short frame obtained in step 401 and a long exposure frame after registration. The ghost image detected by the ghost is weighted, and the two input images are weighted and fused. The morphological expansion and smoothing operation is to remove the ghost and edge smoothness of the ghost Mask and improve the image fusion effect. The long exposure frame after the ghosting is outputted may be referred to as a long frame in this embodiment.
需要说明的是,当拍摄目标物体与终端的相对运动程度较大或拍摄微距场景时,若长短帧图像的鬼影区域面积在整幅图像中占比超过设定阈值(如10%),则表明超过算法设定的能处理的最大鬼影阈值,此时为避免融合错位会跳过长短帧频域融合,直接输出长曝光帧。It should be noted that when the relative motion of the target object and the terminal is relatively large or a macro scene is captured, if the ghost area of the long and short frame image accounts for more than a set threshold (eg, 10%) in the entire image, It indicates that the maximum ghost threshold that can be processed by the algorithm is exceeded. In this case, in order to avoid the misalignment, the long-short frame frequency domain fusion is skipped, and the long-exposure frame is directly output.
在图像处理中,频域反应了图像在空域灰度变化剧烈程度,也就是图像灰度的变化速度,或图像的梯度大小。对图像而言,图像的边缘部分是突变部分,变化较快,因此反应在频域上是高频分量;图像的噪声大部分情况下是高频部分;图像平缓变化部分则为低频分量。也就是说,傅立叶变换提供一条从空域到频率自由转换的途径来观察图像,可以将图像从灰度分布转化到频率分布上来观察图像的特征。图像与频率直接的关系:低频多为图像平缓轮廓,中频多为图像边缘、纹理等细节,高频多为图像噪声,而傅里叶谱图中心亮点则代表图像的灰度均值。利用图像和频域的直接关系,本实施例根据鬼影检测的结果,以长帧的鬼影区域为融合基准,将长帧和短帧进行频域融合,达到同时保留长帧亮度、非运动区细节信息和短帧运动区域清晰度信息的目的。In image processing, the frequency domain reflects the intensity of the image in the spatial gray scale, that is, the speed of the image gray, or the gradient of the image. For the image, the edge part of the image is a mutated part, and the change is faster, so the reaction is a high frequency component in the frequency domain; the noise of the image is a high frequency part in most cases; and the low frequency component is a gradual change part of the image. That is to say, the Fourier transform provides a way to freely convert from the airspace to the frequency to observe the image, and the image can be transformed from the grayscale distribution to the frequency distribution to observe the characteristics of the image. The direct relationship between image and frequency: low frequency is mostly image contour, medium frequency is mostly image edge, texture and other details, high frequency is mostly image noise, while Fourier spectrum center bright point represents the gray level mean of the image. According to the direct relationship between the image and the frequency domain, according to the result of the ghost detection, the ghost region of the long frame is used as a fusion reference, and the long frame and the short frame are fused in the frequency domain to achieve the long frame brightness and non-motion. The purpose of the area detail information and the short-frame motion area definition information.
如图6所示,为长帧和短帧进行频域融合的流程示意图。输入为:多帧降噪融合后的短帧以及去除鬼影的长帧。As shown in FIG. 6, a schematic flowchart of frequency domain fusion for long frames and short frames is shown. The input is: short frame after multi-frame noise reduction and long frame with ghost removal.
步骤601、对多帧降噪融合后的短帧以及去除鬼影的长帧分别进行降采样,降低计算量。 Step 601: Downsampling the short frame after the multi-frame noise reduction fusion and the long frame removing the ghost, respectively, to reduce the calculation amount.
步骤602、长帧降采样后,再上采样计算与原图的损失误差图,用于图像融合后恢复降采样带来的图像细节损失。Step 602: After downsampling the long frame, the upsampling is calculated and the loss error map of the original image is used to restore image detail loss caused by downsampling after image fusion.
步骤603、对降采样后的两张输入帧分别进行快速傅里叶变换,得到各自的傅里叶频谱,并计算相应幅值。Step 603: Perform fast Fourier transform on the two input frames after down-sampling to obtain respective Fourier spectra, and calculate corresponding amplitudes.
步骤604、以幅值为权重,将两个输入的傅里叶频谱进行融合。In step 604, the two input Fourier spectra are fused with the magnitude of the weight.
其中,在融合时,需对长帧傅里叶谱图中心亮点进行保护,将以亮点为中心的10x10区域内的值赋给融合后的傅里叶频谱,以此保留长帧的平均亮度信息。In the fusion, the highlight of the long-frame Fourier spectrum is protected, and the value in the 10x10 region centered on the bright spot is assigned to the fused Fourier spectrum, thereby preserving the average luminance information of the long frame. .
步骤605、将融合的频谱做逆傅里叶变换,得到融合后图像。Step 605: Perform inverse Fourier transform on the fused spectrum to obtain a fused image.
步骤606、将融合后图像与长帧下采样计算得到的误差图相加,恢复降采样带来的损失。Step 606: Add the error image calculated by the fused image and the long frame down sampling to recover the loss caused by the down sampling.
输出最终融合结果。The final fusion result is output.
综上,本申请实施例通过预览状态第一次降低曝光时间,在成像过程第二次降低曝光时间,以及在图像后处理阶段进行多帧短帧降噪融合和长短帧频域融合处理,提高了终端拍摄时消减运动模糊的能力。In summary, the embodiment of the present application reduces the exposure time by the preview state for the first time, reduces the exposure time for the second time in the imaging process, and performs multi-frame short frame noise reduction fusion and long-short frame frequency domain fusion processing in the image post-processing stage to improve The ability to reduce motion blur when shooting at the terminal.
如图7所示,下面结合具体的应用场景对上述图像处理方法做进一步详细介绍,假设应用场景为通过相机进行拍照。As shown in FIG. 7 , the above image processing method is further described in detail below in conjunction with a specific application scenario, and it is assumed that the application scenario is taking a photo through a camera.
步骤701、终端接收到打开相机的指令,启动摄像头,进入预览状态。Step 701: The terminal receives an instruction to open the camera, starts the camera, and enters a preview state.
步骤702、对预览图像数据进行降采样。Step 702: Perform down sampling on the preview image data.
步骤703、对降采样后的图像数据进行运动检测。Step 703: Perform motion detection on the downsampled image data.
通过分析前后两帧预览图像来进行运动检测,并即时输出检测结果,例如可以输出运动状态和速率等级,运动速率越大,速率等级越大。速率等级为0,表示静止无运动,速率等级1、2、3表示的运动速率递增。The motion detection is performed by analyzing the preview images of two frames before and after, and the detection result is outputted immediately, for example, the motion state and the velocity level can be output, and the greater the motion rate, the larger the rate grade. The rate level is 0, indicating that there is no motion at rest, and the rate of motion indicated by rate levels 1, 2, and 3 is increasing.
若没有检测到运动,则执行步骤704~步骤705;若检测到运动,则执行步骤706。If no motion is detected, step 704 to step 705 are performed; if motion is detected, step 706 is performed.
步骤704、通过相机应用端下发拍照命令时,按AE收敛的正常曝光参数进行拍照,即传感器Sensor按正常的曝光参数出帧。Step 704: When the camera application end issues a photographing command, the photograph is taken according to the normal exposure parameter of the AE convergence, that is, the sensor sensor is framed according to the normal exposure parameter.
步骤705、输出并存储图像。 Step 705, outputting and storing an image.
步骤706、判断运动速率等级是否大于设定的速率阈值,或者判断曝光增益是否大于设定的增益阈值,或者判断LV值是否小于设定的亮度阈值;若是,则执行步骤710~步骤714,否则,执行步骤707~步骤709。Step 706: Determine whether the motion rate level is greater than the set rate threshold, or determine whether the exposure gain is greater than the set gain threshold, or determine whether the LV value is less than the set brightness threshold; if yes, perform steps 710 to 714, otherwise Steps 707 to 709 are performed.
步骤707、在预览上调整曝光参数。Step 707: Adjust the exposure parameter on the preview.
基于运动速度等级按预设比例降低曝光时间,并同比例增加曝光增益,以保持图像整体亮度不变。The exposure time is reduced by a preset ratio based on the motion speed level, and the exposure gain is increased in proportion to maintain the overall brightness of the image.
步骤708、通过相机应用端下发拍照命令时,Sensor按调整后的曝光参数出帧。Step 708: When the camera application end issues a photographing command, the Sensor deframes according to the adjusted exposure parameter.
步骤709、输出并存储图像。 Step 709, outputting and storing an image.
步骤710、在预览上调整曝光参数。Step 710: Adjust the exposure parameter on the preview.
基于运动速度等级按预设比例降低曝光时间,并同比例增加曝光增益,以保持图像整体亮度不变。The exposure time is reduced by a preset ratio based on the motion speed level, and the exposure gain is increased in proportion to maintain the overall brightness of the image.
步骤711、通过相机应用端下发拍照命令时,首先在调整后的预览曝光参数基础上按设定的比例再次降低曝光时间和增加曝光增益。Step 711: When the camera command is issued by the camera application end, firstly, according to the adjusted preview exposure parameter, the exposure time is decreased again and the exposure gain is increased according to the set ratio.
步骤712、Sensor按照再次降低的曝光时间和增加的曝光增益生成三张短曝光帧,按 照首次调整后的预览曝光参数生成长曝光帧。经ISP处理后进行图像后处理。Step 712: The Sensor generates three short exposure frames according to the reduced exposure time and the increased exposure gain, and presses A long exposure frame is generated based on the first adjusted preview exposure parameter. Image post-processing is performed after ISP processing.
步骤713、图像后处理中进行短帧多帧降噪和长短帧融合,保留短帧运动区域的细节和长帧非运动区域的细节。In step 713, the short frame multi-frame noise reduction and the long and short frame fusion are performed in the image post-processing, and the details of the short-frame motion area and the details of the long-frame non-motion area are reserved.
步骤714、输出并保存最终融合图像。 Step 714, output and save the final fused image.
综上所述,本申请实施例提供的图像处理方法中,通过成像阶段两次降低曝光时间,获得更高的快门速度,采用第一次降低曝光时间的参数生成长曝光帧,采用第二次降低曝光时间的参数生成至少两个短曝光帧,在图像后处理阶段对长短曝光多帧进行融合,在鬼影区域短帧像素融合权重大于长帧像素融合权重,在其他区域长帧像素融合权重大于短帧像素融合权重,鬼影区域即运动区域,即目标物体与终端存在相对运动的部分区域,非运动区域可以认为与终端相对静止或近似相对静止,运动区域为抖动的花草,非运动区域为天空地面等背景。这样能够保留长曝光帧的亮度信息,使得拍摄图像的运动区域和非运动区域均更加清晰,能够有效避免因权衡噪声水平使得降低曝光时间的力度受到限制导致的终端消减运动模糊的能力不足的问题,通过在预览过程中降低曝光时间,能够有效缩短拍摄成像的时延,在拍摄命令下发后再次降低曝光时间,能够更加有效的消减运动模糊,通过在图像后处理环节对多帧短帧进行时域多帧降噪处理,能够有助于降低因增加曝光增益带来的噪声,从而具有更强的抗运动模糊能力和更优的抗运动模糊效果。In summary, in the image processing method provided by the embodiment of the present application, the exposure time is reduced twice by the imaging stage to obtain a higher shutter speed, and the long exposure frame is generated by using the parameter for reducing the exposure time for the first time, and the second time is adopted. The parameter for reducing the exposure time generates at least two short exposure frames, and the long-short exposure multi-frame is fused in the post-processing stage of the image. In the ghost region, the short-frame pixel fusion weight is greater than the long-frame pixel fusion weight, and the long-frame pixel fusion weight in other regions. It is larger than the short-frame pixel fusion weight, and the ghost region is the motion region, that is, the partial region where the target object and the terminal have relative motion. The non-moving region can be considered as relatively stationary or relatively stationary with the terminal, and the motion region is a jittery flower and a non-motion region. For the sky and other backgrounds. In this way, the brightness information of the long exposure frame can be retained, so that the motion area and the non-motion area of the captured image are more clear, and the problem that the terminal reduces the motion blur due to the limitation of the noise level by reducing the intensity of the exposure time can be effectively avoided. By reducing the exposure time during the preview process, the imaging imaging delay can be effectively shortened, and the exposure time can be reduced again after the shooting command is issued, which can more effectively reduce the motion blur, and the multi-frame short frame is performed in the image post-processing section. The time domain multi-frame noise reduction process can help reduce the noise caused by increasing the exposure gain, thereby having stronger anti-motion blur and better anti-motion blur effect.
基于与图2所示的图像处理方法的同一发明构思,如图8所示,本申请实施例还提供了一种图像处理装置800,该图像处理装置800用于执行图2所示的图像处理方法,该图像处理装置800包括:Based on the same inventive concept as the image processing method shown in FIG. 2, as shown in FIG. 8, the embodiment of the present application further provides an image processing apparatus 800 for performing the image processing shown in FIG. 2. The image processing apparatus 800 includes:
调整单元801,用于在预览通过摄像头采集的图像帧的过程中,当所拍摄的目标物体与装置存在相对运动时,对预览状态下摄像头初始的曝光参数进行第一调整,第一调整包括降低初始的曝光时间和增加初始的曝光增益。The adjusting unit 801 is configured to perform a first adjustment on the initial exposure parameter of the camera in the preview state, in the process of previewing the image frame acquired by the camera, when the captured target object and the device have relative motion, the first adjustment includes reducing the initial The exposure time and increase the initial exposure gain.
调整单元801,还用于在接收拍摄指令后,对第一调整后的曝光参数进行第二调整,其中,第二调整包括降低第一调整后的曝光时间和增加第一调整后的曝光增益。The adjusting unit 801 is further configured to perform a second adjustment on the first adjusted exposure parameter after receiving the shooting instruction, wherein the second adjusting comprises decreasing the first adjusted exposure time and increasing the first adjusted exposure gain.
生成单元802,用于根据第一调整后的曝光参数生成第一曝光帧,以及根据第二调整后的曝光参数生成至少两个第二曝光帧。The generating unit 802 is configured to generate a first exposure frame according to the first adjusted exposure parameter, and generate at least two second exposure frames according to the second adjusted exposure parameter.
融合单元803,用于将生成单元802生成的第一曝光帧和至少两个第二曝光帧进行融合,输出融合后的图像。The merging unit 803 is configured to fuse the first exposure frame generated by the generating unit 802 and the at least two second exposure frames to output the fused image.
可选的,在将第一调整后的曝光参数进行第二调整时,调整单元801用于:在目标物体与装置的相对运动的速率大于设定速率阈值时,将第一调整后的曝光参数进行第二调整;或者,在预览状态下摄像头的初始的曝光增益大于设定增益阈值时,将第一调整后的曝光参数进行第二调整;或者,在预览状态下摄像头的光亮值LV小于设定亮度阈值时,将第一调整后的曝光参数进行第二调整。Optionally, when performing the second adjustment of the first adjusted exposure parameter, the adjusting unit 801 is configured to: when the rate of the relative motion of the target object and the device is greater than the set rate threshold, the first adjusted exposure parameter Performing a second adjustment; or, when the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the second adjusted exposure parameter is second adjusted; or, in the preview state, the brightness value of the camera is less than LV When the brightness threshold is set, the first adjusted exposure parameter is second adjusted.
可选的,在对预览状态下摄像头的初始的曝光参数进行第一调整时,调整单元801用于:按照预设的运动速率与降低曝光时间的比例值之间的关系,确定相对运动的速率对应的降低曝光时间的比例值,以及确定增加曝光增益的值;按照确定的降低曝光时间的比例值以及增加曝光增益的值,对预览状态下摄像头的初始的曝光参数进行第一调整。Optionally, when performing the first adjustment of the initial exposure parameter of the camera in the preview state, the adjusting unit 801 is configured to determine the rate of the relative motion according to a relationship between the preset motion rate and the ratio of decreasing the exposure time. Correspondingly decreasing the ratio of the exposure time, and determining the value of increasing the exposure gain; performing a first adjustment on the initial exposure parameter of the camera in the preview state according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain.
可选的,在将第一曝光帧和至少两个第二曝光帧进行融合之前,融合单元803还用于将至少两个第二曝光帧进行时域多帧降噪融合处理,获得一个短帧。Optionally, before the merging the first exposure frame and the at least two second exposure frames, the merging unit 803 is further configured to perform time domain multi-frame noise reduction fusion processing on the at least two second exposure frames to obtain a short frame. .
可选的,在将第一曝光帧和至少两个第二曝光帧进行融合时,融合单元803用于以短 帧为参考帧,将第一曝光帧和短帧进行图像配准和鬼影检测,并根据鬼影检测的结果,将图像配准后的第一曝光帧进行去鬼影处理,得到去鬼影后的一个长帧;根据鬼影检测的结果,以长帧的鬼影区域为融合基准,将长帧和短帧进行频域融合。Optionally, the fusion unit 803 is configured to be short when the first exposure frame and the at least two second exposure frames are merged. The frame is a reference frame, and the first exposure frame and the short frame are subjected to image registration and ghost detection, and according to the result of the ghost detection, the first exposure frame after the image registration is de-ghosted to obtain a ghost image. After a long frame; according to the result of ghost detection, the ghost frame area of the long frame is used as a fusion reference, and the long frame and the short frame are frequency domain fused.
基于图2所示的图像处理方法,如图9所示,本申请实施例还提供另一种图像处理装置900,包括摄像头901和处理器902。其中,摄像头901用于采集图像帧,处理器902用于执行一组代码,当代码被执行时,使得该图像处理装置能够执行图2所示的图像处理方法。方法相同之处在此不再赘述。该图像处理装置900可以是图1所示的终端100。图1所示的终端100可用于执行图2所示的图像处理方法,摄像头160执行摄像头901所执行的功能,处理器120执行处理器902所执行的功能。其中,摄像头160用于采集图像帧;处理器120用于执行图2所示的图像处理方法的细节。图8中的功能模块调整单元801、生成单元802、融合单元803均可以通过图像处理装置900中的处理器902来实现,即也可以通过图1所示的终端100中的处理器120来实现。Based on the image processing method shown in FIG. 2, as shown in FIG. 9, the embodiment of the present application further provides another image processing apparatus 900, including a camera 901 and a processor 902. Wherein, the camera 901 is configured to acquire an image frame, and the processor 902 is configured to execute a set of codes, and when the code is executed, enable the image processing apparatus to execute the image processing method shown in FIG. 2. The similarities of the methods are not described here. The image processing device 900 can be the terminal 100 shown in FIG. The terminal 100 shown in FIG. 1 can be used to perform the image processing method shown in FIG. 2, the camera 160 performs the functions performed by the camera 901, and the processor 120 executes the functions performed by the processor 902. The camera 160 is used to acquire image frames; the processor 120 is configured to execute the details of the image processing method shown in FIG. 2. The function module adjusting unit 801, the generating unit 802, and the merging unit 803 in FIG. 8 can all be implemented by the processor 902 in the image processing apparatus 900, that is, can also be implemented by the processor 120 in the terminal 100 shown in FIG. .
本申请实施例提供了一种计算机存储介质,存储有计算机程序,该计算机程序包括用于执行图2所示的图像处理方法。The embodiment of the present application provides a computer storage medium, which stores a computer program, and the computer program includes an image processing method shown in FIG. 2.
本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行图2所示的图像处理方法。An embodiment of the present application provides a computer program product comprising instructions that, when run on a computer, cause the computer to perform the image processing method illustrated in FIG. 2.
本申请实施例提供的任一种图像处理装置还可以是一种系统芯片。Any of the image processing apparatuses provided in the embodiments of the present application may also be a system chip.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system, or computer program product. Thus, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。 While the preferred embodiment of the present application has been described, it will be apparent that those skilled in the art can make further changes and modifications to the embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请实施例的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, it is intended that the present invention cover the modifications and variations of the embodiments of the present invention.

Claims (16)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, comprising:
    终端在预览通过摄像头采集的图像帧的过程中,当所拍摄的目标物体与所述终端存在相对运动时,对预览状态下所述摄像头初始的曝光参数进行第一调整,所述第一调整包括降低初始的曝光时间和增加初始的曝光增益;During previewing the image frame acquired by the camera, when the captured target object and the terminal have relative motion, the first adjustment of the initial exposure parameter of the camera in the preview state is performed, and the first adjustment includes: Initial exposure time and increase initial exposure gain;
    所述终端在接收拍摄指令后,对所述第一调整后的曝光参数进行第二调整,并根据所述第一调整后的曝光参数生成第一曝光帧,以及根据所述第二调整后的曝光参数生成至少两个第二曝光帧,其中,所述第二调整包括降低所述第一调整后的曝光时间和增加所述第一调整后的曝光增益;After receiving the shooting instruction, the terminal performs a second adjustment on the first adjusted exposure parameter, and generates a first exposure frame according to the first adjusted exposure parameter, and according to the second adjusted The exposure parameter generates at least two second exposure frames, wherein the second adjustment comprises decreasing the first adjusted exposure time and increasing the first adjusted exposure gain;
    所述终端将所述第一曝光帧和所述至少两个第二曝光帧进行融合,输出融合后的图像。The terminal fuses the first exposure frame and the at least two second exposure frames to output a fused image.
  2. 如权利要求1所述的方法,其特征在于,所述终端将所述第一调整后的曝光参数进行第二调整,包括:The method of claim 1, wherein the terminal performs the second adjustment of the first adjusted exposure parameter, including:
    所述终端在所述目标物体与所述终端的相对运动的速率大于设定速率阈值时,将所述第一调整后的曝光参数进行第二调整;或者,When the rate of the relative motion of the target object and the terminal is greater than a set rate threshold, the terminal performs a second adjustment on the first adjusted exposure parameter; or
    所述终端在预览状态下所述摄像头的初始的曝光增益大于设定增益阈值时,将所述第一调整后的曝光参数进行第二调整;或者,When the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the terminal performs the second adjustment on the first adjusted exposure parameter; or
    所述终端在预览状态下所述摄像头的光亮值LV小于设定亮度阈值时,将所述第一调整后的曝光参数进行第二调整。When the brightness value LV of the camera is less than the set brightness threshold in the preview state, the terminal performs the second adjustment on the first adjusted exposure parameter.
  3. 如权利要求1或2所述的方法,其特征在于,所述对预览状态下所述摄像头的初始的曝光参数进行第一调整,包括:The method according to claim 1 or 2, wherein the first adjustment of the initial exposure parameter of the camera in a preview state comprises:
    所述终端按照预设的运动速率与降低曝光时间的比例值之间的关系,确定所述相对运动的速率对应的降低曝光时间的比例值,以及确定增加曝光增益的值;Determining, by the terminal, a ratio of decreasing the exposure time corresponding to the rate of the relative motion according to a relationship between a preset motion rate and a ratio of decreasing the exposure time, and determining a value of increasing the exposure gain;
    按照确定的降低曝光时间的比例值以及增加曝光增益的值,对预览状态下所述摄像头的初始的曝光参数进行第一调整。The first adjustment of the initial exposure parameter of the camera in the preview state is performed according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain.
  4. 如权利要求1、2或3所述的方法,其特征在于,所述终端在将所述第一曝光帧和所述至少两个第二曝光帧进行融合之前,还包括:The method according to claim 1, 2 or 3, wherein the terminal further comprises: before the merging the first exposure frame and the at least two second exposure frames, the terminal further comprises:
    所述终端将所述至少两个第二曝光帧进行时域多帧降噪融合处理,获得一个短帧。The terminal performs time domain multi-frame noise reduction fusion processing on the at least two second exposure frames to obtain a short frame.
  5. 如权利要求4所述的方法,其特征在于,所述终端将所述第一曝光帧和所述至少两个第二曝光帧进行融合,包括:The method according to claim 4, wherein the terminal fuses the first exposure frame and the at least two second exposure frames, including:
    所述终端以所述短帧为参考帧,将所述第一曝光帧和所述短帧进行图像配准和鬼影检测,并根据鬼影检测的结果,将图像配准后的第一曝光帧进行去鬼影处理,得到去鬼影后的一个长帧;The terminal uses the short frame as a reference frame, performs image registration and ghost detection on the first exposure frame and the short frame, and performs a first exposure after the image is registered according to the result of the ghost detection. The frame is subjected to ghosting processing to obtain a long frame after ghosting;
    根据所述鬼影检测的结果,以所述长帧的鬼影区域为融合基准,将所述长帧和所述短帧进行频域融合。According to the result of the ghost detection, the long frame and the short frame are frequency domain fused by using a ghost region of the long frame as a fusion reference.
  6. 一种图像处理装置,其特征在于,包括:An image processing apparatus, comprising:
    调整单元,用于在预览通过摄像头采集的图像帧的过程中,当所拍摄的目标物体与所述装置存在相对运动时,对预览状态下所述摄像头初始的曝光参数进行第一调整,所述第一调整包括降低初始的曝光时间和增加初始的曝光增益; An adjusting unit, configured to perform a first adjustment on an initial exposure parameter of the camera in a preview state when the captured target object and the device have relative motion during previewing an image frame acquired by the camera, where An adjustment includes reducing the initial exposure time and increasing the initial exposure gain;
    所述调整单元,还用于在接收拍摄指令后,对所述第一调整后的曝光参数进行第二调整,其中,所述第二调整包括降低所述第一调整后的曝光时间和增加所述第一调整后的曝光增益;The adjusting unit is further configured to perform a second adjustment on the first adjusted exposure parameter after receiving the shooting instruction, wherein the second adjusting includes reducing the exposure time and the increasing time after the first adjustment Depicting the first adjusted exposure gain;
    生成单元,用于根据所述第一调整后的曝光参数生成第一曝光帧,以及根据所述第二调整后的曝光参数生成至少两个第二曝光帧;a generating unit, configured to generate a first exposure frame according to the first adjusted exposure parameter, and generate at least two second exposure frames according to the second adjusted exposure parameter;
    融合单元,用于将所述生成单元生成的第一曝光帧和所述至少两个第二曝光帧进行融合,输出融合后的图像。And a merging unit, configured to fuse the first exposure frame generated by the generating unit and the at least two second exposure frames, and output the fused image.
  7. 如权利要求6所述的装置,其特征在于,在将所述第一调整后的曝光参数进行第二调整时,所述调整单元用于:The apparatus according to claim 6, wherein when the first adjusted exposure parameter is second adjusted, the adjusting unit is configured to:
    在所述目标物体与所述装置的相对运动的速率大于设定速率阈值时,将所述第一调整后的曝光参数进行第二调整;或者,And performing, when the rate of the relative movement of the target object and the device is greater than a set rate threshold, performing the second adjustment on the first adjusted exposure parameter; or
    在预览状态下所述摄像头的初始的曝光增益大于设定增益阈值时,将所述第一调整后的曝光参数进行第二调整;或者,When the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the first adjusted exposure parameter is second adjusted; or
    在预览状态下所述摄像头的光亮值LV小于设定亮度阈值时,将所述第一调整后的曝光参数进行第二调整。When the brightness value LV of the camera is less than the set brightness threshold in the preview state, the first adjusted exposure parameter is second adjusted.
  8. 如权利要求6或7所述的装置,其特征在于,在对预览状态下所述摄像头的初始的曝光参数进行第一调整时,所述调整单元用于:The apparatus according to claim 6 or 7, wherein, in the first adjustment of the initial exposure parameter of the camera in the preview state, the adjusting unit is configured to:
    按照预设的运动速率与降低曝光时间的比例值之间的关系,确定所述相对运动的速率对应的降低曝光时间的比例值,以及确定增加曝光增益的值;Determining a ratio of decreasing the exposure time corresponding to the rate of the relative motion according to a relationship between a preset motion rate and a ratio of decreasing the exposure time, and determining a value for increasing the exposure gain;
    按照确定的降低曝光时间的比例值以及增加曝光增益的值,对预览状态下所述摄像头的初始的曝光参数进行第一调整。The first adjustment of the initial exposure parameter of the camera in the preview state is performed according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain.
  9. 如权利要求6、7或8所述的装置,其特征在于,在将所述第一曝光帧和所述至少两个第二曝光帧进行融合之前,所述融合单元还用于:The apparatus according to claim 6, 7 or 8, wherein the merging unit is further configured to: before merging the first exposure frame and the at least two second exposure frames:
    将所述至少两个第二曝光帧进行时域多帧降噪融合处理,获得一个短帧。The at least two second exposure frames are subjected to time domain multi-frame noise reduction fusion processing to obtain a short frame.
  10. 如权利要求9所述的装置,其特征在于,在将所述第一曝光帧和所述至少两个第二曝光帧进行融合时,所述融合单元用于:The apparatus according to claim 9, wherein when the first exposure frame and the at least two second exposure frames are fused, the merging unit is configured to:
    以所述短帧为参考帧,将所述第一曝光帧和所述短帧进行图像配准和鬼影检测,并根据鬼影检测的结果,将图像配准后的第一曝光帧进行去鬼影处理,得到去鬼影后的一个长帧;Taking the short frame as a reference frame, performing image registration and ghost detection on the first exposure frame and the short frame, and performing the first exposure frame after the image registration according to the result of the ghost detection. Ghost processing, get a long frame after ghosting;
    根据所述鬼影检测的结果,以所述长帧的鬼影区域为融合基准,将所述长帧和所述短帧进行频域融合。According to the result of the ghost detection, the long frame and the short frame are frequency domain fused by using a ghost region of the long frame as a fusion reference.
  11. 一种图像处理装置,其特征在于,包括摄像头和处理器,其中:An image processing apparatus includes a camera and a processor, wherein:
    所述摄像头,用于采集图像帧;The camera is configured to acquire an image frame;
    所述处理器用于,在预览通过摄像头采集的图像帧的过程中,当所拍摄的目标物体与所述装置存在相对运动时,对预览状态下所述摄像头初始的曝光参数进行第一调整,在接收拍摄指令后,对所述第一调整后的曝光参数进行第二调整,所述第一调整包括降低初始的曝光时间和增加初始的曝光增益,所述第二调整包括降低所述第一调整后的曝光时间和增加所述第一调整后的曝光增益;根据所述第一调整后的曝光参数生成第一曝光帧,以及根据所述第二调整后的曝光参数生成至少两个第二曝光帧;将生成的第一曝光帧和所述至少两个第二曝光帧进行融合,输出融合后的图像。 The processor is configured to: during a preview of an image frame acquired by the camera, when the captured target object and the device have relative motion, perform a first adjustment on the initial exposure parameter of the camera in a preview state, and receive After the shooting instruction, performing a second adjustment on the first adjusted exposure parameter, the first adjustment comprising decreasing an initial exposure time and increasing an initial exposure gain, the second adjusting comprising reducing the first adjustment Exposure time and increase the first adjusted exposure gain; generating a first exposure frame according to the first adjusted exposure parameter, and generating at least two second exposure frames according to the second adjusted exposure parameter And merging the generated first exposure frame and the at least two second exposure frames to output the fused image.
  12. 如权利要求11所述的装置,其特征在于,在将所述第一调整后的曝光参数进行第二调整时,所述处理器用于:The apparatus according to claim 11, wherein when the first adjusted exposure parameter is second adjusted, the processor is configured to:
    在所述目标物体与所述装置的相对运动的速率大于设定速率阈值时,将所述第一调整后的曝光参数进行第二调整;或者,And performing, when the rate of the relative movement of the target object and the device is greater than a set rate threshold, performing the second adjustment on the first adjusted exposure parameter; or
    在预览状态下所述摄像头的初始的曝光增益大于设定增益阈值时,将所述第一调整后的曝光参数进行第二调整;或者,When the initial exposure gain of the camera is greater than the set gain threshold in the preview state, the first adjusted exposure parameter is second adjusted; or
    在预览状态下所述摄像头的光亮值LV小于设定亮度阈值时,将所述第一调整后的曝光参数进行第二调整。When the brightness value LV of the camera is less than the set brightness threshold in the preview state, the first adjusted exposure parameter is second adjusted.
  13. 如权利要求11或12所述的装置,其特征在于,在对预览状态下所述摄像头的初始的曝光参数进行第一调整时,所述处理器用于:The apparatus according to claim 11 or 12, wherein when the first adjustment of the initial exposure parameter of the camera in the preview state is performed, the processor is configured to:
    按照预设的运动速率与降低曝光时间的比例值之间的关系,确定所述相对运动的速率对应的降低曝光时间的比例值,以及确定增加曝光增益的值;Determining a ratio of decreasing the exposure time corresponding to the rate of the relative motion according to a relationship between a preset motion rate and a ratio of decreasing the exposure time, and determining a value for increasing the exposure gain;
    按照确定的降低曝光时间的比例值以及增加曝光增益的值,对预览状态下所述摄像头的初始的曝光参数进行第一调整。The first adjustment of the initial exposure parameter of the camera in the preview state is performed according to the determined ratio of decreasing the exposure time and increasing the value of the exposure gain.
  14. 如权利要求11、12或13所述的装置,其特征在于,在将所述第一曝光帧和所述至少两个第二曝光帧进行融合之前,所述处理器还用于:The apparatus of claim 11, 12 or 13, wherein the processor is further configured to: prior to fusing the first exposure frame and the at least two second exposure frames:
    将所述至少两个第二曝光帧进行时域多帧降噪融合处理,获得一个短帧。The at least two second exposure frames are subjected to time domain multi-frame noise reduction fusion processing to obtain a short frame.
  15. 如权利要求14所述的装置,其特征在于,在将所述第一曝光帧和所述至少两个第二曝光帧进行融合时,所述处理器用于:The apparatus of claim 14, wherein when the first exposure frame and the at least two second exposure frames are fused, the processor is configured to:
    以所述短帧为参考帧,将所述第一曝光帧和所述短帧进行图像配准和鬼影检测,并根据鬼影检测的结果,将图像配准后的第一曝光帧进行去鬼影处理,得到去鬼影后的一个长帧;Taking the short frame as a reference frame, performing image registration and ghost detection on the first exposure frame and the short frame, and performing the first exposure frame after the image registration according to the result of the ghost detection. Ghost processing, get a long frame after ghosting;
    根据所述鬼影检测的结果,以所述长帧的鬼影区域为融合基准,将所述长帧和所述短帧进行频域融合。According to the result of the ghost detection, the long frame and the short frame are frequency domain fused by using a ghost region of the long frame as a fusion reference.
  16. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括用于执行如权利要求1~权利要求5任一项所述方法的指令。 A computer storage medium, characterized in that the computer storage medium stores a computer program comprising instructions for performing the method of any one of claims 1 to 5.
PCT/CN2017/106176 2017-10-13 2017-10-13 Image processing method and device WO2019071613A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/106176 WO2019071613A1 (en) 2017-10-13 2017-10-13 Image processing method and device
CN201780081683.XA CN110121882B (en) 2017-10-13 2017-10-13 An image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/106176 WO2019071613A1 (en) 2017-10-13 2017-10-13 Image processing method and device

Publications (1)

Publication Number Publication Date
WO2019071613A1 true WO2019071613A1 (en) 2019-04-18

Family

ID=66101215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106176 WO2019071613A1 (en) 2017-10-13 2017-10-13 Image processing method and device

Country Status (2)

Country Link
CN (1) CN110121882B (en)
WO (1) WO2019071613A1 (en)

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519584A (en) * 2019-08-08 2019-11-29 深圳市圆周率软件科技有限责任公司 A kind of device for testing the picture pick-up device time for exposure
CN110619593A (en) * 2019-07-30 2019-12-27 西安电子科技大学 Double-exposure video imaging system based on dynamic scene
CN111091498A (en) * 2019-12-31 2020-05-01 联想(北京)有限公司 Image processing method, image processing apparatus, electronic device, and medium
CN111275653A (en) * 2020-02-28 2020-06-12 北京松果电子有限公司 Image denoising method and device
CN112215875A (en) * 2020-09-04 2021-01-12 北京迈格威科技有限公司 Image processing method, device and electronic system
CN112785537A (en) * 2021-01-21 2021-05-11 北京小米松果电子有限公司 Image processing method, device and storage medium
TWI727497B (en) * 2019-11-11 2021-05-11 瑞昱半導體股份有限公司 Image processing method based on sensor characteristics
CN112819699A (en) * 2019-11-15 2021-05-18 北京金山云网络技术有限公司 Video processing method and device and electronic equipment
CN113055580A (en) * 2019-12-26 2021-06-29 中兴通讯股份有限公司 Environment recognition method, shooting mode switching method, terminal and storage medium
WO2021160001A1 (en) * 2020-02-14 2021-08-19 华为技术有限公司 Image acquisition method and device
CN113379615A (en) * 2021-04-25 2021-09-10 北京迈格威科技有限公司 Image processing method and device, storage medium and electronic equipment
WO2021179223A1 (en) * 2020-03-11 2021-09-16 深圳市大疆创新科技有限公司 Infrared image processing method and processing device, and unmanned aerial vehicle and storage medium
CN113766150A (en) * 2021-08-31 2021-12-07 北京安酷智芯科技有限公司 Noise reduction method, circuit system, electronic equipment and computer readable storage medium
CN114302068A (en) * 2022-01-06 2022-04-08 重庆紫光华山智安科技有限公司 Image shooting method and device
CN114338956A (en) * 2020-09-30 2022-04-12 北京小米移动软件有限公司 Image processing method, image processing device and storage medium
CN114630050A (en) * 2022-03-25 2022-06-14 展讯半导体(南京)有限公司 Photographing method, device, medium and terminal equipment
CN114693723A (en) * 2020-12-30 2022-07-01 中兴通讯股份有限公司 Image fusion method, terminal and storage medium
CN114827386A (en) * 2022-03-31 2022-07-29 艾酷软件技术(上海)有限公司 Video image processing method and device
CN115225823A (en) * 2021-04-16 2022-10-21 成都鼎桥通信技术有限公司 Image acquisition method and device
CN115278069A (en) * 2022-07-22 2022-11-01 北京紫光展锐通信技术有限公司 Image processing method and device, computer readable storage medium and terminal
CN115988329A (en) * 2022-12-30 2023-04-18 南京图格医疗科技有限公司 HDR image generation method and system based on multi-sensor imaging equipment
CN116233625A (en) * 2021-12-01 2023-06-06 荣耀终端有限公司 A kind of image processing method, electronic equipment and chip
WO2024239792A1 (en) * 2023-05-23 2024-11-28 荣耀终端有限公司 Motion snapshot method and electronic device
CN119325018A (en) * 2024-12-19 2025-01-17 杭州海康威视数字技术股份有限公司 High frame rate camera and imaging method

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110460773B (en) * 2019-08-16 2021-05-11 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN111462021B (en) * 2020-04-27 2023-08-29 Oppo广东移动通信有限公司 Image processing method, apparatus, electronic device, and computer-readable storage medium
CN112399091B (en) * 2020-10-26 2023-01-20 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN112532890B (en) * 2020-11-02 2022-06-07 浙江大华技术股份有限公司 Exposure control method, image pickup apparatus, and computer-readable storage medium
CN112689099B (en) * 2020-12-11 2022-03-22 北京邮电大学 A ghost-free high dynamic range imaging method and device for a dual-lens camera
CN112634160A (en) * 2020-12-25 2021-04-09 北京小米松果电子有限公司 Photographing method and device, terminal and storage medium
CN115037915B (en) * 2021-03-05 2023-11-14 华为技术有限公司 Video processing method and processing device
CN113382169B (en) * 2021-06-18 2023-05-09 荣耀终端有限公司 A photographing method and electronic device
CN113298735A (en) * 2021-06-22 2021-08-24 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113592887B (en) * 2021-06-25 2022-09-02 荣耀终端有限公司 Video shooting method, electronic device and computer-readable storage medium
CN115696066A (en) * 2021-07-29 2023-02-03 荣耀终端有限公司 Image processing method and electronic device
CN113411512B (en) * 2021-08-04 2022-06-24 红云红河烟草(集团)有限责任公司 Industrial camera automatic exposure control method for cigarette field
CN115706863B (en) * 2021-08-12 2023-11-21 荣耀终端有限公司 Video processing methods, devices, electronic equipment and storage media
CN115706767B (en) * 2021-08-12 2023-10-31 荣耀终端有限公司 Video processing method, device, electronic equipment and storage medium
CN115706870B (en) * 2021-08-12 2023-12-26 荣耀终端有限公司 Video processing method, device, electronic equipment and storage medium
CN115706766B (en) * 2021-08-12 2023-12-15 荣耀终端有限公司 Video processing methods, devices, electronic equipment and storage media
CN113905185B (en) * 2021-10-27 2023-10-31 锐芯微电子股份有限公司 Image processing method and device
CN114119442B (en) * 2021-11-26 2025-07-29 Oppo广东移动通信有限公司 Image processing method, image processing device, terminal and readable storage medium
CN116437222B (en) * 2021-12-29 2024-04-19 荣耀终端有限公司 Image processing method and electronic device
CN116723408B (en) 2022-02-28 2024-05-14 荣耀终端有限公司 Exposure control method and electronic equipment
CN116402695B (en) * 2022-06-28 2024-08-09 上海玄戒技术有限公司 Video data processing method, device and storage medium
CN117880645A (en) * 2022-10-10 2024-04-12 华为技术有限公司 Image processing method and device, electronic equipment and storage medium
CN117082353A (en) * 2023-07-20 2023-11-17 浙江大华技术股份有限公司 Exposure recovery method, apparatus, and storage medium for eliminating image flicker
CN119255105A (en) * 2024-04-28 2025-01-03 荣耀终端有限公司 Image anti-shake control method, electronic device, chip system and storage medium
CN118158538B (en) * 2024-05-09 2024-08-02 杭州海康威视数字技术股份有限公司 Wide dynamic automatic exposure control method and image acquisition equipment
CN118524293B (en) * 2024-07-23 2024-11-08 浙江大华技术股份有限公司 Exposure parameter control method, camera device and storage medium
CN119206262B (en) * 2024-11-08 2025-04-25 荣耀终端股份有限公司 Ghost detection method and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5986705A (en) * 1997-02-18 1999-11-16 Matsushita Electric Industrial Co., Ltd. Exposure control system controlling a solid state image sensing device
US20080204564A1 (en) * 2007-02-22 2008-08-28 Matsushita Electric Industrial Co., Ltd. Image pickup apparatus and lens barrel
CN101510960A (en) * 2009-03-26 2009-08-19 北京中星微电子有限公司 Mobile phone camera shooting method and apparatus
CN101873437A (en) * 2009-09-15 2010-10-27 杭州海康威视系统技术有限公司 Method and device for regulating exposure
CN103634513A (en) * 2012-08-20 2014-03-12 佳能株式会社 Image processing apparatus and control method thereof
CN103702015A (en) * 2013-12-20 2014-04-02 华南理工大学 Exposure control method for human face image acquisition system under near-infrared condition

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5395293B1 (en) * 2012-05-24 2014-01-22 パナソニック株式会社 Information communication method and information communication apparatus
CN105827964B (en) * 2016-03-24 2019-05-17 维沃移动通信有限公司 An image processing method and mobile terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5986705A (en) * 1997-02-18 1999-11-16 Matsushita Electric Industrial Co., Ltd. Exposure control system controlling a solid state image sensing device
US20080204564A1 (en) * 2007-02-22 2008-08-28 Matsushita Electric Industrial Co., Ltd. Image pickup apparatus and lens barrel
CN101510960A (en) * 2009-03-26 2009-08-19 北京中星微电子有限公司 Mobile phone camera shooting method and apparatus
CN101873437A (en) * 2009-09-15 2010-10-27 杭州海康威视系统技术有限公司 Method and device for regulating exposure
CN103634513A (en) * 2012-08-20 2014-03-12 佳能株式会社 Image processing apparatus and control method thereof
CN103702015A (en) * 2013-12-20 2014-04-02 华南理工大学 Exposure control method for human face image acquisition system under near-infrared condition

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110619593A (en) * 2019-07-30 2019-12-27 西安电子科技大学 Double-exposure video imaging system based on dynamic scene
CN110619593B (en) * 2019-07-30 2023-07-04 西安电子科技大学 Double-exposure video imaging system based on dynamic scene
CN110519584A (en) * 2019-08-08 2019-11-29 深圳市圆周率软件科技有限责任公司 A kind of device for testing the picture pick-up device time for exposure
TWI727497B (en) * 2019-11-11 2021-05-11 瑞昱半導體股份有限公司 Image processing method based on sensor characteristics
CN112819699A (en) * 2019-11-15 2021-05-18 北京金山云网络技术有限公司 Video processing method and device and electronic equipment
CN113055580B (en) * 2019-12-26 2023-10-03 中兴通讯股份有限公司 Environment recognition method, shooting mode switching method, terminal and storage medium
CN113055580A (en) * 2019-12-26 2021-06-29 中兴通讯股份有限公司 Environment recognition method, shooting mode switching method, terminal and storage medium
CN111091498B (en) * 2019-12-31 2023-06-23 联想(北京)有限公司 Image processing method, device, electronic equipment and medium
CN111091498A (en) * 2019-12-31 2020-05-01 联想(北京)有限公司 Image processing method, image processing apparatus, electronic device, and medium
WO2021160001A1 (en) * 2020-02-14 2021-08-19 华为技术有限公司 Image acquisition method and device
US12387451B2 (en) 2020-02-14 2025-08-12 Huawei Technologies Co., Ltd. Image obtaining method and apparatus
CN111275653B (en) * 2020-02-28 2023-09-26 北京小米松果电子有限公司 Image denoising method and device
CN111275653A (en) * 2020-02-28 2020-06-12 北京松果电子有限公司 Image denoising method and device
WO2021179223A1 (en) * 2020-03-11 2021-09-16 深圳市大疆创新科技有限公司 Infrared image processing method and processing device, and unmanned aerial vehicle and storage medium
CN112215875A (en) * 2020-09-04 2021-01-12 北京迈格威科技有限公司 Image processing method, device and electronic system
CN114338956A (en) * 2020-09-30 2022-04-12 北京小米移动软件有限公司 Image processing method, image processing device and storage medium
CN114693723A (en) * 2020-12-30 2022-07-01 中兴通讯股份有限公司 Image fusion method, terminal and storage medium
CN112785537A (en) * 2021-01-21 2021-05-11 北京小米松果电子有限公司 Image processing method, device and storage medium
CN115225823A (en) * 2021-04-16 2022-10-21 成都鼎桥通信技术有限公司 Image acquisition method and device
CN113379615A (en) * 2021-04-25 2021-09-10 北京迈格威科技有限公司 Image processing method and device, storage medium and electronic equipment
CN113766150A (en) * 2021-08-31 2021-12-07 北京安酷智芯科技有限公司 Noise reduction method, circuit system, electronic equipment and computer readable storage medium
CN113766150B (en) * 2021-08-31 2024-03-26 北京安酷智芯科技有限公司 Noise reduction method, circuit system, electronic equipment and computer readable storage medium
CN116233625A (en) * 2021-12-01 2023-06-06 荣耀终端有限公司 A kind of image processing method, electronic equipment and chip
CN114302068A (en) * 2022-01-06 2022-04-08 重庆紫光华山智安科技有限公司 Image shooting method and device
CN114302068B (en) * 2022-01-06 2023-09-26 重庆紫光华山智安科技有限公司 Image shooting method and device
CN114630050A (en) * 2022-03-25 2022-06-14 展讯半导体(南京)有限公司 Photographing method, device, medium and terminal equipment
CN114827386A (en) * 2022-03-31 2022-07-29 艾酷软件技术(上海)有限公司 Video image processing method and device
CN115278069A (en) * 2022-07-22 2022-11-01 北京紫光展锐通信技术有限公司 Image processing method and device, computer readable storage medium and terminal
CN115988329A (en) * 2022-12-30 2023-04-18 南京图格医疗科技有限公司 HDR image generation method and system based on multi-sensor imaging equipment
WO2024239792A1 (en) * 2023-05-23 2024-11-28 荣耀终端有限公司 Motion snapshot method and electronic device
CN119325018A (en) * 2024-12-19 2025-01-17 杭州海康威视数字技术股份有限公司 High frame rate camera and imaging method

Also Published As

Publication number Publication date
CN110121882A (en) 2019-08-13
CN110121882B (en) 2020-09-08

Similar Documents

Publication Publication Date Title
CN110121882B (en) An image processing method and device
KR102512889B1 (en) Image fusion processing module
US11562470B2 (en) Unified bracketing approach for imaging
CN109671106B (en) Image processing method, device and equipment
US8988529B2 (en) Target tracking apparatus, image tracking apparatus, methods of controlling operation of same, and digital camera
US10217200B2 (en) Joint video stabilization and rolling shutter correction on a generic platform
US10853927B2 (en) Image fusion architecture
US20180288311A1 (en) Combining images when a face is present
US9007483B2 (en) Image synthesis device and computer program for image synthesis for synthesizing a plurality of images of different exposure times
CN113099122A (en) Shooting method, shooting device, shooting equipment and storage medium
CN112215875A (en) Image processing method, device and electronic system
US10121093B2 (en) System and method for background subtraction in video content
US20220044371A1 (en) Image Fusion Architecture
CN112422798A (en) Photographing method and device, electronic equipment and storage medium
JP2008053775A (en) Image processing method, program of image processing method, recording medium where program of image processing method is recorded, and image processing circuit
CN114286011B (en) Focusing method and device
CN113873160B (en) Image processing method, device, electronic equipment and computer storage medium
CN113489909B (en) Shooting parameter determining method and device and electronic equipment
CN113747067A (en) Photographing method and device, electronic equipment and storage medium
CN112367465A (en) Image output method and device and electronic equipment
CN112367464A (en) Image output method and device and electronic equipment
CN114093005B (en) Image processing method, device, electronic equipment and readable storage medium
CN115134532A (en) Image processing method, image processing device, storage medium and electronic equipment
US20220044372A1 (en) Image Fusion Architecture with Multimode Operations
US20230368343A1 (en) Global motion detection-based image parameter control

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: 17928271

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17928271

Country of ref document: EP

Kind code of ref document: A1