WO2020207258A1 - Image processing method and apparatus, storage medium and electronic device - Google Patents

Image processing method and apparatus, storage medium and electronic device Download PDF

Info

Publication number
WO2020207258A1
WO2020207258A1 PCT/CN2020/081412 CN2020081412W WO2020207258A1 WO 2020207258 A1 WO2020207258 A1 WO 2020207258A1 CN 2020081412 W CN2020081412 W CN 2020081412W WO 2020207258 A1 WO2020207258 A1 WO 2020207258A1
Authority
WO
WIPO (PCT)
Prior art keywords
scene
images
shooting scene
image
shooting
Prior art date
Application number
PCT/CN2020/081412
Other languages
French (fr)
Chinese (zh)
Inventor
张弓
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2020207258A1 publication Critical patent/WO2020207258A1/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/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/70Circuitry for compensating brightness variation in the scene
    • H04N23/73Circuitry for compensating brightness variation in the scene by influencing the exposure time
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors

Definitions

  • This application relates to the field of computer technology, in particular to an image processing method, device, storage medium and electronic equipment.
  • the current electronic device can only shoot scenes with a relatively small brightness range. If the scene is shot when the brightness of the scene is too different, the captured images are likely to lose the details of the bright and/or dark areas.
  • the embodiments of the present application provide an image processing method, device, storage medium, and electronic equipment, which can flexibly realize the high dynamic range effect of image shooting.
  • an embodiment of the present application provides an image processing method applied to an electronic device, and the image processing method includes:
  • an embodiment of the present application provides an image processing device, which is applied to electronic equipment, and the image processing device includes:
  • the detection module is used to detect whether there is a target object meeting preset motion conditions in the shooting scene
  • the first synthesis module is configured to obtain multiple first scene images of the shooting scene according to the same exposure parameter when the target object does not exist in the shooting scene, and synthesize the multiple first scene images to obtain the The first high dynamic range image of the shooting scene;
  • the second synthesis module is used to obtain a plurality of second scene images of the shooting scene according to different exposure parameters when the target object exists in the shooting scene, and synthesize a plurality of the second scene images to obtain the shooting The second highest dynamic range image of the scene.
  • an embodiment of the present application provides a storage medium on which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute:
  • an embodiment of the present application provides an electronic device, including a processor and a memory, the memory stores a computer program, and the processor invokes the computer program to execute:
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a first high dynamic range image synthesized in an embodiment of the present application.
  • FIG. 3 is a schematic diagram of the location area of the same object in two cache images of the shooting scene in an embodiment of the present application.
  • Fig. 4 is a schematic diagram of a combined position area of the same object in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the location of the first camera and the second camera of the electronic device in an embodiment of the present application.
  • FIG. 6 is another schematic flowchart of the image processing method provided by the embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 9 is another schematic diagram of the structure of an electronic device provided by an embodiment of the present application.
  • the embodiment of the present application first provides an image processing method, which is applied to an electronic device.
  • the execution subject of the image processing method may be the image processing device provided in the embodiment of the present application, or an electronic device integrated with the image processing device.
  • the image processing device may be implemented in hardware or software, and the electronic device may be a smart device.
  • Mobile phones, tablet computers, handheld computers, notebook computers, or desktop computers are equipped with processors and have processing capabilities.
  • This application provides an image processing method, including:
  • the detecting whether there is a target object meeting a preset motion condition in the shooting scene includes:
  • the method before the acquiring multiple first scene images of the shooting scene according to the same exposure parameter and synthesizing the multiple first scene images to obtain the first high dynamic range image of the shooting scene, the method further includes :
  • the method further includes:
  • the acquiring multiple first scene images of the shooting scene according to the same exposure parameter includes:
  • the acquiring multiple second scene images of the shooting scene according to different exposure parameters includes:
  • the multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
  • the image processing method further includes:
  • the first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
  • the image processing method further includes:
  • the multiple second scene images are down-sampled according to the current resolution of the screen.
  • the acquiring multiple first scene images of the shooting scene according to the same exposure parameter includes:
  • the acquiring multiple second scene images of the shooting scene according to different exposure parameters includes:
  • the shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of this application.
  • the image processing method is applied to the electronic device provided in the embodiment of the application.
  • the flow of the image processing method provided in the embodiment of the application may be as follows:
  • the scene to which the camera is aimed is the shooting scene.
  • a shooting application for example, the system application "camera” of the electronic device
  • the scene to which the camera is aimed is the shooting scene.
  • the user clicks on the icon of the “camera” application on the electronic device to start the “camera application” if the user uses the camera of the electronic device to aim at a scene including XX objects, the scene including XX objects is the shooting scene.
  • the shooting scene does not specifically refer to a specific scene, but a scene that is aligned in real time following the direction of the camera.
  • the electronic device first detects whether there is a target object that meets a preset motion condition in the shooting scene, so as to synthesize a high dynamic range image of the shooting scene by using a suitable high dynamic range synthesis technique according to the detection result.
  • the method of detecting whether there is a target object in the shooting scene is not specifically limited in the embodiment of this application, and a person of ordinary skill in the art can select a suitable detection method according to actual needs. For example, optical flow method, Residual error method, etc.
  • an image cache queue is also preset in the electronic device, and the image cache queue may be a fixed-length queue or a variable-length queue.
  • the image cache queue is a fixed-length queue and can cache 8 images. After enabling the camera, the electronic device caches the images collected by the camera in real time into the image cache queue.
  • the electronic device when it detects whether there is a target object that meets the preset motion conditions in the shooting scene, it can first obtain two temporally adjacent shooting scenes from its preset image buffer queue. Cache images, denote them as the first cache image and the second cache image. Then, the electronic device subtracts the first buffer image and the second buffer image to obtain residual images of the first buffer image and the second buffer image. Then, the electronic device determines the brightness value of each pixel in the residual image, and determines the proportion of pixels with non-zero brightness in all the pixels. Finally, the electronic device determines whether the ratio of pixels with non-zero brightness to all pixels is less than a preset ratio value (a person of ordinary skill in the art can take an empirical value according to actual needs. For example, the preset ratio value can be configured as 25 %), it is determined that the aforementioned target object exists in the shooting scene.
  • a preset ratio value a person of ordinary skill in the art can take an empirical value according to actual needs. For example, the preset ratio value can be configured as 25
  • the electronic device After detecting whether there is a target object that meets the preset motion conditions in the shooting scene, the electronic device selects a high dynamic range according to the detection result.
  • Dynamic range synthesis method to synthesize a high dynamic range image of the shooting scene. Among them, if the target object is detected in the shooting scene, then go to 102, select a high dynamic range synthesis method to synthesize the high dynamic range image of the shooting scene; if it is detected that there is no target object in the shooting scene, then go to 103. Select another high dynamic range synthesis method to synthesize a high dynamic range image of the shooting scene.
  • a plurality of first scene images of a shooting scene are acquired according to the same exposure parameter, and the plurality of first scene images are synthesized to obtain a first high dynamic range image of the shooting scene.
  • the exposure parameter includes exposure value (commonly known as EV value) or exposure duration.
  • the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, it can acquire multiple shooting scenes according to the preset short exposure duration.
  • the first scene image For example, the electronic device controls the camera to perform multiple exposures on the shooting scene according to a preset short exposure time of 1 millisecond, thereby obtaining multiple first scene images of the shooting scene.
  • the acquired multiple first scene images are Multiple short exposure images of the shooting scene.
  • the electronic device after acquiring the multiple first scene images of the shooting scene, the electronic device further synthesizes the multiple first scene images in a multi-frame short exposure manner to obtain the first high dynamic range image of the shooting scene.
  • the electronic device when the electronic device synthesizes the multiple first scene images to obtain the first high dynamic range image of the shooting scene, it first performs multi-frame noise reduction synthesis on the multiple first scene images to obtain a noise reduction composite image. It can be understood that since the first scene image is a short exposure image, it will retain more features of the brighter area in the shooting scene. Similarly, the noise-reduction composite image obtained by performing multi-frame noise reduction synthesis on multiple first scene images also retains more features of the brighter area in the shooting scene.
  • the electronic device further improves the brightness of the noise-reduction synthesized image, so that the characteristics of the brighter area and the darker area in the shooting scene can be simultaneously presented, and the high dynamic range image of the shooting scene is obtained, which is recorded as the first high dynamic range image .
  • the electronic device acquires a total of 4 first scene images of the shooting scene, which are the first scene image A, the first scene image B, the first scene image C, and the first scene image D, respectively.
  • the electronic device first selects one of the first scene image A, the first scene image B, the first scene image C, and the first scene image D as the reference image, assuming that the first scene image A is selected as the reference image .
  • the electronic device aligns the first scene image B, the first scene image C, and the first scene image D with the first scene image A, and then calculates the average pixel value of each pixel based on the aligned images (for example, Assuming that the pixel values of a pixel at a certain position in the four first scene images are: "0.8, 0.9, 1.1, 1.2", the average pixel value of the pixel at this position can be calculated as "1").
  • the noise-reduction composite image is obtained according to the average pixel value of each position.
  • the pixel value of each pixel of the reference image that is, the first scene image A
  • the average pixel value can also be calculated according to the calculation to generate A new image, using the generated image as a noise reduction composite image.
  • the electronic device further enhances its brightness to obtain the first high dynamic range image of the shooting scene.
  • multiple second scene images of the shooting scene are acquired according to different exposure parameters, and the multiple second scene images are synthesized to obtain the second high dynamic range image of the shooting scene.
  • the electronic device may acquire the multiple images of the shooting scene in a manner that the preset short exposure duration and the long exposure duration overlap.
  • a second scene image In other words, among two adjacently exposed second scene images, one second scene image is a short exposure image, and the other second scene image is a long exposure image. In this way, the second high dynamic range image of the shooting scene can be synthesized by combining long and short exposures.
  • the electronic device acquires a second scene image with a short exposure time and a second scene image with a long exposure time. Because the second scene image with a short exposure time retains the characteristics of the brighter area in the shooting scene, the long exposure time The second scene image retains the characteristics of the darker area in the shooting scene, so when compositing, the features of the darker area in the shooting scene retained by the second scene image with long exposure time and the second scene image with short exposure time can be used The retained features of the brighter area in the shooting scene are synthesized to obtain the second high dynamic range image of the shooting scene.
  • the electronic device may acquire multiple second scene images of the shooting scene according to different exposure values, where the electronic The device can respectively expose the shooting scene according to the preset overexposure value and the preset underexposure value to obtain two second scene images of the shooting scene. It can also according to the preset overexposure value, preset normal exposure value and preset underexposure value.
  • the exposure values respectively expose the shooting scene to obtain three second scene images of the shooting scene and so on.
  • the electronic device can control the camera to expose the shooting scene according to the preset normal exposure value EV0, the preset underexposure value EV-2, and the preset overexposure value EV2, thereby obtaining three second scene images of the shooting scene.
  • They are respectively a normal exposure image, an overexposed image, and an underexposed image, so that the second high dynamic range image of the shooting scene is synthesized through the bracketing synthesis method.
  • the electronic device can detect whether there is a target object that meets the preset motion condition in the shooting scene; if not, it acquires multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizes multiple images.
  • the high dynamic range image of the shooting scene is synthesized through the corresponding high dynamic range image synthesis method adopted according to the actual state of the shooting scene, which can flexibly realize the high dynamic range effect of image shooting.
  • detecting whether there is a target object meeting a preset motion condition in the shooting scene includes:
  • the electronic device when it detects whether there is a target object meeting preset motion conditions in the shooting scene, it first obtains two temporally adjacent cached images of the shooting scene from its preset image buffer queue , Mark it as the third cache image and the fourth cache image. Then, the electronic device uses semantic segmentation technology to perform semantic segmentation on the third cached image and the fourth cached image respectively, thereby determining the objects existing in the third cached image and the fourth cached image and their corresponding location regions. Then, the electronic device recognizes the location area of the same object in the third cache image and the fourth cache image according to the semantic segmentation results of the third cache image and the fourth cache image. For example, refer to Figure 3, the object A is in the first cache image.
  • the location area in the fourth buffer image moves a certain distance to the right compared to its location area in the third buffer image. Then, the electronic device merges the position areas of the same object in the third cache image and the fourth cache image to obtain a merged position area, as shown in FIG. 4. Finally, the electronic device determines whether the proportion of the combined location area with respect to the third or fourth cached image reaches the preset proportion, and if yes, it determines that the aforementioned same object is a target object that meets the preset conditions; otherwise, it determines that there is no There is a target object.
  • the size of the aforementioned preset proportion depends on the proportion of the aforementioned same object relative to the third buffer image (or fourth buffer image), which can be expressed as:
  • P represents the preset proportion
  • p represents the proportion of the aforementioned same object relative to the third cache image (or fourth cache image)
  • the electronic device determines the object as the target object. It is a moving object, and when the displacement of no object in the shooting scene reaches 1/4 of its occupied position area, the electronic device will determine that there is no target object in the shooting scene, that is, there is no moving object.
  • the salient area of the scene is the area that is easier for users to notice. For example, it is generally believed that people and animals are more salient than the sky, grass, and buildings. Generally, people are more willing to take a prominent area in the shooting scene as the subject for shooting. Therefore, when the proportion of the merged location area corresponding to the same object to any cached image reaches the preset proportion, that is, when the same object is a moving object in the shooting scene, the electronic device further recognizes that the moving object is in the first Whether the location area in the third buffer image or the fourth buffer image is a salient area.
  • a person of ordinary skill in the art can pre-configure the salient area identification method used by the electronic device according to actual needs, so that the electronic device can identify salient areas in the third cached image and the fourth cached image according to the pre-configured salient area identification method. And it is determined whether the location area of the aforementioned moving object in the third cache image is a salient area, and whether the location area of the aforementioned moving object in the fourth cache image is a salient area.
  • the location area of the aforementioned moving object in the third cache image and the fourth cache image is a salient area
  • multiple first scene images of the shooting scene are acquired according to the same exposure parameter, and multiple first scene images are synthesized to obtain
  • the first high dynamic range image of the shooting scene is taken to avoid ghost images in the first high dynamic range image.
  • the electronic device acquires multiple second images of the shooting scene according to different exposure parameters. Scene image, and synthesize multiple second scene images to obtain a second high dynamic range image of the shooting scene. In this way, even if there are ghosts in the synthesized second high dynamic range image (corresponding to the aforementioned target object, that is, the moving object in the shooting scene), it will have less impact on the overall image effect, but a better high dynamic range effect can be obtained .
  • "acquiring multiple first scene images of the shooting scene according to the same exposure parameter” includes:
  • the multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
  • a first camera and a second camera are provided on the same side of the electronic device.
  • the electronic device when the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, it can acquire multiple first scene images of the shooting scene through the first camera and the second camera respectively according to the same exposure parameter. Therefore, the acquisition efficiency of the first scene image is improved, and the synthesis efficiency of the first high dynamic range image is improved.
  • the electronic device simultaneously uses the first camera and the second camera to expose the shooting scene according to the short exposure time, and two first scene images of the shooting scene can be acquired with one exposure operation.
  • the electronic device when it acquires multiple second scene images of the shooting scene according to different exposure parameters, it can provide the first camera and the second camera to acquire multiple second scene images of the shooting scene according to different exposure parameters, respectively. Thereby, the acquisition efficiency of the second scene image is improved, so that the synthesis efficiency of the second high dynamic range image is improved.
  • the electronic device exposes the shooting scene according to the short exposure time through the first camera, and exposes the shooting scene according to the long exposure time through the second camera. Two second scene images of the shooting scene can be obtained with one exposure operation. , Respectively, short exposure image and long exposure image.
  • the image processing method provided in this application further includes:
  • the first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
  • the electronic device after the electronic device synthesizes the first high dynamic range image, it displays the synthesized first high dynamic range image as a preview image of the shooting scene, or after synthesizing the second high dynamic range image , the second high dynamic range image obtained by synthesis is displayed as a preview image of the shooting scene.
  • the user can view the high dynamic range effect of the image obtained by taking a picture of the shooting scene in advance, and help the user better Take pictures.
  • the image processing method provided in this application further includes:
  • the electronic device may also perform video encoding according to the first high dynamic range image or the second high dynamic range image to obtain a video of the shooting scene, that is, when the shooting scene is recorded, the video obtained by the recording also has a high dynamic range effect.
  • video coding format is used for video coding in the embodiments of this application, and a person of ordinary skill in the art can select a suitable video coding format according to actual needs, including but not limited to H.264, H.265, MPEG-4, etc.
  • the image processing method provided in this application further includes:
  • the multiple second scene images are down-sampled according to the current resolution of the screen.
  • the actual resolution of the preview image is greater than the resolution displayed on the screen, and a better display effect will not be obtained compared to the case where the actual resolution of the preview image is equal to the screen display resolution.
  • the electronic device before synthesizing the first high dynamic range image, the electronic device first obtains the current resolution of the screen, and then down-sampling the multiple first scene images according to the current resolution of the screen, so that the multiple first scene images
  • the resolution of is consistent with the current resolution of the screen, so that the resolution of the synthesized first high dynamic range image is consistent with the current resolution of the screen.
  • the synthesis efficiency of the first high dynamic range image can be improved, and the display effect of the first high dynamic range image is not reduced when the first high dynamic range image is displayed as a preview image.
  • the electronic device synthesizes the second high dynamic range image, it first obtains the current resolution of the screen, and then down-sampling the multiple second scene images according to the current resolution of the screen, so that multiple second The resolution of the scene image is consistent with the current resolution of the screen, so that the resolution of the synthesized second high dynamic range image is consistent with the current resolution of the screen.
  • the synthesis efficiency of the second high dynamic range image can be improved, and when the second high dynamic range image is displayed as a preview image, its display effect will not be reduced.
  • FIG. 6 is a schematic diagram of another flow of an image processing method provided by an embodiment of the application.
  • the flow of the image processing method may include:
  • the electronic device obtains two cached images of the shooting scene from a preset image cache queue.
  • an image cache queue is preset in the electronic device, and the image cache queue may be a fixed-length queue or a variable-length queue.
  • the image cache queue is a fixed-length queue and can cache 8 images.
  • the electronic device first obtains two temporally adjacent cached images of the shooting scene from its preset image cache queue, and records them as the third cached image and the fourth cached image.
  • the electronic device recognizes the location area of the same object in the two cached images.
  • the electronic device uses semantic segmentation technology to perform semantic segmentation on the third cache image and the fourth cache image respectively, so as to determine the objects existing in the third cache image and the fourth cache image and their corresponding location regions. After that, the electronic device recognizes the location area of the same object in the third cache image and the fourth cache image according to the semantic segmentation results of the third cache image and the fourth cache image. For example, refer to FIG. 3, the object A is in the first cache image. The location area in the fourth buffer image moves a certain distance to the right compared to its location area in the third buffer image.
  • the electronic device merges the position areas of the aforementioned same object in the two cache images to obtain a merged position area.
  • the electronic device merges the position areas of the same object in the third cache image and the fourth cache image to obtain a merged position area, as shown in FIG. 4.
  • the electronic device judges whether the aforementioned same object is a target object that meets a preset condition according to the proportion of the merged location area relative to any cached image, if yes, go to 206, otherwise go to 205.
  • the electronic device judges whether the proportion of the combined location area relative to the third or fourth buffer image reaches the preset proportion, and if yes, it judges that the aforementioned same object is a target object that meets the preset condition, otherwise it judges that there is no There is a target object.
  • the size of the aforementioned preset proportion depends on the proportion of the aforementioned same object relative to the third buffer image (or fourth buffer image), which can be expressed as:
  • P represents the preset proportion
  • p represents the proportion of the aforementioned same object relative to the third cache image (or fourth cache image)
  • the electronic device determines the object as the target object. It is a moving object, and when the displacement of no object in the shooting scene reaches 1/4 of its occupied position area, the electronic device will determine that there is no target object in the shooting scene, that is, there is no moving object.
  • the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizes the multiple first scene images to obtain the first high dynamic range image of the shooting scene.
  • the exposure parameter includes exposure value (commonly known as EV value) or exposure duration.
  • the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, it can acquire multiple shooting scenes according to the preset short exposure duration.
  • the first scene image For example, the electronic device controls the camera to perform multiple exposures on the shooting scene according to a preset short exposure time, thereby obtaining multiple first scene images of the shooting scene.
  • the acquired multiple first scene images are the shooting scene Of multiple short exposure images.
  • the electronic device after acquiring the multiple first scene images of the shooting scene, the electronic device further synthesizes the multiple first scene images by means of multi-frame short exposure to obtain the first high dynamic range image of the shooting scene.
  • the electronic device when the electronic device synthesizes the multiple first scene images to obtain the first high dynamic range image of the shooting scene, it first performs multi-frame noise reduction synthesis on the multiple first scene images to obtain a noise reduction composite image. It can be understood that since the first scene image is a short exposure image, it will retain more features of the brighter area in the shooting scene. Similarly, the noise-reduction composite image obtained by performing multi-frame noise reduction synthesis on multiple first scene images also retains more features of the brighter area in the shooting scene.
  • the electronic device further improves the brightness of the noise-reduction synthesized image, so that the characteristics of the brighter area and the darker area in the shooting scene can be simultaneously presented, and the high dynamic range image of the shooting scene is obtained, which is recorded as the first high dynamic range image .
  • the electronic device acquires a total of 4 first scene images of the shooting scene, which are the first scene image A, the first scene image B, the first scene image C, and the first scene image D, respectively.
  • the electronic device first selects one of the first scene image A, the first scene image B, the first scene image C, and the first scene image D as the reference image, assuming that the first scene image A is selected as the reference image .
  • the electronic device aligns the first scene image B, the first scene image C, and the first scene image D with the first scene image A, and then calculates the average pixel value of each pixel based on the aligned images (for example, Assuming that the pixel values of a pixel at a certain position in the four first scene images are: "0.8, 0.9, 1.1, 1.2", the average pixel value of the pixel at this position can be calculated as "1").
  • the noise-reduction composite image is obtained according to the average pixel value of each position.
  • the pixel value of each pixel of the reference image that is, the first scene image A
  • the average pixel value can also be calculated according to the calculation to generate A new image, using the generated image as a noise reduction composite image.
  • the electronic device further enhances its brightness to obtain the first high dynamic range image of the shooting scene.
  • the electronic device acquires multiple second scene images of the shooting scene according to different exposure parameters, and synthesizes the multiple second scene images to obtain the second high dynamic range image of the shooting scene.
  • the electronic device may acquire the multiple images of the shooting scene in a manner that the preset short exposure duration and the long exposure duration overlap.
  • a second scene image In other words, among two adjacently exposed second scene images, one second scene image is a short exposure image, and the other second scene image is a long exposure image. In this way, the second high dynamic range image of the shooting scene can be synthesized by combining long and short exposures.
  • the electronic device acquires a second scene image with a short exposure time and a second scene image with a long exposure time. Because the second scene image with a short exposure time retains the characteristics of the brighter area in the shooting scene, the long exposure time The second scene image retains the characteristics of the darker area in the shooting scene, so when compositing, the features of the darker area in the shooting scene retained by the second scene image with long exposure time and the second scene image with short exposure time can be used The retained features of the brighter area in the shooting scene are synthesized to obtain the second high dynamic range image of the shooting scene.
  • the electronic device in acquiring multiple second scene images of the shooting scene according to different exposure parameters, can respectively expose the shooting scene according to a preset overexposure value and a preset underexposure value.
  • preset normal exposure value and preset underexposure value to obtain three second scene images of the shooting scene, etc. .
  • the electronic device can control the camera to expose the shooting scene according to the preset normal exposure value EV0, the preset underexposure value EV-2, and the preset overexposure value EV2, thereby obtaining three second scene images of the shooting scene.
  • They are respectively a normal exposure image, an overexposed image, and an underexposed image, so that the second high dynamic range image of the shooting scene is synthesized through the bracketing synthesis method.
  • the electronic device displays the first high dynamic range image or the second high dynamic range image as a preview image of the shooting scene.
  • the electronic device after the electronic device synthesizes the first high dynamic range image, it displays the synthesized first high dynamic range image as a preview image of the shooting scene, or after synthesizing the second high dynamic range image , the second high dynamic range image obtained by synthesis is displayed as a preview image of the shooting scene.
  • the user can view the high dynamic range effect of the image obtained by taking a picture of the shooting scene in advance, and help the user better Take pictures.
  • the embodiment of the present application also provides an image processing device.
  • FIG. 7, is a schematic structural diagram of an image processing apparatus provided by an embodiment of the application.
  • the image processing device is applied to electronic equipment, and the image processing device includes a detection module 501, a first synthesis module 502, and a second synthesis module 503, as follows:
  • the detection module 501 is configured to detect whether there is a target object meeting preset motion conditions in the shooting scene;
  • the first synthesis module 502 is configured to obtain multiple first scene images of the shooting scene according to the same exposure parameter when the shooting scene is not in a static state, and synthesize the multiple first scene images to obtain the first high dynamic range image of the shooting scene;
  • the second synthesis module 503 is configured to obtain multiple second scene images of the shooting scene according to different exposure parameters when the shooting scene is in a static state, and synthesize the multiple second scene images to obtain the second high dynamic range image of the shooting scene.
  • the detection module 501 when detecting whether there is a target object meeting preset motion conditions in the shooting scene, the detection module 501 may be used to:
  • the first synthesis module 502 may also be used for :
  • multiple first scene images of the shooting scene are acquired according to the same exposure parameter, and the multiple first scene images are synthesized to obtain the first high dynamic range image of the shooting scene.
  • the second synthesis module 503 is further configured to recognize that the aforementioned same object is in the first synthesis module 502 After whether the location area in the two cached images is a salient area, if the recognition result of the first synthesis module 502 is no, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain The second highest dynamic range image of the shooting scene.
  • the first synthesis module 502 when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the first synthesis module 502 may be used to:
  • the second synthesis module 503 may be used to:
  • the multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
  • the image processing device further includes a preview module for:
  • the first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
  • the first synthesis module 502 is further configured to perform down-sampling processing on multiple first scene images according to the current resolution of the screen before the first high dynamic range image is synthesized;
  • the second synthesis module 503 is further configured to perform down-sampling processing on multiple second scene images according to the current resolution of the screen before the second high dynamic range image is synthesized.
  • the first synthesis module 502 when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the first synthesis module 502 may be used to:
  • the second synthesis module 503 may be used to:
  • the shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
  • the image processing device provided in the embodiment of the application belongs to the same concept as the image processing method in the above embodiment, and any method provided in the image processing method embodiment can be run on the image processing device, and its specific implementation For details of the process, refer to the embodiment of the image processing method, which will not be repeated here.
  • the embodiments of the present application provide a computer-readable storage medium on which a computer program is stored.
  • the storage medium may be a magnetic disk, an optical disc, a read only memory (Read Only Memory, ROM,) or a random access device (Random Access Memory, RAM), etc.
  • An embodiment of the present application also provides an electronic device. Please refer to FIG. 8.
  • the electronic device includes a processor 701 and a memory 702.
  • the processor 701 is electrically connected to the memory 702.
  • the processor 701 is the control center of the electronic device. It uses various interfaces and lines to connect the various parts of the entire electronic device. It executes the electronic device by running or loading the computer program stored in the memory 702 and calling the data stored in the memory 702. Various functions and process data.
  • the memory 702 may be used to store software programs and modules.
  • the processor 701 executes various functional applications and data processing by running the computer programs and modules stored in the memory 702.
  • the memory 702 may mainly include a program storage area and a data storage area.
  • the program storage area may store an operating system, a computer program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of electronic equipment, etc.
  • the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the memory 702 may further include a memory controller to provide the processor 701 with access to the memory 702.
  • the processor 701 in the electronic device will load the instructions corresponding to the process of one or more computer programs into the memory 702 according to the following steps, and run the instructions by the processor 701 and store them in the memory 702
  • the computer program to achieve various functions, as follows:
  • multiple second scene images of the shooting scene are acquired according to different exposure parameters, and the multiple second scene images are synthesized to obtain the second high dynamic range image of the shooting scene.
  • FIG. 9 is another schematic structural diagram of an electronic device provided by an embodiment of the application. The difference from the electronic device shown in FIG. 8 is that the electronic device further includes components such as an input unit 703 and an output unit 704.
  • the input unit 703 can be used to receive input numbers, character information, or user characteristic information (such as fingerprints), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
  • user characteristic information such as fingerprints
  • the output unit 704 may be used to display information input by the user or information provided to the user, such as a screen.
  • the processor 701 in the electronic device will load the instructions corresponding to the process of one or more computer programs into the memory 702 according to the following steps, and run the instructions by the processor 701 and store them in the memory 702
  • the computer program to achieve various functions, as follows:
  • the processor 701 may execute:
  • the processor 701 may execute:
  • multiple first scene images of the shooting scene are acquired according to the same exposure parameter, and the multiple first scene images are synthesized to obtain the first high dynamic range image of the shooting scene.
  • the processor 701 may further execute:
  • the processor 701 may execute:
  • the processor 701 may execute:
  • the multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
  • processor 701 may also execute:
  • the first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
  • processor 701 may also execute:
  • the multiple second scene images are down-sampled according to the current resolution of the screen.
  • the processor 701 may execute:
  • the processor 701 may execute:
  • the shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
  • the electronic device provided in this embodiment of the application belongs to the same concept as the image processing method in the above embodiment. Any method provided in the image processing method embodiment can be run on the electronic device. The specific implementation process is detailed. See the embodiment of the feature extraction method, which will not be repeated here.
  • the image processing method of the embodiment of the present application ordinary testers in the field can understand that all or part of the process of implementing the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program.
  • the computer program may be stored in a computer readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device.
  • the execution process may include such as image processing methods.
  • the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
  • the image processing device of the embodiment of the present application its functional modules may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium, such as a read-only memory, a magnetic disk or an optical disk, etc. .

