Image processing method, device and electronic equipment

By fusing the images acquired by the first camera and the second camera, double exposure images are generated, which solves the problem of long operation time for users when processing images, and achieves fast double exposure effects and artistic visual effects.

CN115115559BActive Publication Date: 2025-04-01GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110310094.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-23
Publication Date
2025-04-01
Estimated Expiration
2041-03-23

AI Technical Summary

Technical Problem

In the prior art, users need to spend a lot of operation time when processing images, and cannot effectively meet the user's personalized needs.

Method used

By acquiring the images acquired by the first camera and the second camera, fusing the two to generate a double exposure image to achieve a double exposure effect.

Benefits of technology

Save users' operating time, quickly achieve double exposure effects, and provide artistic visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115115559B_ABST
    Figure CN115115559B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology, and discloses an image processing method, device, and electronic device. The image processing method is applied to an electronic device, and the electronic device includes a first camera and a second camera. The method includes: obtaining a first image captured by the first camera, and obtaining a second image captured by the second camera; fusing the first image and the second image to generate a fused double exposure image; wherein the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a part of the area in the first image and at least a part of the area in the second image. By fusing the first image sent by the first camera and the second image sent by the second camera to generate a double exposure image, the embodiment of the present application can quickly generate an image with a double exposure effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, device and electronic device. Background Art

[0002] With the continuous development of photographing technology and the widespread use of mobile terminals, the photographing function of mobile terminals is becoming more and more popular, but the images collected by existing image acquisition devices cannot meet the increasing personalized requirements of users. The existing technology allows users to manually process the images further after collecting them to meet the personalized requirements of users. However, such processing requires users to have high image processing technology, the processing is cumbersome and takes users a lot of operation time.

[0003] Application Contents

[0004] The embodiments of the present application provide an image processing method, device and electronic device, which can solve the technical problem that users need to spend a lot of operation time when processing images, thereby saving users' operation time and conveniently achieving double exposure effects.

[0005] In a first aspect, an embodiment of the present application provides an image processing method, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the method includes:

[0006] Acquire a first image captured by the first camera, and acquire a second image captured by the second camera;

[0007] fusing the first image and the second image to generate a fused double exposure image;

[0008] The double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a partial area in the first image and at least a partial area in the second image.

[0009] In some embodiments, the first camera includes a front camera of the electronic device, the second camera includes a rear camera of the electronic device, and acquiring a first image captured by the first camera, and acquiring a second image captured by the second camera, comprises:

[0010] Acquire a user image captured by the front camera, and acquire a background image captured by the rear camera;

[0011] The fusing the first image and the second image to generate a fused double exposure image includes:

[0012] The user image and the background image are fused to generate a fused double exposure image.

[0013] In some embodiments, fusing the user image and the background image to generate a fused double exposure image includes:

[0014] Detecting facial contours and / or body contours in the user image;

[0015] The area within the facial contour and / or body contour is fused with the background image, and the area other than the facial contour and the area other than the body contour in the user image is blurred to generate a fused double exposure image.

[0016] In some embodiments, the fusing the user image and the background image includes:

[0017] receiving a preset mode selection instruction;

[0018] According to the preset mode selection instruction, based on a pre-established preset mode library, a preset mode is determined to fuse the user image and the background image, wherein the preset mode library includes a plurality of preset modes, each preset mode corresponds to a camera parameter combination one by one, and the camera parameter combination includes camera parameters of a first camera and camera parameters of a second camera.

[0019] In some embodiments, the method further comprises:

[0020] After determining the preset mode, obtaining an image parameter adjustment instruction, and updating the fused double exposure image generated based on the preset mode according to the image parameter adjustment instruction;

[0021] Based on the updated image parameters of the double exposure image, a new preset mode is generated, and the new preset mode is added to the preset mode library, wherein the updated image parameters of the double exposure image correspond to a camera parameter combination.

[0022] In some embodiments, the image parameters include at least one of exposure, color, and brightness.

[0023] In some embodiments, the electronic device includes a rear camera, the first camera is a main camera of the rear camera, the second camera is a secondary camera of the rear camera, and the acquiring a first image acquired by the first camera, and acquiring a second image acquired by the second camera, include:

[0024] A first image captured by the main camera is acquired, and a second image captured by the auxiliary camera is acquired, wherein the main camera and the auxiliary camera capture images with different camera parameters.

[0025] In some embodiments, the main camera is used to capture a foreground image, wherein the foreground image includes subject information, and the secondary camera is used to capture a background image.

[0026] In some embodiments, before acquiring the first image captured by the main camera and acquiring the second image captured by the secondary camera, the method further includes:

[0027] Establishing a camera coordinate system, wherein the origin of the camera coordinate system is the position where the focus of the main camera is located;

[0028] Determining calibration parameters between the main camera and the secondary camera according to the relative positional relationship between the main camera and the secondary camera, wherein the calibration parameters are used to align the viewing angle of the secondary camera with the viewing angle of the main camera;

[0029] After acquiring the second image captured by the secondary camera, the method further includes:

[0030] calibrating the second image according to the calibration parameters to generate a calibrated second image;

[0031] The fusing the first image and the second image to generate a fused double exposure image includes:

[0032] The first image and the calibrated second image are fused to generate a fused double exposure image.

[0033] In some embodiments, the first image partially overlaps with the calibrated second image, and fusing the first image and the calibrated second image comprises:

[0034] Determining whether an overlapping area between the first image and the calibrated second image is greater than a preset threshold;

[0035] If so, the non-overlapping areas in the first image and the calibrated second image are determined according to the relative positional relationship between the main camera and the secondary camera, and the non-overlapping areas in the calibrated second image are used as the background of the fused double exposure image.

[0036] In some embodiments, fusing the first image and the calibrated second image to generate a fused double exposure image includes:

[0037] Determine subject information in the first image, and use the subject information as the foreground of the fused double exposure image;

[0038] Using the non-overlapping area in the calibrated second image as the background of the fused double exposure image;

[0039] The subject information and the non-overlapping area in the calibrated second image are fused to generate a fused double exposure image.

[0040] In some embodiments, the method further comprises:

[0041] If the overlapping area between the first image and the calibrated second image is not greater than a preset threshold, the overlapping area between the first image and the calibrated second image is determined according to the relative position relationship between the main camera and the secondary camera, and the overlapping area in the calibrated second image is used as the background of the fused double exposure image.

[0042] In some embodiments, the fusing the first image and the calibrated second image to generate a fused double exposure image includes:

[0043] Determine subject information in the first image, and use the subject information as the foreground of the fused double exposure image;

[0044] Cropping the calibrated second image to remove the area corresponding to the subject information in the calibrated second image, and using the overlapping area in the calibrated second image as the background of the fused double exposure image;

[0045] The subject information and the overlapped area in the calibrated second image are fused to generate a fused double exposure image.

[0046] In some embodiments, the subject information includes user image information and / or scene image information.

[0047] In some embodiments, after determining the subject information in the first image, the method further includes:

[0048] Determining a magnification factor according to a size of the calibrated second image, and enlarging the subject information based on the magnification factor;

[0049] The method of using the subject information as the foreground of the fused double exposure image includes:

[0050] The enlarged subject information is used as the foreground of the fused double exposure image, wherein the enlarged subject information is completely superimposed on the calibrated second image.

[0051] In some embodiments, cropping the calibrated second image to remove the area corresponding to the subject information in the calibrated second image includes:

[0052] The calibrated second image is cropped according to a size of a region in the calibrated second image corresponding to the enlarged subject information, so as to remove the region in the calibrated second image corresponding to the enlarged subject information.

[0053] In some embodiments, the camera parameters include at least one of exposure, color, and brightness.

[0054] In a second aspect, an embodiment of the present application provides an image processing device, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the device includes:

[0055] an image acquisition unit, configured to acquire a first image acquired by the first camera, and to acquire a second image acquired by the second camera;

[0056] an image fusion unit, configured to fuse the first image and the second image to generate a fused double-exposure image;

[0057] The double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a partial area in the first image and at least a partial area in the second image.

[0058] In some embodiments, the first camera includes a front camera of the electronic device, the second camera includes a rear camera of the electronic device, and the image acquisition unit is specifically configured to:

[0059] Acquire a user image captured by the front camera, and acquire a background image captured by the rear camera; the image fusion unit is specifically used to:

[0060] The user image and the background image are fused to generate a fused double exposure image.

[0061] In some embodiments, the image fusion unit is specifically used to:

[0062] Detecting facial contours and / or body contours in the user image;

[0063] The area within the facial contour and / or body contour is fused with the background image, and the area other than the facial contour and the area other than the body contour in the user image is blurred to generate a fused double exposure image.

[0064] In some embodiments, the image fusion unit is specifically used to:

[0065] receiving a preset mode selection instruction;

