Photographing method, photographing apparatus, electronic device, and computer-readable storage medium

By using a dual-camera module and optical image stabilization data mapping technology, the problem of image stabilization affecting the quality of blurred images has been solved, achieving high-quality blurred effects and accurate depth images.

CN115633261BActive Publication Date: 2026-01-02GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211212222.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2026-01-02
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

When shooting bokeh images, enabling the camera's image stabilization function can affect the accuracy of the depth image, resulting in a decrease in the quality of the bokeh image.

Method used

A dual-camera module is used. The optical image stabilization function of the first camera is used to acquire a first visible light image, and a third visible light image is generated by mapping the image stabilization data. A depth image is generated by combining the visible light image of the second camera, and finally the first visible light image is blurred.

Benefits of technology

While achieving image stabilization, it ensures the accuracy of depth images and the bokeh effect, thus improving the quality of the bokeh image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115633261B_ABST
    Figure CN115633261B_ABST
Patent Text Reader

Abstract

The application discloses a photographing method, a photographing device, an electronic device and a nonvolatile computer readable storage medium. The photographing method comprises the following steps: starting an optical image stabilization function of a first camera, and acquiring a first visible light image collected by the first camera and a second visible light image collected by a second camera; mapping the first visible light image according to anti-shake data when the first camera performs optical image stabilization, so as to acquire a third visible light image; generating a depth image according to the second visible light image and the third visible light image; and performing a blurring process on the first visible light image according to the depth image, so as to generate a blurred image. By starting the optical image stabilization function, the anti-shake function is realized, and the first visible light image obtained after anti-shake is mapped into the third visible light image that can be acquired when the optical image stabilization function is not started, so that the quality of the depth image is ensured, and the blurring effect of the first visible light image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of consumer electronics, and more particularly, to a photographing method, a photographing device, an electronic device and a computer readable storage medium. BACKGROUND

[0002] With the popularity of smart devices such as smart phones, tablet computers and other mobile devices, people are more accustomed to using mobile devices for shooting. Therefore, people have higher and higher requirements for the imaging quality of mobile devices. At present, when shooting a blurred image, the anti-shake function of the camera is generally not turned on to prevent the anti-shake function from affecting the accuracy of the generated depth image, but also causes the blurred image to be easily affected by shaking and reduces the quality of the blurred image. SUMMARY

[0003] The present application provides a photographing method, a photographing device, an electronic device and a computer readable storage medium.

[0004] The photographing method of the present application is applied to an electronic device, which includes a first camera and a second camera, the focal length of the first camera is greater than the focal length of the second camera, and the photographing method includes turning on the optical anti-shake function of the first camera, and acquiring a first visible light image collected by the first camera and a second visible light image collected by the second camera; mapping the first visible light image according to anti-shake data when the first camera performs optical anti-shake to obtain a third visible light image; generating a depth image according to the second visible light image and the third visible light image; and performing blurring processing on the first visible light image according to the depth image to generate a blurred image.

[0005] The photographing device of the present application includes the acquisition module, the first mapping module, the generation module and the blurring module. The acquisition module is used to turn on the optical anti-shake function of the first camera, and acquire a first visible light image collected by the first camera and a second visible light image collected by the second camera; the first mapping module is used to map the first visible light image according to anti-shake data when the first camera performs optical anti-shake to obtain a third visible light image; the generation module is used to generate a depth image according to the second visible light image and the third visible light image; and the blurring module is used to perform blurring processing on the first visible light image according to the depth image to generate a blurred image.

[0006] The electronic device of the embodiment of the present application comprises a first camera, a second camera and a processor, the processor is configured to turn on an optical image stabilization function of the first camera, and acquire a first visible light image collected by the first camera and a second visible light image collected by the second camera; map the first visible light image according to anti-shake data when the first camera performs optical image stabilization, to acquire a third visible light image; generate a depth image according to the second visible light image and the third visible light image; and perform a bokeh processing on the first visible light image according to the depth image, to generate a bokeh image.

[0007] The computer readable storage medium of the embodiment of the present application comprises a computer program, the computer program is configured to make the processor execute the photographing method when executed by the processor. The photographing method comprises turning on an optical image stabilization function of the first camera, and acquiring a first visible light image collected by the first camera and a second visible light image collected by the second camera; mapping the first visible light image according to anti-shake data when the first camera performs optical image stabilization, to acquire a third visible light image; generating a depth image according to the second visible light image and the third visible light image; and performing a bokeh processing on the first visible light image according to the depth image, to generate a bokeh image.

