Image capturing method and electronic device
By acquiring and processing the image frames captured by the first lens and the second lens at different times in the electronic device, the lens return time is extended, which solves the problem of the lens not being able to completely return to the center and affecting the image quality, and achieves a more stable image shooting effect.
Patent Information
- Application Number
- CN202210724146.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-06-23
AI Technical Summary
The lens cannot be fully centered within a limited time, affecting the anti-shake angle for the next exposure, resulting in a decrease in image quality.
By receiving user input on the display shooting preview interface, the first image frame captured by the first lens in the first period and the second image frame captured by the second lens in the second period are obtained, and the target image is generated based on the two frames of images, extending The time it takes for the lens to return from the anti-shake compensation position to the original position, ensuring that the lens completely returns to the original position.
This effectively avoids the problem of reducing the anti-shake angle for the next exposure, improving image quality and display effects.
Smart Images

Figure CN115278053B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of imaging technology, and specifically relates to an image capturing method and electronic equipment. Background Art
[0002] With the development and popularization of electronic devices, more and more users like to use the shooting function of electronic devices to record their lives.
[0003] In the related art, electronic devices are equipped with optical image stabilization lenses, which can provide motion compensation by moving the lens when the electronic device moves, and re-center the lens at frame intervals, thereby avoiding image smear caused by user hand shaking.
[0004] However, since the lens's return-to-center time is affected by factors such as frame rate, exposure time, and rolling shutter time, the lens may not be able to fully return to the center within a limited time, thereby affecting the anti-shake angle of the next exposure. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide an image capturing method and an electronic device, which can solve the problem that the lens cannot be completely centered within a limited time, thus affecting the anti-shake angle of the next exposure.
[0006] In a first aspect, an embodiment of the present application provides an image capturing method, the method comprising: receiving a first input from a user while displaying a capture preview interface; in response to the first input, acquiring a first image frame captured by a first lens in a first time period and a second image frame captured by a second lens in a second time period; generating a target image based on the first image frame and the second image frame; wherein the first time period includes a time period in which the second lens moves from a second anti-shake compensation position to a second original position, the second time period includes a time period in which the first lens moves from a first anti-shake compensation position to a first original position, and the first time period and the second time period are adjacent exposure time periods.
[0007] In a second aspect, an embodiment of the present application provides an image capturing device, comprising: a receiving module, an acquisition module and a processing module; the receiving module is used to receive a first input from a user while displaying a shooting preview interface; the acquisition module is used to acquire, in response to the first input, a first image frame captured by a first lens in a first time period and a second image frame captured by a second lens in a second time period; the processing module is used to generate a target image based on the first image frame and the second image frame; wherein the first time period includes a time period when the second lens moves from a second anti-shake compensation position to a second original position, the second time period includes a time period when the first lens moves from a first anti-shake compensation position to a first original position, and the first time period and the second time period are adjacent exposure time periods.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0012] In an embodiment of the present application, when a shooting preview interface is displayed, a first input from a user is received; in response to the first input, a first image frame shot by a first lens in a first period and a second image frame shot by a second lens in a second period are obtained; a target image is generated according to the first image frame and the second image frame; wherein the first period includes a period when the second lens moves from a second anti-shake compensation position to a second original position, and the second period includes a period when the first lens moves from a first anti-shake compensation position to a first original position, and the first period and the second period are adjacent exposure periods. Through this scheme, since the target image is generated based on the first image frame shot by the first lens in the first period and the second image frame shot by the second lens in the second period, and the first period includes a period when the second lens moves from a second anti-shake compensation position to a second original position, and the second period includes a period when the first lens moves from a first anti-shake compensation position to a first original position, one of the two lenses can be returned during the exposure period of the other lens, thereby extending the time for the lens to return from the anti-shake compensation position to the original position, ensuring that the lens can completely return to the original position, thereby avoiding the problem that the anti-shake angle of the next exposure will be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flowchart of an image capturing method provided in an embodiment of the present application;
[0014] Figure 2 It is a structural schematic diagram of an electronic device acquiring an image frame provided by an embodiment of the present application;
[0015] Figure 3 is a schematic diagram of an electronic device provided by an embodiment of the present application acquiring image frames at different time periods and controlling the lens to re-center;
[0016] Figure 4 is a schematic diagram of processing a first image frame and a second image frame by an electronic device provided in an embodiment of the present application;
[0017] Figure 5 is a structural schematic diagram of an image capturing device provided in an embodiment of the present application;
[0018] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0019] Figure 7 It is a hardware schematic diagram of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0020] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0022] The image capturing method provided by the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0023] The image capturing method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the image capturing method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, wearable devices, etc. The image capturing method provided in the embodiment of the present application is described below using the electronic device as an example of the execution subject.
[0024] like Figure 1As shown, the embodiment of the present application provides an image capturing method, which may include steps 101 to 103:
[0025] Step 101: When displaying a shooting preview interface, the electronic device receives a first input from a user.
[0026] When a user wants to shoot a video, the electronic device can be triggered to display a shooting preview interface, which includes a shooting object. After that, the user can make a first input to the electronic device, and accordingly, the electronic device can receive the user's first input.
[0027] Optionally, the first input may be a touch input, a voice input, a gesture input, etc. For example, the touch input may be a click input or a long press input of a target control displayed by the electronic device by the user, and the target control may be used to trigger the electronic device to enter a shooting state.
[0028] Step 102: In response to the first input, the electronic device obtains a first image frame captured by a first lens in a first time period and a second image frame captured by a second lens in a second time period.
[0029] The first time period includes the time period when the second lens moves from the second anti-shake compensation position to the second original position, and the second time period includes the time period when the first lens moves from the first anti-shake compensation position to the first original position. The first time period and the second time period are adjacent exposure time periods.
[0030] Specifically, Figure 2 As shown, the first image sensor 212 can collect image frames captured by the first lens 211, and transmit the collected image frames to the central processor 230 of the electronic device after processing through the first image signal processing 213; the second image sensor 222 can collect image frames captured by the second lens 221, and transmit the collected image frames to the central processor 230 after processing through the second image signal processing 223. The central processor 230 can alternately obtain image frames from the image frames transmitted by the first image signal processing 213 and the second image signal processing 223, that is, if the image frames continuously transmitted by the first image signal processing 213 in the target time period include image frames 11, 12, 13, and 14 in sequence, and the image frames continuously transmitted by the second image signal processing 223 in the target time period include image frames 21, 22, 23, and 24 in sequence, then the central processor 230 can obtain image frames 11, 22, 13, and 24, or obtain image frames 21, 12, 23, and 14. That is, the electronic device can obtain a first image frame captured by the first lens 211 in a first period of time and a second image frame captured by the second lens 221 in a second period of time.
[0031] For example, Figure 3 As shown, the continuous image frames captured by the first lens may include: Frame N, Frame N+1 and Frame N+2, and the continuous image frames captured by the second lens may include: Frame M, Frame M+1 and Frame M+2, wherein the shooting period corresponding to Frame N and Frame M is period 1, the shooting period corresponding to Frame N+1 and Frame M+1 is period 2, and the shooting period corresponding to Frame N+2 and Frame M+2 is period 3. Take period 1 as the first period and period 2 as the second period as an example. The electronic device can obtain the image frame Frame N as the first image frame and obtain the image frame Frame M+1 as the second image frame.
[0032] Alternatively, if Figure 3 As shown, in time period 1, the first lens shoots Frame N image frame, and the second lens returns to the original position; after the second lens is completely returned to the original position, the second lens shoots Frame M+1 in time period 2, and controls the first lens to return to the original position; after the first lens is completely returned to the original position, the first lens shoots Frame N+2 in time period 3, and controls the second lens to return to the original position. The electronic device can obtain image frame Frame N as the first image frame, and obtain image frame Frame M+1 as the second image frame.
[0033] Optionally, the electronic device obtains a first image frame taken by a first lens in a first time period and a second image frame taken by a second lens in a second time period, which may specifically include: the electronic device may obtain the first image frame when the first lens moves from a first original position to a first anti-shake compensation position; and obtain the second image frame when the second lens moves from a second original position to a third anti-shake compensation position.
[0034] Optionally, both the first lens and the second lens are provided with an optical image stabilization (OIS) device. The OIS device can detect the real-time motion posture of the electronic device and actively move the lens in the horizontal or vertical direction to compensate for the movement or rotation of the electronic device around the X-axis and the movement and rotation around the Y-axis, thereby ensuring the stability of image capture.
[0035] It should be noted that the first original position refers to the position of the first lens when the electronic device remains relatively still, and the second original position refers to the position of the second lens when the electronic device remains relatively still.
[0036] For example, continue to refer to Figure 3, taking the first image frame as image frame Frame N and the second image frame as image frame Frame M+1 as an example, the electronic device can control the first lens to perform lens movement anti-shake in time period 1, that is, control the first lens to move from the first original position to the first anti-shake compensation position, and control the second lens to perform lens movement anti-shake in time period 2, that is, control the second lens to move from the second original position to the third anti-shake compensation position.
[0037] Based on the above scheme, since image frames can be acquired when the lens moves from the original position to the anti-shake compensation position, the captured image frames can be motion compensated, thereby avoiding the image ghosting problem caused by the movement of the electronic device, thereby improving the display effect of the target image.
[0038] Optionally, the electronic device can obtain a first parameter and a second parameter; and control the first lens to move from the first original position to the first anti-shake compensation position according to the first parameter during the first time period; and control the second lens to move from the second original position to a third anti-shake compensation position according to the second parameter during the second time period; wherein the first parameter is a device movement parameter of the electronic device during the first time period, and the second parameter is a device movement parameter of the electronic device during the second time period.
[0039] Optionally, the first parameter and the second parameter may include at least one of the following: a moving direction of the electronic device, and a moving speed of the electronic device.
[0040] Specifically, if an image frame is captured while the electronic device is in motion, the captured image frame may have a ghosting problem, thereby affecting the viewing experience of the video. To solve this problem, the electronic device can control the first lens to move from the first original position to the first anti-shake compensation position according to the device movement parameter of the electronic device in the first period, i.e., the first parameter, and control the second lens to move from the second original position to the third anti-shake compensation position according to the device movement parameter of the electronic device in the second period, i.e., the second parameter.
[0041] Based on the above scheme, since the movement of the lens during the shooting process can be controlled according to the device movement parameters of the electronic device at different time periods, it can be ensured that the degree of motion compensation of the image frame finally captured corresponds to the degree of movement of the electronic device, thereby solving the image ghosting problem to the greatest extent.
[0042] Optionally, the electronic device may control the second lens to move from the second anti-shake compensation position to the second original position during the first period; and control the first lens to move from the first anti-shake compensation position to the first original position during the second period.
[0043] For example, continue to refer to Figure 3, taking the first image frame as image frame Frame N and the second image frame as image frame Frame M+1 as an example. Since the electronic device can control the first lens to move from the first original position to the first anti-shake compensation position in time period 1, the electronic device can control the first lens to perform lens return in time period 2, that is, control the first lens to move from the first anti-shake compensation position to the first original position. Similarly, the electronic device can control the second lens to perform lens return in time period 1, that is, control the second lens to move from the second anti-shake compensation position to the second original position, control the second lens to move from the second original position to the third anti-shake compensation position in time period 2, and control the second lens to move from the third anti-shake compensation position to the second original position in time period 3.
[0044] It should be noted that the electronic device can control the second lens to move from the second anti-shake compensation position to the second original position not only in the first period, but also in the two exposure gap periods adjacent to the first period; similarly, the electronic device can control the first lens to move from the first anti-shake compensation position to the first original position not only in the second period, but also in the two exposure gap periods adjacent to the second period. In other words, the period during which the lens moves from the anti-shake compensation position to the original position can include not only one exposure period, but also at least one of the two adjacent exposure gap periods.
[0045] Optionally, the period during which the first lens or the second lens moves from the anti-shake compensation position to the original position may be the entire period of the lens homing period, or may be a partial period of the lens homing period, and the lens homing period includes one exposure period and two exposure interval periods adjacent thereto. For example, if the first lens has completed the process of moving from the anti-shake compensation position to the original position within one exposure period and one exposure interval period, the first lens may be in a relatively static state during another exposure interval period.
[0046] Based on the above scheme, since the first image frame taken by the first lens in the first time period and the second image frame taken by the second lens in the second time period can be obtained, and the second lens can be controlled to move from the second anti-shake compensation position to the second original position in the first time period; and the first lens can be controlled to move from the first anti-shake compensation position to the first original position in the second time period, therefore, the time for each lens to move from the anti-shake compensation position to the original position can be increased while ensuring the image shooting effect.
[0047] Step 103: The electronic device generates a target image according to the first image frame and the second image frame.
[0048] Optionally, the above-mentioned target image may include multiple image frames or one image frame. When the target image includes multiple image frames, the target image may be a video image. When the target image includes one image frame, the target image may be a high dynamic range imaging (HDR) image.
[0049] Optionally, in the case that the target image includes multiple image frames, the electronic device generates the target image based on the first image frame and the second image frame, which may specifically include: the electronic device crops the first image frame and the second image frame based on lens parameters of the first lens and the lens parameters of the second lens, respectively, to obtain a first image, and determines the first image as an image frame in the target image; wherein the lens parameters include: lens position coordinates and lens field of view angle, and the first image is an image of the overlapping area of the first image frame and the second image frame.
[0050] Specifically, since the positions of the first lens and the second lens in the electronic device are different, the field of view angles of the lenses are also different. Therefore, the images in the first image frame and the second image frame will not be completely consistent. In order to ensure the continuity between adjacent image frames in the target image, the electronic device can first obtain the lens parameters of the first lens and the lens parameters of the second lens, and then determine the image overlapping area in the first image frame and the second image frame according to the lens parameters, and finally determine the image in the image overlapping area as the image frame in the target image.
[0051] For example, Figure 4 As shown, the electronic device can determine the image overlapping area 41 in the first image frame and the second image frame based on the lens parameters of the first lens and the lens parameters of the second lens, and use the image in the image overlapping area 41 as the first image, and determine the first image as an image frame in the target image.
[0052] Based on the above scheme, since the first image frame and the second image frame can be cropped respectively based on the lens parameters of the first lens and the lens parameters of the second lens to obtain an image frame in the target image, it is possible to avoid the problem of image discontinuity between adjacent image frames in the target image caused by alternately acquiring image frames from the two lenses, thereby improving the display effect of the target image.
[0053] Optionally, in the case where the target image includes one image frame, the electronic device generates the target image according to the first image frame and the second image frame, which may specifically include: the electronic device generates the target image according to the first image frame and the second image frame based on lens parameters of the first lens and lens parameters of the second lens; wherein the lens parameters include exposure, and the target image is an HDR image.
[0054] Specifically, the first lens can shoot a first image frame based on a first exposure, and the second lens can shoot a second image frame based on a second exposure, and then the electronic device can combine the first image frame and the second image frame to obtain an HDR image with better light and shade processing effect. The first exposure is different from the second exposure.
[0055] Based on the above scheme, since an HDR image can be generated according to the first image frame and the second image frame based on the exposure of the first lens and the exposure of the second lens, the time for the lens to return from the anti-shake compensation position to the original position when shooting the HDR image can be extended, thereby improving the image quality.
[0056] In the embodiment of the present application, since the target image is generated based on the first image frame taken by the first lens in the first time period and the second image frame taken by the second lens in the second time period, and the first time period includes the time period when the second lens moves from the second anti-shake compensation position to the second original position, and the second time period includes the time period when the first lens moves from the first anti-shake compensation position to the first original position, therefore, one of the two lenses can be returned during the exposure period of the other lens, thereby extending the time for the lens to return from the anti-shake compensation position to the original position, ensuring that the lens can completely return to the original position, thereby avoiding the problem of a reduced anti-shake angle for the next exposure.
[0057] The image capturing method provided in the embodiment of the present application may be executed by an image capturing device. In the embodiment of the present application, an image capturing device executing the image capturing method is taken as an example to illustrate the image capturing device provided in the embodiment of the present application.
[0058] like Figure 5As shown, the embodiment of the present application also provides an image shooting device 500, including: a receiving module 501, an acquisition module 502 and a processing module 503; the receiving module 501 is used to receive a first input from a user when displaying a shooting preview interface; the acquisition module 502 is used to obtain, in response to the first input, a first image frame shot by a first lens in a first time period and a second image frame shot by a second lens in a second time period; the processing module 503 is used to generate a target image according to the first image frame and the second image frame; wherein, the first time period is a time period in which the second lens moves from a second anti-shake compensation position to a second original position, the second time period is a time period in which the first lens moves from a first anti-shake compensation position to a first original position, and the first time period and the second time period are adjacent exposure time periods.
[0059] Optionally, the acquisition module 502 is specifically used to acquire the first image frame when the first lens moves from a first original position to a first anti-shake compensation position; and acquire the second image frame when the second lens moves from a second original position to a third anti-shake compensation position.
[0060] Optionally, the acquisition module 502 is further used to acquire a first parameter and a second parameter; the processing module 503 is further used to control the first lens to move from the first original position to the first anti-shake compensation position according to the first parameter in the first time period; and control the second lens to move from the second original position to a third anti-shake compensation position according to the second parameter in the second time period; wherein the first parameter is a device movement parameter of the electronic device in the first time period, and the second parameter is a device movement parameter of the electronic device in the second time period.
[0061] Optionally, the processing module 503 is further configured to control the second lens to move from a second anti-shake compensation position to the second original position during the first period; and control the first lens to move from the first anti-shake compensation position to the first original position during the second period.
[0062] Optionally, the target image includes multiple image frames; the processing module 503 is specifically used to crop the first image frame and the second image frame respectively based on the lens parameters of the first lens and the lens parameters of the second lens to obtain a first image, and determine the first image as an image frame in the target image; wherein the lens parameters include: lens position coordinates and lens field of view angle, and the first image is an image of the overlapping area of the first image frame and the second image frame.
[0063] Optionally, the target image includes an image frame; the processing module 503 is specifically used to generate the target image according to the first image frame and the second image frame based on the lens parameters of the first lens and the lens parameters of the second lens; wherein the lens parameters include exposure, and the target image is a high dynamic range imaging HDR image.
[0064] In the embodiment of the present application, since the target image is generated based on the first image frame taken by the first lens in the first time period and the second image frame taken by the second lens in the second time period, and the first time period includes the time period when the second lens moves from the second anti-shake compensation position to the second original position, and the second time period includes the time period when the first lens moves from the first anti-shake compensation position to the first original position, therefore, one of the two lenses can be returned during the exposure period of the other lens, thereby extending the time for the lens to return from the anti-shake compensation position to the original position, ensuring that the lens can completely return to the original position, thereby avoiding the problem of a reduced anti-shake angle for the next exposure.
[0065] The image capture device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0066] The image capture device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0067] The image capture device provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0068] Alternatively, if Figure 6 As shown, an embodiment of the present application further provides an electronic device 600, including a processor 601 and a memory 602, wherein the memory 602 stores programs or instructions that can be executed on the processor 601, and when the program or instructions are executed by the processor 601, the various steps of the above-mentioned image capture method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0069] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0070] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0071] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.
[0072] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0073] Among them, the user input unit 1007 is used to receive the user's first input when displaying the shooting preview interface; the sensor 1005 is used to obtain a first image frame taken by the first lens in a first time period and a second image frame taken by the second lens in a second time period in response to the first input; the processor 1010 is used to generate a target image according to the first image frame and the second image frame; wherein the first time period is a time period in which the second lens moves from the second anti-shake compensation position to the second original position, the second time period is a time period in which the first lens moves from the first anti-shake compensation position to the first original position, and the first time period and the second time period are adjacent exposure time periods.
[0074] In the embodiment of the present application, since the target image is generated based on the first image frame taken by the first lens in the first time period and the second image frame taken by the second lens in the second time period, and the first time period includes the time period when the second lens moves from the second anti-shake compensation position to the second original position, and the second time period includes the time period when the first lens moves from the first anti-shake compensation position to the first original position, therefore, one of the two lenses can be returned during the exposure period of the other lens, thereby extending the time for the lens to return from the anti-shake compensation position to the original position, ensuring that the lens can completely return to the original position, thereby avoiding the problem of a reduced anti-shake angle for the next exposure.
[0075] Optionally, the sensor 1005 is specifically used to obtain the first image frame when the first lens moves from a first original position to a first anti-shake compensation position; and to obtain the second image frame when the second lens moves from a second original position to a third anti-shake compensation position.
[0076] In the embodiment of the present application, since image frames can be acquired when the lens is moved from an original position to an anti-shake compensation position, the captured image frames can be motion compensated, thereby avoiding image ghosting problems caused by the movement of the electronic device and further improving the display effect of the target image.
[0077] Optionally, the sensor 1005 is further used to obtain a first parameter and a second parameter; the processor 1010 is further used to control the first lens to move from the first original position to the first anti-shake compensation position according to the first parameter in the first time period; and control the second lens to move from the second original position to a third anti-shake compensation position according to the second parameter in the second time period; wherein the first parameter is a device movement parameter of the electronic device in the first time period, and the second parameter is a device movement parameter of the electronic device in the second time period.
[0078] In the embodiment of the present application, since the movement of the lens during the shooting process can be controlled according to the device movement parameters of the electronic device at different time periods, it can be ensured that the degree of motion compensation of the image frame finally captured corresponds to the degree of movement of the electronic device, thereby solving the image ghosting problem to the greatest extent.
[0079] Optionally, the processor 1010 is further configured to control the second lens to move from a second anti-shake compensation position to the second original position during the first period; and control the first lens to move from the first anti-shake compensation position to the first original position during the second period.
[0080] In the embodiment of the present application, since a first image frame shot by the first lens in a first time period and a second image frame shot by the second lens in a second time period can be obtained, and the second lens can be controlled to move from a second anti-shake compensation position to a second original position in the first time period; and the first lens can be controlled to move from a first anti-shake compensation position to a first original position in the second time period, it is possible to increase the time for each lens to move from the anti-shake compensation position to the original position while ensuring the image shooting effect.
[0081] Optionally, the target image includes multiple image frames; the processor 1010 is specifically used to crop the first image frame and the second image frame respectively based on the lens parameters of the first lens and the lens parameters of the second lens to obtain a first image, and determine the first image as an image frame in the target image; wherein the lens parameters include: lens position coordinates and lens field of view angle, and the first image is an image of the overlapping area of the first image frame and the second image frame.
[0082] In the embodiment of the present application, since the first image frame and the second image frame can be cropped respectively based on the lens parameters of the first lens and the lens parameters of the second lens to obtain an image frame in the target image, the problem of image discontinuity between adjacent image frames in the target image caused by alternately acquiring image frames from the two lenses can be avoided, thereby improving the display effect of the target image.
[0083] Optionally, the target image includes an image frame; the processor 1010 is specifically used to generate the target image according to the first image frame and the second image frame based on the lens parameters of the first lens and the lens parameters of the second lens; wherein the lens parameters include exposure, and the target image is a high dynamic range imaging HDR image.
[0084] In the embodiment of the present application, since an HDR image can be generated according to the first image frame and the second image frame based on the exposure of the first lens and the exposure of the second lens, the time for the lens to return from the anti-shake compensation position to the original position when shooting the HDR image can be extended, thereby improving the image quality.
[0085] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 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 will not be repeated here.
[0086] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0087] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.
[0088] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image capture method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0089] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0090] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image capture method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0091] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0092] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned image capture method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0093] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0094] 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 relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0095] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An image capturing method, characterized in that: include: When the shooting preview interface is displayed, receiving a first input from a user; Get the first parameter and the second parameter; Controlling the first lens to move from a first original position to a first anti-shake compensation position according to the first parameter during a first period of time; Controlling the second lens to move from a second original position to a second anti-shake compensation position according to the second parameter during a second period; In response to the first input, acquiring a first image frame captured by a first lens in a first time period and a second image frame captured by a second lens in a second time period; generating a target image according to the first image frame and the second image frame; Among them, the first parameter is a device movement parameter of the electronic device in the first time period, the second parameter is a device movement parameter of the electronic device in the second time period, the first time period includes a time period when the second lens moves from the second anti-shake compensation position to the second original position, the second time period includes a time period when the first lens moves from the first anti-shake compensation position to the first original position, and the first time period and the second time period are adjacent exposure time periods.
2. The image capturing method according to claim 1, characterized in that: The step of acquiring a first image frame captured by a first lens in a first period of time and a second image frame captured by a second lens in a second period of time comprises: When the first lens moves from the first original position to the first anti-shake compensation position, acquiring the first image frame; When the second lens moves from the second original position to the second anti-shake compensation position, the second image frame is acquired.
3. The image capturing method according to claim 1, characterized in that: After receiving the first input from the user, the method further includes: controlling the second lens to move from the second anti-shake compensation position to the second original position during the first period; During the second period, the first lens is controlled to move from the first anti-shake compensation position to the first original position.
4. The image capturing method according to any one of claims 1 to 3, characterized in that: The target image includes a plurality of image frames; and generating the target image according to the first image frame and the second image frame includes: Based on the lens parameters of the first lens and the lens parameters of the second lens, the first image frame and the second image frame are respectively cropped to obtain a first image; Determine the first image as an image frame in the target image; The lens parameters include: lens position coordinates and lens field of view angle, and the first image is an image of an overlapping area of the first image frame and the second image frame.
5. The image capturing method according to any one of claims 1 to 3, characterized in that: The target image includes an image frame; and generating the target image according to the first image frame and the second image frame includes: Based on the lens parameters of the first lens and the lens parameters of the second lens, generating the target image according to the first image frame and the second image frame; The lens parameters include exposure, and the target image is a high dynamic range imaging HDR image.
6. An image capturing device, characterized in that: include: Receiving module, acquiring module and processing module; The receiving module is used to receive a first input from a user when the shooting preview interface is displayed; The acquisition module is used to acquire a first parameter and a second parameter, and in response to the first input, acquire a first image frame taken by a first lens in a first period of time and a second image frame taken by a second lens in a second period of time; The processing module is used to control the first lens to move from a first original position to a first anti-shake compensation position according to the first parameter in a first time period, control the second lens to move from a second original position to a second anti-shake compensation position according to the second parameter in a second time period, and generate a target image according to the first image frame and the second image frame; Among them, the first parameter is a device movement parameter of the electronic device in the first time period, the second parameter is a device movement parameter of the electronic device in the second time period, the first time period includes a time period when the second lens moves from the second anti-shake compensation position to the second original position, the second time period includes a time period when the first lens moves from the first anti-shake compensation position to the first original position, and the first time period and the second time period are adjacent exposure time periods.
7. The image capture device according to claim 6, characterized in that: The acquisition module is specifically used to acquire the first image frame when the first lens moves from the first original position to the first anti-shake compensation position; and acquire the second image frame when the second lens moves from the second original position to the second anti-shake compensation position.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the image capturing method according to any one of claims 1 to 5 is implemented.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the image capturing method according to any one of claims 1 to 5 is implemented.