[0066] According to the preset mode selection instruction, based on a pre-established preset mode library, a preset mode is determined to fuse the user image and the background image, wherein the preset mode library includes a plurality of preset modes, each preset mode corresponds to a camera parameter combination one by one, and the camera parameter combination includes camera parameters of a first camera and camera parameters of a second camera.

[0067] In some embodiments, the image processing apparatus further comprises:

[0068] An image parameter adjustment unit, configured to obtain an image parameter adjustment instruction after determining the preset mode, and update the fused double exposure image generated based on the preset mode according to the image parameter adjustment instruction;

[0069] Based on the updated image parameters of the double exposure image, a new preset mode is generated, and the new preset mode is added to the preset mode library, wherein the updated image parameters of the double exposure image correspond to a camera parameter combination.

[0070] In some embodiments, the image parameters include at least one of exposure, color, and brightness.

[0071] In some embodiments, the electronic device includes a rear camera, the first camera is a main camera of the rear camera, the second camera is a secondary camera of the rear camera, and the image acquisition unit is specifically used to:

[0072] Acquire a first image captured by the main camera, and acquire a second image captured by the secondary camera, wherein the main camera and the secondary camera capture images with different camera parameters;

[0073] In some embodiments, the main camera is used to capture a foreground image, wherein the foreground image includes subject information, and the secondary camera is used to capture a background image.

[0074] In some embodiments, the image processing apparatus further includes:

[0075] A camera coordinate system unit, used to establish a camera coordinate system, wherein the origin of the camera coordinate system is the position where the focus of the main camera is located;

[0076] According to the relative positional relationship between the main camera and the secondary camera, a calibration parameter between the main camera and the secondary camera is determined, wherein the calibration parameter is used to align the viewing angle of the secondary camera with the viewing angle of the main camera.

[0077] In some embodiments, the image processing apparatus further includes:

[0078] A calibration unit is used to calibrate the second image according to the calibration parameters to generate a calibrated second image.

[0079] In some embodiments, the image fusion unit is specifically used to:

[0080] The first image and the calibrated second image are fused to generate a fused double exposure image.

[0081] In some embodiments, the first image partially overlaps with the calibrated second image, and the image fusion unit is specifically configured to:

[0082] Determining whether an overlapping area between the first image and the calibrated second image is greater than a preset threshold;

[0083] If so, the non-overlapping areas in the first image and the calibrated second image are determined according to the relative positional relationship between the main camera and the secondary camera, and the non-overlapping areas in the calibrated second image are used as the background of the fused double exposure image.

[0084] In some embodiments, the image fusion unit is specifically used to:

[0085] Determine subject information in the first image, and use the subject information as the foreground of the fused double exposure image;

[0086] Using the non-overlapping area in the calibrated second image as the background of the fused double exposure image;

[0087] The subject information and the non-overlapping area in the calibrated second image are fused to generate a fused double exposure image.

[0088] In some embodiments, the image fusion unit is specifically used to:

[0089] If the overlapping area between the first image and the calibrated second image is not greater than a preset threshold, the overlapping area between the first image and the calibrated second image is determined according to the relative position relationship between the main camera and the secondary camera, and the overlapping area in the calibrated second image is used as the background of the fused double exposure image.

[0090] In some embodiments, the image fusion unit is specifically used to:

[0091] Determine subject information in the first image, and use the subject information as the foreground of the fused double exposure image;

[0092] Cropping the calibrated second image to remove the area corresponding to the subject information in the calibrated second image, and using the overlapping area in the calibrated second image as the background of the fused double exposure image;

[0093] The subject information and the overlapped area in the calibrated second image are fused to generate a fused double exposure image.

[0094] In some embodiments, the subject information includes user image information and / or scene image information.

[0095] In some embodiments, the image processing apparatus further includes:

[0096] The subject magnification unit is used to determine a magnification factor according to the size of the calibrated second image, and to magnify the subject information based on the magnification factor.

[0097] In some embodiments, the image fusion unit is specifically used to:

[0098] The enlarged subject information is used as the foreground of the fused double exposure image, wherein the enlarged subject information is completely superimposed on the calibrated second image.

[0099] In some embodiments, the image fusion unit is further configured to:

[0100] The calibrated second image is cropped according to a size of a region in the calibrated second image corresponding to the enlarged subject information, so as to remove the region in the calibrated second image corresponding to the enlarged subject information.

[0101] In some embodiments, the camera parameters include at least one of exposure, color, and brightness.

[0102] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0103] at least one processor; and

[0104] a memory communicatively connected to the at least one processor; wherein,

[0105] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the image processing method as described above.

[0106] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable an electronic device to execute the image processing method as described above.

[0107] In a fifth aspect, an embodiment of the present application provides a computer program, which includes program instructions. When the program instructions are executed by one or more processors in an electronic device, the electronic device executes the above-mentioned image processing method.

[0108] The beneficial effect of the embodiment of the present application is as follows: Different from the prior art, the embodiment of the present application provides an image processing method, which is applied to an electronic device, the electronic device comprising a first camera and a second camera, the method comprising: obtaining a first image captured by the first camera, and obtaining a second image captured by the second camera; fusing the first image and the second image to generate a fused double exposure image; wherein the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a part of the first image and at least a part of the second image. On the one hand, by fusing the first image sent by the first camera and the second image sent by the second camera to generate a double exposure image, the embodiment of the present application can save the user's operation time and quickly generate an image with a double exposure effect. On the other hand, since the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a part of the first image and at least a part of the second image, the embodiment of the present application can achieve an artistic visual effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0110] Figure 1 is a schematic diagram of an electronic device provided by the present application;

[0111] Figure 2 It is a flowchart of an image processing method provided in Example 1 of the present application;

[0112] Figure 3 It is a flowchart of another image processing method provided in Example 1 of the present application;

[0113] Figure 4 is a schematic diagram of a fused double exposure image provided in Example 1 of the present application;

[0114] Figure 5 is a schematic diagram of a user interface of a photo-taking application provided in Embodiment 1 of the present application;

[0115] Figure 6 is a schematic diagram of a preset mode library provided in Example 1 of the present application;

[0116] Figure 7 is a schematic diagram of a double exposure image provided in Example 1 of the present application;

[0117] Figure 8 This is a schematic diagram of an image fusion process provided in Example 1 of the present application;

[0118] Fig. 9 It is a flowchart of an image processing method provided in Embodiment 2 of the present application;

[0119] Fig.10 is a flowchart of another image processing method provided in Embodiment 2 of the present application;

[0120] Fig.11 yes Fig.10 A detailed flowchart of step S106 in FIG.

[0121] Fig.12 yes Fig.10 Another detailed flowchart of step S106 in FIG.

[0122] Fig.13 is a schematic diagram of the field of view of the main camera and the secondary camera provided in the second embodiment of the present application;

[0123] Fig.14 This is a schematic diagram of an image processing process provided by Embodiment 2 of the present application;

[0124] Fig.15 yes Fig.10 Another detailed flowchart of step S106 in FIG.

[0125] Fig.16 is a schematic diagram of another image processing process provided in Embodiment 2 of the present application;

[0126] Fig.17 is a structural schematic diagram of an image processing device provided in Embodiment 3 of the present application;

[0127] Fig.18 This is a schematic diagram of the hardware structure of an electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION

[0128] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0129] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0130] Before explaining the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0131] (1) Main camera refers to the camera that contains the main image sensor, which is used to provide color clarity and display the main camera image during preview. Blocking the main camera lens will result in the inability to preview and image the subject.

[0132] (2) Auxiliary camera refers to a camera that includes an auxiliary image sensor, which is used to supplement the image brightness and details. If the secondary camera is blocked, it will not affect the photo preview, but the lack of image information provided by the secondary camera will ultimately lead to a deterioration in the photo imaging effect.

[0133] (3) Blurring refers to adjusting the clarity of an image, for example, blurring an image by adjusting the pixel values ​​of the pixels of an image.

[0134] See also Figure 1 , Figure 1 is a schematic diagram of an electronic device provided by the present application;

[0135] like Figure 1 As shown, the electronic device includes: a front camera 10, a rear camera 20 and a display screen 30, wherein the rear camera includes a main camera 21 and a sub-camera 22, wherein the focal lengths of the main camera 21 and the sub-camera 22 are different, for example: the focal length of the main camera 21 is a standard focal length, and the focal length of the sub-camera 22 is a long focal length. Optionally, the main camera 21 is enabled when taking photos with normal focal length, and the sub-camera 22 is enabled when taking distant views, so as to achieve better shooting effects.

[0136] Among them, the display screen 30 includes a display panel (not shown in the figure), and the display panel is used to present a display screen, for example: presenting the user interface of an application. The display screen 30 is used to provide operations for the user so that the user generates corresponding control instructions when triggering the display screen, for example: clicking on the icon of the user interface of the application to generate an operation instruction corresponding to the icon.