[0008] The photographing method, photographing device, electronic device and computer readable storage medium of the embodiment of the present application can turn on the optical image stabilization function of the first camera, to ensure that the first visible light image for bokeh processing is not affected by shaking, thereby improving the quality of the bokeh image. Moreover, when the depth image is generated, the first visible light image is mapped according to the anti-shake data, thereby removing the influence of moving the lens or the image sensor during anti-shaking, so that the first visible light image is mapped to the third visible light image that can be acquired when the optical image stabilization function is not turned on, thereby ensuring the accuracy of the depth image generated based on the preset internal and external parameters of the first camera and the second camera (the preset internal and external parameters are accurate only when the lens or the image sensor of the first camera and the second camera is not moved), the second visible light image and the third visible light image. In this way, the anti-shaking of the first camera is realized while the bokeh effect of the depth image on the first visible light image is ensured.

[0009] Additional aspects and advantages of the embodiments of the present application will be in part apparent and in part pointed out hereinafter in the description of the embodiments of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0010] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the description of the embodiments, taken in conjunction with the following drawings in which:

[0011] Figure 1 is a flowchart of a photographing method according to some embodiments of the present application;

[0012] Figure 2 is a plan view of an electronic device according to some embodiments of the present application;

[0013] Figure 3 is a scene diagram of a photographing method according to some embodiments of the present application;

[0014] Figure 4 is a flowchart of a photographing method according to some embodiments of the present application;

[0015] Figure 5 is a flowchart of a photographing method according to some embodiments of the present application;

[0016] Figure 6 is a scene diagram of a photographing method according to some embodiments of the present application;

[0017] Figure 7 is a scene diagram of a photographing method according to some embodiments of the present application;

[0018] Figure 8 is a scene diagram of a photographing method according to some embodiments of the present application;

[0019] Figure 9 is a flowchart of a photographing method according to some embodiments of the present application;

[0020] Figure 10 is a flowchart of a photographing method according to some embodiments of the present application;

[0021] Figure 11 is a scene diagram of a photographing method according to some embodiments of the present application;

[0022] Figure 12 is a module diagram of a photographing apparatus according to some embodiments of the present application;

[0023] Figure 13 is a connection state diagram of a non-volatile computer readable storage medium and a processor according to some embodiments of the present application. DETAILED DESCRIPTION

[0024] Embodiments of the present application are described in detail below with reference to the attached drawings, wherein the same or like reference numerals in different drawings denote the same or like components or components having the same or similar functions. The embodiments described below are examples of the present application, and are merely intended to explain the embodiments of the present application, and should not be understood as limiting the embodiments of the present application.

[0025] For the convenience of understanding the present application, the terms appearing in the present application are explained as follows:

[0026] Optical Image Stabilization (OIS): refers to the movement of the moving lens or image sensor in the camera or other similar imaging instruments to avoid or reduce the instrument jitter phenomenon in the process of capturing optical signals, so as to improve the imaging quality.

[0027] Image blurring: in order to highlight the shooting subject, the objects outside the shooting subject are generally blurred. Therefore, when performing image blurring, the depth range of the shooting subject needs to be determined, so that the objects outside the depth range of the shooting subject are blurred, so as to highlight the shooting subject. Therefore, when performing image blurring, the depth image of the same scene as the shooting scene can be obtained at the same time to assist in performing image blurring, and the accuracy of the depth image affects the blurring effect of the shooting subject.

[0028] Please refer to Figure 1 and Figure 2 The application embodiment provides a shooting method applied to an electronic device 100, the electronic device 100 comprising a first camera 20 and a second camera 30, the shooting method comprising the steps of:

[0029] Step 011: turn on the optical image stabilization function of the first camera 20, and acquire the first visible light image collected by the first camera 20 and the second visible light image collected by the second camera 30;

[0030] Specifically, when shooting the image to be blurred, the optical image stabilization function of the first camera 20 is turned on to ensure the anti-shake effect of the first visible light image to be blurred, so as to avoid the phenomenon of motion blur of the first visible light image.

[0031] At the same time, when shooting the first visible light image, the second camera 30 is also controlled to shoot to obtain the second visible light image, and the first camera 20 and the second camera 30 form a dual-camera module to generate a depth image.

