WO2017114399A1 - 逆光拍照方法和装置 - Google Patents

逆光拍照方法和装置 Download PDF

Info

Publication number
WO2017114399A1
WO2017114399A1 PCT/CN2016/112483 CN2016112483W WO2017114399A1 WO 2017114399 A1 WO2017114399 A1 WO 2017114399A1 CN 2016112483 W CN2016112483 W CN 2016112483W WO 2017114399 A1 WO2017114399 A1 WO 2017114399A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target area
head
area
pixel
Prior art date
Application number
PCT/CN2016/112483
Other languages
English (en)
French (fr)
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 华为技术有限公司
Publication of WO2017114399A1 publication Critical patent/WO2017114399A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time

Definitions

  • the present invention relates to the field of information technology, and in particular, to a method and apparatus for photographing backlights.
  • the light receiving surface of the object is smaller than the backlight surface, so that the light ratio between the light receiving surface and the backlight surface of the object is large, and the contrast is strong.
  • the invention provides a method and a device for photographing back light, which can automatically capture an image with a clear portrait area in a backlight scene, and does not cause a phenomenon that a face is blacked out due to insufficient exposure of a person.
  • the present invention provides a backlight photographing method, including: detecting whether a photographing scene is a backlight photographing; if the photographing scene is a backlit photographing, using head and shoulder detection to determine a head and shoulder region corresponding to the portrait in the photographing target in the photographing scene. Size; according to the size of the head and shoulder area to determine the distance of the portrait from the camera, according to the distance automatically focus to the head and shoulder area in the portrait, shooting to obtain the first image.
  • the head and shoulder detection can effectively detect the head and shoulder areas of the portrait in the backlight scene, and the image of the portrait area can be automatically captured in the backlight scene, and the phenomenon that the face is blacked out due to insufficient exposure of the person does not occur.
  • the terminal performs quality assessment analysis on the target area of the image, sets the shooting parameters optimally presented to the target area according to the target area, acquires the second best image of the target area with the adjusted parameters, and fuses the second image to the first image.
  • the final captured image when a person's photo is taken in a backlight scene, there is no shortage of the person's exposure, and it is not necessary to manually adjust the shooting parameters, and the person's photo with good quality effect can be automatically captured.
  • the head and shoulder detection is used to determine the background area of the shooting on the first image; and the pixels of the background area and the preset pixel are performed. If the pixel of the target area is smaller than the preset pixel, and the pixel of the background area is smaller than the preset pixel, the exposure adjustment parameter is determined according to the target area and the background area.
  • the terminal performs quality assessment analysis on the target area and the background area of the image respectively, and sets the shooting parameters that best represent the target area and the background area according to the target area and the background area, and obtains the best target area and background area with the adjusted parameters.
  • the second image is fused to the first image as the final captured image, so that when the person photograph is taken in the backlight scene, the person is not underexposed, and the shooting parameters can be automatically adjusted without manual adjustment. A photo of a person with good quality.
  • the exposure adjustment parameter of the target area is determined according to the target area
  • the exposure adjustment parameter of the background area is determined according to the background area.
  • the shooting parameter optimally presented to the target area is set according to the background area, and the optimal image of the target area is obtained according to the background area, and the second image with the best target area and the background area is obtained by the adjusted parameter, so that the terminal according to the target is realized.
  • the area and background area automatically set the shooting parameters and capture the best image for the target area and background area.
  • the terminal can capture the image with the best quality without adjusting the configuration shooting parameters.
  • the present invention provides a backlighting photographing apparatus, comprising: a backlight detecting module, configured to detect whether a photographing scene is a backlight photographing; and a head and shoulder area determining module, configured to determine whether the photographing scene is backlit photographing, using head and shoulder detection The size of the head and shoulder area corresponding to the portrait in the shooting target in the photographing scene; the first obtaining module is configured to determine the distance of the portrait from the camera according to the size of the head and shoulder area, and automatically focus on the head and shoulder area in the portrait according to the distance, and obtain the photographing and acquiring The first image.
  • the back-lighting device can effectively detect the head-shoulder area of the portrait in the backlight scene by using the head-shoulder detection, and can automatically capture the image of the portrait area in the backlight scene without the phenomenon that the face is black-faced due to insufficient exposure of the person. .
  • the present invention provides a terminal, including: a memory, a processor, and a camera.
  • the memory is used to store execution instructions, the processor and the memory communicate, and the processor invokes execution instructions for detecting whether the photographed scene is photographed by backlighting; if the photographing scene is photographed by backlighting, the head and shoulder detection is used to determine the shooting target under the photographing scene.
  • the size of the head and shoulder area corresponding to the middle portrait; the camera is used to determine the distance of the portrait from the camera according to the size of the head and shoulder area, and automatically focus on the head and shoulder area in the portrait according to the distance, and capture the first image.
  • the terminal can effectively detect the head and shoulder areas of the portrait in the backlight scene, and can automatically capture the image of the portrait area in the backlight scene without the phenomenon that the face is blacked out due to insufficient exposure of the person.
  • the back light photographing method and device provided by the present invention detect whether the photographing scene is photographed by backlighting, and if the photographing scene is photographed by backlighting, the head and shoulders detection is used to determine the size of the head and shoulder region corresponding to the portrait in the photographing target under the photographing scene, according to the head.
  • the size of the shoulder area determines the distance of the portrait from the camera, automatically focuses on the head and shoulder areas in the portrait according to the distance, captures the first image, and uses the head and shoulder detection to effectively detect the head and shoulder areas of the portrait in the backlight scene, which can be automatically In the backlight scene, a clear image of the portrait area is taken, and there is no phenomenon that the face is blacked out due to insufficient exposure of the person.
  • Embodiment 1 is a flowchart of a method for photographing backlights according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for photographing backlights according to Embodiment 2 of the present invention
  • Embodiment 3 is a flowchart of a method for photographing backlights according to Embodiment 3 of the present invention.
  • FIG. 4 is a schematic structural diagram of a backlighting camera device according to Embodiment 1 of the present invention.
  • FIG. 5 is a schematic structural diagram of a backlighting camera device according to Embodiment 2 of the present invention.
  • FIG. 6 is a schematic structural diagram of a backlighting camera device according to Embodiment 3 of the present invention.
  • FIG. 7 is a schematic structural diagram of a terminal according to Embodiment 1 of the present invention.
  • FIG. 8 is a schematic structural diagram of a terminal according to Embodiment 2 of the present invention.
  • the contrast between the light-receiving surface and the backlight surface of the object is large, and the contrast is strong.
  • the image obtained based on the face detection is prone to underexposure of the person and presents a black face.
  • the technical solution provided by the invention can realize that when photographing a person's photograph in a backlight scene, it is not necessary to manually adjust the photographing parameter, and the photograph of the person with good quality effect can be automatically photographed, and the situation that the person is underexposed is not present.
  • FIG. 1 is a flowchart of a method for photographing backlights according to Embodiment 1 of the present invention. As shown in FIG. 1 , the method for photographing backlights provided by the embodiment of the present invention includes:
  • the backlight photographing method in the embodiment of the present invention can be used in a terminal, for example, a mobile phone, a tablet computer, a notebook computer, and the like having a photographing function. It may also be a device having a photographing function, such as a digital camera, a video camera or the like.
  • the terminal judges the current shot based on the backlight detection technology Whether the photographed scene is a backlit scene to detect whether the current photograph is a backlit photograph.
  • the backlight detection technology may be, but is not limited to, determining whether the current photographing scene is backlit by the brightness value of the photographing target in the photographing scene, which is not limited and described herein.
  • the terminal performs head and shoulder detection on the portrait in the photographing target, and determines the size of the head and shoulder region corresponding to the portrait in the photographing target. Since the head and shoulders of the portrait are still clear in the backlight scene, the head and shoulder detection can effectively detect the head and shoulder areas of the portrait in the backlight scene, and determine the size of the head and shoulder area.
  • the head and shoulder detection target is to mark the head and shoulder area of the portrait (indicated by a rectangular frame) in the shooting target, and the head and shoulder detection can search in the shooting target in the form of a sliding window, and it is determined for each sliding window. Whether the head and shoulders are included in the window, and the size of the head and shoulder area included in the window is determined.
  • the terminal can detect the head and shoulder regions in the backlight scene by using the contour feature based head and shoulder detection for the portrait in the shooting target, for example, a Histogram of Oriented Gradient (HOG) feature, and can also be used.
  • HOG Histogram of Oriented Gradient
  • the header and shoulder detection in the backlit scene is detected by the fusion of the features of the Haar-like (HAAR) feature, the modified Census Transform (MCT) feature, and the HOG feature.
  • HAAR Haar-like
  • MCT modified Census Transform
  • HOG HOG feature
  • S103 Determine a distance of the portrait from the camera according to the size of the head and shoulder area, automatically focus on the head and shoulder area in the portrait according to the distance, and capture the first image.
  • the terminal automatically adjusts the focus based on the distance measurement between the camera and the shooting target, and the distance of the portrait determined by the size of the head and shoulder area is automatically focused on the head and shoulder area in the portrait, and the terminal passes the camera.
  • the first image is captured by the camera, and an image with a clear portrait area is automatically captured in the backlight scene.
  • the terminal through the camera may be, but is not limited to, capturing the first image by taking an automatic exposure mode.
  • the backlight photographing method detects whether the photographing scene is photographed by backlighting, and if the photographing scene is photographed by backlighting, the head and shoulders are used to determine the size of the head and shoulder area corresponding to the portrait in the photographing target under the photographing scene, according to the head.
  • the size of the shoulder area determines the distance of the portrait from the camera, and automatically focuses on the head and shoulder areas in the portrait according to the distance. For example, using the head and shoulder detection can effectively detect the head and shoulder areas of the portrait in the backlight scene, and it is possible to automatically capture a clear image of the portrait area in the backlight scene, without the phenomenon that the face is blacked out due to insufficient exposure of the person.
  • FIG. 2 is a flowchart of a method for photographing backlights according to Embodiment 2 of the present invention. As shown in FIG. 2, on the basis of the embodiment shown in FIG. 1, the backlight photographing method provided by the embodiment of the present invention further includes:
  • the terminal needs to evaluate the quality of the captured first image, and determine whether the captured first image is the best quality image, so that the terminal is based on the head and shoulders in the backlight scene. Detecting the captured image is the best image.
  • the terminal performs quality assessment analysis on the target area of the captured image, and the terminal performs head and shoulder detection on the captured first image to determine the target area of the shooting.
  • the terminal performs head and shoulder detection on the first image, and uses the detected head and shoulder area as the target area.
  • the method for performing quality evaluation on the target area of the captured image is performed by comparing the pixels of the target area with the preset pixels, and if the pixels of the target area are greater than or equal to the preset pixels, the image quality evaluation is performed.
  • the terminal uses the first image as the final captured image; if the pixel of the target area is smaller than the preset pixel, the image quality evaluation does not pass, and the terminal automatically adjusts the exposure parameter according to the pixel of the target area.
  • preset pixels in the embodiment of the present invention are determined according to the illumination conditions in the shooting scene, and the embodiments of the present invention are not limited and described herein.
  • the terminal analyzes the pixels of the target area, and evaluates camera parameters that are optimal for the target area, such as flash parameters and exposure parameters.
  • S204 Adjust the shooting parameter according to the exposure adjustment parameter, and acquire the second image according to the adjusted shooting parameter.
  • the terminal re-shoots and acquires the second image of the protruding target area according to the adjusted shooting parameters.
  • the terminal performs quality assessment analysis on the target area of the image, according to the target area.
  • the shooting parameters that are optimally presented in the target area are set, and the adjusted second parameter is used to obtain the best second image of the target area, so that the terminal automatically sets the shooting parameters according to the target area.
  • the terminal fuses the captured second image of the protruding target area to the first image by using an image fusion algorithm, that is, replacing the target area in the first image by image fusion with the target area in the re-captured image, as a final
  • an image fusion algorithm that is, replacing the target area in the first image by image fusion with the target area in the re-captured image
  • the backlight photographing method uses the head and shoulder detection on the first image to determine the target area to be photographed, and compares the pixels of the target area with the preset pixels, if the target area is When the pixel is smaller than the preset pixel, the exposure adjustment parameter is determined according to the target area, the shooting parameter is adjusted according to the exposure adjustment parameter, the second image is acquired according to the adjusted shooting parameter, and the second image is fused to the first image as the final captured image.
  • the terminal performs quality assessment analysis on the target area of the image, sets the shooting parameters optimally presented to the target area according to the target area, acquires the second best image of the target area with the adjusted parameters, and fuses the second image to the first image.
  • the final captured image when a person's photo is taken in a backlight scene, there is no shortage of the person's exposure, and it is not necessary to manually adjust the shooting parameters, and the person's photo with good quality effect can be automatically captured.
  • FIG. 3 is a flowchart of a method for photographing backlights according to Embodiment 3 of the present invention. As shown in FIG. 3, the method for photographing the backlight according to the embodiment of the present invention includes:
  • S301 Detect whether the photographing scene is a backlight photograph. If it is detected that the photographing scene is photographed by backlighting, S303 is performed; otherwise, S302 is performed.
  • the terminal normally photographs according to the photographing mode in the normal scene, for example,
  • the normal shooting may be, but is not limited to, a face detection shooting, which is not limited and described herein.
  • S303 Using head and shoulder detection to determine a head and shoulder area corresponding to a portrait in a shooting target in a photographing scene The size of the domain.
  • S304 Determine the distance of the portrait from the camera according to the size of the head and shoulder area, automatically focus on the head and shoulder area in the portrait according to the distance, and take a first image.
  • S305 Determine the target area and the background area of the shooting by using the head and shoulder detection on the first image.
  • the terminal needs to evaluate the quality of the captured first image, and determine whether the captured first image is the best quality image, so that the terminal is based on the head and shoulders in the backlight scene. Detecting the captured image is the best image.
  • the terminal performs quality assessment analysis on the target area and the background area of the captured image, and the terminal performs head and shoulder detection on the captured first image to determine the target area and the background area of the shooting.
  • the terminal performs head and shoulder detection on the first image, uses the detected head and shoulder area as the target area, and uses the area other than the head and shoulder as the background area.
  • S306 Compare pixels of the target area and pixels of the background area with preset pixels. If the pixel of the target area is smaller than the preset pixel, and the pixel of the background area is smaller than the preset pixel, S308 is performed; if the pixel of the target area is greater than or equal to the preset pixel, S307 is performed.
  • the method for performing quality evaluation on the target area and the background area of the captured image is performed by comparing pixels of the target area and pixels of the background area with preset pixels, respectively, if the pixel of the target area is greater than or Equal to the preset pixel, the image quality is evaluated, and the terminal uses the first image as the final captured image; otherwise, the image quality evaluation fails, and the terminal automatically adjusts the exposure parameter according to the pixel of the target area and the pixel of the background area.
  • the preset pixels that are compared with the pixels of the target area and the pixels of the background area may be the same preset pixel, that is, the pixels of the target area and the pixels of the background area are respectively the same preset.
  • the pixel is compared; the pixel of the target area is compared with a preset pixel, and the pixel of the background area is compared with another preset pixel, which is not performed in this embodiment of the present invention.
  • the preset pixels in the embodiment of the present invention are determined according to the illumination conditions in the shooting scene, and the embodiments of the present invention are not limited herein. Said.
  • the terminal may determine that the image quality evaluation passes, and the terminal uses the first image as the final captured image. By evaluating the target area of the first image, the terminal can capture the image with the best quality without adjusting the configuration shooting parameters.
  • S308 Determine an exposure adjustment parameter according to the target area and the background area.
  • the terminal separately analyzes the pixel of the target area and the pixel of the background area, respectively, and respectively measures the shooting effect on the target area and the background area.
  • the best camera parameters such as flash parameters and exposure parameters.
  • the exposure adjustment parameters are determined according to the target area and the background area, including:
  • the exposure adjustment parameter of the target area is determined according to the target area, and the exposure adjustment parameter of the background area is determined according to the background area.
  • S309 Adjust the shooting parameter according to the exposure adjustment parameter, and acquire the second image according to the adjusted shooting parameter.
  • the terminal re-shoots the second image that is optimal for acquiring the target area and the background area according to the adjusted shooting parameters.
  • the terminal performs quality assessment analysis on the target area and the background area of the image, sets the shooting parameters optimally presented to the target area according to the target area, sets the shooting parameters optimally presented to the background area according to the background area, and acquires the target with the adjusted parameters.
  • the best second image of the area and the background area enables the terminal to automatically set the shooting parameters according to the target area and the background area, and capture the best image of the target area and the background area.
  • the terminal fuses the captured second image of the target area and the background area to the first image by using an image fusion algorithm, that is, replacing the target area in the first image by image fusion with the target area in the re-captured image.
  • an image fusion algorithm that is, replacing the target area in the first image by image fusion with the target area in the re-captured image.
  • the backlight photographing method detects whether the photographing scene is photographed by backlighting. If the photographing scene is photographed by backlighting, the head and shoulders are used to determine the size of the head and shoulder area corresponding to the portrait, and the portrait is determined according to the size of the head and shoulder area.
  • the distance of the camera automatically focuses on the head and shoulder areas in the portrait according to the distance, and captures the first image.
  • the head and shoulder detection can effectively detect the head and shoulder areas of the portrait in the backlight scene, and the portrait area can be automatically captured in the backlight scene. Clear images, there will be no phenomenon that the face is underexposed and the face is black.
  • the terminal performs quality assessment analysis on the target area and the background area of the image separately, sets the shooting parameters optimally presented to the target area according to the target area, and sets the shooting parameters optimally presented to the background area according to the background area, with the adjusted
  • the parameter acquires the best second image of the target area and the background area, and fuses the second image to the first image as the final captured image, so that when the person photograph is taken in the backlight scene, the person is not underexposed, and there is no need Manually adjust the shooting parameters to automatically take pictures of people with good quality results.
  • FIG. 4 is a schematic structural diagram of a backlighting photographing apparatus according to Embodiment 1 of the present invention.
  • the backlighting device of the present invention includes a backlight detecting module 401, a head and shoulder area determining module 402, and a first acquiring module 403.
  • the backlight detection module 401 is configured to detect whether the photographing scene is a backlight photograph.
  • the head and shoulder area determining module 402 is configured to determine the size of the head and shoulder area corresponding to the portrait in the shooting target under the photographing scene if the photographing scene is backlit photographing.
  • the first obtaining module 403 is configured to determine a distance of the portrait from the camera according to the size of the head and shoulder area, automatically focus on the head and shoulder area in the portrait according to the distance, and capture and acquire the first image.
  • the backlighting device provided by the embodiment of the present invention is used to implement the technical solution of the method embodiment shown in FIG. 1 , and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • FIG. 5 is a schematic structural diagram of a backlighting camera device according to Embodiment 2 of the present invention.
  • the backlighting camera device provided by the embodiment of the present invention further includes: a target area determining module 404, a target area comparing module 405, a first adjusting module 406, and a first The second acquisition module 407 and the first imaging module 408.
  • the target area determining module 404 is configured to determine the target area of the shot using the head and shoulder detection on the first image.
  • the target area comparison module 405 is configured to compare pixels of the target area with preset pixels Correct.
  • the first adjustment module 406 is configured to determine an exposure adjustment parameter according to the target area if the pixel of the target area is smaller than the preset pixel.
  • the second obtaining module 407 is configured to adjust the shooting parameter according to the exposure adjustment parameter, and acquire the second image according to the adjusted shooting parameter.
  • the first shooting module 408 is configured to fuse the second image to the first image as a final captured image.
  • the backlighting device provided by the embodiment of the present invention is used to implement the technical solution of the method embodiment shown in FIG. 2, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • FIG. 6 is a schematic structural diagram of a backlighting camera device according to Embodiment 3 of the present invention. As shown in FIG. 6, on the basis of the embodiment shown in FIG. 4 and FIG. 5, the backlighting device of the present invention further includes: a background area determining module 409, a background area comparing module 410, and a second adjusting module. 411 and second shooting module 412.
  • the background area determining module 409 is configured to determine the background area of the shot using the head and shoulder detection on the first image.
  • the background area comparison module 410 is configured to compare pixels of the background area with preset pixels.
  • the second adjustment module 411 is configured to determine an exposure adjustment parameter according to the target area and the background area, if the pixel of the target area is smaller than the preset pixel, and the pixel of the background area is smaller than the preset pixel.
  • the second adjusting module 411 is specifically configured to: determine an exposure adjustment parameter of the target area according to the target area, and determine an exposure adjustment parameter of the background area according to the background area.
  • the second shooting module 412 is configured to use the first image as the final captured image if the pixel of the target area is greater than or equal to the preset pixel.
  • the backlighting device provided by the embodiment of the present invention is used to implement the technical solution of the method embodiment shown in FIG. 3, and the implementation principle and technical effects thereof are similar, and details are not described herein again.
  • FIG. 7 is a schematic structural diagram of a terminal according to Embodiment 1 of the present invention.
  • the terminal provided by the embodiment of the present invention includes: a memory 71, a processor 72, and a camera 73.
  • the terminal in the embodiment of the present invention can be used as a backlighting camera.
  • the memory 71 is for storing execution instructions
  • the processor 72 can be a central processor (Central) A processing unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits that implement embodiments of the present invention.
  • CPU central processor
  • ASIC Application Specific Integrated Circuit
  • the head and shoulders detection is used to determine the size of the head and shoulder area corresponding to the portrait in the photographing target under the photographing scene.
  • the camera 73 is configured to determine the distance of the portrait from the camera according to the size of the head and shoulder area, automatically focus on the head and shoulder area in the portrait according to the distance, and capture and acquire the first image.
  • the processor 72 is further configured to perform the following operations:
  • the head and shoulder detection is used to determine the target area of the shot on the first image; the pixels of the target area are compared with the preset pixels; if the pixels of the target area are smaller than the preset pixels, the exposure adjustment parameter is determined according to the target area.
  • the camera 73 is further configured to adjust the shooting parameter according to the exposure adjustment parameter, acquire the second image according to the adjusted shooting parameter, and fuse the second image to the first image as the final captured image.
  • the processor 72 is further configured to perform the following operations:
  • the processor 72 is further configured to perform the following operations:
  • the exposure adjustment parameter of the target area is determined according to the target area, and the exposure adjustment parameter of the background area is determined according to the background area.
  • the camera 73 is further configured to use the first image as the final captured image if the pixel of the target area is greater than or equal to the preset pixel.
  • FIG. 8 is a schematic structural diagram of a terminal according to Embodiment 2 of the present invention.
  • the terminal 100 can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), or an in-vehicle computer.
  • the terminal 100 provided by the embodiment of the present invention includes: a memory 120, a processor 160, and an input unit 130.
  • the memory 120 stores various types of data to support operations at the terminal 100. Examples of such data include instructions for any application or method operating on terminal 100, the deposit
  • the memory 120 may be one of NVRAM nonvolatile memory, DRAM dynamic random access memory, SRAM static random access memory, Flash flash memory, etc.; the memory 120 may also be a hard disk, an optical disk, a USB disk, a floppy disk or a tape drive, etc.;
  • the 160 is used to detect whether the photographing scene is a backlight photographing. If the photographing scene is backlit photographing, the head and shoulders detection is used to determine the size of the head and shoulder area corresponding to the portrait in the photographing target under the photographing scene.
  • the processor 160 is a control center of the terminal 100, and connects various parts of the entire mobile phone by using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 120, and calling storage.
  • the data in the memory 120 performs various functions and processing data of the terminal 100, thereby performing overall monitoring of the terminal 100.
  • the processor 160 can include one or more processing units.
  • the processor 160 communicates with the memory 120, which calls the execution instructions in the memory 120 for performing the operations in the above method embodiments.
  • the input unit 130 can be a camera.
  • the distance between the portrait and the camera is determined according to the size of the head and shoulder area, and the head and shoulder areas in the portrait are automatically focused according to the distance, and the first image is captured.
  • the terminal 100 may further include a display unit 140, which may be used to display the first image captured by the input unit 130.
  • the display unit 140 may include a display panel 141.
  • the display panel 141 may be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
  • the terminal 100 may further include an RF circuit 110, an audio circuit 170, a WIFI module 180, and a power supply 190.
  • a radio frequency (RF) circuit 110 can receive and/or transmit signals for the terminal 100.
  • the audio circuit 170 can output and/or input an audio signal to the terminal 100.
  • the WIreless-Fidelity (WIFI) module 180 can be used as a communication unit for communication between the terminal 100 and other devices, and the terminal 100 can access a wireless network based on a communication standard.
  • Power source 190 can be used to provide power to various modules and/or units of terminal 100.