[0137] In the embodiment of the present application, the electronic device 100 is a device with a camera function and a communication function, including an imaging device, a processor, a memory, an input device and an output device. Furthermore, embedded computing, control technology, artificial intelligence technology and biometric authentication technology can be integrated to achieve functions such as calling, taking pictures, listening to music, playing games, information processing, fingerprint scanning, and environmental detection; wherein the imaging device is fixed or restricted to a specific position or place of the electronic device, the imaging device can remain stationary at a specific position or place or can move within a limited range, and the imaging device can be disassembled or not after being fixed or restricted to a specific position or place. Among them, the electronic device 100 includes but is not limited to: mobile terminals, such as: smart phones, tablets and other devices. The following is an example of the electronic device 100 being a smart phone:

[0138] Embodiment 1

[0139] See also Figure 2 , Figure 2 It is a flowchart of an image processing method provided in Example 1 of the present application;

[0140] like Figure 2 As shown, the image processing method is applied to an electronic device, the electronic device includes a first camera and a second camera, and the method includes:

[0141] Step S201: Acquire a first image captured by the first camera;

[0142] Specifically, the first camera includes a front camera of the electronic device, and the front camera is used to obtain a user image. The obtaining of the first image captured by the first camera includes: obtaining the user image sent by the front camera, wherein the user image includes facial features and / or body features of the user.

[0143] Step S202: Acquire a second image captured by the second camera;

[0144] Specifically, the second camera includes a rear camera of the electronic device, and the rear camera is used to obtain a background image. The obtaining of the second image captured by the second camera includes: obtaining the background image sent by the rear camera, wherein the background image includes scenery information, character information, biological information and other information.

[0145] It can be understood that, before acquiring the first image captured by the first camera and acquiring the second image captured by the second camera, the method further includes:

[0146] Open the camera application of the electronic device;

[0147] A dual exposure mode instruction is received, where the dual exposure mode is used to control a processor of the electronic device to simultaneously acquire a first image captured by the first camera and a second image captured by the second camera.

[0148] Step S203: fusing the first image and the second image to generate a fused double-exposure image; wherein the double-exposure image includes a double-exposure area, and the double-exposure area is formed by superimposing at least a portion of the first image and at least a portion of the second image;

[0149] Specifically, fusing the first image and the second image to generate a fused double exposure image includes:

[0150] The user image and the background image are fused to generate a fused double exposure image.

[0151] Specifically, by receiving a single shutter operation instruction, a first image captured by the first camera and a second image captured by the second camera are obtained, wherein the single shutter operation instruction is used to enable the first camera and the second camera to simultaneously acquire the first image and the second image, and to capture a fused double exposure image presented on the display screen, wherein the fused double exposure image is a double exposure image. In an embodiment of the present application, the single shutter operation instruction is triggered by a user clicking on the display screen of the electronic device, for example: clicking on a specific icon on the display screen to trigger the generation of the single shutter operation instruction, and the display screen sends the single shutter operation instruction to the processor of the electronic device.

[0152] In an embodiment of the present application, the method further includes:

[0153] The display screen of the electronic device is controlled to present the fused double exposure image.

[0154] Among them, the display screen of the electronic device presents the fused double exposure image through a preset mode, for example: after receiving the double exposure mode instruction, the user image sent by the front camera and the background image sent by the rear camera are simultaneously acquired, the user image and the background image are fused, and the fused double exposure image is presented on the display screen of the electronic device.

[0155] Since the operation is performed through the display screen and the fusion process is achieved through a single shutter, no other post-processing is required. The embodiment of the present application can quickly produce an image with a double exposure effect. In addition, the display screen provides a superimposed visual effect, making it easier for users to imagine the image effect in the double exposure mode, providing users with a simpler, faster and time-friendly way to create a double exposure effect, thereby facilitating the creation of artistic images and greatly improving the user's photography experience.

[0156] Please refer to Figure 3 , Figure 3 It is a flowchart of another image processing method provided in Example 1 of the present application;

[0157] like Figure 3 As shown, the image processing method comprises:

[0158] Step S301: opening a camera application of an electronic device;

[0159] Specifically, the user triggers the camera application, such as a mobile phone camera application (Application, APP), by clicking a camera application icon on the display screen of the electronic device, thereby opening the camera application of the electronic device;

[0160] Step S302: receiving a double exposure mode instruction;

[0161] Specifically, the camera application is preset with a dual exposure mode. When the user clicks on the dual exposure mode icon on the user interface of the camera application, a dual exposure mode instruction is generated, so that the processor of the electronic device receives the dual exposure mode instruction, and the processor controls the camera application of the electronic device to enter the dual exposure mode.

[0162] Step S303: Acquire the user image sent by the front camera;

[0163] Step S304: Acquire the background image sent by the rear camera;

[0164] Specifically, the front camera and the rear camera of the electronic device work simultaneously to obtain the user image and the background image respectively. It can be understood that the front camera and the rear camera obtain the user image and the background image based on the same scene. For example, when a user takes photos in a scenic area, the front camera is used for self-portraits and the rear camera is used for photographing the scenery. Figure 4 , Figure 4 It is a schematic diagram of a fused double exposure image provided in Example 1 of the present application.

[0165] Step S305: Detecting facial contour and / or body contour in the user image;

[0166] Specifically, detecting the facial contour and / or body contour in the user image includes:

[0167] Based on a preset image detection algorithm, a facial contour and / or a body contour in the user image is detected, wherein the preset image detection algorithm is used to detect a region of interest (ROI) in the user image, wherein the region of interest includes a face region of interest (face ROI) and a body region of interest (body ROI), and the face region of interest and the body region of interest in the user image are used as the facial contour or the body contour in the user image, respectively. In an embodiment of the present application, the preset image detection algorithm includes at least one of a ROI-pooling algorithm, a ROI-align algorithm, and a Deformable-Roi-pooling algorithm.

[0168] Step S306: fusing the area within the facial contour and / or body contour with the background image, and blurring the area other than the facial contour and body contour in the user image;

[0169] Specifically, the image information of the non-facial contour and non-body contour area in the user image is blurred to obtain the blurred image information of the non-facial contour and non-body contour, the area within the facial contour and / or body contour is fused with the background image to obtain a fused double exposure image, and the display screen of the electronic device is controlled to present the fused double exposure image. It is understandable that after the non-facial contour and non-body contour area in the user image is blurred, the area corresponding to the position of the non-facial contour and non-body contour in the double exposure image obtained by fusion of the user image and the background image also presents a blurred effect.

[0170] Specifically, blurring is performed on the non-facial contour and non-body contour regions in the user image, wherein the blurring includes: setting the pixel values ​​of the non-facial contour and non-body contour regions to the maximum, so that the non-facial contour and non-body contour regions are completely whitened, thereby retaining only the details of the regions corresponding to the facial contour and / or body contour;

[0171] Alternatively, the blurring process also includes: based on a preset filtering algorithm, blurring the non-facial contour and non-body contour areas in the user image, for example: the preset filtering algorithm includes: a linear filtering algorithm, such as a mean filtering algorithm, a median filtering algorithm, preferably, the preset filtering algorithm in the embodiment of the present application is a mean filtering algorithm, specifically including: generating a filtering template for the target pixel in the non-facial contour and non-body contour area, the filtering template including the neighboring pixels of the target pixel (for example: 8 pixels around the target pixel as the center constitute a filtering template, that is, removing the target pixel itself), and then replacing the original pixel value of the target pixel with the pixel average value of all pixels in the filtering template.

[0172] Step S307: receiving a preset mode selection instruction;

[0173] For details, please refer to Figure 5 , Figure 5 is a schematic diagram of a user interface of a photo-taking application provided in Embodiment 1 of the present application;

[0174] like Figure 5 As shown, the user interface of the photographing application is provided with a preset mode selection icon (Presets). When the user clicks the preset mode selection icon (Presets), it will trigger the generation of a preset mode selection instruction.

[0175] Step S308: determining a preset mode to fuse the user image and the background image based on a pre-established preset mode library according to the preset mode selection instruction;

[0176] Specifically, the preset mode library includes a plurality of preset modes, each preset mode corresponds to a camera parameter combination, and the camera parameter combination includes camera parameters of a first camera and camera parameters of a second camera. Specifically, the camera parameters include at least one of exposure, exposure time, brightness, and focal length, wherein the preset mode selection instruction is used to select a preset mode in the preset mode library, wherein each preset mode in the preset mode library corresponds to a camera parameter combination, for example, the black and white mode corresponds to the first camera parameter of the first camera and the second camera parameter of the second camera.

[0177] For details, please refer to Figure 6, Figure 6 is a schematic diagram of a preset mode library provided in Example 1 of the present application;