[0032] Generally, the larger the focal length, the smaller the field of view of the camera. For a dual-camera module, generally only the depth image in the overlapping field of view of the two cameras can be obtained. For example, for a dual-camera module composed of a long-focus camera and a wide-angle camera, the field of view of the wide-angle camera generally covers the field of view of the long-focus camera. Therefore, when obtaining a depth image based on a dual-camera, only the depth image in the field of view of the long-focus camera can be obtained.

[0033] Therefore, the image to be blurred is generally an image taken by a camera with a small focal length, such as when the focal length of the first camera 20 is greater than that of the second camera 30 (for example, the first camera 20 is a telephoto camera, and the second camera 30 is a wide-angle camera; or, the first camera 20 is a wide-angle camera, and the second camera 30 is an ultra-wide-angle camera), and the image to be blurred is the first visible light image.

[0034] Step 012: mapping the first visible light image according to the anti-shake data of the first camera 20 when optical anti-shake is performed, to obtain a third visible light image.

[0035] Specifically, since the optical anti-shake function is turned on when the first visible light image is taken, the lens and / or image sensor of the first camera 20 moves when the first visible light image is obtained, and the dual-camera module of the first camera 20 and the second camera 30 is calibrated based on the preset position (such as the center position) of the moving stroke of the lens and image sensor of the first camera 20 and the second camera 30. If the first camera 20 performs anti-shake, the calibrated intrinsic and extrinsic parameters will no longer be accurate, and the use of inaccurate intrinsic and extrinsic parameters for stereo rectification and disparity calculation to generate a depth image will inevitably result in a decrease in the accuracy of the depth image.

[0036] Please refer to Figure 3 Therefore, in order to ensure that the calibrated intrinsic and extrinsic parameters can be accurately used to generate a depth image, it is necessary to eliminate the influence of anti-shake on the first visible light image P1. It can be understood that when no anti-shake is performed, the initial image P0 generated by the first camera 20 is cropped in a preset area (such as the center area) to generate the first visible light image P1. After anti-shake is performed, the cropped area is offset, and the anti-shake data is related to the offset of the cropped area. According to the anti-shake data of the motor of the first camera 20 (such as the amount of movement of the lens and / or the amount of movement of the image sensor), the offset of the cropped area can be determined, and the first visible light image P1 cropped based on anti-shake can be obtained.

[0037] On the contrary, according to the cropped area of the first visible light image P1 and the offset determined by the anti-shake data, the cropped area when no anti-shake is performed can be determined in the initial image P0, and the third visible light image P3 that should be generated when no anti-shake is performed can be obtained, thereby eliminating the influence of anti-shake on the depth image. The third visible light image P3 and the second visible light image can be accurately stereo rectified and disparity calculated using the calibrated intrinsic and extrinsic parameters, thereby generating an accurate depth image.

[0038] Step 013: generating a depth image according to the second visible light image and the third visible light image.

[0039] Specifically, after obtaining the third visible light image, based on the double camera imaging principle, the internal and external parameters of the first camera 20 and the second camera 30, the second visible light image and the third visible light image are rectified and parallax is calculated to generate a depth image.

[0040] Step 014: blurring the first visible light image according to the depth image to generate a blurred image.

[0041] Specifically, in the case where the focal length of the first camera 20 is greater than the focal length of the second camera 30, it means that the first visible light image captured by the first camera 20 is the image to be blurred, so after obtaining the depth image, the first visible light image can be blurred according to the depth image to generate a blurred image.

[0042] It can be understood that when the first visible light is blurred, the depth image and the first visible light image can be registered first to determine the depth value of each pixel in the first visible light, and then the blurring process is performed according to the depth value of each pixel and the depth range of the target object. For example, the pixels with depth values outside the depth range of the target object are blurred, and the blurring degree is determined according to the difference between the depth value of the pixel and the maximum value of the depth range of the target object. The greater the difference, the greater the blurring degree, and the greater the image blur.

[0043] The shooting method of the embodiments of the present application can turn on the optical anti-shake function of the first camera 20 to ensure that the first visible light image subjected to the blurring process is not affected by the shaking, thereby improving the quality of the blurred image. Moreover, when generating the depth image, the first visible light image is mapped according to the anti-shake data, thereby removing the influence of moving the lens or the image sensor during anti-shake, so that the first visible light image is mapped to the third visible light image that can be obtained when the optical anti-shake function is not turned on, thereby ensuring the accuracy of the depth image generated based on the preset internal and external parameters of the first camera 20 and the second camera 30 (the preset internal and external parameters are accurate when neither the first camera 20 nor the second camera 30 moves the lens or the image sensor), the second visible light image and the third visible light image. In this way, while realizing the anti-shake of the first camera 20, the blurring effect of the depth image on the first visible light image is ensured.