Abstract

本发明提供一种逆光拍照方法和装置,该方法包括:检测拍照场景是否是逆光拍照;若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小;根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。本发明提供的逆光拍照方法和装置,使用头肩检测能够有效检测出逆光场景下人像的头肩区域,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。

Description

逆光拍照方法和装置 技术领域
本发明涉及信息技术领域,尤其涉及一种逆光拍照方法和装置。
背景技术
随着照相机和终端尤其是智能拍摄终端拍摄技术的提高,人们对拍摄的图像质量要求越来越高,尤其是在逆光场景下拍摄时。其中,在逆光的场景下进行拍摄时,被拍摄物体受光面小于背光面,使得被拍摄物体受光面与背光面的光比大,反差强烈。
目前,基于人脸检测的自动对焦在照相机和终端上广泛使用,拍摄时对被拍摄物进行人脸检测,根据图像中人脸的大小确定被拍摄物离摄像头的距离,从而自动对焦,获取图像。然而,在逆光场景下拍摄时,基于人脸检测获取的图像中人脸区域的背光面较大时,人脸与周围环境的被拍摄物体相比较暗,使得拍摄得到的图像中人脸的肤色偏暗,呈现出黑脸的效果,使得无法从获取的图像中提取特征,从而无法根据人脸区域自动对焦,导致拍摄的图像模糊、质量不高。
发明内容
本发明提供一种逆光拍照方法和装置,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。
第一方面,本发明提供一种逆光拍照方法,包括:检测拍照场景是否是逆光拍照;若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小;根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。使用头肩检测能够有效检测出逆光场景下人像的头肩区域,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。
结合第一方面,在第一方面第一种可能的实现方式中,拍摄获取第一图像之后,在第一图像上使用头肩检测确定拍摄的目标区域;将目标区域的像素与预设像素进行比对;若目标区域的像素小于预设像素,则根据目标区域确定曝光调整参数;根据曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像;将第二图像融合到第一图像作为最终的拍摄图像。终端通过对图像的目标区域进行质量评估分析,根据目标区域设置对目标区域最佳呈现的拍摄参数,用调整后的参数获取目标区域最佳的第二图像,将第二图像融合到第一图像作为最终的拍摄图像,实现在逆光场景下拍摄人物照片时,不会出现人物曝光不足的情况,且无需手动调整拍摄参数,能够自动拍摄出质量效果佳的人物照片。
结合第一方面第一种可能的实现方式,在第一方面第二种可能的实现方式中,在第一图像上使用头肩检测确定拍摄的背景区域;将背景区域的像素与预设像素进行比对;若目标区域的像素小于预设像素,且背景区域的像素小于预设像素,则根据目标区域和背景区域确定曝光调整参数。终端通过分别对图像的目标区域和背景区域进行质量评估分析,根据目标区域和背景区域分别设置对目标区域和背景区域最佳呈现的拍摄参数,用调整后的参数获取目标区域和背景区域最佳的第二图像,将第二图像融合到第一图像作为最终的拍摄图像,实现在逆光场景下拍摄人物照片时,不会出现人物曝光不足的情况,且无需手动调整拍摄参数,能够自动拍摄出质量效果佳的人物照片。
结合第一方面第二种可能的实现方式,在第一方面第三种可能的实现方式中,根据目标区域确定目标区域的曝光调整参数,根据背景区域确定背景区域的曝光调整参数。根据目标区域设置对目标区域最佳呈现的拍摄参数,根据背景区域设置对背景区域最佳呈现的拍摄参数,用调整后的参数获取目标区域和背景区域最佳的第二图像,实现终端根据目标区域和背景区域自动设置拍摄参数,拍摄获取目标区域和背景区域最佳的图像。
结合第一方面第一种可能的实现方式至第一方面第三种可能的实现方式,在第一方面第四种可能的实现方式中,若目标区域的像素大于或 等于预设像素,则将第一图像作为最终的拍摄图像。终端通过对第一图像的目标区域进行评估,无需调整配置拍摄参数,即可拍摄获取质量最佳的图像。
第二方面,本发明提供一种逆光拍照装置,包括:逆光检测模块,用于检测拍照场景是否是逆光拍照;头肩区域确定模块,用于若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小;第一获取模块,用于根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。逆光拍照装置通过使用头肩检测能够有效检测出逆光场景下人像的头肩区域,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。
第三方面,本发明提供一种终端,包括:存储器、处理器和摄像头。存储器用于存储执行指令,处理器与存储器之间通信,处理器调用执行指令,用于检测拍照场景是否是逆光拍照;若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小;摄像头用于根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。终端通过使用头肩检测能够有效检测出逆光场景下人像的头肩区域,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。
本发明提供的逆光拍照方法和装置,通过检测拍照场景是否是逆光拍照,若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小,根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像,使用头肩检测能够有效检测出逆光场景下人像的头肩区域,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将 对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例一提供的逆光拍照方法流程图;
图2为本发明实施例二提供的逆光拍照方法流程图;
图3为本发明实施例三提供的逆光拍照方法流程图;
图4为本发明实施例一提供的逆光拍照装置结构示意图;
图5为本发明实施例二提供的逆光拍照装置结构示意图;
图6为本发明实施例三提供的逆光拍照装置结构示意图;
图7为本发明实施例一提供的终端结构示意图;
图8为本发明实施例二提供的终端结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
在逆光场景下拍摄人物照片时,由于被拍摄物体受光面与背光面的光比大,反差强烈,基于人脸检测获取的图像容易出现人物曝光不足,呈现出人脸黑脸的现象。本发明提供的技术方案,可以实现在逆光场景下拍摄人物照片时,无需手动调整拍摄参数,能够自动拍摄出质量效果佳的人物照片,且不会出现人物曝光不足的情况。
图1为本发明实施例一提供的逆光拍照方法流程图。如图1所示,本发明实施例提供的逆光拍照方法,包括:
S101:检测拍照场景是否是逆光拍照。
具体的,本发明实施例中的逆光拍照方法可以用于终端中,例如,具有拍照功能的手机、平板电脑和笔记本电脑等。也可以是具有拍照功能的其设备,例如,数字相机、摄像机等。终端基于逆光检测技术判断当前拍 照的拍照场景是否为逆光场景,以检测当前拍照是否是逆光拍照。其中,逆光检测技术可以是但不限于通过拍照场景下拍摄目标的亮度值确定当前拍照场景是否逆光,本发明实施例在此不进行限定和赘述。
S102:若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小。
具体的,若拍照场景是逆光拍照,且拍照场景下的拍摄目标中包括人像,则终端对拍摄目标中的人像进行头肩检测,确定拍摄目标中的人像对应的头肩区域的大小。由于在逆光场景中,人像的头肩轮廓依然清晰,使用头肩检测能够有效检测出逆光场景下人像的头肩区域,确定出头肩区域的大小。其中,头肩检测的目标是将人像的头肩区域(以矩形框标示)在拍摄目标中标示出来,头肩检测可以以滑动窗口的形式在拍摄目标中进行搜索,对于每一个滑动窗口判断该窗口内是否包括头肩,以及确定该窗口内包括的头肩区域的大小。
需要说明的是,终端对拍摄目标中的人像可以使用基于轮廓特征的头肩检测检测出逆光场景下的头肩区域,例如方向梯度直方图(Histogram of Oriented Gradient,简称HOG)特征,也可以使用矩形(Haar-like,简称HAAR)特征、统计变化(Modified Census Transform,简称MCT)特征和HOG特征等特征的融合的头肩检测检测出逆光场景下的头肩检测,本发明实施例在此不进行限定和赘述。
S103:根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。
具体的,本发明实施例中终端基于摄像头与拍摄目标之间距离测量的测距自动对焦,根据头肩区域的大小确定的人像离摄像头的距离自动对焦到人像中的头肩区域,终端通过摄像头拍摄获取第一图像,实现自动在逆光场景下拍摄出人像区域清晰的图像。其中,终端通过摄像头可以是但不限于按自动曝光方式拍摄获取第一图像。
本发明实施例提供的逆光拍照方法,通过检测拍照场景是否是逆光拍照,若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小,根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图 像,使用头肩检测能够有效检测出逆光场景下人像的头肩区域,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。
图2为本发明实施例二提供的逆光拍照方法流程图。如图2所示,在图1所示实施例的基础上,本发明实施例提供的逆光拍照方法,在S103之后还包括:
S201:在第一图像上使用头肩检测确定拍摄的目标区域。
具体的,在拍摄获取第一图像后,终端需要对拍摄获取的第一图像的质量进行评估,确定拍摄获取的第一图像是否是质量最佳的图像,以实现终端在逆光场景下基于头肩检测拍摄出来的图像是最佳的图像。本发明实施例中,终端通过对拍摄的图像的目标区域进行质量评估分析,终端在拍摄获取的第一图像上进行头肩检测,确定拍摄的目标区域。其中,终端在第一图像上进行头肩检测,将检测到的头肩区域作为目标区域。
S202:将目标区域的像素与预设像素进行比对。
具体的,本发明实施对拍摄的图像的目标区域进行质量评估分析的方式是通过将目标区域的像素与预设像素进行比对,若目标区域的像素大于或等于预设像素,则图像质量评估通过,终端将第一图像作为最终的拍摄图像;若目标区域的像素小于预设像素,则图像质量评估没有通过,终端根据目标区域的像素自动调整曝光参数。
需要说明的是,本发明实施例中的预设像素根据拍摄场景下的光照情况而定,本发明实施例在此不进行限定和赘述。
S203:若目标区域的像素小于预设像素,则根据目标区域确定曝光调整参数。
具体的,若目标区域的像素小于预设像素,则终端对目标区域的像素进行分析,评测出对目标区域拍摄效果最佳的相机参数,例如闪光灯参数和曝光参数等。
S204:根据曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像。
具体的,终端根据调整后的拍摄参数重新拍摄获取突出目标区域的第二图像。终端通过对图像的目标区域进行质量评估分析,根据目标区域设 置对目标区域最佳呈现的拍摄参数,用调整后的参数获取目标区域最佳的第二图像,实现终端根据目标区域自动设置拍摄参数。
S205:将第二图像融合到第一图像作为最终的拍摄图像。
具体的,终端通过图像融合算法将拍摄的突出目标区域的第二图像融合到第一图像,也即,用重新拍摄图像中的目标区域通过图像融合替换第一图像中的目标区域,作为最终的拍摄图像,实现在逆光场景下拍摄人物照片时,不会出现人物曝光不足的情况,且无需手动调整拍摄参数,能够自动拍摄出质量效果佳的人物照片。
本发明实施例提供的逆光拍照方法,在上述实施例的基础上,在第一图像上使用头肩检测确定拍摄的目标区域,将目标区域的像素与预设像素进行比对,若目标区域的像素小于预设像素,则根据目标区域确定曝光调整参数,根据曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像,将第二图像融合到第一图像作为最终的拍摄图像。终端通过对图像的目标区域进行质量评估分析,根据目标区域设置对目标区域最佳呈现的拍摄参数,用调整后的参数获取目标区域最佳的第二图像,将第二图像融合到第一图像作为最终的拍摄图像,实现在逆光场景下拍摄人物照片时,不会出现人物曝光不足的情况,且无需手动调整拍摄参数,能够自动拍摄出质量效果佳的人物照片。
图3为本发明实施例三提供的逆光拍照方法流程图。如图3所示,本发明实施例提供的逆光拍照方法,包括:
S301:检测拍照场景是否是逆光拍照。若检测到拍照场景是逆光拍照,则执行S303;否则,执行S302。
需要说明的是,S301与S101的实现方式相同,详见S101的描述,此处不再赘述。
S302:正常拍摄。
具体的,若终端检测到拍照场景是非逆光拍照,或者是终端检测到拍照场景是逆光拍照,但逆光拍照场景的拍摄目标中不包括人像,则终端按正常场景下的拍照方式正常拍摄,例如,正常拍摄可以是但不限于是采用人脸检测拍摄,本发明实施例在此不进行限定和赘述。
S303:使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区 域的大小。
需要说明的是,S303与S102的实现方式相同,详见S102的描述,此处不再赘述。
S304:根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。
需要说明的是,S304与S103的实现方式相同,详见S103的描述,此处不再赘述。
S305:在第一图像上使用头肩检测确定拍摄的目标区域和背景区域。
具体的,在拍摄获取第一图像后,终端需要对拍摄获取的第一图像的质量进行评估,确定拍摄获取的第一图像是否是质量最佳的图像,以实现终端在逆光场景下基于头肩检测拍摄出来的图像是最佳的图像。本发明实施例中,终端通过对拍摄的图像的目标区域和背景区域进行质量评估分析,终端在拍摄获取的第一图像上进行头肩检测,确定拍摄的目标区域和背景区域。其中,终端在第一图像上进行头肩检测,将检测到的头肩区域作为目标区域,将头肩以外的区域作为背景区域。
S306:将目标区域的像素和背景区域的像素分别与预设像素进行比对。若目标区域的像素小于预设像素,且背景区域的像素小于预设像素,则执行S308;若目标区域的像素大于或等于预设像素,则执行S307。
具体的,本发明实施对拍摄的图像的目标区域和背景区域进行质量评估分析的方式是通过将目标区域的像素和背景区域的像素分别与预设像素进行比对,若目标区域的像素大于或等于预设像素,则图像质量评估通过,终端将第一图像作为最终的拍摄图像;否则,图像质量评估没有通过,终端根据目标区域的像素和背景区域的像素自动调整曝光参数。
需要说明的是,本发明实施例中与目标区域的像素和背景区域的像素比对的预设像素可以是同一个预设像素,即目标区域的像素和背景区域的像素分别与同一个预设像素进行比对;也可以是不同的预设像素,即目标区域的像素与一个预设像素进行比对,背景区域的像素与另一个预设像素进行比对,本发明实施例在此不进行限定和赘述。本发明实施例中的预设像素根据拍摄场景下的光照情况而定,本发明实施例在此不进行限定和赘 述。
S307:将第一图像作为最终的拍摄图像。
具体的,本发明实施例中,只要目标区域的像素大于预设像素时,终端即可确定图像质量评估通过,终端将第一图像作为最终的拍摄图像。终端通过对第一图像的目标区域进行评估,无需调整配置拍摄参数,即可拍摄获取质量最佳的图像。
S308:根据目标区域和背景区域确定曝光调整参数。
具体的,若目标区域的像素小于预设像素,且背景区域的像素小于预设像素时,终端分别对目标区域的像素和背景区域的像素进行分析,分别评测出对目标区域和背景区域拍摄效果最佳的相机参数,例如闪光灯参数和曝光参数等。
可选的,根据目标区域和背景区域确定曝光调整参数,包括:
根据目标区域确定目标区域的曝光调整参数,根据背景区域确定背景区域的曝光调整参数。
S309:根据曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像。
具体的,终端根据调整后的拍摄参数重新拍摄获取目标区域和背景区域最佳的第二图像。终端通过对图像的目标区域和背景区域进行质量评估分析,根据目标区域设置对目标区域最佳呈现的拍摄参数,根据背景区域设置对背景区域最佳呈现的拍摄参数,用调整后的参数获取目标区域和背景区域最佳的第二图像,实现终端根据目标区域和背景区域自动设置拍摄参数,拍摄获取目标区域和背景区域最佳的图像。
S310:将第二图像融合到第一图像作为最终的拍摄图像。
具体的,终端通过图像融合算法将拍摄的目标区域和背景区域最佳的第二图像融合到第一图像,也即,用重新拍摄图像中的目标区域通过图像融合替换第一图像中的目标区域,用重新拍摄图像中的背景区域通过图像融合替换第一图像中的背景区域,作为最终的拍摄图像,实现在逆光场景下拍摄人物照片时,不会出现人物曝光不足的情况,且无需手动调整拍摄参数,能够自动拍摄出质量效果佳的人物照片。同时,在逆光场景下拍摄人物照片时,不会出现人脸清晰后背景过度曝光的情况。
本发明实施例提供的逆光拍照方法,通过检测拍照场景是否是逆光拍照,若拍照场景是逆光拍照,则使用头肩检测确定人像对应的头肩区域的大小,根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像,使用头肩检测能够有效检测出逆光场景下人像的头肩区域,可以实现自动在逆光场景下拍摄出人像区域清晰的图像,不会出现人物曝光不足导致人脸呈现黑脸的现象。同时,终端通过分别对图像的目标区域和背景区域进行质量评估分析,根据目标区域设置对目标区域最佳呈现的拍摄参数,根据背景区域设置对背景区域最佳呈现的拍摄参数,用调整后的参数获取目标区域和背景区域最佳的第二图像,将第二图像融合到第一图像作为最终的拍摄图像,实现在逆光场景下拍摄人物照片时,不会出现人物曝光不足的情况,且无需手动调整拍摄参数,能够自动拍摄出质量效果佳的人物照片。
图4为本发明实施例一提供的逆光拍照装置结构示意图。如图4所示,本发明实施例提供的逆光拍照装置,包括:逆光检测模块401、头肩区域确定模块402和第一获取模块403。
逆光检测模块401,用于检测拍照场景是否是逆光拍照。
头肩区域确定模块402,用于若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小。
第一获取模块403,用于根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。
本发明实施例提供的逆光拍照装置用于执行图1所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图5为本发明实施例二提供的逆光拍照装置结构示意图。如图5所示,在图4所示实施例的基础上,本发明实施例提供的逆光拍照装置,还包括:目标区域确定模块404、目标区域比对模块405、第一调整模块406、第二获取模块407和第一拍摄模块408。
目标区域确定模块404,用于在第一图像上使用头肩检测确定拍摄的目标区域。
目标区域比对模块405,用于将目标区域的像素与预设像素进行比 对。
第一调整模块406,用于若目标区域的像素小于预设像素,则根据目标区域确定曝光调整参数。
第二获取模块407,用于根据曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像。
第一拍摄模块408,用于将第二图像融合到第一图像作为最终的拍摄图像。
本发明实施例提供的逆光拍照装置用于执行图2所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图6为本发明实施例三提供的逆光拍照装置结构示意图。如图6所示,在图4和图5所示实施例的基础上,本发明实施例提供的逆光拍照装置,还包括:背景区域确定模块409、背景区域比对模块410、第二调整模块411和第二拍摄模块412。
背景区域确定模块409,用于在第一图像上使用头肩检测确定拍摄的背景区域。
背景区域比对模块410,用于将背景区域的像素与预设像素进行比对。
第二调整模块411,用于若目标区域的像素小于预设像素,且背景区域的像素小于预设像素,则根据目标区域和背景区域确定曝光调整参数。
可选的,第二调整模块411具体用于:根据目标区域确定目标区域的曝光调整参数,根据背景区域确定背景区域的曝光调整参数。
第二拍摄模块412,用于若目标区域的像素大于或等于预设像素,则将第一图像作为最终的拍摄图像。
本发明实施例提供的逆光拍照装置用于执行图3所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
图7为本发明实施例一提供的终端结构示意图。如图7所示,本发明实施例提供的终端,包括:存储器71、处理器72和摄像头73。
需要说明的是,本发明实施例中的终端可以作为逆光拍照装置。存储器71用于存储执行指令,处理器72可以是一个中央处理器(Central  Processing Unit,CPU),或者是特定集成电路(Application Specific Integrated Circuit,ASIC),或者完成实施本发明实施例的一个或多个集成电路。当终端运行时,处理器72与存储器71之间通信,处理器72调用执行指令,用于执行以下操作:
检测拍照场景是否是逆光拍照;若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小。
摄像头73,用于根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。
其中,处理器72还用于执行以下操作:
在第一图像上使用头肩检测确定拍摄的目标区域;将目标区域的像素与预设像素进行比对;若目标区域的像素小于预设像素,则根据目标区域确定曝光调整参数。
摄像头73,还用于根据曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像;将第二图像融合到第一图像作为最终的拍摄图像。
其中,处理器72还用于执行以下操作:
在第一图像上使用头肩检测确定拍摄的背景区域;将背景区域的像素与预设像素进行比对;若目标区域的像素小于预设像素,且背景区域的像素小于预设像素,则根据目标区域和背景区域确定曝光调整参数。
其中,处理器72还用于执行以下操作:
根据目标区域确定目标区域的曝光调整参数,根据背景区域确定背景区域的曝光调整参数。
其中,摄像头73,还用于若目标区域的像素大于或等于预设像素,则将第一图像作为最终的拍摄图像。
图8为本发明实施例二提供的终端结构示意图。如图8所示,该终端100可以为手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、或车载电脑等。本发明实施例提供的终端100,包括:存储器120、处理器160及输入单元130。
该存储器120存储各种类型的数据以支持在终端100的操作。这些数据的示例包括用于在终端100上操作的任何应用程序或方法的指令,该存 储器120可以为NVRAM非易失存储器、DRAM动态随机存储器、SRAM静态随机存储器、Flash闪存等其中之一;该存储器120也可以为硬盘、光盘、USB盘、软盘或磁带机等;该处理器160用于检测拍照场景是否是逆光拍照;若拍照场景是逆光拍照,则使用头肩检测确定拍照场景下的拍摄目标中人像对应的头肩区域的大小。
需要说明的是,该处理器160是终端100的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在该存储器120内的软件程序和/或模块,以及调用存储在该存储器120内的数据,执行终端100的各种功能和处理数据,从而对终端100进行整体监控。可选的,该处理器160可包括一个或多个处理单元。当终端100运行时,处理器160与存储器120之间通信,该处理器160调用存储器120中的执行指令,用于执行上述方法实施例中的操作。
该输入单元130可以为摄像头,根据头肩区域的大小确定人像离摄像头的距离,根据距离自动对焦到人像中的头肩区域,拍摄获取第一图像。
该终端100还可以包括显示单元140,该显示单元140可以用于显示输入单元130拍摄的第一图像。该显示单元140可包括显示面板141,可选的,可以采用LCD(Liquid Crystal Display,液晶显示器)或OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板141。
该终端100还可以包括RF电路110、音频电路170、WIFI模块180和电源190。射频(Radio Frequency,简称RF)电路110可以为终端100接收和/或发送信号。音频电路170可以为终端100输出和/或输入音频信号。无线保真(WIreless-Fidelity,简称WIFI)模块180作为通信单元,可以用于终端100与其他设备之间的通信,终端100可以接入基于通信标准的无线网络。电源190可以用于为终端100的各个模块和/或单元提供电力。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进 行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使对应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (10)

  1. 一种逆光拍照方法,其特征在于,包括:
    检测拍照场景是否是逆光拍照;
    若所述拍照场景是逆光拍照,则使用头肩检测确定所述拍照场景下的拍摄目标中人像对应的头肩区域的大小;
    根据所述头肩区域的大小确定所述人像离摄像头的距离,根据所述距离自动对焦到所述人像中的头肩区域,拍摄获取第一图像。
  2. 根据权利要求1所述的方法,其特征在于,所述拍摄获取第一图像之后,还包括:
    在所述第一图像上使用头肩检测确定拍摄的目标区域;
    将所述目标区域的像素与预设像素进行比对;
    若所述目标区域的像素小于所述预设像素,则根据所述目标区域确定曝光调整参数;
    根据所述曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像;
    将所述第二图像融合到所述第一图像作为最终的拍摄图像。
  3. 根据权利要求2所述的方法,其特征在于,还包括:
    在所述第一图像上使用头肩检测确定拍摄的背景区域;
    将所述背景区域的像素与预设像素进行比对;
    所述若所述目标区域的像素小于所述预设像素,则根据所述目标区域确定曝光调整参数,包括:
    若所述目标区域的像素小于预设像素,且所述背景区域的像素小于所述预设像素,则根据所述目标区域和所述背景区域确定曝光调整参数。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述目标区域和所述背景区域确定曝光调整参数,包括:
    根据所述目标区域确定所述目标区域的曝光调整参数,根据所述背景区域确定所述背景区域的曝光调整参数。
  5. 根据权利要求2-4任一项所述的方法,其特征在于,还包括:
    若所述目标区域的像素大于或等于所述预设像素,则将所述第一图 像作为最终的拍摄图像。
  6. 一种逆光拍照装置,其特征在于,包括:
    逆光检测模块,用于检测拍照场景是否是逆光拍照;
    头肩区域确定模块,用于若所述拍照场景是逆光拍照,则使用头肩检测确定所述拍照场景下的拍摄目标中人像对应的头肩区域的大小;
    第一获取模块,用于根据所述头肩区域的大小确定所述人像离摄像头的距离,根据所述距离自动对焦到所述人像中的头肩区域,拍摄获取第一图像。
  7. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    目标区域确定模块,用于在所述第一图像上使用头肩检测确定拍摄的目标区域;
    目标区域比对模块,用于将所述目标区域的像素与预设像素进行比对;
    第一调整模块,用于若所述目标区域的像素小于所述预设像素,则根据所述目标区域确定曝光调整参数;
    第二获取模块,用于根据所述曝光调整参数调整拍摄参数,根据调整后的拍摄参数获取第二图像;
    第一拍摄模块,用于将所述第二图像融合到所述第一图像作为最终的拍摄图像。
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    背景区域确定模块,用于在所述第一图像上使用头肩检测确定拍摄的背景区域;
    背景区域比对模块,用于将所述背景区域的像素与预设像素进行比对;
    第二调整模块,用于若所述目标区域的像素小于预设像素,且所述背景区域的像素小于所述预设像素,则根据所述目标区域和所述背景区域确定曝光调整参数。
  9. 根据权利要求8所述的装置,其特征在于,所述第二调整模块具体用于:
    根据所述目标区域确定所述目标区域的曝光调整参数,根据所述背 景区域确定所述背景区域的曝光调整参数。
  10. 根据权利要求7-10任一项所述的装置,其特征在于,所述装置还包括:
    第二拍摄模块,用于若所述目标区域的像素大于或等于所述预设像素,则将所述第一图像作为最终的拍摄图像。