[0178] like Figure 6 As shown, the preset mode library includes an overlap mode (Superimpose), a soft light mode (Softlight), a black and white mode (BlackandWhite) and a hard light mode (Hardlight), wherein the overlap mode (Superimpose) refers to directly fusing the first image and the second image to obtain a fused double exposure image; the soft light mode refers to applying a layer of soft light to the fused image after the first image and the second image are fused; the black and white mode refers to performing black and white processing on the fused image after the first image and the second image are fused; the hard light mode refers to changing the tone of the fused image to make the image brighter after the first image and the second image are fused. In an embodiment of the present application, by pre-establishing a preset mode library, the preset mode library includes at least one preset mode, so that the user can directly click on the preset mode to generate the fused double exposure image corresponding to the preset mode, which is conducive to the user to quickly generate a picture with a double exposure effect.

[0179] Step S309: obtaining an image parameter adjustment instruction, and adjusting the image parameters of the fused double exposure image according to the image parameter adjustment instruction;

[0180] For details, please refer to Figure 5 ,like Figure 5 As shown, by determining the preset mode, after determining the preset mode, adjusting the image parameters of the fused double exposure image based on the preset mode, for example, adjusting the exposure to adjust the fused double exposure image, such as Figure 5 As shown in Figure (a), an exposure adjustment bar is provided in the user interface of the photo application, and the exposure is adjusted by pulling up or down, for example, adjusting the exposure of the front camera or the rear camera. Preferably, the embodiment of the present application adjusts the image parameters of the fused double exposure image by adjusting the exposure of the rear camera. In the embodiment of the present application, the image parameters include at least one of exposure, sensitivity, color, and brightness. By providing a corresponding adjustment bar or selection button in the user interface of the photo application, the user can adjust the exposure, sensitivity, color, and / or brightness, thereby adjusting the fused double exposure image to meet the user's needs.

[0181] Step S310: receiving a single shutter operation instruction, capturing the fused double exposure image presented on the display screen to generate a double exposure image.

[0182] Specifically, the user clicks a photo button on the user interface of a photo-taking application to trigger the display screen to generate a single shutter operation instruction, and sends the single shutter operation instruction to a processor. After receiving the single shutter operation instruction, the processor captures the fused double exposure image presented by the display screen to generate a double exposure image, and saves the double exposure image to the storage space of the electronic device, for example, in the gallery of the photo-taking application.

[0183] Please refer to Figure 7 , Figure 7 is a schematic diagram of a double exposure image provided in Example 1 of the present application;

[0184] like Figure 7 As shown, the non-facial contour and non-body contour areas in the user image are blurred, wherein the blurring includes setting the pixel values ​​of the non-facial contour and non-body contour areas to the maximum, so that the non-facial contour and non-body contour areas are completely whitened, thereby retaining only the image information of the areas corresponding to the facial contour and / or body contour, and then the facial contour and body contour areas in the user image are merged with the background image to generate a double exposure image.

[0185] In an embodiment of the present application, the first camera and the second camera capture images with different camera parameters, wherein the camera parameters include at least one of exposure, color, and brightness;

[0186] For example, see Figure 8 , Figure 8 This is a schematic diagram of an image fusion process provided in Example 1 of the present application;

[0187] like Figure 8 As shown, the image fusion process includes:

[0188] Get the camera parameters, where Figure 8 In the figure, the camera parameter is used as the exposure degree for illustration, and the exposure degree includes a first exposure degree and a second exposure degree. The front camera corresponds to the first exposure degree, and the rear camera corresponds to the second exposure degree, so that the front camera obtains a foreground image based on the first exposure degree, and the rear camera obtains a background image based on the second exposure degree, and then the foreground image and the background image are fused to obtain a fused double exposure image.

[0189] In an embodiment of the present application, an image processing method is provided, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the method includes: obtaining a first image captured by the first camera, and obtaining a second image captured by the second camera; fusing the first image and the second image to generate a fused double exposure image; wherein the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a portion of the first image and at least a portion of the second image. On the one hand, by fusing the first image sent by the first camera and the second image sent by the second camera to generate a double exposure image, the embodiment of the present application can save the user's operation time and quickly generate an image with a double exposure effect. On the other hand, since the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a portion of the first image and at least a portion of the second image, the embodiment of the present application can achieve an artistic visual effect.

[0190] Embodiment 2

[0191] See also Fig. 9 , Fig. 9 It is a flowchart of an image processing method provided in Embodiment 2 of the present application;

[0192] The image processing method is applied to an electronic device, wherein the electronic device includes a rear camera, the rear camera includes a main camera and a secondary camera, the first camera is the main camera of the rear camera, and the second camera is the secondary camera of the rear camera. Specifically, the execution subject of the image processing method is one or more processors of the electronic device;

[0193] like Fig. 9 As shown, the image processing method comprises:

[0194] Step S901: Acquire a first image captured by the main camera;

[0195] Specifically, the main camera is used to capture a foreground image, wherein the foreground image includes subject information, wherein the subject information includes person information and / or scene information, such as a photographed object or a landscape.

[0196] Step S902: Acquire a second image captured by the secondary camera;

[0197] Specifically, the secondary camera is used to capture the background image. The primary camera and the secondary camera capture images with different camera parameters, and the camera parameters include at least one of exposure, sensitivity, color, and brightness.

[0198] In an embodiment of the present application, the main camera is exposed with a normal exposure setting, and the exposure of the secondary camera is used for adjustment. By adjusting the exposure of the secondary camera, pictures with different brightness can be achieved. For example, the main camera uses a standard automatic exposure routine (AE routine) used in the camera, referred to as the AE routine, to estimate the exposure of a given scene. Among them, the AE routine will obtain an image block from the image grid, where the size of the image block depends on the implementation of AE, and obtain the average pixel value of the image block, and use the average pixel value to calculate the current brightness of the current scene and the target brightness of the current scene. And based on the target brightness and the current brightness, estimate the required exposure. The AE routine can be controlled by specifying a region of interest (ROI) to be considered when calculating the current and target brightness. For example, if the current brightness is 50, the sensitivity ISO is 100, the exposure time (ET) is 30ms, and the target brightness of the current scene is 100, then the exposure value (EV) needs to be doubled.

[0199] Step S903: fusing the first image and the second image to generate a fused double exposure image; wherein the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a portion of the first image and at least a portion of the second image;

[0200] Specifically, the first image includes a foreground image, the second image includes a background image, and the fusing the first image and the second image to generate a fused double exposure image includes:

[0201] The foreground image and the background image are fused to generate a fused double exposure image.

[0202] In an embodiment of the present application, the method further includes: controlling a display screen of the electronic device to present a fused double exposure image.

[0203] Among them, the display screen of the electronic device presents the fused double exposure image through a preset mode, for example: after receiving the double exposure mode instruction, the foreground image sent by the main camera and the background image sent by the sub-camera are simultaneously acquired, the foreground image and the background image are fused, and the fused double exposure image is presented on the display screen of the electronic device.

[0204] Specifically, by receiving a single shutter operation instruction, a first image captured by the main camera and a second image captured by the sub-camera are obtained, wherein the single shutter operation instruction is used to enable the main camera and the sub-camera to simultaneously acquire the first image and the second image, and capture a fused double exposure image presented on the display screen.

[0205] In the embodiment of the present application, before acquiring the first image sent by the main camera and acquiring the second image sent by the secondary camera, the method further includes:

[0206] Establishing a camera coordinate system, wherein the origin of the camera coordinate system is the position where the focus of the main camera is located;

[0207] According to the relative positional relationship between the main camera and the secondary camera, a calibration parameter between the main camera and the secondary camera is determined, wherein the calibration parameter is used to align the viewing angle of the secondary camera with the viewing angle of the main camera.

[0208] For details, please refer to Fig.10 , Fig.10 is a flowchart of another image processing method provided in Embodiment 2 of the present application;

[0209] like Fig.10 As shown, the image processing method comprises:

[0210] Step S101: establishing a camera coordinate system, wherein the origin of the camera coordinate system is the position where the focus of the main camera is located;

[0211] Step S102: determining calibration parameters between the main camera and the secondary camera according to the relative positional relationship between the main camera and the secondary camera, wherein the calibration parameters are used to align the viewing angle of the secondary camera with the viewing angle of the main camera, that is, the calibration parameters are used to calibrate the image captured by the secondary camera to the camera coordinate system;

[0212] It is understandable that, due to the different positions of the main camera and the secondary camera, the viewing angles of the main camera and the secondary camera are different. In order to merge the images captured by the main camera and the secondary camera, it is necessary to ensure that the viewing angles of the main camera and the secondary camera are aligned. Specifically, the calibration parameters include a translation matrix between the main camera and the secondary camera. The translation matrix of the main camera and the secondary camera is determined according to the relative position relationship between the main camera and the secondary camera, wherein the translation matrix is ​​used to convert the position information obtained by the secondary camera into the position information in the coordinate system established by the main camera, wherein it is assumed that the world coordinate information of the position where the focus of the main camera is located is (x m ,y m , z m ), the world coordinate information of the position where the focus of the secondary camera is located is (xa ,y a , z a ), and (Δx, Δy, Δz) = (x a -x m ,y a -y m , z a -z m ), determine the translation matrix of the images obtained by the main camera and the secondary camera as Then the coordinate information of the coordinate point of the second image acquired by the secondary camera after calibration is Wherein, (x2, y2, z2) is the position information of the coordinate point of the second image acquired by the secondary camera.