[0044] Referring to Figure 2 and Figure 4 In some embodiments, the shooting method further comprises:

[0045] Step 015: mapping the depth image according to the anti-shake data to obtain a target depth image.

[0046] Step 014: performing a blurring process on the first visible light image according to the depth image to generate a blurred image, comprising:

[0047] Step 0141: performing a blurring process on the first visible light image according to the target depth image to generate a blurred image.

[0048] Specifically, since the depth image is generated according to the second visible light image and the third visible light image, and the third visible light image is mapped by the anti-shake data, there is also an image deviation between the generated depth image and the first visible light image. Therefore, the depth image can also be mapped again according to the anti-shake data to obtain a target depth image that corresponds to the first visible light image, so that the registration of the target depth image and the first visible light image can be achieved without feature point matching.

[0049] It can be understood that when the third visible light image is obtained, not only is the mapping performed according to the anti-shake data and the cropped region in the initial image of the first visible light image, but also the cropped region after mapping can be appropriately enlarged to obtain the third visible light image. At this time, the field of view range of the generated depth image is greater than the field of view range corresponding to the first visible light image, so as to facilitate subsequent mapping of the depth image based on the anti-shake data, and the target depth image corresponding to the field of view range of the first visible light image can be obtained.

[0050] Then, the first visible light image is blurred according to the target depth image corresponding to the field of view range of the first visible light image, so as to generate an accurate blurred image

[0051] Please refer to Figure 2 and Figure 5 In some embodiments, step 012: mapping the first visible light image according to the anti-shake data when the first camera 20 performs optical anti-shake to obtain a third visible light image, comprising:

[0052] Step 0121: obtaining an initial image shot by the first camera 20, and determining a first image region of the first visible light image in the initial image;

[0053] Step 0122: determining a second image region according to the anti-shake data and the first image region; and

[0054] Step 0123: obtaining image data of the second image region in the initial image to obtain a third visible light image.

[0055] Specifically, please refer to Figure 6When the first camera 20 is shooting, an initial image P0 can be obtained, and then the first visible light image P1 can be obtained by cropping the initial image P0. Therefore, when the anti-shake control is performed, the first image region M1 of the first visible light image P1 in the initial image can be obtained first.

[0056] Then, the second image region M2 after the offset is eliminated is obtained according to the position of the first image region M1 and the anti-shake data (the offset of the cropped region is related to the anti-shake data, which can be calculated according to the movement amount of the motor, that is, the offset amount of the cropped region).

[0057] Optionally, the travel data and the image row can be aligned according to a first time of obtaining each row of travel data and a second time of exposure of each image row of the first image region M1; a pixel offset of the image row aligned with each row of travel data can be calculated according to the travel data and a preset mapping function; and the second image region M2 can be determined according to the pixel offset of each image row of the first image region M1.

[0058] It can be understood that when the anti-shake control of the image is performed, the image sensor is generally exposed row by row due to the rolling shutter effect, and therefore the exposure time of each row is different, and the anti-shake data corresponding to different image rows is also different. The anti-shake data specifically includes travel data, that is, the position of the motor in the movement travel, and the motor moves in the movement travel to drive the lens and / or the image sensor of the first camera 20 to move, thereby realizing the anti-shake control.

[0059] The first camera 20 is also provided with a Hall sensor for collecting continuous multiple rows of travel data, and when the travel data corresponding to each image row is obtained, the first time of collecting the travel data and the second time of exposure of each image row need to be aligned. For example, the travel data and the image row with the same first time and second time or a difference less than a preset difference threshold are aligned.

[0060] Please refer to Figure 7 Of course, since the frame rate of collecting the travel data can be low, the number of collected travel data in the exposure time of one frame is less than the number of image rows, for example, the image row is 5 rows, and 3 travel data D1, D2 and D3 are collected in the exposure time of one frame. At this time, in order to make each image row have corresponding travel data, the travel data located in the exposure time of the first image region M1 can be interpolated to obtain the target number of travel data. Since there can be travel data that does not correspond to any image row in the collected travel data, the target number of frames can be greater than the number of image rows of the first image region M1 after interpolation, and therefore the target number of frames is greater than or equal to the number of image rows of the first image region M1.