PCT/CN2016/112483 2015-12-31 2016-12-27 逆光拍照方法和装置 WO2017114399A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201511032564.4A CN105450932B (zh) 2015-12-31 2015-12-31 逆光拍照方法和装置
CN201511032564.4 2015-12-31

Publications (1)

Publication Number Publication Date
WO2017114399A1 true WO2017114399A1 (zh) 2017-07-06

Family

ID=55560666

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/112483 WO2017114399A1 (zh) 2015-12-31 2016-12-27 逆光拍照方法和装置

Country Status (2)

Country Link
CN (1) CN105450932B (zh)
WO (1) WO2017114399A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105450932B (zh) * 2015-12-31 2018-11-09 华为技术有限公司 逆光拍照方法和装置
CN106161980A (zh) * 2016-07-29 2016-11-23 宇龙计算机通信科技(深圳)有限公司 基于双摄像头的拍照方法及系统
CN106331510B (zh) * 2016-10-31 2019-10-15 维沃移动通信有限公司 一种逆光拍照方法及移动终端
CN106791410A (zh) * 2016-12-28 2017-05-31 深圳天珑无线科技有限公司 一种拍照装置及其拍照方法
CN106851063A (zh) * 2017-02-27 2017-06-13 努比亚技术有限公司 一种基于双摄像头的曝光调节终端及方法
CN107360361B (zh) * 2017-06-14 2020-07-31 中科创达软件科技(深圳)有限公司 一种逆光拍摄人物方法及装置
CN107945107A (zh) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 图像处理方法、装置、计算机可读存储介质和电子设备
CN108289170B (zh) * 2018-01-12 2020-02-14 深圳奥比中光科技有限公司 能够检测计量区域的拍照装置、方法及计算机可读介质
CN110536068B (zh) * 2019-09-29 2021-09-28 Oppo广东移动通信有限公司 对焦方法和装置、电子设备、计算机可读存储介质
CN113284106B (zh) * 2021-05-25 2023-06-06 浙江商汤科技开发有限公司 距离检测方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064783A (zh) * 2006-04-30 2007-10-31 华为技术有限公司 自动曝光控制参数的获得方法及控制方法和成像装置
CN101777114A (zh) * 2009-01-08 2010-07-14 北京中星微电子有限公司 视频监控智能分析系统和方法及头肩检测跟踪系统和方法
CN102833489A (zh) * 2011-06-15 2012-12-19 Abb股份公司 用于基于图像的自动曝光矫正的方法
CN103591953A (zh) * 2013-11-20 2014-02-19 无锡赛思汇智科技有限公司 一种基于单摄像头的人员定位方法
CN104166840A (zh) * 2014-07-22 2014-11-26 厦门亿联网络技术股份有限公司 一种基于视频会议系统的聚焦实现方法
CN105450932A (zh) * 2015-12-31 2016-03-30 华为技术有限公司 逆光拍照方法和装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101900097B1 (ko) * 2012-07-30 2018-09-20 삼성전자주식회사 이미지 캡처 방법 및 이미지 캡처 장치
JP5647209B2 (ja) * 2012-11-07 2014-12-24 オリンパスイメージング株式会社 撮像装置及び撮像方法
CN103699877A (zh) * 2013-12-02 2014-04-02 广东欧珀移动通信有限公司 提高人脸识别效果的方法和系统
CN104038704B (zh) * 2014-06-12 2018-08-07 小米科技有限责任公司 逆光人像场景的拍摄处理方法及装置
CN104159046A (zh) * 2014-09-04 2014-11-19 上海航天电子通讯设备研究所 一种探月工程用自适应宽动态成像方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064783A (zh) * 2006-04-30 2007-10-31 华为技术有限公司 自动曝光控制参数的获得方法及控制方法和成像装置
CN101777114A (zh) * 2009-01-08 2010-07-14 北京中星微电子有限公司 视频监控智能分析系统和方法及头肩检测跟踪系统和方法
CN102833489A (zh) * 2011-06-15 2012-12-19 Abb股份公司 用于基于图像的自动曝光矫正的方法
CN103591953A (zh) * 2013-11-20 2014-02-19 无锡赛思汇智科技有限公司 一种基于单摄像头的人员定位方法
CN104166840A (zh) * 2014-07-22 2014-11-26 厦门亿联网络技术股份有限公司 一种基于视频会议系统的聚焦实现方法
CN105450932A (zh) * 2015-12-31 2016-03-30 华为技术有限公司 逆光拍照方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HARUKI, TOSHINOBU: "VIDEO CAMERA SYSTEM USING FUZZY LOGIC", IEEE TRANSACTIONS ON CONSUMER ELECTRONICS, vol. 38, no. 3, 31 August 1992 (1992-08-31), pages 624 - 634, XP000311903, ISSN: 0098-3063, DOI: 10.1109/30.156746 *