[0213] In the embodiment of the present application, after acquiring the second image sent by the secondary camera, the method further includes:

[0214] calibrating the second image according to the calibration parameters to generate a calibrated second image;

[0215] The fusing the first image and the second image to generate a fused double exposure image includes:

[0216] The first image and the calibrated second image are fused to generate a fused double exposure image.

[0217] Step S103: Acquire a first image captured by the main camera;

[0218] Specifically, the main camera is used to capture a foreground image, wherein the foreground image includes subject information, wherein the subject information includes person information and / or scene information, such as a photographed object or a landscape.

[0219] Step S104: Acquire a second image captured by the secondary camera;

[0220] Specifically, the secondary camera is used to capture the background image. The primary camera and the secondary camera capture images with different camera parameters, and the camera parameters include at least one of exposure, color, and brightness.

[0221] Step S105: calibrating the second image according to the calibration parameters to generate a calibrated second image;

[0222] Specifically, according to the calibration parameters, each coordinate point in the second image is converted into a calibrated coordinate point, so as to calibrate the second image to generate a calibrated second image, wherein the calibrated coordinate point is in a camera coordinate system with the focus of the main camera as the coordinate origin.

[0223] Step S106: fusing the first image and the calibrated second image to generate a fused double exposure image;

[0224] It can be understood that, since the field of view angles of the main camera and the secondary camera overlap, the first image partially overlaps with the calibrated second image.

[0225] Please refer to Fig.11 , Fig.11 yes Fig.10 A detailed flowchart of step S106 in FIG.

[0226] like Fig.11 As shown, step S106: fusing the first image and the calibrated second image includes:

[0227] Step S1061: determining whether an overlapping area between the first image and the calibrated second image is greater than a preset threshold;

[0228] Specifically, the first image includes a foreground image, and the second image includes background image information, wherein the foreground image includes subject information, wherein the subject information includes person information and / or scene information, such as: photographed object, scenery.

[0229] Among them, the preset threshold is used to determine whether the overlapping area between the first image and the calibrated second image is too large. If the overlapping area is too large, the foreground in the fused double exposure image may block a large amount of background, thereby affecting the double exposure effect. Therefore, the present application sets a preset threshold. If the overlapping area between the first image and the calibrated second image is greater than the preset threshold, it is necessary to determine the background from the non-overlapping area between the first image and the calibrated second image to ensure the double exposure effect. In an embodiment of the present application, the preset threshold is a preset multiple of the area of ​​the first image or a preset multiple of the area of ​​the calibrated second image. For example, the preset threshold is a preset multiple of the area of ​​the first image, and the value of the preset multiple is within a certain range. For example, the value range of the preset multiple is (0.5, 0.8), such as the preset multiple is 0.5, 0.6, 0.7, etc. It can be understood that the preset multiple is a value not greater than 1.

[0230] Step S1062: determining non-overlapping areas in the first image and the calibrated second image according to the relative positional relationship between the main camera and the auxiliary camera, and using the non-overlapping areas in the calibrated second image as the background of the fused double exposure image;

[0231] Specifically, the first image partially overlaps with the calibrated second image, that is, the foreground image partially overlaps with the background image. If the overlapping area between the first image and the calibrated second image is greater than a preset threshold, the non-overlapping area in the first image and the calibrated second image is determined according to the relative position relationship between the main camera and the secondary camera, and the non-overlapping area in the calibrated second image is used as the background of the fused double exposure image.

[0232] For details, please refer to Fig.12 , Fig.12 yes Fig.10 Another detailed flowchart of step S106 in FIG.

[0233] like Fig.12 As shown, step S106: fusing the first image and the calibrated second image to generate a fused double exposure image includes:

[0234] Step S1062: determining non-overlapping areas in the first image and the calibrated second image according to the relative positional relationship between the main camera and the auxiliary camera, and using the non-overlapping areas in the calibrated second image as the background of the fused double exposure image;

[0235] See also Fig.13 , Fig.13 is a schematic diagram of the field of view of the main camera and the secondary camera provided in the second embodiment of the present application;

[0236] like Fig.13 As shown, region 1 (Region 1), region 3 (Region 3) and region 7 (Region 7) serve as non-overlapping regions of the first image and the calibrated second image.

[0237] Step S1064: determining subject information in the first image, and using the subject information as the foreground of the fused double exposure image;

[0238] Specifically, the subject information includes user image information and / or scene image information, and determining the subject information in the first image includes:

[0239] Detecting the facial contour and / or body contour in the user image information specifically includes: based on a preset image detection algorithm, detecting the facial contour and / or body contour in the user image information, wherein the preset image detection algorithm is used to detect a region of interest (ROI) in the user image information, the region of interest including a face region of interest (face ROI) and a body region of interest (body ROI), and using the face region of interest and the body region of interest in the user image information as the facial contour or body contour in the user image, respectively. In an embodiment of the present application, the preset image detection algorithm includes at least one of a ROI-pooling algorithm, a ROI-align algorithm, and a Deformable-Roi-pooling algorithm.

[0240] Specifically, the determining the subject information in the first image further includes:

[0241] Detecting the scene contour in the scene image information specifically includes: detecting the scene contour in the scene image information based on a preset image detection algorithm, wherein the preset image detection algorithm is used to detect a region of interest (ROI) in the scene image information, the region of interest includes a scene region of interest, and the scene region of interest in the scene image information is used as the scene contour in the scene image information. In an embodiment of the present application, the preset image detection algorithm includes at least one of a ROI-pooling algorithm, a ROI-align algorithm, and a Deformable-Roi-pooling algorithm.

[0242] After detecting the subject information in the first image, the subject information is used as the foreground of the fused double exposure image.

[0243] Step S1065: using the non-overlapping area in the calibrated second image as the background of the fused double exposure image;

[0244] Specifically, the non-overlapping area is an area that is invisible to the main camera but visible to the secondary camera, and the non-overlapping area can be used as the background of the fused double exposure image, that is, the non-overlapping area in the calibrated second image is used as the background of the fused double exposure image. In an embodiment of the present application, the method further includes: cropping the non-overlapping area in the calibrated second image to obtain a cropped non-overlapping area, and using the cropped non-overlapping area as the background of the fused double exposure image, for example, determining a blurred area in the non-overlapping area in the calibrated second image, and cropping the blurred area.

[0245] In an embodiment of the present application, the method further includes:

[0246] Performing a perspective conversion on the non-overlapping area to generate a non-overlapping area after the perspective conversion, and using the non-overlapping area after the perspective conversion as a background image.

[0247] Step S1066: Fusing the subject information and the non-overlapping area in the calibrated second image to generate a fused double exposure image.

[0248] Specifically, the non-overlapping area after the perspective conversion, that is, the background image is used as the background and the subject information is used as the foreground, is fused to generate a fused double exposure image, and the display screen of the electronic device is controlled to present the fused double exposure image.

[0249] For details, please refer to Fig.13 , Fig.13 is a schematic diagram of the field of view of the main camera and the secondary camera provided in the second embodiment of the present application;

[0250] like Fig.13 As shown, the camera on the upper left side of the figure is the secondary camera, and the camera on the lower left side is the main camera, wherein the main camera is used to capture the foreground, and the position of its focus is set to the coordinate origin of the camera coordinate system, and the secondary camera is used to capture the background, wherein the main camera and the secondary camera respectively capture the foreground and the background with different camera parameters, for example: capturing the foreground and the background with different brightness.

[0251] Assume that the focus position of the main camera is (0,0), which is the origin of the camera coordinate system, and the focus position of the secondary camera is (0,s), where s is the distance of the secondary camera in the y direction;

[0252] The coordinates of the upper and lower endpoints of the subject / foreground are (D_s, L_up) and (D_s, L_down) respectively, and the distance between the background and the main camera and the secondary camera is D_bg;

[0253] It can be seen that due to the different field of view angles of the main camera and the secondary camera, the visible areas of the main camera and the secondary camera are different. According to the positional relationship between the main camera, the secondary camera and the subject / foreground, they can be divided into seven regions, namely Region 1, Region 2, Region 3, Region 4, Region 5, Region 6 and Region 7. Among them, the field of view angle of the secondary camera is greater than that of the main camera, so that Region 1 and Region 7 are visible to the secondary camera but not to the main camera, while Region 2 and Region 6 are visible to both the main camera and the secondary camera, and Region 4 is invisible to both the main camera and the secondary camera.

[0254] Since the subject / foreground blocks the main camera's view of Region 3, Region 3 is visible to the secondary camera but invisible to the main camera. This region is a non-overlapping region and can be used as the background of the fused double exposure image.