[0061] In Figure 7 the example of 3-frame travel data D1, D2 and D3, the first, third and fifth image rows of the first image region M1 are aligned with the travel data D1, D2 and D3 respectively. When interpolating, it is generally considered that the change of the travel data is linear over time, so linear interpolation can be performed according to the first time of the two continuous frames of travel data and the second time of the image row located between the first time of the two continuous frames of travel data, so that there is corresponding travel data for the image row located between the first time of the two continuous frames of travel data. As Figure 7 shown in FIG. 6, the second image row can be interpolated according to D1 and D2 to obtain the travel data (D1+D2) / 2 corresponding to the second image row, and the fourth image row can be interpolated according to D2 and D3 to obtain the travel data (D2+D3) / 2 corresponding to the second image row.

[0062] In this way, the travel data of the target frame number can be obtained, and the travel data of the target frame number is aligned with the image rows of the first image region M1, so that each image row corresponds to the travel data.

[0063] After determining the travel data of each image row, the pixel offset of each image row can be calculated according to the travel data of each image row and a preset mapping function. The mapping function is as follows:

[0064] Δx i = K x0 *hallx i 3 + K x1 *hallx i 2 + K x2 *hallx i + K x3

[0065] Δy i = K y0 *hally i 3 + K y1 *hally i 2 + K y2 *hally i + K y3

[0066] wherein Kx0, Kx1, Kx2, Kx3 are the x-direction (e.g. horizontal direction) of the first camera 20 at the moving travel of the motor, and Ky0, Ky1, Ky2, Ky3 are the y-direction (e.g. vertical direction) of the first camera 20 at the moving travel of the motor. Figure 2Ky0, Ky1, Ky2, Ky3 are preset parameters of the first camera 20 in the y direction of the moving stroke of the motor, and the x direction and the y direction are perpendicular. hallxi and hallyi are the halldata values of the i-th row of the first image area M1 in the x and y directions, respectively, and △xi and △yi are the pixel offsets of the i-th row in the x and y directions when the motor is located at the center position of the moving stroke. In this way, the pixel offset of the image row corresponding to each stroke data can be quickly calculated.

[0067] Finally, please refer to Figure 6 and Figure 8 According to the pixel offset of each image row of the first image area M1, the second image area M2 that eliminates the pixel offset can be determined in the initial image P0. As Figure 6 shown, the initial image is a 9*9 image, and the first image area M1 is 5*5. Through calculation, the pixel offsets of the 5 image rows in the first image area M1 are (1, 1), (1, 1), (1, 1), (1, 1), and (2, 1) respectively. Therefore, by subtracting the corresponding pixel offset from the image coordinates of each row of the first image area M1, the second image area M2 can be obtained.

[0068] Thus, the image data of the second image area M2 is obtained to obtain the mapped third visible light image P3. At this time, the third visible light image P3 is the image that should be obtained without the anti-shake control of the first camera 20. Therefore, the third visible light image P3 and the second visible light image can be accurately rectified and parallax calculated using the calibrated intrinsic and extrinsic parameters, thereby generating an accurate depth image.

[0069] Please refer to Figure 2 and Figure 9 In some embodiments, the photographing method further comprises:

[0070] Step 016: turning on the optical anti-shake function of the second camera 30;

[0071] Step 017: mapping the second visible light image according to the anti-shake data when the second camera 30 performs optical anti-shake to obtain a fourth visible light image;

[0072] Step 013: generating a depth image according to the second visible light image and the third visible light image, comprising:

[0073] Step 0131: generating a depth image according to the third visible light image and the fourth visible light image.

[0074] Specifically, when the anti-shake control is performed, not only the optical anti-shake function of the first camera 20 can be turned on, but also the optical anti-shake function of the second camera 30 can be turned on. In order to ensure the accuracy of the depth image, after the second visible light image is obtained, the second visible light image also needs to be mapped according to the anti-shake data of the second camera 30 to obtain a fourth visible light image (for details of mapping the second visible light image according to the anti-shake data of the second camera 30, please refer to step 012). Thus, the third visible light image and the fourth visible light image that eliminate the influence of anti-shake can be obtained, and an accurate depth image can be generated according to the third visible light image and the fourth visible light image. In the meanwhile, the accuracy of the depth image is ensured, and the first camera 20 and the second camera 30 are not affected by shaking.