Landscapes

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

Abstract

Disclosed by the embodiment of the application are an image processing method and apparatus, a storage medium, and an electronic device. The present application adopts a corresponding high dynamic range image synthesis method according to the actual state of a shooting scene to obtain a high dynamic range image of the shooting scene, which can flexibly realize the high dynamic range effect of image shooting.

Description

图像处理方法、装置、存储介质及电子设备Image processing method, device, storage medium and electronic equipment
本申请要求于2019年04月09日提交中国专利局、申请号为201910280193.3、发明名称为“图像处理方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910280193.3, and the invention title is "Image processing methods, devices, storage media and electronic equipment" on April 9, 2019, the entire contents of which are incorporated by reference In this application.
技术领域Technical field
本申请涉及计算机技术领域,具体涉及一种图像处理方法、装置、存储介质及电子设备。This application relates to the field of computer technology, in particular to an image processing method, device, storage medium and electronic equipment.
背景技术Background technique
由于电子设备本身的硬件限制,目前的电子设备只能拍摄亮度范围比较小的场景,若在场景明暗相差太大时进行拍摄,拍摄出来的图像容易丢失明处和/或暗处的细节。Due to the hardware limitations of the electronic device itself, the current electronic device can only shoot scenes with a relatively small brightness range. If the scene is shot when the brightness of the scene is too different, the captured images are likely to lose the details of the bright and/or dark areas.
发明内容Summary of the invention
本申请实施例提供了一种图像处理方法、装置、存储介质及电子设备,能够灵活的实现图像拍摄的高动态范围效果。The embodiments of the present application provide an image processing method, device, storage medium, and electronic equipment, which can flexibly realize the high dynamic range effect of image shooting.
第一方面,本申请实施例提供了一种图像处理方法,应用于电子设备,所述图像处理方法包括:In the first aspect, an embodiment of the present application provides an image processing method applied to an electronic device, and the image processing method includes:
检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
若否,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;If not, acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter, and synthesizing the plurality of first scene images to obtain the first high dynamic range image of the shooting scene;
若是,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If so, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain the second high dynamic range image of the shooting scene.
第二方面,本申请实施例提供了一种图像处理装置,应用于电子设备,所述图像处理装置包括:In a second aspect, an embodiment of the present application provides an image processing device, which is applied to electronic equipment, and the image processing device includes:
检测模块,用于检测拍摄场景中是否存在满足预设运动条件的目标物体;The detection module is used to detect whether there is a target object meeting preset motion conditions in the shooting scene;
第一合成模块,用于在所述拍摄场景中不存在所述目标物体时,按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;The first synthesis module is configured to obtain multiple first scene images of the shooting scene according to the same exposure parameter when the target object does not exist in the shooting scene, and synthesize the multiple first scene images to obtain the The first high dynamic range image of the shooting scene;
第二合成模块,用于在所述拍摄场景中存在所述目标物体时,按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。The second synthesis module is used to obtain a plurality of second scene images of the shooting scene according to different exposure parameters when the target object exists in the shooting scene, and synthesize a plurality of the second scene images to obtain the shooting The second highest dynamic range image of the scene.
第三方面,本申请实施例提供了一种存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行:In the third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute:
检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
若否,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;If not, acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter, and synthesizing the plurality of first scene images to obtain the first high dynamic range image of the shooting scene;
若是,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If so, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain the second high dynamic range image of the shooting scene.
第四方面,本申请实施例提供了一种电子设备,包括处理器和存储器,所述存储器存储有计算机程序,所述处理器通过调用所述计算机程序,用于执行:In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory stores a computer program, and the processor invokes the computer program to execute:
检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
若否,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;If not, acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter, and synthesizing the plurality of first scene images to obtain the first high dynamic range image of the shooting scene;
若是,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If so, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain the second high dynamic range image of the shooting scene.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
图1是本申请实施例提供的图像处理方法的一流程示意图。FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
图2是本申请实施例中合成得到第一高动态范围图像的一示意图。FIG. 2 is a schematic diagram of a first high dynamic range image synthesized in an embodiment of the present application.
图3是本申请实施例中同一物体在拍摄场景的两个缓存图像中的位置区域示意图。FIG. 3 is a schematic diagram of the location area of the same object in two cache images of the shooting scene in an embodiment of the present application.
图4是本申请实施例中同一物体的合并位置区域示意图。Fig. 4 is a schematic diagram of a combined position area of the same object in an embodiment of the present application.
图5是本申请实施例中电子设备的第一摄像头和第二摄像头的设置位置示意图。FIG. 5 is a schematic diagram of the location of the first camera and the second camera of the electronic device in an embodiment of the present application.
图6是本申请实施例提供的图像处理方法的另一流程示意图。FIG. 6 is another schematic flowchart of the image processing method provided by the embodiment of the present application.
图7是本申请实施例提供的图像处理装置的一结构示意图。FIG. 7 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application.
图8是本申请实施例提供的电子设备的一结构示意图。FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
图9是本申请实施例提供的电子设备的另一结构示意图。FIG. 9 is another schematic diagram of the structure of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Please refer to the drawings, in which the same component symbols represent the same components, and the principle of the present application is implemented in an appropriate computing environment for illustration. The following description is based on the exemplified specific embodiments of the present application, which should not be regarded as limiting other specific embodiments that are not described in detail herein.
本申请实施例首先提供一种图像处理方法,该图像处理方法应用于电子设备。其中,该图像处理方法的执行主体可以是本申请实施例提供的图像处理装置,或者集成了该图像处理装置的电子设备,该图像处理装置可以采用硬件或者软件的方式实现,电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑、或者台式电脑等配置有处理器而具有处理能力的设备。The embodiment of the present application first provides an image processing method, which is applied to an electronic device. Wherein, the execution subject of the image processing method may be the image processing device provided in the embodiment of the present application, or an electronic device integrated with the image processing device. The image processing device may be implemented in hardware or software, and the electronic device may be a smart device. Mobile phones, tablet computers, handheld computers, notebook computers, or desktop computers are equipped with processors and have processing capabilities.
本申请提供一种图像处理方法,包括:This application provides an image processing method, including:
检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
若否,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;If not, acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter, and synthesizing the plurality of first scene images to obtain the first high dynamic range image of the shooting scene;
若是,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If so, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain the second high dynamic range image of the shooting scene.
在一实施例中,所述检测拍摄场景中是否存在满足预设运动条件的目标物体,包括:In an embodiment, the detecting whether there is a target object meeting a preset motion condition in the shooting scene includes:
从预设的图像缓存队列中获取所述拍摄场景的两个缓存图像;Acquiring two cached images of the shooting scene from a preset image cache queue;
识别同一物体在两个所述缓存图像中的位置区域;Identifying the location area of the same object in the two cached images;
合并所述同一物体在两个所述缓存图像中的位置区域得到合并位置区域;Combining the location areas of the same object in the two cache images to obtain a combined location area;
判断所述合并位置区域相对于所述缓存图像的占比是否达到预设占比,是则判定所述同一物体为所述目标物体,否则判定所述拍摄场景中不存在所述目标物体。It is determined whether the proportion of the combined location area relative to the cache image reaches a preset proportion, if yes, it is determined that the same object is the target object, otherwise it is determined that the target object does not exist in the shooting scene.
在一实施例中,所述按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像之前,还包括:In an embodiment, before the acquiring multiple first scene images of the shooting scene according to the same exposure parameter and synthesizing the multiple first scene images to obtain the first high dynamic range image of the shooting scene, the method further includes :
识别所述目标物体在两个所述缓存图像中的位置区域是否为显著区域;Identifying whether the location area of the target object in the two cache images is a salient area;
若是,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像。If so, acquire multiple first scene images of the shooting scene according to the same exposure parameter, and synthesize the multiple first scene images to obtain the first high dynamic range image of the shooting scene.
在一实施例中,所述识别所述目标物体在两个所述缓存图像中的位置区域是否为显著区域之后,还包括:In an embodiment, after identifying whether the location area of the target object in the two cache images is a salient area, the method further includes:
若否,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If not, acquiring multiple second scene images of the shooting scene according to different exposure parameters, and synthesizing multiple second scene images to obtain a second high dynamic range image of the shooting scene.
在一实施例中,所述按照同一曝光参数获取所述拍摄场景的多个第一场景图像,包括:In an embodiment, the acquiring multiple first scene images of the shooting scene according to the same exposure parameter includes:
分别通过第一摄像头和第二摄像头按照同一曝光参数获取所述拍摄场景的多个所述第一场景图像;Acquiring the multiple first scene images of the shooting scene through a first camera and a second camera respectively according to the same exposure parameter;
所述按照不同曝光参数获取所述拍摄场景的多个第二场景图像,包括:The acquiring multiple second scene images of the shooting scene according to different exposure parameters includes:
分别通过所述第一摄像头和所述第二摄像头按照不同曝光参数获取所述拍摄场景的多个所述第二场景图像。The multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
在一实施例中,所述图像处理方法还包括:In an embodiment, the image processing method further includes:
将所述第一高动态范围图像或者所述第二高动态范围图像作为所述拍摄场景的预览图像进行展示。The first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
在一实施例中,所述图像处理方法还包括:In an embodiment, the image processing method further includes:
在合成得到所述第一高动态范围图像之前,根据屏幕当前的分辨率对多个所述第一场景图像进行降采样处理;Before synthesizing the first high dynamic range image, performing down-sampling processing on a plurality of the first scene images according to the current resolution of the screen;
或者,在合成得到所述第二高动态范围图像之前,根据屏幕当前的分辨率对多个所述第二场景图像进行降采样处理。Alternatively, before the second high dynamic range image is synthesized, the multiple second scene images are down-sampled according to the current resolution of the screen.
在一实施例中,所述按照同一曝光参数获取所述拍摄场景的多个第一场景图像,包括:In an embodiment, the acquiring multiple first scene images of the shooting scene according to the same exposure parameter includes:
按照预设短曝光时长对所述拍摄场景进行曝光,得到多个所述第一场景图像。Exposing the shooting scene according to a preset short exposure duration to obtain multiple images of the first scene.
在一实施例中,所述按照不同曝光参数获取所述拍摄场景的多个第二场景图像,包括:In an embodiment, the acquiring multiple second scene images of the shooting scene according to different exposure parameters includes:
按照预设过曝光值和预设欠曝光值分别对所述拍摄场景进行曝光,得到两个所述第二场景图像。The shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
请参照图1,图1为本申请实施例提供的图像处理方法的流程示意图。该图像处理方法应用于本申请实施例提供的电子设备,如图1所示,本申请实施例提供的图像处理方法的流程可以如下:Please refer to FIG. 1, which is a schematic flowchart of an image processing method provided by an embodiment of this application. The image processing method is applied to the electronic device provided in the embodiment of the application. As shown in FIG. 1, the flow of the image processing method provided in the embodiment of the application may be as follows:
在101中,检测拍摄场景中是否存在满足预设运动条件的目标物体,是则转入103,否则转入102。In 101, detect whether there is a target object that meets the preset motion conditions in the shooting scene, if yes, go to 103, otherwise go to 102.
其中,电子设备在根据用户操作启动拍摄类应用程序(比如电子设备的系统应用“相机”)后,其摄像头所对准的场景即为拍摄场景。比如,用户通过手指点击电子设备上“相机”应用的图标启动“相机应用”后,若用户使用电子设备的摄像头对准一包括XX物体的场景,则该包括XX物体的场景即为拍摄场景。根据以上描述,本领域技术人员应当理解的是,拍摄场景并非特指某一特定场景,而是跟随摄像头的指向所实时对准的场景。Among them, after the electronic device starts a shooting application (for example, the system application "camera" of the electronic device) according to a user operation, the scene to which the camera is aimed is the shooting scene. For example, after the user clicks on the icon of the “camera” application on the electronic device to start the “camera application”, if the user uses the camera of the electronic device to aim at a scene including XX objects, the scene including XX objects is the shooting scene. Based on the above description, those skilled in the art should understand that the shooting scene does not specifically refer to a specific scene, but a scene that is aligned in real time following the direction of the camera.
在本申请实施例中,电子设备首先检测拍摄场景中是否存在满足预设运动条件的目标物体,从而根据检测结果来采用合适的高动态范围合成技术合成得到拍摄场景的高动态范围图像。In the embodiment of the present application, the electronic device first detects whether there is a target object that meets a preset motion condition in the shooting scene, so as to synthesize a high dynamic range image of the shooting scene by using a suitable high dynamic range synthesis technique according to the detection result.
其中,对于采用何种方式来检测拍摄场景中是否存在目标物体,本申请实施例不做具体限制,可由本领域普通技术人员是根据实际需要选取合适的检测方式,比如,可以采用光流法、残差法等。Among them, the method of detecting whether there is a target object in the shooting scene is not specifically limited in the embodiment of this application, and a person of ordinary skill in the art can select a suitable detection method according to actual needs. For example, optical flow method, Residual error method, etc.
应当说明的是,电子设备中还预先设置有图像缓存队列,该图像缓存队列可以为定长队列,也可以为变长队列,比如,该图像缓存队列为定长队列,能够缓存8个图像。电子设备在使能摄像头后,会将摄像头实时采集到的图像缓存到图像缓存队列中。It should be noted that an image cache queue is also preset in the electronic device, and the image cache queue may be a fixed-length queue or a variable-length queue. For example, the image cache queue is a fixed-length queue and can cache 8 images. After enabling the camera, the electronic device caches the images collected by the camera in real time into the image cache queue.
以残差法为例,电子设备在检测拍摄场景中是否存在满足预设运动条件的目标物体时,可以首先从其预设的图像缓存队列中获取到拍摄场景的两个在时间上相邻的缓存图像,将其记为第一缓存图像和第二缓存图像。然后,电子设备将第一缓存图像和第二缓存图像相减,得到第一缓存图像和第二缓存图像的残差图像。然后,电子设备确定残差图像中各像素点的亮度值,并确定其中非零亮度的像素点占所有像素点的比例值。最后,电子设备判断非零亮度的像素点占所有像素点的比例值是否小于预设比例值(可由本领域普通技术人员根据实际需要取经验值,比如,可以将该预设比例值配置为25%),是则判定拍摄场景中存在前述目标物体。Taking the residual method as an example, when the electronic device detects whether there is a target object that meets the preset motion conditions in the shooting scene, it can first obtain two temporally adjacent shooting scenes from its preset image buffer queue. Cache images, denote them as the first cache image and the second cache image. Then, the electronic device subtracts the first buffer image and the second buffer image to obtain residual images of the first buffer image and the second buffer image. Then, the electronic device determines the brightness value of each pixel in the residual image, and determines the proportion of pixels with non-zero brightness in all the pixels. Finally, the electronic device determines whether the ratio of pixels with non-zero brightness to all pixels is less than a preset ratio value (a person of ordinary skill in the art can take an empirical value according to actual needs. For example, the preset ratio value can be configured as 25 %), it is determined that the aforementioned target object exists in the shooting scene.
此外,还应当说明的是,在本申请实施例中提供了两种高动态范围合成方式,电子设备在检测拍摄场景中是否存在满足预设运动条件的目标物体之后,根据检测结果选择一种 高动态范围合成方式来合成得到拍摄场景的高动态范围图像。其中,若检测到拍摄场景中存在目标物体,则转入102,选择一种高动态范围合成方式来合成得到拍摄场景的高动态范围图像;若检测到拍摄场景中不存在目标物体,则转入103,选择另一种高动态范围合成方式来合成得到拍摄场景的高动态范围图像。In addition, it should also be noted that two high dynamic range synthesis methods are provided in the embodiments of this application. After detecting whether there is a target object that meets the preset motion conditions in the shooting scene, the electronic device selects a high dynamic range according to the detection result. Dynamic range synthesis method to synthesize a high dynamic range image of the shooting scene. Among them, if the target object is detected in the shooting scene, then go to 102, select a high dynamic range synthesis method to synthesize the high dynamic range image of the shooting scene; if it is detected that there is no target object in the shooting scene, then go to 103. Select another high dynamic range synthesis method to synthesize a high dynamic range image of the shooting scene.
在102中,按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像。In 102, a plurality of first scene images of a shooting scene are acquired according to the same exposure parameter, and the plurality of first scene images are synthesized to obtain a first high dynamic range image of the shooting scene.
其中,曝光参数包括曝光值(即俗称的EV值)或曝光时长,电子设备在按照同一曝光参数获取拍摄场景的多个第一场景图像时,可以按照预设短曝光时长获取拍摄场景的多个第一场景图像。比如,电子设备控制摄像头按照预设短曝光时长1毫秒对拍摄场景进行多次曝光,由此得到拍摄场景的多个第一场景图像,换言之,获取到的这多个第一场景图像,即为拍摄场景的多个短曝光图像。Wherein, the exposure parameter includes exposure value (commonly known as EV value) or exposure duration. When the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, it can acquire multiple shooting scenes according to the preset short exposure duration. The first scene image. For example, the electronic device controls the camera to perform multiple exposures on the shooting scene according to a preset short exposure time of 1 millisecond, thereby obtaining multiple first scene images of the shooting scene. In other words, the acquired multiple first scene images are Multiple short exposure images of the shooting scene.
本申请实施例中,电子设备在获取到拍摄场景的多个第一场景图像后,进一步通过多帧短曝的方式合成多个第一场景图像得到拍摄场景的第一高动态范围图像。In the embodiment of the present application, after acquiring the multiple first scene images of the shooting scene, the electronic device further synthesizes the multiple first scene images in a multi-frame short exposure manner to obtain the first high dynamic range image of the shooting scene.
其中,电子设备在合成多个第一场景图像得到拍摄场景的第一高动态范围图像时,首先对多个第一场景图像进行多帧降噪合成,得到一个降噪合成图像。可以理解的是,由于第一场景图像为短曝光图像,其将更多保留拍摄场景中较亮区域的特征。同样的,对多个第一场景图像进行多帧降噪合成而得到的降噪合成图像同样更多保留的是拍摄场景中较亮区域的特征。此时,电子设备进一步提升降噪合成图像的亮度,使得拍摄场景中较亮区域的特征以及较暗区域的特征得以同时呈现,得到拍摄场景的高动态范围图像,记为第一高动态范围图像。Wherein, when the electronic device synthesizes the multiple first scene images to obtain the first high dynamic range image of the shooting scene, it first performs multi-frame noise reduction synthesis on the multiple first scene images to obtain a noise reduction composite image. It can be understood that since the first scene image is a short exposure image, it will retain more features of the brighter area in the shooting scene. Similarly, the noise-reduction composite image obtained by performing multi-frame noise reduction synthesis on multiple first scene images also retains more features of the brighter area in the shooting scene. At this time, the electronic device further improves the brightness of the noise-reduction synthesized image, so that the characteristics of the brighter area and the darker area in the shooting scene can be simultaneously presented, and the high dynamic range image of the shooting scene is obtained, which is recorded as the first high dynamic range image .
比如,假设电子设备共获取到拍摄场景的4个第一场景图像,分别为第一场景图像A、第一场景图像B、第一场景图像C以及第一场景图像D。For example, suppose that the electronic device acquires a total of 4 first scene images of the shooting scene, which are the first scene image A, the first scene image B, the first scene image C, and the first scene image D, respectively.
请参照图2,电子设备首先从第一场景图像A、第一场景图像B、第一场景图像C以及第一场景图像D中选定一个作为基准图像,假定选择第一场景图像A为基准图像,则电子设备将第一场景图像B、第一场景图像C以及第一场景图像D与第一场景图像A对齐,再基于对齐后的各图像,计算得到各像素点的平均像素值(比如,假设某位置的像素点在四个第一场景图像中的像素值分别为:“0.8,0.9,1.1,1.2”,则可计算得到该位置的像素点的平均像素值为“1”)。之后,根据各位置的平均像素值得到降噪合成图像。其中,可以将基准图像(即第一场景图像A)的各像素点的像素值相应调整为计算得到的各平均像素值,从而得到降噪合成图像,还可以根据计算得到各平均像素值,生成一幅新的图像,将生成的图像作为降噪合成图像。对于降噪合成图像,电子设备进一步提升其亮度,得到拍摄场景的第一高动态范围图像。Referring to FIG. 2, the electronic device first selects one of the first scene image A, the first scene image B, the first scene image C, and the first scene image D as the reference image, assuming that the first scene image A is selected as the reference image , The electronic device aligns the first scene image B, the first scene image C, and the first scene image D with the first scene image A, and then calculates the average pixel value of each pixel based on the aligned images (for example, Assuming that the pixel values of a pixel at a certain position in the four first scene images are: "0.8, 0.9, 1.1, 1.2", the average pixel value of the pixel at this position can be calculated as "1"). After that, the noise-reduction composite image is obtained according to the average pixel value of each position. Among them, the pixel value of each pixel of the reference image (that is, the first scene image A) can be adjusted to the calculated average pixel value to obtain the noise reduction composite image, and the average pixel value can also be calculated according to the calculation to generate A new image, using the generated image as a noise reduction composite image. For the noise reduction composite image, the electronic device further enhances its brightness to obtain the first high dynamic range image of the shooting scene.
在103中,按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。In 103, multiple second scene images of the shooting scene are acquired according to different exposure parameters, and the multiple second scene images are synthesized to obtain the second high dynamic range image of the shooting scene.
其中,作为一种可选的实施方式,在按照不同曝光参数获取拍摄场景的多个第二场景图像时,电子设备可以按照预设短曝光时长和长曝光时长交叠的方式获取拍摄场景的多个第二场景图像。换言之,即两个相邻曝光的第二场景图像中,一个第二场景图像为短曝光图像,另一个第二场景图像为长曝光图像。这样即可通过长、短曝合成的方式合成得到拍摄场景的第二高动态范围图像。Among them, as an optional implementation manner, when acquiring multiple second scene images of the shooting scene according to different exposure parameters, the electronic device may acquire the multiple images of the shooting scene in a manner that the preset short exposure duration and the long exposure duration overlap. A second scene image. In other words, among two adjacently exposed second scene images, one second scene image is a short exposure image, and the other second scene image is a long exposure image. In this way, the second high dynamic range image of the shooting scene can be synthesized by combining long and short exposures.
比如,电子设备获取到一个短曝光时长的第二场景图像以及一个长曝光时长的第二场景图像,由于短曝光时长的第二场景图像保留了拍摄场景中较亮区域的特征,而长曝光时长的第二场景图像保留了拍摄场景中较暗区域的特征,则在合成时,可以利用长曝光时长的第二场景图像保留的拍摄场景中较暗区域的特征以及短曝光时长的第二场景图像保留的拍摄场景中较亮区域的特征进行合成得到拍摄场景的第二高动态范围图像。For example, the electronic device acquires a second scene image with a short exposure time and a second scene image with a long exposure time. Because the second scene image with a short exposure time retains the characteristics of the brighter area in the shooting scene, the long exposure time The second scene image retains the characteristics of the darker area in the shooting scene, so when compositing, the features of the darker area in the shooting scene retained by the second scene image with long exposure time and the second scene image with short exposure time can be used The retained features of the brighter area in the shooting scene are synthesized to obtain the second high dynamic range image of the shooting scene.
作为另一种可选的实施方式,在按照不同的曝光参数获取拍摄场景的多个第二场景图像,电子设备可以按照不同的曝光值来获取拍摄场景的多个第二场景图像,其中,电子设备可以按照预设过曝光值和预设欠曝光值分别对拍摄场景进行曝光,得到拍摄场景的两个第二场景图像,还可以按照预设过曝光值、预设正常曝光值以及预设欠曝光值分别对拍摄场景进行曝光,得到拍摄场景的三个第二场景图像等。As another optional implementation manner, after acquiring multiple second scene images of the shooting scene according to different exposure parameters, the electronic device may acquire multiple second scene images of the shooting scene according to different exposure values, where the electronic The device can respectively expose the shooting scene according to the preset overexposure value and the preset underexposure value to obtain two second scene images of the shooting scene. It can also according to the preset overexposure value, preset normal exposure value and preset underexposure value. The exposure values respectively expose the shooting scene to obtain three second scene images of the shooting scene and so on.
比如,电子设备可以控制摄像头分别按照预设正常曝光值EV0、预设欠曝光值EV-2以及预设过曝光值EV2对拍摄场景进行曝光,由此得到拍摄场景的三个第二场景图像,分别为正常曝光图像、过曝图像以及欠曝图像,从而通过包围曝光合成的方式来合成得到拍摄场景的第二高动态范围图像。For example, the electronic device can control the camera to expose the shooting scene according to the preset normal exposure value EV0, the preset underexposure value EV-2, and the preset overexposure value EV2, thereby obtaining three second scene images of the shooting scene. They are respectively a normal exposure image, an overexposed image, and an underexposed image, so that the second high dynamic range image of the shooting scene is synthesized through the bracketing synthesis method.
由上可知,本申请实施例中,电子设备可以通过检测拍摄场景中是否存在满足预设运动条件的目标物体;若否,则按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像;若是,则按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。通过这种根据拍摄场景的实际状态采用的对应的高动态范围图像合成方式来合成得到拍摄场景的高动态范围图像,能够灵活的实现图像拍摄的高动态范围效果。It can be seen from the above that, in the embodiment of the present application, the electronic device can detect whether there is a target object that meets the preset motion condition in the shooting scene; if not, it acquires multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizes multiple images. One first scene image to obtain the first high dynamic range image of the shooting scene; if so, multiple second scene images of the shooting scene are obtained according to different exposure parameters, and multiple second scene images are synthesized to obtain the second high dynamic range image of the shooting scene image. The high dynamic range image of the shooting scene is synthesized through the corresponding high dynamic range image synthesis method adopted according to the actual state of the shooting scene, which can flexibly realize the high dynamic range effect of image shooting.
在一实施例中,“检测拍摄场景中是否存在满足预设运动条件的目标物体”,包括:In an embodiment, "detecting whether there is a target object meeting a preset motion condition in the shooting scene" includes:
(1)从预设的图像缓存队列中获取拍摄场景的两个缓存图像;(1) Obtain two cached images of the shooting scene from the preset image cache queue;
(2)识别同一物体在两个缓存图像中的位置区域;(2) Identify the location area of the same object in two cached images;
(3)合并同一物体在两个缓存图像中的位置区域得到合并位置区域;(3) Combine the location areas of the same object in the two cache images to obtain a combined location area;
(4)判断合并位置区域相对于任一缓存图像的占比是否达到预设占比,是则判定前述同一物体为目标物体,否则判定拍摄场景中不存在目标物体。(4) Determine whether the proportion of the combined location area relative to any cached image reaches the preset proportion, if yes, determine the same object as the target object, otherwise determine that there is no target object in the shooting scene.
本申请实施例中,电子设备在检测拍摄场景中是否存在满足预设运动条件的目标物体时,首先从其预设的图像缓存队列中获取到拍摄场景的两个在时间上相邻的缓存图像,将其记为第三缓存图像和第四缓存图像。然后,电子设备利用语义分割技术对第三缓存图像 和第四缓存图像分别进行语义分割,从而确定出第三缓存图像和第四缓存图像中存在的物体及其对应的位置区域。然后,电子设备根据对第三缓存图像和第四缓存图像的语义分割结果,识别出同一物体在第三缓存图像和第四缓存图像中的位置区域,比如,请参照图3,物体A在第四缓存图像中位置区域相较于其在第三缓存图像中的位置区域向右移动一定距离。然后,电子设备合并同一物体在第三缓存图像和第四缓存图像中的位置区域得到合并位置区域,如图4所示。最后,电子设备判断合并位置区域相对于第三缓存图像或第四缓存图像的占比是否达到预设占比,是则判定前述同一物体为满足预设条件的目标物体,否则判定拍摄场景中不存在目标物体。In the embodiment of the present application, when the electronic device detects whether there is a target object meeting preset motion conditions in the shooting scene, it first obtains two temporally adjacent cached images of the shooting scene from its preset image buffer queue , Mark it as the third cache image and the fourth cache image. Then, the electronic device uses semantic segmentation technology to perform semantic segmentation on the third cached image and the fourth cached image respectively, thereby determining the objects existing in the third cached image and the fourth cached image and their corresponding location regions. Then, the electronic device recognizes the location area of the same object in the third cache image and the fourth cache image according to the semantic segmentation results of the third cache image and the fourth cache image. For example, refer to Figure 3, the object A is in the first cache image. The location area in the fourth buffer image moves a certain distance to the right compared to its location area in the third buffer image. Then, the electronic device merges the position areas of the same object in the third cache image and the fourth cache image to obtain a merged position area, as shown in FIG. 4. Finally, the electronic device determines whether the proportion of the combined location area with respect to the third or fourth cached image reaches the preset proportion, and if yes, it determines that the aforementioned same object is a target object that meets the preset conditions; otherwise, it determines that there is no There is a target object.
应当说明的是,前述预设占比的大小取决于前述同一物体相对于第三缓存图像(或第四缓存图像)的占比,可将其表示为:It should be noted that the size of the aforementioned preset proportion depends on the proportion of the aforementioned same object relative to the third buffer image (or fourth buffer image), which can be expressed as:
P=p+kp;P=p+kp;
其中,P表示预设占比,p表示前述同一物体相对于第三缓存图像(或第四缓存图像)的占比,k表示修订系数,可由本领域普通技术人员根据实际需要取合适值,比如,将k取值为0.25时,P=1.25p,通俗的说,即当拍摄场景中有物体的位移达到其所占位置区域的1/4时,电子设备将该物体判定为目标物体,也即是移动物体,而当拍摄场景中没有物体的位移达到其所占位置区域的1/4时,电子设备将判定拍摄场景中不存在目标物体,也即是不存在移动物体。Among them, P represents the preset proportion, p represents the proportion of the aforementioned same object relative to the third cache image (or fourth cache image), and k represents the revision coefficient, which can be selected by those of ordinary skill in the art according to actual needs, such as When the value of k is 0.25, P=1.25p. In layman's terms, when the displacement of an object in the shooting scene reaches 1/4 of its occupied position area, the electronic device determines the object as the target object. It is a moving object, and when the displacement of no object in the shooting scene reaches 1/4 of its occupied position area, the electronic device will determine that there is no target object in the shooting scene, that is, there is no moving object.
在一实施例中,“按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像”之前,还包括:In an embodiment, before “acquiring multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizing the multiple first scene images to obtain the first high dynamic range image of the shooting scene”, it further includes:
(1)识别前述目标物体在两个缓存图像中的位置区域是否为显著区域;(1) Identify whether the location area of the aforementioned target object in the two cached images is a salient area;
(2)若是,则按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像。(2) If yes, acquire multiple first scene images of the shooting scene according to the same exposure parameter, and synthesize the multiple first scene images to obtain the first high dynamic range image of the shooting scene.
应当说明的是,场景的显著区域即为用户更容易注意到的区域,比如普遍认为人物、动物要比天空、草地以及建筑物的显著性更高。通常的,人们更愿意将拍摄场景中的显著区域作为拍摄主体进行拍摄。因此,在前述同一物体对应的合并位置区域相对于任一缓存图像的占比达到预设占比,也即是前述同一物体为拍摄场景中的移动物体时,电子设备进一步识别该移动物体在第三缓存图像或第四缓存图像中的位置区域是否为显著区域。比如,可由本领域普通技术人员根据实际需要预先配置电子设备采用的显著区域识别方式,从而由电子设备根据预先配置的显著区域识别方式识别出第三缓存图像和第四缓存图像中的显著区域,并判断前述移动物体的在第三缓存图像中的位置区域是否为其显著区域,以及判断前述移动物体在第四缓存图像中的位置区域是否为其显著区域。It should be noted that the salient area of the scene is the area that is easier for users to notice. For example, it is generally believed that people and animals are more salient than the sky, grass, and buildings. Generally, people are more willing to take a prominent area in the shooting scene as the subject for shooting. Therefore, when the proportion of the merged location area corresponding to the same object to any cached image reaches the preset proportion, that is, when the same object is a moving object in the shooting scene, the electronic device further recognizes that the moving object is in the first Whether the location area in the third buffer image or the fourth buffer image is a salient area. For example, a person of ordinary skill in the art can pre-configure the salient area identification method used by the electronic device according to actual needs, so that the electronic device can identify salient areas in the third cached image and the fourth cached image according to the pre-configured salient area identification method. And it is determined whether the location area of the aforementioned moving object in the third cache image is a salient area, and whether the location area of the aforementioned moving object in the fourth cache image is a salient area.
其中,若识别到前述移动物体在第三缓存图像以及第四缓存图像中的位置区域为显著区域,则按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像,以避免第一高动态范围图像中存在鬼影。Among them, if it is recognized that the location area of the aforementioned moving object in the third cache image and the fourth cache image is a salient area, multiple first scene images of the shooting scene are acquired according to the same exposure parameter, and multiple first scene images are synthesized to obtain The first high dynamic range image of the shooting scene is taken to avoid ghost images in the first high dynamic range image.
在一实施例中,“识别前述目标物体在两个缓存图像中的位置区域是否为显著区域”之后,还包括:In an embodiment, after "identifying whether the location area of the aforementioned target object in the two cached images is a salient area", it further includes:
若否,则按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。If not, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize the multiple second scene images to obtain the second high dynamic range image of the shooting scene.
其中,在识别到前述目标物体在两个缓存图像中的位置区域不为显著区域,也即是拍摄场景中的移动物体不是拍摄主体时,电子设备按照不同曝光参数获取拍摄场景的多个第二场景图像,并合成多个第二场景图像得到拍摄场景的第二高动态范围图像。这样,即使合成得到的第二高动态范围图像中存在鬼影(对应前述目标物体,即拍摄场景中的移动物体),也对图像整体效果影响较小,但是可以获得更好的高动态范围效果。Wherein, when it is recognized that the location area of the aforementioned target object in the two cached images is not a salient area, that is, the moving object in the shooting scene is not the subject of the shooting, the electronic device acquires multiple second images of the shooting scene according to different exposure parameters. Scene image, and synthesize multiple second scene images to obtain a second high dynamic range image of the shooting scene. In this way, even if there are ghosts in the synthesized second high dynamic range image (corresponding to the aforementioned target object, that is, the moving object in the shooting scene), it will have less impact on the overall image effect, but a better high dynamic range effect can be obtained .
在一实施例中,“按照同一曝光参数获取拍摄场景的多个第一场景图像”,包括:In an embodiment, "acquiring multiple first scene images of the shooting scene according to the same exposure parameter" includes:
分别通过第一摄像头和第二摄像头按照同一曝光参数获取拍摄场景的多个第一场景图像;Acquiring multiple first scene images of the shooting scene through the first camera and the second camera respectively according to the same exposure parameter;
“按照不同曝光参数获取拍摄场景的多个第二场景图像”,包括:"Acquiring multiple second scene images of the shooting scene according to different exposure parameters" includes:
分别通过第一摄像头和第二摄像头按照不同曝光参数获取拍摄场景的多个第二场景图像。The multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
请参照图5,在本申请实施例中,电子设备的同一侧设置有第一摄像头和第二摄像头。Referring to FIG. 5, in the embodiment of the present application, a first camera and a second camera are provided on the same side of the electronic device.
一方面,电子设备在按照同一曝光参数获取拍摄场景的多个第一场景图像时,即可分别通过第一摄像头和第二摄像头按照同一曝光参数获取拍摄场景的多个第一场景图像。从而提高第一场景图像的获取效率,使得第一高动态范围图像的合成效率得以提高。比如,电子设备同步通过第一摄像头和第二摄像头按照短曝光时长对拍摄场景进行曝光,利用一次曝光操作即可获取到拍摄场景的两个第一场景图像。On the one hand, when the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, it can acquire multiple first scene images of the shooting scene through the first camera and the second camera respectively according to the same exposure parameter. Therefore, the acquisition efficiency of the first scene image is improved, and the synthesis efficiency of the first high dynamic range image is improved. For example, the electronic device simultaneously uses the first camera and the second camera to expose the shooting scene according to the short exposure time, and two first scene images of the shooting scene can be acquired with one exposure operation.
另一方面,电子设备在按照不同曝光参数获取拍摄场景的多个第二场景图像时,即可分别提供第一摄像头和第二摄像头按照不同曝光参数获取拍摄场景的多个第二场景图像。从而提高第二场景图像的获取效率,使得第二高动态范围图像的合成效率得以提高。比如,电子设备分别通过第一摄像头按照短曝光时长对拍摄场景进行曝光、通过第二摄像头按照长曝光时长对拍摄场景进行曝光,利用一次曝光操作即可获取到拍摄场景的两个第二场景图像,分别为短曝光图像和长曝光图像。On the other hand, when the electronic device acquires multiple second scene images of the shooting scene according to different exposure parameters, it can provide the first camera and the second camera to acquire multiple second scene images of the shooting scene according to different exposure parameters, respectively. Thereby, the acquisition efficiency of the second scene image is improved, so that the synthesis efficiency of the second high dynamic range image is improved. For example, the electronic device exposes the shooting scene according to the short exposure time through the first camera, and exposes the shooting scene according to the long exposure time through the second camera. Two second scene images of the shooting scene can be obtained with one exposure operation. , Respectively, short exposure image and long exposure image.
在一实施例中,本申请提供的图像处理方法还包括:In an embodiment, the image processing method provided in this application further includes:
将第一高动态范围图像或者第二高动态范围图像作为拍摄场景的预览图像进行展示。The first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
本申请实施例中,电子设备在合成得到第一高动态范围图像之后,将合成得到的第一高动态范围图像作为拍摄场景的预览图像进行展示,或者,在合成得到第二高动态范围图像之后,将合成得到的第二高动态范围图像作为拍摄场景的预览图像进行展示。In the embodiment of the present application, after the electronic device synthesizes the first high dynamic range image, it displays the synthesized first high dynamic range image as a preview image of the shooting scene, or after synthesizing the second high dynamic range image , The second high dynamic range image obtained by synthesis is displayed as a preview image of the shooting scene.
以上通过将第一高动态范围图像或者第二高动态范围图像作为拍摄场景的预览图像进行展示,可以使得用户提前查看到对拍摄场景进行拍照所得的图像的高动态范围效果,帮 助用户更好的拍照。By displaying the first high dynamic range image or the second high dynamic range image as the preview image of the shooting scene, the user can view the high dynamic range effect of the image obtained by taking a picture of the shooting scene in advance, and help the user better Take pictures.
在一实施例中,本申请提供的图像处理方法还包括:In an embodiment, the image processing method provided in this application further includes:
根据第一高动态范围图像或者第二高动态范围图像进行视频编码,得到拍摄场景的视频。Perform video encoding according to the first high dynamic range image or the second high dynamic range image to obtain a video of the shooting scene.
其中,电子设备还可以根据第一高动态范围图像或者第二高动态范围图像进行视频编码,得到拍摄场景的视频,即在对拍摄场景录像时,使得录像得到视频也具有高动态范围效果。The electronic device may also perform video encoding according to the first high dynamic range image or the second high dynamic range image to obtain a video of the shooting scene, that is, when the shooting scene is recorded, the video obtained by the recording also has a high dynamic range effect.
应当说明的是,对于采用何种视频编码格式进行视频编码,本申请实施例中不做具体限制,可由本领域普通技术人员根据实际需要选取合适的视频编码格式,包括但不限于H.264、H.265、MPEG-4等等。It should be noted that there are no specific restrictions on which video coding format is used for video coding in the embodiments of this application, and a person of ordinary skill in the art can select a suitable video coding format according to actual needs, including but not limited to H.264, H.265, MPEG-4, etc.
在一实施例中,本申请提供的图像处理方法还包括:In an embodiment, the image processing method provided in this application further includes:
在合成得到第一高动态范围图像之前,根据屏幕当前的分辨率对多个第一场景图像进行降采样处理;Before synthesizing the first high dynamic range image, perform down-sampling processing on the multiple first scene images according to the current resolution of the screen;
或者,在合成得到第二高动态范围图像之前,根据屏幕当前的分辨率对多个第二场景图像进行降采样处理。Alternatively, before the second high dynamic range image is synthesized, the multiple second scene images are down-sampled according to the current resolution of the screen.
本领域普通技术人员应当理解的是,预览图像的实际分辨率大于屏幕显示的分辨率情况,相较于预览图像的实际分辨率等于屏幕显示分辨率的情况并不会获得更好的显示效果。Those of ordinary skill in the art should understand that the actual resolution of the preview image is greater than the resolution displayed on the screen, and a better display effect will not be obtained compared to the case where the actual resolution of the preview image is equal to the screen display resolution.
因此,电子设备在合成得到第一高动态范围图像之前,首先获取到屏幕当前的分辨率,再根据屏幕当前的分辨率对多个第一场景图像进行降采样处理,使得多个第一场景图像的分辨率与屏幕当前的分辨率一致,进而使得合成得到的第一高动态范围图像的分辨率与屏幕当前的分辨率一致。这样,能够提高第一高动态范围图像的合成效率,并且在将第一高动态范围图像作为预览图像进行展示时,也不会降低其显示效果。Therefore, before synthesizing the first high dynamic range image, the electronic device first obtains the current resolution of the screen, and then down-sampling the multiple first scene images according to the current resolution of the screen, so that the multiple first scene images The resolution of is consistent with the current resolution of the screen, so that the resolution of the synthesized first high dynamic range image is consistent with the current resolution of the screen. In this way, the synthesis efficiency of the first high dynamic range image can be improved, and the display effect of the first high dynamic range image is not reduced when the first high dynamic range image is displayed as a preview image.
另一方面,电子设备在合成得到第二高动态范围图像之前,首先获取到屏幕当前的分辨率,再根据屏幕当前的分辨率对多个第二场景图像进行降采样处理,使得多个第二场景图像的分辨率与屏幕当前的分辨率一致,进而使得合成得到的第二高动态范围图像的分辨率与屏幕当前的分辨率一致。这样,能够提高第二高动态范围图像的合成效率,并且在将第二高动态范围图像作为预览图像进行展示时,也不会降低其显示效果。On the other hand, before the electronic device synthesizes the second high dynamic range image, it first obtains the current resolution of the screen, and then down-sampling the multiple second scene images according to the current resolution of the screen, so that multiple second The resolution of the scene image is consistent with the current resolution of the screen, so that the resolution of the synthesized second high dynamic range image is consistent with the current resolution of the screen. In this way, the synthesis efficiency of the second high dynamic range image can be improved, and when the second high dynamic range image is displayed as a preview image, its display effect will not be reduced.
请参照图6,图6为本申请实施例提供的图像处理方法的另一种流程示意图,该图像处理方法的流程可以包括:Please refer to FIG. 6. FIG. 6 is a schematic diagram of another flow of an image processing method provided by an embodiment of the application. The flow of the image processing method may include:
在201中,电子设备从预设的图像缓存队列中获取拍摄场景的两个缓存图像。In 201, the electronic device obtains two cached images of the shooting scene from a preset image cache queue.
应当说明的是,电子设备中预先设置有图像缓存队列,该图像缓存队列可以为定长队列,也可以为变长队列,比如,该图像缓存队列为定长队列,能够缓存8个图像。电子设备在使能摄像头后,会将摄像头实时采集到的图像缓存到图像缓存队列中。It should be noted that an image cache queue is preset in the electronic device, and the image cache queue may be a fixed-length queue or a variable-length queue. For example, the image cache queue is a fixed-length queue and can cache 8 images. After enabling the camera, the electronic device caches the images collected by the camera in real time into the image cache queue.
其中,电子设备首先从其预设的图像缓存队列中获取到拍摄场景的两个在时间上相邻的缓存图像,将其记为第三缓存图像和第四缓存图像。Wherein, the electronic device first obtains two temporally adjacent cached images of the shooting scene from its preset image cache queue, and records them as the third cached image and the fourth cached image.
在202中,电子设备识别同一物体在两个缓存图像中的位置区域。In 202, the electronic device recognizes the location area of the same object in the two cached images.
其中,电子设备利用语义分割技术对第三缓存图像和第四缓存图像分别进行语义分割,从而确定出第三缓存图像和第四缓存图像中存在的物体及其对应的位置区域。之后,电子设备根据对第三缓存图像和第四缓存图像的语义分割结果,识别出同一物体在第三缓存图像和第四缓存图像中的位置区域,比如,请参照图3,物体A在第四缓存图像中位置区域相较于其在第三缓存图像中的位置区域向右移动一定距离。The electronic device uses semantic segmentation technology to perform semantic segmentation on the third cache image and the fourth cache image respectively, so as to determine the objects existing in the third cache image and the fourth cache image and their corresponding location regions. After that, the electronic device recognizes the location area of the same object in the third cache image and the fourth cache image according to the semantic segmentation results of the third cache image and the fourth cache image. For example, refer to FIG. 3, the object A is in the first cache image. The location area in the fourth buffer image moves a certain distance to the right compared to its location area in the third buffer image.
在203中,电子设备合并前述同一物体在两个缓存图像中的位置区域得到合并位置区域。In 203, the electronic device merges the position areas of the aforementioned same object in the two cache images to obtain a merged position area.
其中,电子设备合并同一物体在第三缓存图像和第四缓存图像中的位置区域得到合并位置区域,如图4所示。Wherein, the electronic device merges the position areas of the same object in the third cache image and the fourth cache image to obtain a merged position area, as shown in FIG. 4.
在204中,电子设备根据合并位置区域相对于任一缓存图像的占比判断前述同一物体是否为满足预设条件的目标物体,是则转入206,否则转入205。In 204, the electronic device judges whether the aforementioned same object is a target object that meets a preset condition according to the proportion of the merged location area relative to any cached image, if yes, go to 206, otherwise go to 205.
比如,电子设备判断合并位置区域相对于第三缓存图像或第四缓存图像的占比是否达到预设占比,是则判定前述同一物体为满足预设条件的目标物体,否则判定拍摄场景中不存在目标物体。For example, the electronic device judges whether the proportion of the combined location area relative to the third or fourth buffer image reaches the preset proportion, and if yes, it judges that the aforementioned same object is a target object that meets the preset condition, otherwise it judges that there is no There is a target object.
应当说明的是,前述预设占比的大小取决于前述同一物体相对于第三缓存图像(或第四缓存图像)的占比,可将其表示为:It should be noted that the size of the aforementioned preset proportion depends on the proportion of the aforementioned same object relative to the third buffer image (or fourth buffer image), which can be expressed as:
P=p+kp;P=p+kp;
其中,P表示预设占比,p表示前述同一物体相对于第三缓存图像(或第四缓存图像)的占比,k表示修订系数,可由本领域普通技术人员根据实际需要取合适值,比如,将k取值为0.25时,P=1.25p,通俗的说,即当拍摄场景中有物体的位移达到其所占位置区域的1/4时,电子设备将该物体判定为目标物体,也即是移动物体,而当拍摄场景中没有物体的位移达到其所占位置区域的1/4时,电子设备将判定拍摄场景中不存在目标物体,也即是不存在移动物体。Among them, P represents the preset proportion, p represents the proportion of the aforementioned same object relative to the third cache image (or fourth cache image), and k represents the revision coefficient, which can be selected by those of ordinary skill in the art according to actual needs, such as When the value of k is 0.25, P=1.25p. In layman's terms, when the displacement of an object in the shooting scene reaches 1/4 of its occupied position area, the electronic device determines the object as the target object. It is a moving object, and when the displacement of no object in the shooting scene reaches 1/4 of its occupied position area, the electronic device will determine that there is no target object in the shooting scene, that is, there is no moving object.
在205中,电子设备按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像。In 205, the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizes the multiple first scene images to obtain the first high dynamic range image of the shooting scene.
其中,曝光参数包括曝光值(即俗称的EV值)或曝光时长,电子设备在按照同一曝光参数获取拍摄场景的多个第一场景图像时,可以按照预设短曝光时长获取拍摄场景的多个第一场景图像。比如,电子设备控制摄像头按照预设短曝光时长对拍摄场景进行多次曝光,由此得到拍摄场景的多个第一场景图像,换言之,获取到的这多个第一场景图像,即为拍摄场景的多个短曝光图像。Wherein, the exposure parameter includes exposure value (commonly known as EV value) or exposure duration. When the electronic device acquires multiple first scene images of the shooting scene according to the same exposure parameter, it can acquire multiple shooting scenes according to the preset short exposure duration. The first scene image. For example, the electronic device controls the camera to perform multiple exposures on the shooting scene according to a preset short exposure time, thereby obtaining multiple first scene images of the shooting scene. In other words, the acquired multiple first scene images are the shooting scene Of multiple short exposure images.
本申请实施例中,电子设备在获取到拍摄场景的多个第一场景图像后,进一步通过多 帧短曝的方式合成多个第一场景图像得到拍摄场景的第一高动态范围图像。In the embodiment of the present application, after acquiring the multiple first scene images of the shooting scene, the electronic device further synthesizes the multiple first scene images by means of multi-frame short exposure to obtain the first high dynamic range image of the shooting scene.
其中,电子设备在合成多个第一场景图像得到拍摄场景的第一高动态范围图像时,首先对多个第一场景图像进行多帧降噪合成,得到一个降噪合成图像。可以理解的是,由于第一场景图像为短曝光图像,其将更多保留拍摄场景中较亮区域的特征。同样的,对多个第一场景图像进行多帧降噪合成而得到的降噪合成图像同样更多保留的是拍摄场景中较亮区域的特征。此时,电子设备进一步提升降噪合成图像的亮度,使得拍摄场景中较亮区域的特征以及较暗区域的特征得以同时呈现,得到拍摄场景的高动态范围图像,记为第一高动态范围图像。Wherein, when the electronic device synthesizes the multiple first scene images to obtain the first high dynamic range image of the shooting scene, it first performs multi-frame noise reduction synthesis on the multiple first scene images to obtain a noise reduction composite image. It can be understood that since the first scene image is a short exposure image, it will retain more features of the brighter area in the shooting scene. Similarly, the noise-reduction composite image obtained by performing multi-frame noise reduction synthesis on multiple first scene images also retains more features of the brighter area in the shooting scene. At this time, the electronic device further improves the brightness of the noise-reduction synthesized image, so that the characteristics of the brighter area and the darker area in the shooting scene can be simultaneously presented, and the high dynamic range image of the shooting scene is obtained, which is recorded as the first high dynamic range image .
比如,假设电子设备共获取到拍摄场景的4个第一场景图像,分别为第一场景图像A、第一场景图像B、第一场景图像C以及第一场景图像D。For example, suppose that the electronic device acquires a total of 4 first scene images of the shooting scene, which are the first scene image A, the first scene image B, the first scene image C, and the first scene image D, respectively.
请参照图2,电子设备首先从第一场景图像A、第一场景图像B、第一场景图像C以及第一场景图像D中选定一个作为基准图像,假定选择第一场景图像A为基准图像,则电子设备将第一场景图像B、第一场景图像C以及第一场景图像D与第一场景图像A对齐,再基于对齐后的各图像,计算得到各像素点的平均像素值(比如,假设某位置的像素点在四个第一场景图像中的像素值分别为:“0.8,0.9,1.1,1.2”,则可计算得到该位置的像素点的平均像素值为“1”)。之后,根据各位置的平均像素值得到降噪合成图像。其中,可以将基准图像(即第一场景图像A)的各像素点的像素值相应调整为计算得到的各平均像素值,从而得到降噪合成图像,还可以根据计算得到各平均像素值,生成一幅新的图像,将生成的图像作为降噪合成图像。对于降噪合成图像,电子设备进一步提升其亮度,得到拍摄场景的第一高动态范围图像。Referring to FIG. 2, the electronic device first selects one of the first scene image A, the first scene image B, the first scene image C, and the first scene image D as the reference image, assuming that the first scene image A is selected as the reference image , The electronic device aligns the first scene image B, the first scene image C, and the first scene image D with the first scene image A, and then calculates the average pixel value of each pixel based on the aligned images (for example, Assuming that the pixel values of a pixel at a certain position in the four first scene images are: "0.8, 0.9, 1.1, 1.2", the average pixel value of the pixel at this position can be calculated as "1"). After that, the noise-reduction composite image is obtained according to the average pixel value of each position. Among them, the pixel value of each pixel of the reference image (that is, the first scene image A) can be adjusted to the calculated average pixel value to obtain the noise reduction composite image, and the average pixel value can also be calculated according to the calculation to generate A new image, using the generated image as a noise reduction composite image. For the noise reduction composite image, the electronic device further enhances its brightness to obtain the first high dynamic range image of the shooting scene.
在206中,电子设备按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。In 206, the electronic device acquires multiple second scene images of the shooting scene according to different exposure parameters, and synthesizes the multiple second scene images to obtain the second high dynamic range image of the shooting scene.
其中,作为一种可选的实施方式,在按照不同曝光参数获取拍摄场景的多个第二场景图像时,电子设备可以按照预设短曝光时长和长曝光时长交叠的方式获取拍摄场景的多个第二场景图像。换言之,即两个相邻曝光的第二场景图像中,一个第二场景图像为短曝光图像,另一个第二场景图像为长曝光图像。这样即可通过长、短曝合成的方式合成得到拍摄场景的第二高动态范围图像。Among them, as an optional implementation manner, when acquiring multiple second scene images of the shooting scene according to different exposure parameters, the electronic device may acquire the multiple images of the shooting scene in a manner that the preset short exposure duration and the long exposure duration overlap. A second scene image. In other words, among two adjacently exposed second scene images, one second scene image is a short exposure image, and the other second scene image is a long exposure image. In this way, the second high dynamic range image of the shooting scene can be synthesized by combining long and short exposures.
比如,电子设备获取到一个短曝光时长的第二场景图像以及一个长曝光时长的第二场景图像,由于短曝光时长的第二场景图像保留了拍摄场景中较亮区域的特征,而长曝光时长的第二场景图像保留了拍摄场景中较暗区域的特征,则在合成时,可以利用长曝光时长的第二场景图像保留的拍摄场景中较暗区域的特征以及短曝光时长的第二场景图像保留的拍摄场景中较亮区域的特征进行合成得到拍摄场景的第二高动态范围图像。For example, the electronic device acquires a second scene image with a short exposure time and a second scene image with a long exposure time. Because the second scene image with a short exposure time retains the characteristics of the brighter area in the shooting scene, the long exposure time The second scene image retains the characteristics of the darker area in the shooting scene, so when compositing, the features of the darker area in the shooting scene retained by the second scene image with long exposure time and the second scene image with short exposure time can be used The retained features of the brighter area in the shooting scene are synthesized to obtain the second high dynamic range image of the shooting scene.
作为另一种可选的实施方式,在按照不同的曝光参数获取拍摄场景的多个第二场景图像,其中,电子设备可以按照预设过曝光值和预设欠曝光值分别对拍摄场景进行曝光,得 到拍摄场景的两个第二场景图像,还可以按照预设过曝光值、预设正常曝光值以及预设欠曝光值分别对拍摄场景进行曝光,得到拍摄场景的三个第二场景图像等。As another optional implementation manner, in acquiring multiple second scene images of the shooting scene according to different exposure parameters, the electronic device can respectively expose the shooting scene according to a preset overexposure value and a preset underexposure value. , To obtain two second scene images of the shooting scene, and to respectively expose the shooting scene according to the preset overexposure value, preset normal exposure value and preset underexposure value to obtain three second scene images of the shooting scene, etc. .
比如,电子设备可以控制摄像头分别按照预设正常曝光值EV0、预设欠曝光值EV-2以及预设过曝光值EV2对拍摄场景进行曝光,由此得到拍摄场景的三个第二场景图像,分别为正常曝光图像、过曝图像以及欠曝图像,从而通过包围曝光合成的方式来合成得到拍摄场景的第二高动态范围图像。For example, the electronic device can control the camera to expose the shooting scene according to the preset normal exposure value EV0, the preset underexposure value EV-2, and the preset overexposure value EV2, thereby obtaining three second scene images of the shooting scene. They are respectively a normal exposure image, an overexposed image, and an underexposed image, so that the second high dynamic range image of the shooting scene is synthesized through the bracketing synthesis method.
在207中,电子设备将第一高动态范围图像或者第二高动态范围图像作为拍摄场景的预览图像进行展示。In 207, the electronic device displays the first high dynamic range image or the second high dynamic range image as a preview image of the shooting scene.
本申请实施例中,电子设备在合成得到第一高动态范围图像之后,将合成得到的第一高动态范围图像作为拍摄场景的预览图像进行展示,或者,在合成得到第二高动态范围图像之后,将合成得到的第二高动态范围图像作为拍摄场景的预览图像进行展示。In the embodiment of the present application, after the electronic device synthesizes the first high dynamic range image, it displays the synthesized first high dynamic range image as a preview image of the shooting scene, or after synthesizing the second high dynamic range image , The second high dynamic range image obtained by synthesis is displayed as a preview image of the shooting scene.
以上通过将第一高动态范围图像或者第二高动态范围图像作为拍摄场景的预览图像进行展示,可以使得用户提前查看到对拍摄场景进行拍照所得的图像的高动态范围效果,帮助用户更好的拍照。By displaying the first high dynamic range image or the second high dynamic range image as the preview image of the shooting scene, the user can view the high dynamic range effect of the image obtained by taking a picture of the shooting scene in advance, and help the user better Take pictures.
本申请实施例还提供一种图像处理装置。请参照图7,图7为本申请实施例提供的图像处理装置的结构示意图。其中该图像处理装置应用于电子设备,该图像处理装置包括检测模块501、第一合成模块502以及第二合成模块503,如下:The embodiment of the present application also provides an image processing device. Please refer to FIG. 7, which is a schematic structural diagram of an image processing apparatus provided by an embodiment of the application. The image processing device is applied to electronic equipment, and the image processing device includes a detection module 501, a first synthesis module 502, and a second synthesis module 503, as follows:
检测模块501,用于检测拍摄场景中是否存在满足预设运动条件的目标物体;The detection module 501 is configured to detect whether there is a target object meeting preset motion conditions in the shooting scene;
第一合成模块502,用于在拍摄场景不处于静止状态时,按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像;The first synthesis module 502 is configured to obtain multiple first scene images of the shooting scene according to the same exposure parameter when the shooting scene is not in a static state, and synthesize the multiple first scene images to obtain the first high dynamic range image of the shooting scene;
第二合成模块503,用于在拍摄场景处于静止状态时,按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。The second synthesis module 503 is configured to obtain multiple second scene images of the shooting scene according to different exposure parameters when the shooting scene is in a static state, and synthesize the multiple second scene images to obtain the second high dynamic range image of the shooting scene.
在一实施例中,在检测拍摄场景中是否存在满足预设运动条件的目标物体时,检测模块501可以用于:In an embodiment, when detecting whether there is a target object meeting preset motion conditions in the shooting scene, the detection module 501 may be used to:
从预设的图像缓存队列中获取拍摄场景的两个缓存图像;Obtain two cached images of the shooting scene from the preset image cache queue;
识别同一物体在两个缓存图像中的位置区域;Identify the location area of the same object in two cached images;
合并同一物体在两个缓存图像中的位置区域得到合并位置区域;Combine the location areas of the same object in the two cached images to obtain a combined location area;
判断合并位置区域相对于任一缓存图像的占比是否达到预设占比,是则判定前述同一物体为目标物体,否则判定拍摄场景中不存在目标物体。It is determined whether the proportion of the combined location area relative to any cached image reaches the preset proportion, if yes, it is determined that the aforementioned same object is the target object, otherwise it is determined that there is no target object in the shooting scene.
在一实施例中,在按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像之前,第一合成模块502还可以用于:In an embodiment, before acquiring multiple first scene images of the shooting scene according to the same exposure parameter and synthesizing the multiple first scene images to obtain the first high dynamic range image of the shooting scene, the first synthesis module 502 may also be used for :
识别前述目标物体在两个缓存图像中的位置区域是否为显著区域;Identify whether the location area of the aforementioned target object in the two cached images is a salient area;
若是,则按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图 像得到拍摄场景的第一高动态范围图像。If so, multiple first scene images of the shooting scene are acquired according to the same exposure parameter, and the multiple first scene images are synthesized to obtain the first high dynamic range image of the shooting scene.
在一实施例中,在第一合成模块502识别前述目标物体在两个缓存图像中的位置区域是否为显著区域之后,第二合成模块503还用于在第一合成模块502识别前述同一物体在两个缓存图像中的位置区域是否为显著区域之后,若第一合成模块502的识别结果为否,则按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。In one embodiment, after the first synthesis module 502 recognizes whether the location area of the aforementioned target object in the two cached images is a salient area, the second synthesis module 503 is further configured to recognize that the aforementioned same object is in the first synthesis module 502 After whether the location area in the two cached images is a salient area, if the recognition result of the first synthesis module 502 is no, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain The second highest dynamic range image of the shooting scene.
在一实施例中,在按照同一曝光参数获取拍摄场景的多个第一场景图像时,第一合成模块502可以用于:In an embodiment, when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the first synthesis module 502 may be used to:
分别通过第一摄像头和第二摄像头按照同一曝光参数获取所述拍摄场景的多个所述第一场景图像;Acquiring the multiple first scene images of the shooting scene through a first camera and a second camera respectively according to the same exposure parameter;
在按照不同曝光参数获取拍摄场景的多个第二场景图像时,第二合成模块503可以用于:When acquiring multiple second scene images of the shooting scene according to different exposure parameters, the second synthesis module 503 may be used to:
分别通过第一摄像头和第二摄像头按照不同曝光参数获取拍摄场景的多个第二场景图像。The multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
在一实施例中,图像处理装置还包括预览模块,用于:In an embodiment, the image processing device further includes a preview module for:
将第一高动态范围图像或者第二高动态范围图像作为拍摄场景的预览图像进行展示。The first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
在一实施例中,第一合成模块502还用于在合成得到第一高动态范围图像之前,根据屏幕当前的分辨率对多个第一场景图像进行降采样处理;In an embodiment, the first synthesis module 502 is further configured to perform down-sampling processing on multiple first scene images according to the current resolution of the screen before the first high dynamic range image is synthesized;
或者,第二合成模块503还用于在合成得到第二高动态范围图像之前,根据屏幕当前的分辨率对多个第二场景图像进行降采样处理。Alternatively, the second synthesis module 503 is further configured to perform down-sampling processing on multiple second scene images according to the current resolution of the screen before the second high dynamic range image is synthesized.
在一实施例中,在按照同一曝光参数获取拍摄场景的多个第一场景图像时,第一合成模块502可以用于:In an embodiment, when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the first synthesis module 502 may be used to:
按照预设短曝光时长对所述拍摄场景进行曝光,得到多个第一场景图像。Expose the shooting scene according to a preset short exposure time length to obtain multiple first scene images.
在一实施例中,在按照不同曝光参数获取拍摄场景的多个第二场景图像时,第二合成模块503可以用于:In an embodiment, when acquiring multiple second scene images of the shooting scene according to different exposure parameters, the second synthesis module 503 may be used to:
按照预设过曝光值和预设欠曝光值分别对拍摄场景进行曝光,得到两个第二场景图像。The shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
应当说明的是,本申请实施例提供的图像处理装置与上文实施例中的图像处理方法属于同一构思,在图像处理装置上可以运行图像处理方法实施例中提供的任一方法,其具体实现过程详见图像处理方法实施例,此处不再赘述。It should be noted that the image processing device provided in the embodiment of the application belongs to the same concept as the image processing method in the above embodiment, and any method provided in the image processing method embodiment can be run on the image processing device, and its specific implementation For details of the process, refer to the embodiment of the image processing method, which will not be repeated here.
本申请实施例提供一种计算机可读的存储介质,其上存储有计算机程序,当其存储的计算机程序在计算机上执行时,使得计算机执行如本申请实施例提供的图像处理方法中的步骤。其中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM,)或者随机存取器(Random Access Memory,RAM)等。The embodiments of the present application provide a computer-readable storage medium on which a computer program is stored. When the stored computer program is executed on a computer, the computer is caused to execute the steps in the image processing method provided in the embodiment of the present application. Among them, the storage medium may be a magnetic disk, an optical disc, a read only memory (Read Only Memory, ROM,) or a random access device (Random Access Memory, RAM), etc.
本申请实施例还提供一种电子设备,请参照图8,电子设备包括处理器701和存储器702。其中,处理器701与存储器702电性连接。An embodiment of the present application also provides an electronic device. Please refer to FIG. 8. The electronic device includes a processor 701 and a memory 702. The processor 701 is electrically connected to the memory 702.
处理器701是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器702内的计算机程序,以及调用存储在存储器702内的数据,执行电子设备的各种功能并处理数据。The processor 701 is the control center of the electronic device. It uses various interfaces and lines to connect the various parts of the entire electronic device. It executes the electronic device by running or loading the computer program stored in the memory 702 and calling the data stored in the memory 702. Various functions and process data.
存储器702可用于存储软件程序以及模块,处理器701通过运行存储在存储器702的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器702可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器702还可以包括存储器控制器,以提供处理器701对存储器702的访问。The memory 702 may be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the computer programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, a computer program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of electronic equipment, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 702 may further include a memory controller to provide the processor 701 with access to the memory 702.
在本申请实施例中,电子设备中的处理器701会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器702中,并由处理器701运行存储在存储器702中的计算机程序,从而实现各种功能,如下:In the embodiment of the present application, the processor 701 in the electronic device will load the instructions corresponding to the process of one or more computer programs into the memory 702 according to the following steps, and run the instructions by the processor 701 and store them in the memory 702 The computer program to achieve various functions, as follows:
检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
若否,则按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像;If not, acquiring multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizing the multiple first scene images to obtain the first high dynamic range image of the shooting scene;
若是,则按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。If so, multiple second scene images of the shooting scene are acquired according to different exposure parameters, and the multiple second scene images are synthesized to obtain the second high dynamic range image of the shooting scene.
请参照图9,图9为本申请实施例提供的电子设备的另一结构示意图,与图8所示电子设备的区别在于,电子设备还包括输入单元703和输出单元704等组件。Please refer to FIG. 9. FIG. 9 is another schematic structural diagram of an electronic device provided by an embodiment of the application. The difference from the electronic device shown in FIG. 8 is that the electronic device further includes components such as an input unit 703 and an output unit 704.
其中,输入单元703可用于接收输入的数字、字符信息或用户特征信息(比如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入等。The input unit 703 can be used to receive input numbers, character information, or user characteristic information (such as fingerprints), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
输出单元704可用于显示由用户输入的信息或提供给用户的信息,如屏幕。The output unit 704 may be used to display information input by the user or information provided to the user, such as a screen.
在本申请实施例中,电子设备中的处理器701会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器702中,并由处理器701运行存储在存储器702中的计算机程序,从而实现各种功能,如下:In the embodiment of the present application, the processor 701 in the electronic device will load the instructions corresponding to the process of one or more computer programs into the memory 702 according to the following steps, and run the instructions by the processor 701 and store them in the memory 702 The computer program to achieve various functions, as follows:
检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
若否,则按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像;If not, acquiring multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizing the multiple first scene images to obtain the first high dynamic range image of the shooting scene;
若是,则按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图 像得到拍摄场景的第二高动态范围图像。If so, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize the multiple second scene images to obtain the second high dynamic range image of the shooting scene.
在一实施例中,在检测拍摄场景中是否存在满足预设运动条件的目标物体时,处理器701可以执行:In an embodiment, when detecting whether there is a target object meeting a preset motion condition in the shooting scene, the processor 701 may execute:
从预设的图像缓存队列中获取拍摄场景的两个缓存图像;Obtain two cached images of the shooting scene from the preset image cache queue;
识别同一物体在两个缓存图像中的位置区域;Identify the location area of the same object in two cached images;
合并同一物体在两个缓存图像中的位置区域得到合并位置区域;Combine the location areas of the same object in the two cached images to obtain a combined location area;
判断合并位置区域相对于任一缓存图像的占比是否达到预设占比,是则判定前述同一物体为目标物体,否则判定拍摄场景中不存在目标物体。It is determined whether the proportion of the combined location area relative to any cached image reaches the preset proportion, if yes, it is determined that the aforementioned same object is the target object, otherwise it is determined that there is no target object in the shooting scene.
在一实施例中,在按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像之前,处理器701可以执行:In an embodiment, before acquiring multiple first scene images of the shooting scene according to the same exposure parameter, and synthesizing the multiple first scene images to obtain the first high dynamic range image of the shooting scene, the processor 701 may execute:
识别前述目标物体在两个缓存图像中的位置区域是否为显著区域;Identify whether the location area of the aforementioned target object in the two cached images is a salient area;
若是,则按照同一曝光参数获取拍摄场景的多个第一场景图像,合成多个第一场景图像得到拍摄场景的第一高动态范围图像。If so, multiple first scene images of the shooting scene are acquired according to the same exposure parameter, and the multiple first scene images are synthesized to obtain the first high dynamic range image of the shooting scene.
在一实施例中,在识别前述目标物体在两个缓存图像中的位置区域是否为显著区域之后,处理器701还可以执行:In an embodiment, after identifying whether the location area of the aforementioned target object in the two cached images is a salient area, the processor 701 may further execute:
若否,则按照不同曝光参数获取拍摄场景的多个第二场景图像,合成多个第二场景图像得到拍摄场景的第二高动态范围图像。If not, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize the multiple second scene images to obtain the second high dynamic range image of the shooting scene.
在一实施例中,在按照同一曝光参数获取拍摄场景的多个第一场景图像时,处理器701可以执行:In an embodiment, when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the processor 701 may execute:
分别通过第一摄像头和第二摄像头按照同一曝光参数获取所述拍摄场景的多个所述第一场景图像;Acquiring the multiple first scene images of the shooting scene through a first camera and a second camera respectively according to the same exposure parameter;
在按照不同曝光参数获取拍摄场景的多个第二场景图像时,处理器701可以执行:When acquiring multiple second scene images of the shooting scene according to different exposure parameters, the processor 701 may execute:
分别通过第一摄像头和第二摄像头按照不同曝光参数获取拍摄场景的多个第二场景图像。The multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
在一实施例中,处理器701还可以执行:In an embodiment, the processor 701 may also execute:
将第一高动态范围图像或者第二高动态范围图像作为拍摄场景的预览图像进行展示。The first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
在一实施例中,处理器701还可以执行:In an embodiment, the processor 701 may also execute:
在合成得到第一高动态范围图像之前,根据屏幕当前的分辨率对多个第一场景图像进行降采样处理;Before synthesizing the first high dynamic range image, perform down-sampling processing on the multiple first scene images according to the current resolution of the screen;
或者,在合成得到第二高动态范围图像之前,根据屏幕当前的分辨率对多个第二场景图像进行降采样处理。Alternatively, before the second high dynamic range image is synthesized, the multiple second scene images are down-sampled according to the current resolution of the screen.
在一实施例中,在按照同一曝光参数获取拍摄场景的多个第一场景图像时,处理器701可以执行:In an embodiment, when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the processor 701 may execute:
按照预设短曝光时长对所述拍摄场景进行曝光,得到多个第一场景图像。Expose the shooting scene according to a preset short exposure time length to obtain multiple first scene images.
在一实施例中,在按照不同曝光参数获取拍摄场景的多个第二场景图像时,处理器701可以执行:In an embodiment, when acquiring multiple second scene images of the shooting scene according to different exposure parameters, the processor 701 may execute:
按照预设过曝光值和预设欠曝光值分别对拍摄场景进行曝光,得到两个第二场景图像。The shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
应当说明的是,本申请实施例提供的电子设备与上文实施例中的图像处理方法属于同一构思,在电子设备上可以运行图像处理方法实施例中提供的任一方法,其具体实现过程详见特征提取方法实施例,此处不再赘述。It should be noted that the electronic device provided in this embodiment of the application belongs to the same concept as the image processing method in the above embodiment. Any method provided in the image processing method embodiment can be run on the electronic device. The specific implementation process is detailed. See the embodiment of the feature extraction method, which will not be repeated here.
需要说明的是,对本申请实施例的图像处理方法而言,本领域普通测试人员可以理解实现本申请实施例的图像处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,所述计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个处理器执行,在执行过程中可包括如图像处理方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that for the image processing method of the embodiment of the present application, ordinary testers in the field can understand that all or part of the process of implementing the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program. The computer program may be stored in a computer readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device. The execution process may include such as image processing methods. The flow of the embodiment. Wherein, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
对本申请实施例的图像处理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,所述存储介质譬如为只读存储器,磁盘或光盘等。For the image processing device of the embodiment of the present application, its functional modules may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium, such as a read-only memory, a magnetic disk or an optical disk, etc. .
以上对本申请实施例所提供的一种图像处理方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The above describes in detail an image processing method, device, storage medium, and electronic equipment provided by the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementations of the present application. The description of the above embodiments is only It is used to help understand the methods and core ideas of this application; at the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation and the scope of application. In summary, this specification The content should not be construed as a limitation on this application.

Claims (20)

  1. 一种图像处理方法,应用于电子设备,其中,所述图像处理方法包括:An image processing method applied to electronic equipment, wherein the image processing method includes:
    检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
    若否,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;If not, acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter, and synthesizing the plurality of first scene images to obtain the first high dynamic range image of the shooting scene;
    若是,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If so, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain the second high dynamic range image of the shooting scene.
  2. 根据权利要求1所述的图像处理方法,其中,所述检测拍摄场景中是否存在满足预设运动条件的目标物体,包括:The image processing method according to claim 1, wherein said detecting whether there is a target object meeting a preset motion condition in the shooting scene comprises:
    从预设的图像缓存队列中获取所述拍摄场景的两个缓存图像;Acquiring two cached images of the shooting scene from a preset image cache queue;
    识别同一物体在两个所述缓存图像中的位置区域;Identifying the location area of the same object in the two cached images;
    合并所述同一物体在两个所述缓存图像中的位置区域得到合并位置区域;Combining the location areas of the same object in the two cache images to obtain a combined location area;
    判断所述合并位置区域相对于所述缓存图像的占比是否达到预设占比,是则判定所述同一物体为所述目标物体,否则判定所述拍摄场景中不存在所述目标物体。It is determined whether the proportion of the combined location area relative to the cache image reaches a preset proportion, if yes, it is determined that the same object is the target object, otherwise it is determined that the target object does not exist in the shooting scene.
  3. 根据权利要求2所述的图像处理方法,其中,所述按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像之前,还包括:The image processing method according to claim 2, wherein said acquiring a plurality of first scene images of said shooting scene according to the same exposure parameter, and synthesizing a plurality of said first scene images to obtain the first height of said shooting scene Before the dynamic range image, it also includes:
    识别所述目标物体在两个所述缓存图像中的位置区域是否为显著区域;Identifying whether the location area of the target object in the two cache images is a salient area;
    若是,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像。If so, acquire multiple first scene images of the shooting scene according to the same exposure parameter, and synthesize the multiple first scene images to obtain the first high dynamic range image of the shooting scene.
  4. 根据权利要求3所述的图像处理方法,其中,所述识别所述目标物体在两个所述缓存图像中的位置区域是否为显著区域之后,还包括:3. The image processing method according to claim 3, wherein after identifying whether the location area of the target object in the two buffered images is a salient area, the method further comprises:
    若否,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If not, acquiring multiple second scene images of the shooting scene according to different exposure parameters, and synthesizing multiple second scene images to obtain a second high dynamic range image of the shooting scene.
  5. 根据权利要求1所述的图像处理方法,其中,所述按照同一曝光参数获取所述拍摄场景的多个第一场景图像,包括:The image processing method according to claim 1, wherein said acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter comprises:
    分别通过第一摄像头和第二摄像头按照同一曝光参数获取所述拍摄场景的多个所述第一场景图像;Acquiring the multiple first scene images of the shooting scene through a first camera and a second camera respectively according to the same exposure parameter;
    所述按照不同曝光参数获取所述拍摄场景的多个第二场景图像,包括:The acquiring multiple second scene images of the shooting scene according to different exposure parameters includes:
    分别通过所述第一摄像头和所述第二摄像头按照不同曝光参数获取所述拍摄场景的多个所述第二场景图像。The multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
  6. 根据权利要求1所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to claim 1, wherein the image processing method further comprises:
    将所述第一高动态范围图像或者所述第二高动态范围图像作为所述拍摄场景的预览图像进行展示。The first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
  7. 根据权利要求6所述的图像处理方法,其中,所述图像处理方法还包括:The image processing method according to claim 6, wherein the image processing method further comprises:
    在合成得到所述第一高动态范围图像之前,根据屏幕当前的分辨率对多个所述第一场景图像进行降采样处理;Before synthesizing the first high dynamic range image, performing down-sampling processing on a plurality of the first scene images according to the current resolution of the screen;
    或者,在合成得到所述第二高动态范围图像之前,根据屏幕当前的分辨率对多个所述第二场景图像进行降采样处理。Alternatively, before the second high dynamic range image is synthesized, the multiple second scene images are down-sampled according to the current resolution of the screen.
  8. 根据权利要求1所述的图像处理方法,其中,所述按照同一曝光参数获取所述拍摄场景的多个第一场景图像,包括:The image processing method according to claim 1, wherein said acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter comprises:
    按照预设短曝光时长对所述拍摄场景进行曝光,得到多个所述第一场景图像。Exposing the shooting scene according to a preset short exposure duration to obtain multiple images of the first scene.
  9. 根据权利要求1所述的图像处理方法,其中,所述按照不同曝光参数获取所述拍摄场景的多个第二场景图像,包括:The image processing method according to claim 1, wherein said acquiring a plurality of second scene images of the shooting scene according to different exposure parameters comprises:
    按照预设过曝光值和预设欠曝光值分别对所述拍摄场景进行曝光,得到两个所述第二场景图像。The shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
  10. 一种图像处理装置,应用于电子设备,其中,所述图像处理装置包括:An image processing device applied to electronic equipment, wherein the image processing device includes:
    检测模块,用于检测拍摄场景中是否存在满足预设运动条件的目标物体;The detection module is used to detect whether there is a target object meeting preset motion conditions in the shooting scene;
    第一合成模块,用于在所述拍摄场景中不存在所述目标物体时,按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;The first synthesis module is configured to obtain multiple first scene images of the shooting scene according to the same exposure parameter when the target object does not exist in the shooting scene, and synthesize the multiple first scene images to obtain the The first high dynamic range image of the shooting scene;
    第二合成模块,用于在所述拍摄场景中存在所述目标物体时,按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。The second synthesis module is used to obtain a plurality of second scene images of the shooting scene according to different exposure parameters when the target object exists in the shooting scene, and synthesize a plurality of the second scene images to obtain the shooting The second highest dynamic range image of the scene.
  11. 一种存储介质,其上存储有计算机程序,其中,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至9任一项所述的图像处理方法中的步骤。A storage medium having a computer program stored thereon, wherein when the computer program runs on a computer, the computer is caused to execute the steps in the image processing method according to any one of claims 1 to 9.
  12. 一种电子设备,包括处理器和存储器,所述存储器储存有计算机程序,其中,所述处理器通过调用所述计算机程序,用于执行:An electronic device includes a processor and a memory, and the memory stores a computer program, wherein the processor is configured to execute:
    检测拍摄场景中是否存在满足预设运动条件的目标物体;Detect whether there is a target object meeting preset motion conditions in the shooting scene;
    若否,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像;If not, acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter, and synthesizing the plurality of first scene images to obtain the first high dynamic range image of the shooting scene;
    若是,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If so, acquire multiple second scene images of the shooting scene according to different exposure parameters, and synthesize multiple second scene images to obtain the second high dynamic range image of the shooting scene.
  13. 根据权利要求12所述的电子设备,其中,在检测拍摄场景中是否存在满足预设运动条件的目标物体时,所述处理器用于执行:The electronic device according to claim 12, wherein, when detecting whether there is a target object meeting a preset motion condition in the shooting scene, the processor is configured to execute:
    从预设的图像缓存队列中获取所述拍摄场景的两个缓存图像;Acquiring two cached images of the shooting scene from a preset image cache queue;
    识别同一物体在两个所述缓存图像中的位置区域;Identifying the location area of the same object in the two cached images;
    合并所述同一物体在两个所述缓存图像中的位置区域得到合并位置区域;Combining the location areas of the same object in the two cache images to obtain a combined location area;
    判断所述合并位置区域相对于所述缓存图像的占比是否达到预设占比,是则判定所述同一物体为所述目标物体,否则判定所述拍摄场景中不存在所述目标物体。It is determined whether the proportion of the combined location area relative to the cache image reaches a preset proportion, if yes, it is determined that the same object is the target object, otherwise it is determined that the target object does not exist in the shooting scene.
  14. 根据权利要求13所述的电子设备,其中,在按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像之前,所述处理器还用于执行:The electronic device according to claim 13, wherein in acquiring a plurality of first scene images of the shooting scene according to the same exposure parameter, combining a plurality of the first scene images to obtain the first high dynamic range of the shooting scene Before the image, the processor is also used to execute:
    识别所述目标物体在两个所述缓存图像中的位置区域是否为显著区域;Identifying whether the location area of the target object in the two cache images is a salient area;
    若是,则按照同一曝光参数获取所述拍摄场景的多个第一场景图像,合成多个所述第一场景图像得到所述拍摄场景的第一高动态范围图像。If so, acquire multiple first scene images of the shooting scene according to the same exposure parameter, and synthesize the multiple first scene images to obtain the first high dynamic range image of the shooting scene.
  15. 根据权利要求14所述的电子设备,其中,在识别所述目标物体在两个所述缓存图像中的位置区域是否为显著区域之后,所述处理器还用于执行:The electronic device according to claim 14, wherein after identifying whether the location area of the target object in the two cache images is a salient area, the processor is further configured to execute:
    若否,则按照不同曝光参数获取所述拍摄场景的多个第二场景图像,合成多个所述第二场景图像得到所述拍摄场景的第二高动态范围图像。If not, acquiring multiple second scene images of the shooting scene according to different exposure parameters, and synthesizing multiple second scene images to obtain a second high dynamic range image of the shooting scene.
  16. 根据权利要求12所述的电子设备,其中,在按照同一曝光参数获取所述拍摄场景的多个第一场景图像时,所述处理器用于执行:The electronic device according to claim 12, wherein, when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the processor is configured to execute:
    分别通过第一摄像头和第二摄像头按照同一曝光参数获取所述拍摄场景的多个所述第一场景图像;Acquiring the multiple first scene images of the shooting scene through a first camera and a second camera respectively according to the same exposure parameter;
    所述按照不同曝光参数获取所述拍摄场景的多个第二场景图像,包括:The acquiring multiple second scene images of the shooting scene according to different exposure parameters includes:
    分别通过所述第一摄像头和所述第二摄像头按照不同曝光参数获取所述拍摄场景的多个所述第二场景图像。The multiple second scene images of the shooting scene are acquired through the first camera and the second camera respectively according to different exposure parameters.
  17. 根据权利要求12所述的电子设备,其中,所述处理器还用于执行:The electronic device according to claim 12, wherein the processor is further configured to execute:
    将所述第一高动态范围图像或者所述第二高动态范围图像作为所述拍摄场景的预览图像进行展示。The first high dynamic range image or the second high dynamic range image is displayed as a preview image of the shooting scene.
  18. 根据权利要求17所述的电子设备,其中,所述处理器还用于执行:The electronic device according to claim 17, wherein the processor is further configured to execute:
    在合成得到所述第一高动态范围图像之前,根据屏幕当前的分辨率对多个所述第一场景图像进行降采样处理;Before synthesizing the first high dynamic range image, performing down-sampling processing on a plurality of the first scene images according to the current resolution of the screen;
    或者,在合成得到所述第二高动态范围图像之前,根据屏幕当前的分辨率对多个所述第二场景图像进行降采样处理。Alternatively, before the second high dynamic range image is synthesized, the multiple second scene images are down-sampled according to the current resolution of the screen.
  19. 根据权利要求12所述的电子设备,其中,在按照同一曝光参数获取所述拍摄场景的多个第一场景图像时,所述处理器用于执行:The electronic device according to claim 12, wherein, when acquiring multiple first scene images of the shooting scene according to the same exposure parameter, the processor is configured to execute:
    按照预设短曝光时长对所述拍摄场景进行曝光,得到多个所述第一场景图像。Exposing the shooting scene according to a preset short exposure duration to obtain multiple images of the first scene.
  20. 根据权利要求12所述的电子设备,其中,在按照不同曝光参数获取所述拍摄场景的多个第二场景图像时,所述处理器用于执行:The electronic device according to claim 12, wherein, when acquiring multiple second scene images of the shooting scene according to different exposure parameters, the processor is configured to execute:
    按照预设过曝光值和预设欠曝光值分别对所述拍摄场景进行曝光,得到两个所述第二场景图像。The shooting scene is respectively exposed according to the preset overexposure value and the preset underexposure value to obtain two second scene images.
PCT/CN2020/081412 2019-04-09 2020-03-26 Image processing method and apparatus, storage medium and electronic device WO2020207258A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910280193.3A CN109996009B (en) 2019-04-09 2019-04-09 Image processing method, image processing device, storage medium and electronic equipment
CN201910280193.3 2019-04-09

Publications (1)

Publication Number Publication Date
WO2020207258A1 true WO2020207258A1 (en) 2020-10-15

Family

ID=67132538

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/081412 WO2020207258A1 (en) 2019-04-09 2020-03-26 Image processing method and apparatus, storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN109996009B (en)
WO (1) WO2020207258A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109996009B (en) * 2019-04-09 2021-03-02 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN110392214A (en) * 2019-08-05 2019-10-29 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN110445989B (en) * 2019-08-05 2021-03-23 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN110445988B (en) * 2019-08-05 2021-06-25 Oppo广东移动通信有限公司 Image processing method, image processing device, storage medium and electronic equipment
CN111383224B (en) * 2020-03-19 2024-04-16 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN111835982B (en) * 2020-07-02 2021-08-17 维沃移动通信有限公司 Image acquisition method, image acquisition device, electronic device, and storage medium
CN113472980B (en) * 2021-06-15 2022-12-09 展讯通信(上海)有限公司 Image processing method, device, equipment, medium and chip
CN116095513B (en) * 2022-08-05 2024-03-26 荣耀终端有限公司 Photographing method and related device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017169274A1 (en) * 2016-03-31 2017-10-05 ソニー株式会社 Imaging control device, imaging control method, computer program, and electronic equipment
CN108391059A (en) * 2018-03-23 2018-08-10 华为技术有限公司 A kind of method and apparatus of image procossing
CN108924420A (en) * 2018-07-10 2018-11-30 Oppo广东移动通信有限公司 Image capturing method, device, medium, electronic equipment and model training method
CN109417592A (en) * 2016-07-01 2019-03-01 麦克赛尔株式会社 Filming apparatus, image pickup method and photographing program
CN109547699A (en) * 2018-12-24 2019-03-29 成都西纬科技有限公司 A kind of method and device taken pictures
CN109996009A (en) * 2019-04-09 2019-07-09 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6629454B2 (en) * 2015-12-28 2020-01-15 華為技術有限公司Huawei Technologies Co.,Ltd. Image fusion method and device, and terminal device
CN107231530B (en) * 2017-06-22 2019-11-26 维沃移动通信有限公司 A kind of photographic method and mobile terminal
CN108063902A (en) * 2018-01-08 2018-05-22 信利光电股份有限公司 HDR image pickup methods, filming apparatus and the mobile terminal and readable storage medium storing program for executing of multi-cam
CN109005367B (en) * 2018-10-15 2020-10-13 Oppo广东移动通信有限公司 High dynamic range image generation method, mobile terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017169274A1 (en) * 2016-03-31 2017-10-05 ソニー株式会社 Imaging control device, imaging control method, computer program, and electronic equipment
CN109417592A (en) * 2016-07-01 2019-03-01 麦克赛尔株式会社 Filming apparatus, image pickup method and photographing program
CN108391059A (en) * 2018-03-23 2018-08-10 华为技术有限公司 A kind of method and apparatus of image procossing
CN108924420A (en) * 2018-07-10 2018-11-30 Oppo广东移动通信有限公司 Image capturing method, device, medium, electronic equipment and model training method
CN109547699A (en) * 2018-12-24 2019-03-29 成都西纬科技有限公司 A kind of method and device taken pictures
CN109996009A (en) * 2019-04-09 2019-07-09 Oppo广东移动通信有限公司 Image processing method, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN109996009B (en) 2021-03-02
CN109996009A (en) 2019-07-09

Similar Documents

Publication Publication Date Title
WO2020207258A1 (en) Image processing method and apparatus, storage medium and electronic device
US20200227089A1 (en) Method and device for processing multimedia information
CN110248098B (en) Image processing method, image processing device, storage medium and electronic equipment
CN110493538B (en) Image processing method, image processing device, storage medium and electronic equipment
US10284789B2 (en) Dynamic generation of image of a scene based on removal of undesired object present in the scene
CN113592887B (en) Video shooting method, electronic device and computer-readable storage medium
CN106375674B (en) Method and apparatus for finding and using video portions related to adjacent still images
WO2019148978A1 (en) Image processing method and apparatus, storage medium and electronic device
US7450756B2 (en) Method and apparatus for incorporating iris color in red-eye correction
WO2019071613A1 (en) Image processing method and device
JP6319101B2 (en) Image processing apparatus, image processing method, and program
CN110620873B (en) Device imaging method and device, storage medium and electronic device
US9195880B1 (en) Interactive viewer for image stacks
US20180270445A1 (en) Methods and apparatus for generating video content
WO2020207387A1 (en) Image processing method and apparatus, storage medium, and electronic device
JP6892524B2 (en) Slow motion video capture based on target tracking
CN106470313B (en) Image generation system and image generation method
WO2023160285A9 (en) Video processing method and apparatus
CN110971841A (en) Image processing method, image processing device, storage medium and electronic equipment
US20240007588A1 (en) Slow-motion video recording method and device
US20110050913A1 (en) Method of controlling digital photographing apparatus having memory, recording medium for recording the method, and digital photographing apparatus
CN115278047A (en) Shooting method, shooting device, electronic equipment and storage medium
CN110033421B (en) Image processing method, image processing device, storage medium and electronic equipment
US20240196091A1 (en) Image capturing device and method
CN113923367B (en) Shooting method and shooting device

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

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

Country of ref document: EP

Kind code of ref document: A1