[0255] Since the subject / foreground blocks the view of the secondary camera in Region 5, Region 5 is visible to the primary camera but invisible to the secondary camera. This region is a non-overlapping region. Since this region is visible to the primary camera and the primary camera is used to obtain the foreground, it is preferred not to use this region as the background of the fused double exposure image.

[0256] Assume that the coordinates of the upper and lower endpoints of Region 3 are (D_bg, y_2) and (D_bg, y_1) respectively. According to the geometric principle of triangles:

[0257] y_2: L_up = D_s: D_bg;

[0258] From this, we can calculate the coordinates of Region 3 in the y direction:

[0259] y_2=(L_up / D_s)*D_bg;

[0260] y_1=(L_up-s) / (D_s)*(D_bg)+s;

[0261] Similarly, the coordinates of Region 3 in the x direction can be calculated;

[0262] Therefore, it can be concluded that any background image in Region 3 can be acquired by the secondary camera, and the acquired background image can be superimposed on the foreground in any fusion manner as needed to obtain a fused double exposure image.

[0263] Please refer to Fig.14 , Fig.14 This is a schematic diagram of an image processing process provided by Embodiment 2 of the present application;

[0264] like Fig.14 As shown, the image processing process includes: the main camera captures a first image based on a first brightness, and performs foreground division processing on the first image to divide the foreground of the fused double exposure image, the sub-camera captures a second image based on a second brightness, and performs background acquisition processing on the second image to acquire the background, and performs perspective conversion on the acquired background to generate the background of the fused double exposure image, and performs image fusion on the foreground and background of the fused double exposure image to obtain the fused double exposure image.

[0265] Step S1063: determining an overlapped area between the first image and the calibrated second image according to the relative positional relationship between the main camera and the auxiliary camera, and using the overlapped area in the calibrated second image as the background of the fused double exposure image;

[0266] For details, please refer to Fig.15 , Fig.15 yes Fig.10 Another detailed flowchart of step S106 in FIG.

[0267] like Fig.15 As shown, step S106: fusing the first image and the calibrated second image to generate a fused double exposure image includes:

[0268] Step S1063: determining an overlapped area between the first image and the calibrated second image according to the relative positional relationship between the main camera and the auxiliary camera, and using the overlapped area in the calibrated second image as the background of the fused double exposure image;

[0269] Specifically, the first image partially overlaps with the calibrated second image. If the overlap area between the first image and the calibrated second image is not greater than a preset threshold, the overlap area between the first image and the calibrated second image is determined according to the relative position relationship between the main camera and the auxiliary camera, and the overlap area in the calibrated second image is used as the background of the fused double exposure image. Fig.13As shown in FIG. 1 , since the main camera and the secondary camera are both visible to the subject or foreground, the overlapping area in the first image and the calibrated second image includes the subject or foreground, and the subject or foreground is the foreground of the fused double exposure image and will not be the background thereof. Therefore, the overlapping area in the first image and the calibrated second image includes Fig.13 In the embodiment of the present invention, the overlapping area in the first image and the calibrated second image is determined, including: determining the partial area or the entire area in the region 2 (Region2) and the region 6 (Region6) as the background of the fused double exposure image, for example: cropping the region 2 (Region2) and the region 6 (Region6), for example: cropping the blurred areas in the region 2 (Region2) and the region 6 (Region6), so as to determine the partial area in the region 2 (Region2) and the region 6 (Region6) as the background of the fused double exposure image.

[0270] Step S1067: determining subject information in the first image, and using the subject information as the foreground of the fused double exposure image;

[0271] Step S1068: cropping the calibrated second image to remove the area corresponding to the subject information in the calibrated second image, and using the overlapping area in the calibrated second image as the background of the fused double exposure image;

[0272] After determining the subject information in the first image, the method further includes: determining a magnification factor according to the size of the calibrated second image, and magnifying the subject information based on the magnification factor, wherein the subject information is used as the foreground of the fused double exposure image, including:

[0273] The enlarged subject information is used as the foreground of the fused double exposure image, wherein the enlarged subject information is completely superimposed on the calibrated second image.

[0274] Specifically, if the cropped second image is not large enough, that is, the subject information cannot be completely superimposed on the calibrated second image, that is, the foreground formed by simply superimposing the subject information and the background formed by the cropped second image cannot completely cover the entire range of the fused double exposure image. At this time, it is necessary to appropriately enlarge the subject information so that the subject information can be completely superimposed on the calibrated second image. Specifically, the magnification factor is determined according to the ratio of the size of the calibrated second image to the size of the area corresponding to the subject information, wherein the ratio is positively correlated with the magnification factor, for example: the ratio of the size of the calibrated second image to the size of the area corresponding to the subject information is 3:1, the magnification factor is determined to be 1.5 times, and based on the magnification factor, the subject information is enlarged so that the subject information can be completely superimposed on the calibrated second image.

[0275] Specifically, the cropping of the calibrated second image to remove the area corresponding to the subject information in the calibrated second image includes:

[0276] The calibrated second image is cropped according to a size of a region in the calibrated second image corresponding to the enlarged subject information, so as to remove the region in the calibrated second image corresponding to the enlarged subject information.

[0277] For example: See also Fig.13 , obtaining a calibrated second image, and cropping Region 3 (Region3), Region 4 (Region4) and Region 5 (Region5) in the calibrated second image to retain image information corresponding to Region 2 and Region 6, and using the image information corresponding to Region 2 and Region 6 as the background of the fused double exposure image, wherein the image information corresponding to Region 2 and Region 6 both belong to the image information within the visible area of ​​the main camera and the secondary camera, which is equivalent to the image information corresponding to Region 2 and Region 6 being the overlapping area in the calibrated second image.

[0278] Since the cropped area includes region 3 (Region 3) and region 5 (Region 5), the subject information may not be sufficient to completely cover the image information corresponding to region 2 and region 6. At this time, it is necessary to appropriately enlarge the subject information so that the subject information can be completely superimposed on the calibrated second image, for example: enlarge the subject information with a preset magnification factor so that the subject information can be completely superimposed on the calibrated second image, wherein the preset magnification factor is determined by the ratio of the size of the overlapping area to the size of the area corresponding to the subject information.

[0279] Step S1069: fusing the subject information and the overlapping area in the calibrated second image to generate a fused double exposure image;

[0280] Specifically, the subject information is used as the foreground of the fused double exposure image, the image information of the overlapping area in the calibrated second image is used as the background of the fused double exposure image, the subject information and the overlapping area in the calibrated second image are fused, and the display screen is controlled to present the fused double exposure image.

[0281] In an embodiment of the present application, the main camera and the auxiliary camera capture images with different camera parameters, wherein the camera parameters include at least one of exposure, color, and brightness;

[0282] For example, see Fig.16 , Fig.16 is a process schematic diagram of another image processing method provided in Example 2 of the present application;

[0283] like Fig.16 As shown, the image processing process includes: the main camera acquires a first image based on a first brightness, divides the first image into a foreground to acquire a foreground, and amplifies the acquired foreground to acquire an amplified foreground, that is, the foreground of a fused double exposure image; the sub-camera acquires a second image based on a second brightness, performs a perspective conversion on the second image acquired by the sub-camera to generate a calibrated second image, performs a background cropping process on the calibrated second image to acquire the background of the fused double exposure image, and finally fuses the foreground and background of the fused double exposure image to obtain a fused double exposure image.

[0284] In an embodiment of the present application, the method also includes: presenting the fused double exposure image through the display screen of the electronic device, wherein the fused double exposure image is a double exposure image. Specifically, the user clicks a photo button on the user interface of the photo application to trigger the display screen to generate a single shutter operation instruction, and sends the single shutter operation instruction to the processor. After receiving the single shutter operation instruction, the processor captures the image presented on the display screen to generate a fused double exposure image, and saves the double exposure image to the storage space of the electronic device, for example: in the gallery of the photo application.

[0285] In an embodiment of the present application, an image processing method is provided, which is applied to an electronic device, wherein the electronic device includes a rear camera, and the rear camera includes a main camera and a secondary camera. The method includes: obtaining a first image captured by the main camera, and obtaining a second image captured by the secondary camera, wherein the main camera and the secondary camera capture images with different camera parameters; fusing the first image and the second image to generate a fused double exposure image; wherein the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a part of the first image and at least a part of the second image. On the one hand, by fusing the first image sent by the main camera and the second image sent by the secondary camera to generate a fused double exposure image, the embodiment of the present application can better generate an image with a double exposure effect. On the other hand, since the main camera and the secondary camera perform image capture with different camera parameters, the embodiment of the present application can reduce the user's operation time while realizing an artistic image.

[0286] Embodiment 3

[0287] See also Fig.17 , Fig.17 It is a structural diagram of an image processing device provided in Embodiment 3 of the present application; wherein the image processing device 170 is applied to an electronic device, specifically, to one or more processors of the electronic device.