[0075] Please refer to Figure 2 and Figure 10 In some embodiments, the photographing method further comprises:

[0076] Step 018: After the optical anti-shake function of the first camera 20 is turned on, the motor of the first camera 20 is controlled to perform a centering operation between adjacent two frames of the first visible light images, so that the lens and / or the image sensor of the first camera 20 moves to the center position of the corresponding movement stroke.

[0077] Specifically, for the anti-shake of OIS, the compensation ability of the lens and the image sensor is the strongest when they are at the center position of the movement stroke. As shown in Figure 11 , taking the movement of the lens in the x direction driven by the motor as an example, the center position of the movement stroke in the x direction is O point, the end point in the negative direction of the x direction is O1 point, and the end point in the positive direction of the x direction is O2 point. That is, the lens can only move between O1 and O2. When the lens is at the center position O point, the compensation ability of the lens is the strongest in both the positive direction and the negative direction of the x direction. When the lens moves in a certain direction (such as the x direction or the y direction), for example, moves in the positive direction of the x direction, since the remaining movable distance in the positive direction of the x direction is reduced, the anti-shake ability of OIS in the positive direction of the x direction becomes weaker.

[0078] The image sensor has a non-exposure time when acquiring adjacent two frames of images. In the non-exposure time, the image sensor does not image an image. At this time, the motor of the first camera 20 is controlled to perform a centering operation between adjacent two frames of the first visible light images, so that the lens and / or the image sensor of the first camera 20 moves to the center position O of the corresponding movement stroke. That is, the lens is pulled back to the center position O in the non-exposure time, so that the compensation ability of OIS is always the strongest. In this way, the anti-shake ability of OIS can be maximized. Therefore, during the entire photographing and frame acquisition process when the photographing is blurred, since OIS always has the strongest compensation ability, the acquired frames all have good motion blur suppression effect.

[0079] Please refer to Figure 12 In order to better implement the photographing method of the embodiments of the present application, the embodiments of the present application further provide a photographing device 10. The photographing device 10 can include:

[0080] The acquisition module 11 is configured to start the optical image stabilization function of the first camera, and acquire a first visible light image collected by the first camera and a second visible light image collected by the second camera.

[0081] The first mapping module 12 is configured to map the first visible light image according to anti-shake data when the first camera performs optical image stabilization, to obtain a third visible light image.

[0082] The generation module 13 is configured to generate a depth image according to the second visible light image and the third visible light image.

[0083] The blurring module 14 is configured to blur the first visible light image according to the depth image, to generate a blurred image.

[0084] The photographing device 10 further includes a second mapping module 15, which is configured to map the depth image according to the anti-shake data, to obtain a target depth image.

[0085] The blurring module 14 is specifically configured to blur the first visible light image according to the target depth image, to generate the blurred image.

[0086] The first mapping module 12 is specifically configured to acquire an initial image photographed by the first camera, and determine a first image region of the first visible light image in the initial image; determine a second image region according to the anti-shake data and the first image region; and acquire image data of the second image region in the initial image, to obtain the third visible light image.

[0087] The first mapping module 12 is specifically configured to align the travel data and the image row according to a first time at which each frame of the travel data is acquired and a second time at which each image row of the first image region is exposed; calculate a pixel offset of the image row aligned with each frame of the travel data according to the travel data and a preset mapping function; and determine the second image region according to the pixel offset of each image row of the first image region.

[0088] The first mapping module 12 is specifically further configured to interpolate the travel data located within the exposure time length of the first image region to obtain the travel data of a target frame number, the target frame number being greater than or equal to the number of image rows of the first image region; and align the travel data of the target frame number with the image rows of the first image region so that the image rows and the travel data correspond to each other one by one.

[0089] The photographing apparatus 10 further includes an opening module 16 and a third mapping module 17. The opening module 16 is configured to open the optical image stabilization function of the second camera; and the third mapping module 17 is configured to map the second visible light image according to the anti-shake data when the second camera performs optical image stabilization, to obtain a fourth visible light image.

[0090] The generation module 13 is specifically further configured to generate the depth image according to the third visible light image and the fourth visible light image.

[0091] The photographing apparatus 10 further includes a centering module 18. The centering module 18 is configured to, after the optical image stabilization function of the first camera is opened, control the motor of the first camera to perform centering operation between adjacent two frames of the first visible light images, so that the lens and / or image sensor of the first camera moves to the center position of the corresponding motion travel.