Also Published As

Publication number Publication date
CN105450932A (zh) 2016-03-30
CN105450932B (zh) 2018-11-09

Similar Documents

Publication Publication Date Title
WO2017114399A1 (zh) 逆光拍照方法和装置
US11089207B2 (en) Imaging processing method and apparatus for camera module in night scene, electronic device and storage medium
US8994845B2 (en) System and method of adjusting a camera based on image data
JP6309111B2 (ja) 撮像条件を検出するための方法および装置
WO2019183813A1 (zh) 一种拍摄方法及设备
KR102149187B1 (ko) 전자 장치와, 그의 제어 방법
CN111028189A (zh) 图像处理方法、装置、存储介质及电子设备
CN107592473A (zh) 曝光参数调整方法、装置、电子设备和可读存储介质
US9247152B2 (en) Determining image alignment failure
KR102263537B1 (ko) 전자 장치와, 그의 제어 방법
US20060245643A1 (en) Method and apparatus for incorporating iris color in red-eye correction
CN109844804B (zh) 一种图像检测的方法、装置及终端
CN108616689B (zh) 基于人像的高动态范围图像获取方法、装置及设备
CN107493407B (zh) 拍照装置及拍照方法
US20150063694A1 (en) Techniques for combining images with varying brightness degrees
JP6096298B2 (ja) 逆光補正方法、装置及び端末
CN106791451B (zh) 一种智能终端的拍照方法
US10623653B2 (en) Image adjustment apparatus and image adjustment method that determines and adjusts a state of a back light region in an image
CN113810590A (zh) 图像处理方法、电子设备、介质和系统
WO2023137956A1 (zh) 图像处理方法、装置、电子设备及存储介质
US20200128154A1 (en) Method and system for processing image
CN109120856B (zh) 一种摄像方法及装置
WO2023151210A1 (zh) 图像处理方法、电子设备及计算机可读存储介质
WO2016074414A1 (zh) 一种图像的处理方法和装置
EP2658245B1 (en) System and method of adjusting camera image data

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

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

Country of ref document: EP

Kind code of ref document: A1