[0288] like Fig.17 As shown, the image processing device 170 is applied to an electronic device, the electronic device includes a first camera and a second camera, and the image processing device 170 includes:

[0289] An image acquisition unit 171 is used to acquire a first image acquired by the first camera, and to acquire a second image acquired by the second camera;

[0290] An image fusion unit 172, configured to fuse the first image and the second image to generate a fused double exposure image;

[0291] The double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a partial area in the first image and at least a partial area in the second image.

[0292] In the embodiment of the present application, the first camera includes a front camera of the electronic device, and the second camera includes a rear camera of the electronic device.

[0293] The image acquisition unit 171 is specifically used for:

[0294] Acquire a user image captured by the front camera, and acquire a background image captured by the rear camera; the image fusion unit is specifically used to:

[0295] The user image and the background image are fused to generate a fused double exposure image.

[0296] In the embodiment of the present application, the image fusion unit 172 is specifically used for:

[0297] Detecting facial contours and / or body contours in the user image;

[0298] The area within the facial contour and / or body contour is fused with the background image, and the area other than the facial contour and the area other than the body contour in the user image is blurred to generate a fused double exposure image.

[0299] In the embodiment of the present application, the image fusion unit 172 is specifically used for:

[0300] receiving a preset mode selection instruction;

[0301] According to the preset mode selection instruction, based on a pre-established preset mode library, a preset mode is determined to fuse the user image and the background image, wherein the preset mode library includes a plurality of preset modes, each preset mode corresponds to a camera parameter combination one by one, and the camera parameter combination includes camera parameters of a first camera and camera parameters of a second camera.

[0302] In the embodiment of the present application, the image processing device 170 further includes:

[0303] An image parameter adjustment unit (not shown), configured to obtain an image parameter adjustment instruction after determining the preset mode, and update the fused double exposure image generated based on the preset mode according to the image parameter adjustment instruction;

[0304] Based on the updated image parameters of the double exposure image, a new preset mode is generated, and the new preset mode is added to the preset mode library, wherein the updated image parameters of the double exposure image correspond to a camera parameter combination.

[0305] In an embodiment of the present application, the image parameter includes at least one of exposure, color, and brightness.

[0306] In an embodiment of the present application, the electronic device includes a rear camera, the first camera is a main camera of the rear camera, and the second camera is a secondary camera of the rear camera.

[0307] The image acquisition unit 171 is further specifically used for:

[0308] Acquire a first image captured by the main camera, and acquire a second image captured by the secondary camera, wherein the main camera and the secondary camera capture images with different camera parameters;

[0309] In the embodiment of the present application, the main camera is used to capture a foreground image, wherein the foreground image includes subject information, and the sub-camera is used to capture a background image.

[0310] In the embodiment of the present application, the image processing device 170 further includes:

[0311] A camera coordinate system unit, used to establish a camera coordinate system, wherein the origin of the camera coordinate system is the position where the focus of the main camera is located;

[0312] According to the relative positional relationship between the main camera and the secondary camera, a calibration parameter between the main camera and the secondary camera is determined, wherein the calibration parameter is used to align the viewing angle of the secondary camera with the viewing angle of the main camera.

[0313] In the embodiment of the present application, the image processing device 170 further includes:

[0314] A calibration unit (not shown) is used to calibrate the second image according to the calibration parameters to generate a calibrated second image.

[0315] In the embodiment of the present application, the image fusion unit 172 is specifically used for:

[0316] The first image and the calibrated second image are fused to generate a fused double exposure image.

[0317] In the embodiment of the present application, the first image partially overlaps with the calibrated second image, and the image fusion unit 172 is specifically configured to:

[0318] Determining whether an overlapping area between the first image and the calibrated second image is greater than a preset threshold;

[0319] If so, the non-overlapping areas in the first image and the calibrated second image are determined according to the relative positional relationship between the main camera and the secondary camera, and the non-overlapping areas in the calibrated second image are used as the background of the fused double exposure image.

[0320] In the embodiment of the present application, the image fusion unit 172 is specifically used for:

[0321] Determine subject information in the first image, and use the subject information as the foreground of the fused double exposure image;

[0322] Using the non-overlapping area in the calibrated second image as the background of the fused double exposure image;

[0323] The subject information and the non-overlapping area in the calibrated second image are fused to generate a fused double exposure image.

[0324] In the embodiment of the present application, the image fusion unit 172 is specifically used for:

[0325] If the overlapping area between the first image and the calibrated second image is not greater than a preset threshold, the overlapping area between the first image and the calibrated second image is determined according to the relative position relationship between the main camera and the secondary camera, and the overlapping area in the calibrated second image is used as the background of the fused double exposure image.

[0326] In the embodiment of the present application, the image fusion unit 172 is specifically used for:

[0327] Determine subject information in the first image, and use the subject information as the foreground of the fused double exposure image;

[0328] Cropping the calibrated second image to remove the area corresponding to the subject information in the calibrated second image, and using the overlapping area in the calibrated second image as the background of the fused double exposure image;

[0329] The subject information and the overlapped area in the calibrated second image are fused to generate a fused double exposure image.

[0330] In the embodiment of the present application, the subject information includes user image information and / or scene image information.

[0331] In the embodiment of the present application, the image processing device 170 further includes:

[0332] The subject magnification unit (not shown) is used to determine a magnification factor according to the size of the calibrated second image, and to magnify the subject information based on the magnification factor.

[0333] In the embodiment of the present application, the image fusion unit 172 is specifically used for:

[0334] The enlarged subject information is used as the foreground of the fused double exposure image, wherein the enlarged subject information is completely superimposed on the calibrated second image.

[0335] In the embodiment of the present application, the image fusion unit 172 is further configured to:

[0336] The calibrated second image is cropped according to a size of a region in the calibrated second image corresponding to the enlarged subject information, so as to remove the region in the calibrated second image corresponding to the enlarged subject information.

[0337] In an embodiment of the present application, the camera parameters include at least one of exposure, color, and brightness.

[0338] It should be noted that the above device can execute the image processing method provided in Embodiment 1 or Embodiment 2 of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the device embodiment, please refer to the image processing method provided in Embodiment 1 or Embodiment 2 of the present application.

[0339] In an embodiment of the present application, an image processing device is provided, which is applied to an electronic device, wherein the electronic device includes a first camera and a second camera, and the device includes: an image acquisition unit, which is used to acquire a first image captured by the first camera, and to acquire a second image captured by the second camera; an image fusion unit, which is used to fuse the first image and the second image to generate a fused double exposure image; wherein the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a part of the first image and at least a part of the second image. On the one hand, by fusing the first image sent by the first camera and the second image sent by the second camera to generate a double exposure image, the embodiment of the present application can save the user's operation time and quickly generate an image with a double exposure effect. On the other hand, since the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a part of the first image and at least a part of the second image, the embodiment of the present application can achieve an artistic visual effect.

[0340] Embodiment 4

[0341] See also Fig.18 , Fig.18 A schematic diagram of the hardware structure of an electronic device provided in Embodiment 4 of the present application;

[0342] like Fig.18 As shown, the electronic device 180 includes but is not limited to: a radio frequency unit 181, a network module 182, an audio output unit 183, an input unit 184, a sensor 185, a display unit 186, a user input unit 187, an interface unit 188, a memory 189, a processor 1810, and a power supply 1811, and the electronic device 180 also includes a camera. Those skilled in the art will understand that Fig.18The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present application, the electronic device includes but is not limited to a television, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0343] Processor 1810 is used to obtain a first image captured by the first camera, and to obtain a second image captured by the second camera; fuse the first image and the second image to generate a fused double exposure image; wherein the double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a portion of the first image and at least a portion of the second image. By fusing the first image sent by the first camera and the second image sent by the second camera to generate a double exposure image, the embodiment of the present application can quickly generate an image with a double exposure effect.

[0344] It should be understood that in the embodiment of the present application, the radio frequency unit 181 can be used for receiving and sending signals during information transmission or calls. Specifically, after receiving downlink data from the base station, it is sent to the processor 1810 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 181 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 181 can also communicate with the network and other devices through a wireless communication system.

[0345] The electronic device 180 provides users with wireless broadband Internet access through the network module 182, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0346] The audio output unit 183 can convert the audio data received by the RF unit 181 or the network module 182 or stored in the memory 189 into an audio signal and output it as sound. Moreover, the audio output unit 183 can also provide audio output related to a specific function performed by the electronic device 180 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 183 includes a speaker, a buzzer, a receiver, etc.

[0347] The input unit 184 is used to receive audio or video signals. The input unit 184 may include a graphics processor (GPU) 1841 and a microphone 1842, and the graphics processor 1841 processes the target image of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 186. The image frame processed by the graphics processor 1841 can be stored in the memory 189 (or other storage medium) or sent via the radio frequency unit 181 or the network module 182. The microphone 1842 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 181 in the case of a telephone call mode.