[0092] Please refer to Figure 2 , the electronic device 100 of the embodiment of the present application includes a first camera 20, a second camera 30 and a processor 40. The processor 40 is configured to open the optical image stabilization function of the first camera 20, and obtain the first visible light image collected by the first camera 20 and the second visible light image collected by the second camera 30; map the first visible light image according to the anti-shake data when the first camera 20 performs optical image stabilization, to obtain a third visible light image; generate a depth image according to the second visible light image and the third visible light image; and perform blurring processing on the first visible light image according to the depth image, to generate a blurred image.

[0093] The electronic device 100 can be a mobile phone, a tablet computer, a display device, a notebook computer, a teller machine, a gate machine, a smart watch, a head-mounted device, a game machine, etc. As shown in Figure 3 , the embodiment of the present application takes the mobile phone as an example for illustration, and it can be understood that the specific form of the electronic device 100 is not limited to the mobile phone.

[0094] Optionally, the processor 40 in cooperation with the first camera 20 and the second camera 30 can be configured to execute the photographing method of any one of the above-mentioned embodiments, and for the sake of brevity, the details are not described herein.

[0095] Please refer to Figure 13The embodiment of the present application further provides a computer readable storage medium 300, which stores a computer program 310. When the computer program 310 is executed by the processor 40, the steps of the photographing method of any one of the above embodiments are realized. For brevity, details are not repeated herein.

[0096] In the description of the present specification, the description referring to the terms "certain embodiments", "in one example", "exemplarily" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.

[0097] Any process or method descriptions in flow charts or described herein in other ways can be understood as representing code modules, segments, or portions of code that include one or more executable instructions for performing specific logic functions or steps in the process. The flow diagrams and the descriptions of the various processes presented herein are not limited to the order of the steps, including the specific order of steps, as some steps can be performed in other orders or omitted, including performing according to the functions involved, in a substantially simultaneous manner, or in reverse order, which should be understood by those skilled in the art of the embodiments of the present application.

[0098] Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A photographing method characterized by comprising: The method is applied to an electronic device comprising a first camera and a second camera, the focal length of the first camera being greater than the focal length of the second camera, and the method comprises: starting an optical image stabilization function of the first camera, and obtaining a first visible light image captured by the first camera and a second visible light image captured by the second camera; mapping the first visible light image according to anti-shake data when the first camera performs optical image stabilization to obtain a third visible light image, the anti-shake data comprising continuous multi-frame travel data of a motor; generating a depth image according to the second visible light image and the third visible light image; and performing a blurring process on the first visible light image according to the depth image to generate a blurred image. The method further comprises: mapping the depth image according to the anti-shake data to obtain a target depth image. The mapping the first visible light image according to the anti-shake data when the first camera performs optical image stabilization to obtain a third visible light image comprises: obtaining an initial image captured by the first camera, and determining a first image region of the first visible light image in the initial image; interpolating the travel data within an exposure time length of the first image region to obtain the travel data of a target frame number, the target frame number being greater than or equal to the number of image rows of the first image region; aligning the travel data of the target frame number and the image rows of the first image region according to a first time of obtaining each frame of the travel data and a second time of exposure of each image row of the first image region, so that the image rows and the travel data correspond to each other one by one; calculating a pixel offset of the image row aligned with each frame of the travel data according to the travel data and a preset mapping function; 2. The photographing method according to claim 1, wherein determining a second image region according to the pixel offset of each image row of the first image region; obtaining image data of the second image region in the initial image to obtain the third visible light image. The method further comprises: mapping the depth image according to the anti-shake data to obtain a target depth image.

3. The photographing method according to claim 2, wherein The performing a blurring process on the first visible light image according to the depth image to generate a blurred image comprises: performing a blurring process on the first visible light image according to the target depth image to generate the blurred image. The performing a blurring process on the first visible light image according to the target depth image to generate the blurred image comprises:

4. The photographing method according to claim 1, wherein registering the target depth image and the first visible light image to determine a depth value of each pixel in the first visible light image; performing a blurring process according to the depth value of each pixel and a depth range of a target object to be captured to generate the blurred image. The interpolating the travel data within an exposure time length of the first image region to obtain the travel data of a target frame number comprises: performing linear interpolation according to a first time of continuous two-frame travel data and a second time of an image row in the first image region whose exposure time is between the first times of the continuous two-frame travel data to obtain the travel data of a target frame number.

5. The photographing method according to claim 1, wherein The first camera is provided with a Hall sensor for collecting continuous multi-frame travel data.

6. The photographing method according to claim 1, wherein Further comprising: starting the optical image stabilization function of the second camera; mapping the second visible light image according to the anti-shake data when the optical image stabilization of the second camera is performed to obtain a fourth visible light image; The generating of the depth image according to the second visible light image and the third visible light image comprises: generating the depth image according to the third visible light image and the fourth visible light image.

7. The photographing method according to claim 1, wherein Further comprising: controlling the motor of the first camera to perform centering operation between adjacent two frames of the first visible light image after the optical image stabilization function of the first camera is started, so that the lens and / or image sensor of the first camera moves to the center position of the corresponding motion travel.

8. An imaging device, characterized by comprising: Comprising: an acquisition module, configured to start the optical image stabilization function of a first camera, and acquire a first visible light image collected by the first camera and a second visible light image collected by a second camera; a first mapping module, configured to map the first visible light image according to anti-shake data when the optical image stabilization of the first camera is performed to obtain a third visible light image, wherein the anti-shake data comprises continuous multi-frame travel data of a motor; a generation module, configured to generate a depth image according to the second visible light image and the third visible light image; a blurring module, configured to perform blurring processing on the first visible light image according to the depth image to generate a blurred image; The mapping of the first visible light image according to the anti-shake data when the optical image stabilization of the first camera is performed to obtain a third visible light image comprises: acquiring an initial image photographed by the first camera, and determining a first image region of the first visible light image in the initial image; interpolating the travel data within the exposure time length of the first image region to obtain the travel data of a target frame number, wherein the target frame number is greater than or equal to the number of image rows of the first image region; aligning the travel data of the target frame number and the image rows of the first image region according to a first time of acquiring each frame of the travel data and a second time of exposure of each image row of the first image region, so that the image rows and the travel data correspond to each other one by one; calculating pixel offsets of the image rows aligned with each frame of the travel data according to the travel data and a preset mapping function; determining a second image region according to the pixel offsets of each of the image rows of the first image region; acquiring image data of the second image region in the initial image to obtain the third visible light image.

9. An electronic device, comprising: The method comprises the following steps: a first camera, a second camera and a processor are provided, the processor is used to start an optical image stabilization function of the first camera, and a first visible light image collected by the first camera and a second visible light image collected by the second camera are acquired; the first visible light image is mapped according to anti-shake data when the first camera performs optical image stabilization, so as to acquire a third visible light image; a depth image is generated according to the second visible light image and the third visible light image; and the first visible light image is blurred according to the depth image, so as to generate a blurred image, wherein the anti-shake data comprises continuous multi-frame movement data of a motor. The method comprises the following steps: a first camera, a second camera and a processor are provided, the processor is used to start an optical image stabilization function of the first camera, and a first visible light image collected by the first camera and a second visible light image collected by the second camera are acquired; the first visible light image is mapped according to anti-shake data when the first camera performs optical image stabilization, so as to acquire a third visible light image; a depth image is generated according to the second visible light image and the third visible light image; and the first visible light image is blurred according to the depth image, so as to generate a blurred image, wherein the anti-shake data comprises continuous multi-frame movement data of a motor. The method comprises the following steps: an initial image photographed by the first camera is acquired, and a first image area of the first visible light image in the initial image is determined; The movement data within an exposure time length of the first image area is interpolated to obtain the movement data of a target frame number, wherein the target frame number is greater than or equal to the number of image rows of the first image area; The movement data of the target frame number and the image rows of the first image area are aligned according to a first time of acquiring each frame of the movement data and a second time of exposure of each image row of the first image area, so that the image rows and the movement data correspond to each other one by one; According to the movement data and a preset mapping function, pixel offsets of the image rows aligned with each frame of the movement data are calculated; According to the pixel offsets of each image row of the first image area, a second image area is determined; Image data of the second image area in the initial image is acquired to obtain the third visible light image.

10. A non-transitory computer readable storage medium embodying a computer program, characterized in that, The computer program is executed by the processor, so that the processor executes the photographing method in any one of claims 1-7.

Citation Information

Patent Citations

  • Image processing method, image processing device and mobile terminal

    CN108769545A

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN109600548A

  • Image processing method and device, electronic equipment and readable storage medium

    CN113888435A