[0348] The electronic device 180 also includes at least one sensor 185, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1861 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1861 and / or the backlight when the electronic device 180 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 185 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0349] The display unit 186 is used to display information input by the user or information provided to the user. The display unit 186 may include a display panel 1861, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0350] The user input unit 187 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 187 includes a touch panel 1871 and other input devices 1872. The touch panel 1871, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 1871 or near the touch panel 1871 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 1871 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 1810, receives the command sent by the processor 1810 and executes it. In addition, the touch panel 1871 can be implemented in various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 1871, the user input unit 187 may also include other input devices 1872. Specifically, other input devices 1872 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.

[0351] Furthermore, the touch panel 1871 may be overlaid on the display panel 1861. When the touch panel 1871 detects a touch operation on or near it, it is transmitted to the processor 1810 to determine the type of touch event. Then, the processor 1810 provides corresponding visual output on the display panel 1861 according to the type of touch event. Fig.18 In the figure, the touch panel 1871 and the display panel 1861 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 1871 and the display panel 1861 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0352] The interface unit 188 is an interface for connecting an external device to the electronic device 180. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 188 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 180 or may be used to transmit data between the electronic device 180 and an external device.

[0353] The memory 189 can be used to store software programs and various data. The memory 189 can mainly include a program storage area and a data storage area, wherein the program storage area can store at least one application 1891 required for a function (such as a sound playback function, an image playback function, etc.) and an operating system 1892, etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.), etc. In addition, the memory 189 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0354] The processor 1810 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 189 and calling data stored in the memory 189, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 1810 may include one or more processing units; preferably, the processor 1810 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1810.

[0355] The electronic device 180 may also include a power supply 1811 (such as a battery) for supplying power to each component. Preferably, the power supply 1811 may be logically connected to the processor 1810 via a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0356] In addition, the electronic device 180 includes some functional modules not shown, which will not be described in detail here.

[0357] The electronic device of the embodiment of the present application exists in various forms, including but not limited to:

[0358] (1) Mobile communication equipment: This type of equipment is characterized by having mobile communication functions and its main purpose is to provide voice and data communications. This type of terminal includes: smart phones, multimedia phones, functional phones, etc.

[0359] (2) Mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, etc.

[0360] (3) Other electronic devices with photo taking and data exchange functions.

[0361] Preferably, an embodiment of the present application also provides an electronic device, including a processor 1810, a memory 189, and a computer program stored in the memory 189 and executable on the processor 1810. When the computer program is executed by the processor 1810, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0362] The embodiment of the present application also provides a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by one or more processors, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The non-volatile computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0363] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0364] The above described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0365] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile terminal, a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0366] Finally, it should be noted that the embodiments described above in conjunction with the accompanying drawings are only used to illustrate the technical solutions of the present application. The present application is not limited to the above-mentioned specific implementation methods, which are merely illustrative and not restrictive. Under the idea of ​​the present application, the technical features in the above-mentioned embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above. For the sake of simplicity, they are not provided in detail. Although the present application has been described in detail with reference to the above-mentioned embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the above-mentioned embodiments, or replace some of the technical features therein with equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. An image processing method, applied to an electronic device, characterized in that: The electronic device comprises a first camera and a second camera, the first camera is a main camera of a rear camera of the electronic device, and the second camera is a secondary camera of the rear camera, and the method comprises: Establishing a camera coordinate system, wherein the origin of the camera coordinate system is the position where the focus of the main camera is located; Determining calibration parameters between the main camera and the secondary camera according to the relative positional relationship between the main camera and the secondary camera, wherein the calibration parameters are used to align the viewing angle of the secondary camera with the viewing angle of the main camera; Acquire a first image captured by the main camera, and acquire a second image captured by the auxiliary camera, and calibrate the second image according to the calibration parameters to generate a calibrated second image; Determine subject information in the first image, and use the subject information as the foreground of the fused double exposure image; Determine whether the overlap area between the first image and the calibrated second image is greater than a preset threshold, and if so, determine the non-overlap area between the first image and the calibrated second image according to the relative position relationship between the main camera and the auxiliary camera, and use the non-overlap area in the calibrated second image as the background of the fused double exposure image, and fuse the subject information and the non-overlap area in the calibrated second image to generate a fused double exposure image; If the overlap area between the first image and the calibrated second image is not greater than a preset threshold, determining the overlap area between the first image and the calibrated second image according to the relative position relationship between the main camera and the auxiliary camera, and using the overlap area in the calibrated second image as the background of the fused double exposure image; cropping the calibrated second image to remove the area in the calibrated second image corresponding to the subject information; fusing the subject information and the overlap area in the calibrated second image to generate a fused double exposure image; The double exposure image includes a double exposure area, and the double exposure area is formed by superimposing at least a partial area in the first image and at least a partial area in the second image.

2. The method according to claim 1, characterized in that The first camera includes a front camera of the electronic device, and the second camera includes a rear camera of the electronic device; acquiring a first image captured by the first camera, and acquiring a second image captured by the second camera, comprises: Acquire a user image captured by the front camera, and acquire a background image captured by the rear camera; The fusing the first image and the second image to generate a fused double exposure image includes: The user image and the background image are fused to generate a fused double exposure image.

3. The method according to claim 2, characterized in that The fusing the user image and the background image to generate a fused double exposure image includes: Detecting facial contours and / or body contours in the user image; The area within the facial contour and / or body contour is fused with the background image, and the area other than the facial contour and the area other than the body contour in the user image is blurred to generate a fused double exposure image.

4. The method according to claim 2 or 3, characterized in that: The fusing the user image and the background image comprises: receiving a preset mode selection instruction; According to the preset mode selection instruction, based on a pre-established preset mode library, a preset mode is determined to fuse the user image and the background image, wherein the preset mode library includes a plurality of preset modes, each preset mode corresponds to a camera parameter combination one by one, and the camera parameter combination includes camera parameters of a first camera and camera parameters of a second camera.

5. The method according to claim 4, characterized in that The method further comprises: After determining the preset mode, obtaining an image parameter adjustment instruction, and updating the fused double exposure image generated based on the preset mode according to the image parameter adjustment instruction; Based on the updated image parameters of the double exposure image, a new preset mode is generated, and the new preset mode is added to the preset mode library, wherein the updated image parameters of the double exposure image correspond to a camera parameter combination.

6. The method according to claim 1, characterized in that After determining the subject information in the first image, the method further includes: Determining a magnification factor according to a size of the calibrated second image, and enlarging the subject information based on the magnification factor; The method of using the subject information as the foreground of the fused double exposure image includes: The enlarged subject information is used as the foreground of the fused double exposure image, wherein the enlarged subject information is completely superimposed on the calibrated second image.

7. The method according to claim 6, characterized in that The step of cropping the calibrated second image to remove a region in the calibrated second image corresponding to the subject information includes: The calibrated second image is cropped according to a size of a region in the calibrated second image corresponding to the enlarged subject information, so as to remove the region in the calibrated second image corresponding to the enlarged subject information.

8. An image processing device, applied to an electronic device, characterized in that: The electronic device comprises a first camera and a second camera, the first camera is a main camera of a rear camera of the electronic device, and the second camera is a secondary camera of the rear camera, and the device comprises: A camera coordinate system unit, used to establish a camera coordinate system, wherein the origin of the camera coordinate system is the position of the focus of the main camera; according to the relative position relationship between the main camera and the secondary camera, determine the calibration parameters between the main camera and the secondary camera, wherein the calibration parameters are used to align the viewing angle of the secondary camera with the viewing angle of the main camera; an image acquisition unit, configured to acquire a first image acquired by the main camera, and acquire a second image acquired by the auxiliary camera, and calibrate the second image according to the calibration parameters to generate a calibrated second image; an image fusion unit, configured to determine subject information in the first image, use the subject information as the foreground of a fused double exposure image, determine whether an overlapping area between the first image and the calibrated second image is greater than a preset threshold, and if so, determine a non-overlapping area between the first image and the calibrated second image according to a relative positional relationship between the main camera and the auxiliary camera, use the non-overlapping area in the calibrated second image as the background of the fused double exposure image, fuse the subject information and the non-overlapping area in the calibrated second image to generate a fused double exposure image; if the overlapping area between the first image and the calibrated second image is not If the subject information is greater than a preset threshold, then, according to the relative positional relationship between the main camera and the auxiliary camera, determining the overlapping area between the first image and the calibrated second image, and using the overlapping area in the calibrated second image as the background of the fused double exposure image; cropping the calibrated second image to remove the area corresponding to the subject information in the calibrated second image; fusing the subject information and the overlapping area in the calibrated second image to generate a fused double exposure image; wherein the double exposure image contains a double exposure area, and the double exposure area is formed by superimposing at least a portion of the first image and at least a portion of the second image.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Picture taking method and mobile terminal

    CN104853091A

  • Image generation method based on electronic device and electronic device

    CN106878606A