Shooting method, electronic equipment, computer readable storage medium and program product
By offsetting and cropping the difference in field of view between the target camera and the non-target camera, the problem of image changes during camera switching is solved, achieving a smooth image transition and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-10-11
- Publication Date
- 2026-04-21
AI Technical Summary
There is a noticeable change in the image when the camera switches, causing a sudden change in the center of the field of view (FOV).
By offsetting and cropping the difference in field of view between the target camera and the non-target camera, and using a camera with a smaller FOV to assist a camera with a larger FOV in performing two offset cropping operations, the FOV center of the preview image gradually moves towards the FOV center of the non-target camera, achieving a smooth transition in the image.
The sudden change in the FOV center is avoided when switching cameras, ensuring a smooth transition of the displayed image and improving the user experience.
Smart Images

Figure CN121908135A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic device technology, and in particular to a shooting method, electronic device, computer-readable storage medium, and program product. Background Technology
[0002] With the development of electronic device technology, more and more electronic devices, such as mobile phones and tablets, are equipped with more and more cameras, enabling them to achieve wide-range zoom shooting. However, because zooming triggers camera switching, there is a noticeable image change at the moment of camera switching. Summary of the Invention
[0003] This application provides a shooting method, electronic device, computer-readable storage medium, and program product to avoid significant changes in the image due to a sudden change in the FOV center during camera switching, and to ensure a smooth transition of the image during switching.
[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0005] A first aspect provides a shooting method applied to an electronic device, the electronic device including at least two cameras; the method includes: displaying a shooting interface, the shooting interface including a first preview image, the first preview image corresponding to a first zoom level, the first zoom level corresponding to a first camera; receiving a zoom operation, the zoom operation triggering a change from the first zoom level to a second zoom level; displaying at least one intermediate preview image and a second preview image corresponding to the second zoom level; wherein, at least one intermediate zoom level is included between the first zoom level and the second zoom level; the at least one intermediate preview image is based on a corresponding intermediate zoom level, and the first camera and the second camera. The difference in the center point of the field of view of the camera is obtained by performing offset cropping preprocessing and target offset cropping on the first full field of view image captured by the target camera; in the first camera and the second camera, the camera with the larger field of view is the target camera, and the camera with the smaller field of view is the non-target camera; the offset amount of the target offset cropping is determined by image alignment of the first full field of view image and the second full field of view image captured by the non-target camera; the second camera is a camera whose focal length range is adjacent to that of the first camera; the center of the field of view of at least one intermediate preview image and the second preview image gradually approaches or coincides with the center of the field of view of the non-target camera.
[0006] Among them, the offset clipping preprocessing refers to the first offset clipping in the two offset clipping processes. The target offset clipping refers to the second offset clipping in the two offset clipping processes.
[0007] In this implementation, a second full FOV image captured by a non-target camera with a smaller FOV is used as an aid. The first full FOV image captured by the target camera with a larger FOV is subjected to two offset cropping operations to obtain a preview image for display. This causes the FOV center of the displayed preview image to gradually move towards the FOV center corresponding to the non-target camera, thereby avoiding abrupt changes in the FOV center and ensuring a smooth transition of the displayed image at the moment of camera switching.
[0008] In one possible implementation of the first aspect, the second zoom ratio corresponds to the second camera, and the second zoom ratio is the minimum zoom ratio corresponding to the second camera; the second preview image is obtained by centering and cropping the full field-of-view image captured by the second camera corresponding to the second zoom ratio; the center of the field of view of at least one intermediate preview image gradually approaches the center of the field of view of the non-target camera, and the center of the field of view of the second preview image coincides with the center of the field of view of the non-target camera.
[0009] In this implementation, when zooming involves camera switching and there is no room for offset at the second zoom level because it is the minimum zoom level corresponding to the second camera, the second preview image can be directly obtained by center-cropping. Simultaneously, since the camera has already switched to the second camera at the second zoom level, even center-cropping will not cause a sudden change in the FOV center, thus ensuring a smooth transition of the displayed image at the moment of camera switching.
[0010] In one possible implementation of the first aspect, the second zoom ratio corresponds to the second camera, and the second zoom ratio is not the minimum zoom ratio corresponding to the second camera; the intermediate preview image corresponding to the intermediate zoom ratio between the first zoom ratio and the minimum zoom ratio is obtained by performing offset cropping preprocessing and target offset cropping on the first full field-of-view image captured by the target camera based on the corresponding intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera; the intermediate preview image corresponding to the intermediate zoom ratio between the minimum zoom ratio and the second zoom ratio is obtained by center-cropping the full field-of-view image captured by the second camera based on the corresponding intermediate zoom ratio; the second preview image is obtained by center-cropping the full field-of-view image captured by the second camera based on the second zoom ratio.
[0011] In this implementation, if the electronic device includes only two cameras, since the camera with the smaller FOV will not have a camera with an even smaller FOV, there is no FOV center as a reference for offsetting. Therefore, the preview image corresponding to the camera with the smaller FOV can be directly cropped by centering. The preview image of the camera with the larger FOV is cropped twice based on the FOV center of the camera with the smaller FOV to ensure a smooth transition in the display when switching from the camera with the larger FOV to the camera with the smaller FOV.
[0012] In one possible implementation of the first aspect, the second zoom ratio corresponds to the second camera, the second zoom ratio is greater than the minimum zoom ratio corresponding to the second camera, and the second zoom ratio is greater than the first zoom ratio; the method further includes:
[0013] For a first intermediate zoom ratio greater than the first zoom ratio and less than the minimum zoom ratio, based on the first intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is preprocessed by offset cropping and target offset cropping to obtain the corresponding first intermediate preview image; the center of the field of view of the first intermediate preview image gradually approaches the center of the field of view of the non-target camera; for a second intermediate zoom ratio equal to the minimum zoom ratio, the full field of view image captured by the second camera is centered and cropped based on the second intermediate zoom ratio to obtain the corresponding second intermediate preview image; the center of the field of view of the second intermediate preview image coincides with the center of the field of view of the second camera.
[0014] In another possible implementation, for the third intermediate zoom ratio and the second zoom ratio, which are greater than the minimum zoom ratio, if the second camera is not the camera with the largest focal length range, the first full field-of-view image captured by the target camera is preprocessed by offset cropping based on the third intermediate zoom ratio, the second zoom ratio, and the difference in the center points of the field of view of the first camera and the second camera, respectively, to obtain the corresponding third intermediate preview image and the second preview image; the center of the field of view of the third intermediate preview image and the second preview image gradually approaches the center of the field of view of the non-target camera; if the second camera is the camera with the largest focal length range, the full field-of-view image captured by the second camera is centered and cropped based on the third intermediate zoom ratio and the second zoom ratio, respectively, to obtain the corresponding third intermediate preview image and the second preview image; the center of the field of view of the third intermediate preview image and the second preview image coincides with the center of the field of view of the second camera.
[0015] In this implementation, in order not to affect the display of the images captured by the camera, based on the actual relationship between the intermediate zoom ratio, the second zoom ratio and the minimum zoom ratio, and the camera corresponding to the maximum focal length range, the corresponding intermediate preview image and the second preview image can be centered or cropped twice by offset.
[0016] In one possible implementation of the first aspect, the second zoom ratio corresponds to the second camera, the second zoom ratio is greater than the minimum zoom ratio corresponding to the second camera, and the second zoom ratio is less than the first zoom ratio; the method further includes: for a first intermediate zoom ratio and a second zoom ratio that are less than the minimum zoom ratio and greater than the second zoom ratio, based on the first intermediate zoom ratio and the second zoom ratio, and the difference between the center points of the field of view of the first camera and the second camera, respectively, performing offset cropping preprocessing and target offset cropping on the first full field of view image captured by the target camera to obtain the corresponding first intermediate preview image and second preview image; the center of the field of view of the first intermediate preview image and the second preview image gradually approaches the center of the field of view of the non-target camera; for a second intermediate zoom ratio equal to the minimum zoom ratio, centering cropping is performed on the full field of view image captured by the second camera based on the second intermediate zoom ratio to obtain the corresponding second intermediate preview image; the center of the field of view of the second intermediate preview image coincides with the center of the field of view of the second camera.
[0017] In another possible implementation, for a third intermediate zoom ratio that is less than the first zoom ratio but greater than the minimum zoom ratio, if the first camera is the camera with the largest focal length range, the full field-of-view image captured by the second camera is centered and cropped based on the third intermediate zoom ratio to obtain the corresponding third intermediate preview image; the center of the field of view of the third intermediate preview image coincides with the center of the field of view of the second camera; if the first camera is not the camera with the largest focal length range, based on the third intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field-of-view image captured by the target camera is preprocessed by offset cropping and then offset cropped to obtain the corresponding third intermediate preview image; the center of the field of view of the third intermediate preview image gradually approaches the center of the field of view of the non-target camera.
[0018] In this implementation, similarly, in order not to affect the display of the images captured by the camera, based on the actual relationship between the intermediate zoom ratio, the second zoom ratio and the minimum zoom ratio, and the camera corresponding to the maximum focal length range, the corresponding intermediate preview image and the second preview image can be centered or cropped twice by offset.
[0019] In one possible implementation of the first aspect, the second zoom level corresponds to the first camera; the second preview image is obtained by performing offset cropping preprocessing and target offset cropping on the first full field-of-view image captured by the target camera based on the second zoom level and the difference between the center points of the field of view of the first camera and the second camera; the offset amount of the target offset cropping is determined by image alignment of the first full field-of-view image and the second full field-of-view image captured by the non-target camera; the center of the field of view of at least one intermediate preview image and the second preview image gradually approaches the center of the field of view of the target camera.
[0020] In this implementation, when the zoom process does not involve camera switching, in order to ensure a smooth transition of the displayed image during subsequent camera switching, the second preview image corresponding to the first camera is also obtained by two offset cropping operations.
[0021] In one possible implementation of the first aspect, in order to improve the accuracy of the offset, the offsets corresponding to the offset cropping preprocessing and the target offset cropping can both be determined by image alignment.
[0022] Based on this, the method may further include: downsampling the first full field-of-view image to obtain a first downsampled image, and downsampling the second full field-of-view image to obtain a second downsampled image; aligning the first downsampled image and the second downsampled image to determine a first offset; for each intermediate zoom level, cropping the first cropped image from the first full field-of-view image based on the first offset to obtain a first cropped image corresponding to the offset cropping preprocessing; wherein, the field-of-view size of the first cropped image is larger than the field-of-view size corresponding to the corresponding intermediate zoom level by a preset ratio; the offset corresponding to the first cropped image is smaller than the first offset; and the center of the field-of-view of the first cropped image cropped later is larger than that of the first cropped image cropped earlier. The field of view center of the first cropped image is closer to the field of view center of the non-target camera; the first cropped image and the second full field of view image are image aligned to determine a second offset; based on the second offset, a second cropped image corresponding to the target offset is obtained from the first cropped image, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field of view size of the second cropped image is equal to the field of view size corresponding to the intermediate zoom ratio; the offset corresponding to the second cropped image is less than the second offset; and the field of view center of the second cropped image cropped later is closer to the field of view center of the non-target camera than the field of view center of the second cropped image cropped earlier.
[0023] This is understandable, as preview images are typically displayed sequentially based on the zoom level adjustment direction. For example, when the zoom level decreases (i.e., the zoom level decreases), electronic devices usually need to display the preview images corresponding to each zoom level in descending order. Therefore, the cropping order of the preview images will also have a certain sequence. Thus, to achieve a smooth transition in the displayed image, the FOV center of the later-cropped image will be closer to the center of the target camera's field of view than the FOV center of the earlier-cropped image.
[0024] In one possible implementation of the first aspect, the offset amount corresponding to the offset cropping preprocessing can also be determined by the shooting object distance and camera calibration data. Based on this, the method further includes:
[0025] A first offset is determined based on the shooting distance and preset camera calibration data; wherein, the camera calibration data includes the difference between the center points of the field of view of the first camera and the second camera; for each intermediate zoom magnification, a first cropped image corresponding to the offset cropping preprocessing is obtained from the first full field of view image based on the first offset; wherein, the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom magnification by a preset ratio; the offset corresponding to the first cropped image is less than the first offset; and, the center of the field of view of the first cropped image cropped later is closer to the center of the field of view of the first cropped image cropped earlier. The field of view center of the non-target camera is located near the target camera; the first cropped image and the second full field of view image are image aligned to determine a second offset; based on the second offset, a second cropped image corresponding to the target offset is obtained from the first cropped image, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field of view size of the second cropped image is equal to the field of view size corresponding to the intermediate zoom ratio; the offset corresponding to the second cropped image is less than the second offset; and the field of view center of the second cropped image cropped later is closer to the field of view center of the non-target camera than the field of view center of the second cropped image cropped earlier.
[0026] In one possible implementation of the first aspect, to improve the accuracy of the offset, for the first offset cropping, i.e., the first offset corresponding to the offset cropping preprocessing, the method can be further determined by comparing the differences between two offsets determined in different ways. Based on this, the method further includes:
[0027] A first offset and a comparison offset are determined; wherein the first offset is obtained by image alignment of the downsampled first full field-of-view image and the second full field-of-view image; the comparison offset is determined based on the shooting object distance and preset camera calibration data; when the difference between the first offset and the comparison offset is less than or equal to a difference threshold, for each intermediate zoom ratio, a first cropped image corresponding to the offset cropping preprocessing is obtained from the first full field-of-view image based on the first offset; wherein the field-of-view size of the first cropped image is larger than the field-of-view size corresponding to the corresponding intermediate zoom ratio by a preset proportion; the offset corresponding to the first cropped image is less than the first offset; and, in the subsequent cropping of the first cropped image, the field-of-view size of the first cropped image is... The field of view center of the second cropped image is closer to the field of view center of the non-target camera than the field of view center of the first cropped image. The first cropped image and the second full field of view image are image aligned to determine a second offset. Based on the second offset, a second cropped image corresponding to the target offset cropping is obtained from the first cropped image, and a corresponding intermediate preview image is obtained based on the second cropped image. The field of view size of the second cropped image is equal to the field of view size corresponding to the intermediate zoom ratio. The offsets corresponding to the second cropped images are all less than the second offset. Furthermore, the field of view center of the second cropped image cropped later is closer to the field of view center of the non-target camera than the field of view center of the second cropped image cropped earlier.
[0028] In one possible implementation of the first aspect, when the offset difference is too large, an offset can be performed only once to avoid unpredictable unexpected effects. Based on this, the method may further include: when the difference between the first offset and the comparison offset is greater than a difference threshold, cropping first cropped images corresponding to each intermediate zoom ratio from the first full field of view image; wherein the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom ratio by a preset ratio; and the center of the field of view of the first cropped image coincides with the center of the field of view of the first full field of view image; performing image alignment on the first cropped image and the second full field of view image to determine a second offset; cropping a second cropped image corresponding to the target offset cropping from the first cropped image based on the second offset, and obtaining a corresponding intermediate preview image based on the second cropped image; wherein the field of view size of the second cropped image is equal to the field of view size corresponding to the corresponding intermediate zoom ratio; the offset corresponding to the second cropped image is less than the second offset; and the center of the field of view of the second cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image cropped earlier.
[0029] Secondly, this application provides an electronic device, comprising: at least two cameras, one or more processors and a memory, wherein the cameras and the memory are respectively coupled to the processors; the cameras are used to acquire images; the memory stores one or more computer program codes, the computer program codes including computer instructions; when the processor executes the computer instructions, the electronic device performs the following steps:
[0030] The shooting interface includes a first preview image, which corresponds to a first zoom level and a first camera. It receives a zoom operation, triggering a change from the first zoom level to a second zoom level. It displays at least one intermediate preview image and a second preview image corresponding to the second zoom level. At least one intermediate zoom level is included between the first and second zoom levels. The at least one intermediate preview image is obtained by performing offset cropping preprocessing and target offset cropping on a first full-field-of-view image captured by the target camera, based on the corresponding intermediate zoom level and the difference in the center points of the field of view of the first and second cameras. In the first and second cameras, the camera with the larger field of view is the target camera, and the camera with the smaller field of view is the non-target camera. The offset amount of the target offset cropping is determined by image alignment of the first full-field-of-view image and the second full-field-of-view image captured by the non-target camera. The second camera is a camera whose focal length range is adjacent to that of the first camera. The center of the field of view of the at least one intermediate preview image and the second preview image gradually approaches or coincides with the center of the field of view of the non-target camera.
[0031] In one possible implementation of the second aspect, the second zoom ratio corresponds to the second camera, and the second zoom ratio is the minimum zoom ratio corresponding to the second camera; when the above computer instructions are executed by the processor, the electronic device further performs the following steps: a second preview image is obtained by centering and cropping the full field-of-view image captured by the second camera corresponding to the second zoom ratio; the center of the field of view of at least one frame of the intermediate preview image gradually approaches the center of the field of view of the non-target camera, and the center of the field of view of the second preview image coincides with the center of the field of view of the non-target camera.
[0032] In one possible implementation of the second aspect, the second zoom ratio corresponds to the second camera, and the second zoom ratio is not the minimum zoom ratio corresponding to the second camera; when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: for an intermediate preview image corresponding to an intermediate zoom ratio between the first zoom ratio and the minimum zoom ratio, based on the corresponding intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is preprocessed by offset cropping and target offset cropping; for an intermediate preview image corresponding to an intermediate zoom ratio between the minimum zoom ratio and the second zoom ratio, the full field of view image captured by the second camera is centered and cropped based on the corresponding intermediate zoom ratio; the second preview image is centered and cropped based on the second zoom ratio of the full field of view image captured by the second camera.
[0033] In one possible implementation of the second aspect, the second zoom ratio corresponds to the second camera, the second zoom ratio is greater than the minimum zoom ratio corresponding to the second camera, and the second zoom ratio is greater than the first zoom ratio; when the above computer instructions are executed by the processor, the electronic device further performs the following steps: for a first intermediate zoom ratio greater than the first zoom ratio and less than the minimum zoom ratio, based on the first intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain a corresponding first intermediate preview image; the center of the field of view of the first intermediate preview image gradually approaches the center of the field of view of the non-target camera; for a second intermediate zoom ratio equal to the minimum zoom ratio, the full field of view image captured by the second camera is centered and cropped based on the second intermediate zoom ratio to obtain a corresponding second intermediate preview image; the center of the field of view of the second intermediate preview image coincides with the center of the field of view of the second camera.
[0034] In one possible implementation of the second aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: for a third intermediate zoom ratio and a second zoom ratio greater than the minimum zoom ratio, if the second camera is not the camera with the largest focal length range, based on the third intermediate zoom ratio and the second zoom ratio, and the difference in the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain the corresponding third intermediate preview image and second preview image; the center of the field of view of the third intermediate preview image and the second preview image gradually approaches the center of the field of view of the non-target camera; if the second camera is the camera with the largest focal length range, based on the third intermediate zoom ratio and the second zoom ratio, the full field of view image captured by the second camera is centered and cropped to obtain the corresponding third intermediate preview image and second preview image; the center of the field of view of the third intermediate preview image and the second preview image coincides with the center of the field of view of the second camera.
[0035] In one possible implementation of the second aspect, the second zoom ratio corresponds to the second camera, the second zoom ratio is greater than the minimum zoom ratio corresponding to the second camera, and the second zoom ratio is less than the first zoom ratio; when the above computer instructions are executed by the processor, the electronic device further performs the following steps: for a first intermediate zoom ratio and a second zoom ratio that are less than the minimum zoom ratio and greater than the second zoom ratio, based on the first intermediate zoom ratio and the second zoom ratio, and the difference between the center points of the field of view of the first camera and the second camera, respectively, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain the corresponding first intermediate preview image and second preview image; the center of the field of view of the first intermediate preview image and the second preview image gradually approaches the center of the field of view of the non-target camera; for a second intermediate zoom ratio equal to the minimum zoom ratio, the full field of view image captured by the second camera is centered and cropped based on the second intermediate zoom ratio to obtain the corresponding second intermediate preview image; the center of the field of view of the second intermediate preview image coincides with the center of the field of view of the second camera.
[0036] In one possible implementation of the second aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: for a third intermediate zoom ratio that is less than the first zoom ratio but greater than the minimum zoom ratio, if the first camera is the camera with the largest focal length range, based on the third intermediate zoom ratio, the full field-of-view image captured by the second camera is centered and cropped to obtain a corresponding third intermediate preview image; the center of the field of view of the third intermediate preview image coincides with the center of the field of view of the second camera; if the first camera is not the camera with the largest focal length range, based on the third intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field-of-view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain a corresponding third intermediate preview image; the center of the field of view of the third intermediate preview image gradually approaches the center of the field of view of the non-target camera.
[0037] In one possible implementation of the second aspect, the second zoom ratio corresponds to the first camera; when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: based on the second zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain a second preview image; the offset amount of the target offset cropping is determined by image alignment of the first full field of view image and the second full field of view image captured by the non-target camera; the center of the field of view of at least one intermediate preview image and the second preview image gradually approaches the center of the field of view of the target camera.
[0038] In one possible implementation of the second aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: downsampling the first full-field-of-view image to obtain a first downsampled image, and downsampling the second full-field-of-view image to obtain a second downsampled image; aligning the first downsampled image and the second downsampled image to determine a first offset; for each intermediate zoom level, cropping the first cropped image from the first full-field-of-view image based on the first offset to obtain a first cropped image corresponding to the offset cropping preprocessing; wherein the field-of-view size of the first cropped image is larger than the field-of-view size corresponding to the corresponding intermediate zoom level by a preset ratio; the offset corresponding to the first cropped image is less than the first offset; and, in the subsequent cropping... The field-of-view center of the first cropped image is closer to the field-of-view center of the non-target camera than the field-of-view center of the first cropped image cropped earlier; image alignment is performed on the first cropped image and the second full-field-of-view image to determine a second offset; based on the second offset, a second cropped image corresponding to the target offset is obtained from the first cropped image, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field-of-view size of the second cropped image is equal to the field-of-view size corresponding to the intermediate zoom ratio; the offset corresponding to the second cropped image is less than the second offset; and the field-of-view center of the second cropped image cropped later is closer to the field-of-view center of the non-target camera than the field-of-view center of the second cropped image cropped earlier.
[0039] In one possible implementation of the second aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: determining a first offset based on the shooting distance and preset camera calibration data; wherein the camera calibration data includes the difference between the center points of the field of view of the first camera and the second camera; for each intermediate zoom magnification, cropping a first cropped image corresponding to the offset cropping preprocessing from the first full field of view image based on the first offset; wherein the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom magnification by a preset proportion; the offset corresponding to the first cropped image is less than the first offset; and, in the field of view of the subsequently cropped first cropped image... The center of the field of view of the first cropped image is closer to the center of the field of view of the non-target camera than the center of the field of view of the first cropped image. The first cropped image and the second full field of view image are image aligned to determine the second offset. Based on the second offset, the second cropped image corresponding to the target offset is obtained from the first cropped image, and the corresponding intermediate preview image is obtained based on the second cropped image. The field of view of the second cropped image is equal to the field of view of the corresponding intermediate zoom ratio. The offset of the second cropped image is less than the second offset. Furthermore, the center of the field of view of the second cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image cropped earlier.
[0040] In one possible implementation of the second aspect, when the aforementioned computer instructions are executed by the processor, the electronic device further performs the following steps: determining a first offset and a contrast offset; the first offset is obtained by image alignment of the downsampled first full-field-of-view image and the second full-field-of-view image; the contrast offset is determined based on the shooting distance and preset camera calibration data; when the difference between the first offset and the contrast offset is less than or equal to a difference threshold, for each intermediate zoom level, a first cropped image corresponding to the offset cropping preprocessing is obtained from the first full-field-of-view image based on the first offset; wherein the field-of-view size of the first cropped image is larger than the field-of-view size corresponding to the corresponding intermediate zoom level by a preset ratio; the offset corresponding to the first cropped image is less than... A first offset; and, the center of the field of view of the first cropped image after cropping is closer to the center of the field of view of the non-target camera than the center of the field of view of the first cropped image before cropping; image alignment is performed on the first cropped image and the second full field of view image to determine a second offset; based on the second offset, a second cropped image corresponding to the target offset cropping is obtained from the first cropped image, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field of view size of the second cropped image is equal to the field of view size corresponding to the intermediate zoom ratio; the offsets corresponding to the second cropped images are all less than the second offset; and, the center of the field of view of the second cropped image after cropping is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image before cropping.
[0041] In one possible implementation of the second aspect, when the aforementioned computer instructions are executed by the processor, the electronic device also performs the following steps: when the offset difference is too large, in order to avoid unpredictable accidental effects, the offset can be performed only once. Based on this, the method may further include: when the difference between the first offset and the comparison offset is greater than a difference threshold, cropping first cropped images corresponding to each intermediate zoom ratio from the first full field of view image; wherein the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom ratio by a preset ratio; and the center of the field of view of the first cropped image coincides with the center of the field of view of the first full field of view image; performing image alignment on the first cropped image and the second full field of view image to determine a second offset; cropping a second cropped image corresponding to the target offset cropping from the first cropped image based on the second offset, and obtaining a corresponding intermediate preview image based on the second cropped image; wherein the field of view size of the second cropped image is equal to the field of view size corresponding to the corresponding intermediate zoom ratio; the offset corresponding to the second cropped image is less than the second offset; and the center of the field of view of the second cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image cropped earlier.
[0042] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor in an electronic device, causes the electronic device to perform a shooting method as described in the first aspect and any possible implementation thereof.
[0043] Fourthly, this application provides a computer program product that, when run on a computer, causes the computer to perform the method described in the first aspect and any possible implementation thereof. The computer may be the aforementioned electronic device.
[0044] Fifthly, embodiments of this application provide a chip, the chip including a processor, the processor being configured to invoke a computer program in memory to perform the method as described in any one of the first aspects.
[0045] Understandably, the beneficial effects achieved by the electronic device of any possible implementation of the second aspect, the computer-readable storage medium of the third aspect, the computer program product of the fourth aspect, and the chip of the fifth aspect can be referred to as the beneficial effects of the first aspect and any possible implementation thereof, which will not be repeated here. Attached Figure Description
[0046] Figure 1 This application provides a schematic diagram of a multi-camera product.
[0047] Figure 2 A schematic diagram of a zoom interface provided for an embodiment of this application;
[0048] Figure 3 A schematic diagram of another zoom interface provided in an embodiment of this application;
[0049] Figure 4 A schematic diagram of the center point of a camera corresponding to the field of view (FOV) provided in an embodiment of this application;
[0050] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0051] Figure 6 A software structure block diagram of an electronic device provided in an embodiment of this application;
[0052] Figure 7 A flowchart illustrating a shooting method provided in this application embodiment. Figure 1 ;
[0053] Figure 8 A flowchart illustrating a shooting method provided in this application embodiment. Figure 2 ;
[0054] Figure 9A flowchart illustrating a shooting method provided in this application embodiment. Figure 3 ;
[0055] Figure 10 This is a schematic diagram of a cutting area provided in an embodiment of this application;
[0056] Figure 11 A schematic diagram of a first offset cut provided for an embodiment of this application;
[0057] Figure 12 A schematic diagram of a second offset cutting provided in an embodiment of this application;
[0058] Figure 13 This is a schematic diagram illustrating a smooth transition of the image in a scene with increased zoom magnification, provided as an embodiment of this application.
[0059] Figure 14 This is a schematic diagram illustrating a smooth transition of the image in a scene with reduced zoom magnification, provided as an embodiment of this application.
[0060] Figure 15 This is a structural block diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the application. Furthermore, to facilitate a clear description of the technical solutions of the embodiments of this application, the terms "first," "second," etc., are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., are not necessarily different. Also, in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0062] With the development of electronic device technology, more and more electronic devices, such as mobile phones and tablets, can be equipped with multiple cameras (lenses), enabling electronic devices to achieve wide-range zoom shooting.
[0063] For example, let's take mobile phone A as an example. Figure 1 A schematic diagram of a product with multiple cameras is shown.
[0064] like Figure 1 As shown, phone A has a total of three cameras: camera 1, camera 2, and camera 3. This is understandable. Figure 1The camera of mobile phone A shown is only one example in the embodiments of this application, and it does not constitute any limitation on the number and position (arrangement of cameras) of cameras in electronic devices.
[0065] In some embodiments, electronic devices (such as Figure 1 The multiple cameras configured on the mobile phone A shown may include an ultra-wide (UW) camera, a wide-angle camera (also known as the main camera), a telephoto camera, etc.
[0066] It should be noted that the specific types of multiple cameras in an electronic device can be configured based on actual device requirements, and this application embodiment does not impose any limitations on this. For example, Figure 1 The camera 1 of the mobile phone A shown can be the main camera, the camera 2 can be the ultra-wide-angle camera (UW), and the camera 3 can be the telephoto camera.
[0067] Different cameras correspond to different focal length ranges, and multiple zoom levels are typically configured within each focal length range. By adjusting the zoom level (Zoom value), the field of view (FOV) of the shooting interface can be adjusted. Images corresponding to different zoom levels need to be captured and displayed by the camera corresponding to that zoom level. Therefore, when adjusting two zoom levels to correspond to different cameras, the electronic device will switch cameras, turning the camera corresponding to the adjusted zoom level into the main camera (the camera that captures and displays the image).
[0068] For example, a user can apply a zoom operation to an electronic device. Upon receiving this zoom operation, if it triggers an adjustment from a first zoom value to a second zoom value, the electronic device will display a preview image corresponding to the second zoom value. Simultaneously, if the first and second zoom values correspond to different cameras, the electronic device will switch cameras, using the camera corresponding to the second zoom value to capture the image and display it. In other words, the displayed preview image corresponding to the second zoom value is captured by the camera corresponding to that second zoom value.
[0069] For example, if 0.5x corresponds to an ultra-wide-angle camera, 1x corresponds to a wide-angle camera, and 3x corresponds to a telephoto camera, then zoom values greater than or equal to 0.5x and less than 1x all correspond to ultra-wide-angle cameras, zoom values greater than or equal to 1x and less than 3x all correspond to wide-angle cameras, and zoom values greater than or equal to 3x all correspond to telephoto cameras.
[0070] In other words, when the zoom level is 1x, the wide-angle camera is the primary camera, so the image captured by the wide-angle camera is displayed. When the zoom level is switched from 1x to 0.5x, the electronic device switches from the wide-angle camera to the ultra-wide-angle camera, at which point the ultra-wide-angle camera becomes the primary camera, and therefore the image captured by the ultra-wide-angle camera is displayed. When the zoom level is switched from 1x to 3x, the electronic device switches from the wide-angle camera to the telephoto camera, at which point the telephoto camera becomes the primary camera, and therefore the image captured by the telephoto camera is displayed.
[0071] For example, Figure 2 and Figure 3 A schematic diagram of a zoom operation interface is shown.
[0072] refer to Figure 2 In section (1), the shooting interface 200 includes a preview area 210 and a zoom control 220. The preview area 210 is used to display a preview image, which is an image captured in real time by the electronic device through the camera. The electronic device can refresh the display screen in the preview area 210 in real time so that the user can preview the image currently captured by the camera in real time.
[0073] The zoom control 220 is used to adjust the field of view (FOV) of the displayed image within the preview area 210 in response to zoom operations performed by the user on the electronic device. The value displayed in the zoom control 220 represents the zoom ratio currently used by the electronic device for shooting. Figure 2 As shown in Figure (1), the 0.5x displayed in the zoom control 220 indicates that the zoom ratio currently used by the electronic device for shooting is 0.5x. At this time, the preview image corresponds to the 0.5x zoom image captured by the ultra-wide-angle camera UW. Figure 2 As shown in (2), the 1x displayed in the zoom control 220 indicates that the zoom ratio used by the electronic device for shooting is 1x. At this time, the preview image corresponds to the 1x zoom image captured by the wide-angle camera.
[0074] Users can apply zoom operations by clicking or sliding the zoom control 220. (Reference) Figure 2 In (1) and (2), the user's finger can control the zoom control 220 to slide from 0.5x to 1x. Since 0.5x corresponds to an ultra-wide-angle camera and 1x is a wide-angle camera, the electronic device will switch the main camera (the camera whose captured image will be displayed) from an ultra-wide-angle camera to a wide-angle camera. Correspondingly, the preview image displayed in the preview area 210 will become a zoomed image captured by the wide-angle camera with a zoom ratio of 1x.
[0075] Alternatively, users can apply zoom operations through touch operations that do not directly affect the zoom control 220. For example, the electronic device can predefine that sliding fingers towards or away from each other on the shooting interface constitutes a zoom operation, or predefine that clockwise or counterclockwise rotation sliding on the shooting interface also constitutes a zoom operation. That is, these predefined touch operations are applied to the shooting interface, but not necessarily to the zoom control 220.
[0076] refer to Figure 3 In (1) and (2), the user's finger can slide back and forth in the preview area 210 to increase the zoom ratio. At this time, the zoom control 220 moves upward as the user's finger slides back and forth, automatically switching from 0.5x to 1x. That is, the zoom ratio changes from 0.5x to 1x. The electronic device switches the main camera to a wide-angle camera. The preview image displayed in the preview area 210 is a zoom image captured by the wide-angle camera with a zoom ratio of 1x.
[0077] Alternatively, in other cases, the zoom operation received by the electronic device may be a touch operation that does not require interaction with the shooting interface. For example, a physical button or knob can be provided on the side of the electronic device as a zoom switch. This physical button or knob can be associated with indicating specific zoom value selection or zoom magnification adjustment operations. This physical button or knob can be a separate physical device dedicated to receiving zoom operations, or it can reuse existing volume adjustment buttons or channel adjustment knobs in the shooting scenario. This application embodiment does not impose any limitations on this.
[0078] However, because multiple cameras are located in different positions within electronic devices, such as Figure 1 As shown, camera 1 is located to the upper right of camera 2, and camera 2 is located to the upper left of camera 3. The field of view (FOV) of a camera changes depending on its position. Therefore, the FOV centers corresponding to multiple cameras on an electronic device are not the same. That is, in Figure 1 In the phone A shown, because cameras 1, 2, and 3 are positioned differently, their respective fields of view (FOV) centers are also different. Furthermore, traditionally, preview images corresponding to different target zoom values are obtained by center-cropping the full FOV images captured by the camera corresponding to the target zoom value and then sending them for display.
[0079] Furthermore, when a user takes a photo using an electronic device, if the device switches cameras during the zoom adjustment process in response to the user's zoom operation (e.g., from 0.9x / 0.999 to 1x, or from 2.9x / 2.999 to 3x), the FOV center point will change accordingly. Therefore, at the moment of camera switching, the preview image will exhibit noticeable distortion due to the change in the FOV center point; that is, there is a lack of smooth transition in the image during the camera switch.
[0080] For example, Figure 4 A schematic diagram showing the center point of a camera's field of view (FOV) is shown.
[0081] refer to Figure 4 , Figure 4 The image shown in (1) is the full FOV image of the wide-angle camera, that is, the FOV image under wide-angle 1x. Figure 4 Figure (2) shows the full FOV image of the ultra-wide-angle camera (UW), specifically the FOV image at 0.5x zoom. When the wide-angle camera is the main camera, the displayed preview image is the image captured by the wide-angle camera. However, after the main camera is switched to the ultra-wide-angle camera (UW), the displayed preview image needs to be changed to the image captured by the ultra-wide-angle camera (UW). It is understandable that although different zoom values correspond to different FOV sizes, the FOV size can be considered consistent at the moment of camera switching. Therefore... Figure 4 The image shows the difference between 1x FOV under a wide-angle camera and 1x FOV under an ultra-wide-angle camera.
[0082] by Figure 4 The figures shown are for reference; comparison is necessary. Figure 4 As can be seen from the two preview images before and after the camera switch, because both are cropped with the center of the full FOV image, the change in the FOV center point caused by the camera switch results in a noticeable change in the position of the person in the two preview images. Therefore, at the instant of the camera switch, the user will perceive this obvious change in the displayed image. In other words, the displayed image in preview area 210 will show a noticeable change at the moment of camera switch, meaning the display image does not transition smoothly during the switch. It is understandable that the closer the subject is to the camera, that is, in close-up shooting scenarios, the greater the difference in the FOV center point between the two cameras, so the change at the moment of camera switch will be more pronounced in close-up shooting scenarios.
[0083] It should be noted that, Figures 2-4 The direction and distance of change of the figures shown are merely examples in this embodiment and do not constitute any limitation on the changes. Specifically, Figure 4 The depicted person does not limit the changes to the person in scenarios where the ultra-wide-angle and wide-angle cameras switch. For example, based on the actual arrangement of the ultra-wide-angle and wide-angle cameras on the electronic device, Figure 4 The character shown can move in any direction, such as up, down, left, right, upper left, upper right, lower left, or lower right.
[0084] Therefore, in order to ensure a smooth transition of the displayed image during camera switching, this application provides an image capturing method. This image capturing method is applied to an electronic device including at least two cameras.
[0085] The electronic device can first activate the camera in response to a camera activation event. After the camera application is activated, the electronic device will display a shooting interface, and the preview area of the shooting interface will also display a preview image, i.e., the first preview image. The zoom ratio and camera corresponding to the first preview image are referred to in this embodiment as the first zoom ratio and the first camera, respectively. For example, as... Figure 2 As shown, the first zoom ratio is 0.5x, and the first camera is an ultra-wide-angle camera. Alternatively, the first zoom ratio is 1x, and the first camera is a wide-angle camera. Or, the first zoom ratio is 3x, and the first camera is a telephoto camera.
[0086] In some embodiments, the camera launch event may be a touch event where the user clicks the camera application icon, or a call event where other applications need to launch the camera due to business requirements. This application embodiment does not impose any limitations on this.
[0087] Then, if the electronic device receives a zoom operation from the user instructing it to adjust the zoom ratio from a first zoom ratio to a second zoom ratio, the electronic device responds to the zoom operation by displaying a preview image corresponding to the adjusted zoom ratio. For example, if there is no zoom ratio between the first and second zoom ratios, i.e., no intermediate zoom ratio between the first and second zoom ratios, the electronic device can directly display the preview image corresponding to the second zoom ratio after the first preview image, i.e., display the second preview image. Alternatively, if there is an intermediate zoom ratio between the first and second zoom ratios, the electronic device, in addition to displaying the second preview image, can also first display at least one intermediate preview image corresponding to the intermediate zoom ratio, i.e., display at least one frame of intermediate preview image.
[0088] In traditional methods, preview images (such as intermediate and second preview images) are typically cropped from the full FOV image captured by the camera corresponding to the zoom level (intermediate and second zoom levels) based on the required FOV size. The image is then centered and cropped around the FOV. Therefore, in traditional methods, if the zoom process from the first zoom level to the second zoom level involves camera switching—for example, if the second zoom level corresponds to a second camera—then switching from the first camera to the second camera is necessary because the preview image for the second zoom level needs to be captured by the second camera.
[0089] Furthermore, during the camera switching moment, because the cropping is centered, the FOV center of the first and second cameras changes abruptly due to a sudden inconsistency. Consequently, the displayed image will show noticeable shifts during the camera switching moment. Figure 4 As shown.
[0090] To address this issue, the preview image in this application embodiment is no longer obtained by centering and cropping the full FOV image based on the FOV center of the full FOV image, but rather by offset cropping the full FOV image.
[0091] The so-called offset cropping includes two processing steps: offsetting and cropping. Compared to traditional center-cropping, offset cropping adds an offset processing step. Specifically, during the cropping process, instead of centering the crop based on the FOV center of the full FOV image corresponding to the zoom magnification, it needs to be cropped with a slight offset based on the FOV center of the camera to be switched.
[0092] The difference lies in the fact that the FOV center of the preview image obtained by cropping using the center-cropping method within the full FOV image will coincide with the FOV center of the full FOV image. However, the FOV center of the preview image obtained by cropping using the offset-cropping method, due to the offset, will no longer coincide with the FOV center of the full FOV image, and will be closer to the FOV center of the camera to be switched. This avoids significant changes in the FOV center due to camera switching, thus ensuring a smooth transition of the image when switching cameras.
[0093] Understandably, since offsetting requires space to move, this embodiment of the application will use the full FOV image (i.e., the second full FOV image) captured by the camera with a smaller FOV (i.e., the non-target camera) as an aid between two cameras that may switch cameras, and perform offset cropping on the full FOV image (i.e., the first full FOV image) captured by the camera with a larger FOV (i.e., the target camera) to obtain the preview image corresponding to the zoom magnification.
[0094] In one embodiment, the offset cropping in this application can be a single offset and two cropping operations.
[0095] In simple terms, the electronic device first crops a larger cropped image from the first full FOV image captured by the target camera, based on the zoom ratio (such as intermediate zoom ratio or second zoom ratio), compared to the second full FOV image captured by the non-target camera. Then, based on the difference in FOV centers between the target and non-target cameras, the electronic device performs offsetting and secondary cropping on the resulting cropped image to obtain a preview image with an FOV size corresponding to the zoom ratio and an FOV center closer to the FOV center of the non-target camera.
[0096] In another embodiment, the offset cut can also be two offsets and two cuts.
[0097] The double offset and double cropping are based on the single offset and double cropping mentioned above. During the first cropping, the electronic device also performs an offset (i.e., the first offset), which is implemented in the full FOV image. In other words, the first offset will be performed in the first full FOV image.
[0098] Thus, because the first full FOV image is larger than the cropped image described above, there is a greater offset range compared to offsetting within the cropped image. Therefore, compared to a single offset, two offset cropping methods, with sufficient offset range, ensure that even if the difference between the FOV centers of the two cameras is too large, the FOV center of the preview image gradually approaches or even coincides with the FOV center of the non-target camera.
[0099] In summary, the shooting method provided in this application mainly involves, during the zoom process, for two cameras that may be switched (such as the first camera and the second camera), based on the difference in the FOV center between the two cameras, offsetting and cropping the first full FOV image to be displayed to obtain a displayable preview image. This results in the FOV center of the preview images corresponding to different zoom magnifications gradually approaching the FOV center of the camera to be switched (such as the second camera) until they coincide, according to the order in which the preview images are displayed.
[0100] In this way, because the electronic device has already pre-calculated the difference between the FOV centers of the first and second cameras, it uses offset cropping to gradually bring the FOV center of the preview image corresponding to the first camera closer to, until they coincide, the FOV center of the second camera. In other words, the electronic device has already distributed the difference in the FOV centers of the first and second cameras across the various zoom ratios required when switching between the two cameras. Therefore, during zooming, whether the zoom adjustment involves camera switching or not, it can be ensured that there are no obvious changes in the displayed image. That is, the FOV center is smoothly moved throughout the zooming process, thus ensuring a smooth transition in the displayed image at the moment of camera switching.
[0101] The aforementioned electronic devices may include at least one of the following: mobile phones, cameras, camcorders, foldable electronic devices, tablets, desktop computers, laptops, handheld computers, ultra-mobile personal computers (UMPCs), netbooks, cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices, or smart city devices. This application does not impose any specific limitations on the type of electronic device described.
[0102] For example, Figure 5 A schematic diagram of the structure of an electronic device is shown.
[0103] refer to Figure 5The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera module 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, proximity sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, etc.
[0104] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0105] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors. Processor 110 can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0106] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 may be a cache memory. This memory can store instructions or data that the processor 110 has used or that are used frequently. If the processor 110 needs to use the instruction or data, it can directly retrieve it from this memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0107] In some embodiments, the processor 110 may include one or more interfaces. These interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 can connect to modules such as touch sensors, audio modules, wireless communication modules, displays, and camera modules through at least one of these interfaces.
[0108] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0109] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, it can save music, video, and other files to the external memory card, or transfer music, video, and other files from the electronic device to the external memory card.
[0110] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as image capture, sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phone book, etc.). In addition, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional methods or data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory disposed in the processor.
[0111] The charging management module 140 receives charging input from the charger and charges the battery 142. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141. The power management module 141 connects the battery 142, the charging management module 140, and the processor 110.
[0112] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0113] Electronic device 100 can implement display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0114] The display screen 194 is used to display images, videos, etc. Specifically, in this embodiment, the display screen 194 can display preview images corresponding to different zoom levels. The display screen 194 includes a display panel. In this embodiment, the display panel can be an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194.
[0115] Electronic device 100 can realize camera function through camera module 193, ISP, video codec, GPU, display screen 194, application processor AP, neural network processor NPU, etc.
[0116] The camera module 193 can be used to acquire color image data and depth data of the subject. In this embodiment, the camera module 193 may consist of two or more cameras. For example, see reference... Figure 5 The camera module 193 may include camera 1, camera 2, and camera 3. In one specific embodiment, these two or more cameras may include a wide-angle camera, an ultra-wide-angle camera, a telephoto camera, etc.
[0117] The ISP can be used to process color image data acquired by the camera module 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits this electrical signal to the ISP for processing, converting it into an image visible to the naked eye (e.g., the preview image in this embodiment). The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera module 193.
[0118] In some embodiments, the camera module 193 may consist of a color camera module and a 3D sensing module.
[0119] In some embodiments, the photosensitive element of the camera in the color camera module can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats.
[0120] In some embodiments, the 3D sensing module can be a time-of-flight (TOF) 3D sensing module or a structured light 3D sensing module. Structured light 3D sensing is an active depth sensing technology, and its basic components may include an infrared emitter, an IR camera module, etc. The working principle of a structured light 3D sensing module is to first emit a specific pattern of light onto the object being photographed, then receive the light coding on the object's surface, compare it with the original projected light pattern, and calculate the object's three-dimensional coordinates using triangulation principles. These three-dimensional coordinates include the distance between the electronic device 100 and the object being photographed. Similarly, TOF 3D sensing can be an active depth sensing technology, and its basic components may include an infrared emitter, an IR camera module, etc. The working principle of a TOF 3D sensing module is to calculate the distance (i.e., depth) between the TOF 3D sensing module and the object being photographed by measuring the infrared reflection time to obtain a 3D depth map.
[0121] Structured light 3D sensing modules can also be applied to facial recognition, motion-sensing game consoles, and industrial machine vision inspection. Time-of-flight (TOF) 3D sensing modules can also be applied to game consoles, augmented reality (AR) / virtual reality (VR) and other fields.
[0122] In some embodiments, the two or more cameras in the camera module 193 may also be color cameras, which can be used to acquire color image data of the object being photographed. These two or more cameras can employ stereo vision technology to acquire depth data of the object being photographed. Stereo vision technology is based on the principle of human parallax. Under natural light, two or more cameras capture images of the same object from different angles, and then triangulation and other calculations are performed to obtain distance information between the electronic device 100 and the object being photographed.
[0123] In some embodiments, the electronic device 100 may include one or more camera modules 193. Specifically, the electronic device 100 may include one front-facing camera module and one rear-facing camera module. The front-facing camera module is typically used to capture color image data and depth data of the user facing the display screen 194, while the rear-facing camera module is used to capture color image data and depth data of the subject (such as a person, landscape, etc.) in front of the user. The rear-facing camera module may consist of two or more cameras.
[0124] In some embodiments, the CPU, GPU, or NPU in processor 110 can process the color image data and depth data acquired by camera module 193. In some embodiments, the NPU can identify the color image data acquired by camera module 193 (specifically, the color camera module) using neural network algorithms based on skeletal point recognition technology, such as convolutional neural network algorithms (CNN), to determine the image content of the subject being photographed. The CPU or GPU can also run neural network algorithms to determine the image content of the subject being photographed based on the color image data.
[0125] Electronic device 100 can implement audio functions through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor, such as music playback and recording. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card.
[0126] In some embodiments, the software system of the electronic device 100 may adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture of Android... TM Taking the system as an example, the software structure of electronic device 100 is illustrated.
[0127] For example, Figure 6 A software architecture block diagram of an electronic device is shown.
[0128] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, Android... TM The system is divided into five layers, from top to bottom: application layer, application framework layer, Android runtime (ART) and native C / C++ libraries, hardware abstraction layer (HAL) and kernel layer.
[0129] The application layer can include a series of application packages. These application packages can include applications such as camera, gallery, calendar, maps, WLAN, music, SMS, calling, navigation, Bluetooth, and video.
[0130] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0131] like Figure 6 As shown, the application framework layer may include a window manager, activity manager, input manager, resource manager, notification manager, view system, content provider, etc.
[0132] The window manager provides a window management service (WMS), which can be used for window management, window animation management, surface management, and as a relay station for the input system.
[0133] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.
[0134] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0135] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0136] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0137] The Activity Manager Service (AMS) can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers), as well as manage and schedule application processes.
[0138] The input manager can provide an input management service (IMS), which can be used to manage system inputs, such as touchscreen input, keypad input, and sensor input. IMS retrieves events from input device nodes and, through interaction with the WMS, distributes these events to the appropriate windows.
[0139] The Android runtime consists of the core libraries and the Android runtime itself. The Android runtime is responsible for converting source code into machine code. The Android runtime primarily employs ahead-of-time (AOT) compilation and just-in-time (JIT) compilation techniques.
[0140] The core library primarily provides basic Java class library functionalities, such as libraries for fundamental data structures, mathematics, I / O, tools, databases, and networking. It also provides APIs for users to develop Android applications.
[0141] Native C / C++ libraries can include multiple functional modules. Examples include: surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.
[0142] The Surface Manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The Media Framework supports playback and recording of various common audio and video formats, as well as still image files. The Media Library supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. OpenGL ES provides drawing and manipulation of 2D and 3D graphics in applications. SQLite provides a lightweight relational database for applications on the electronic device.
[0143] The Hardware Abstraction Layer (HAL) runs in user space, encapsulates kernel drivers, and provides calling interfaces to higher layers. The kernel layer acts as the layer between hardware and software. Figure 6 As shown, the Hardware Abstraction Layer (HAL) can include display HAL, audio HAL, camera HAL, Bluetooth HAL, etc. The kernel layer contains at least display drivers, audio drivers, camera drivers, and Bluetooth drivers.
[0144] In this embodiment, the camera HAL includes a region of interest (ROI) module, a thin front end (TFE) module, a spatial alignment transform (SAT) module, a miniSAT module, and an image front end + image processing engine (IFE + IPE) module.
[0145] The ROI module determines the corresponding cropping box based on the target zoom value (including intermediate and second zoom levels), thus defining the required cropping area. Both the MiniSAT and SAT modules determine the offset between the center points of two FOVs (fields of view) between two cameras (e.g., the first and second cameras). The TFE module performs a first offset cropping of the image based on the cropping area determined by the ROI and the offset between the two FOV center points. The IFE+IPE module performs a second offset cropping of the image based on the offset between the two FOV center points.
[0146] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.
[0147] When the touch sensor receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click operation as an example, where the corresponding control is the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then calls the kernel layer to start the camera driver. The camera module 193 captures still images or videos, and then transmits the captured images or videos to the camera application for display, i.e., display sending.
[0148] In this embodiment of the application, in order to ensure a smooth transition of the image during camera switching, before sending the image to the display, the camera HAL needs to selectively perform one or two offset cropping operations on the full FOV images captured by some cameras corresponding to certain target Zoom values, based on whether the actual target Zoom value involves camera switching, to obtain the preview image to be sent to the display.
[0149] The following will describe in detail the shooting method proposed in the embodiments of this application with reference to the accompanying drawings. It should be noted that the shooting methods in the following embodiments can all be implemented in the electronic device 100 having the above-described hardware structure.
[0150] Combination Figure 6 The software structure shown is as follows: Figure 7 , Figure 8 and Figure 9 Flowcharts of one shooting method are shown below. The following, in conjunction with... Figure 7 , Figure 8 and Figure 9 The three shooting methods provided in the embodiments of this application will be described separately.
[0151] refer to Figure 7 The first shooting method provided in this application embodiment includes steps S701-S705.
[0152] S701, camera application determines target zoom value.
[0153] The target zoom value (second zoom level, or including intermediate zoom levels and second zoom levels) is the zoom value corresponding to the zoom operation determined by the camera application. For example, refer to... Figure 2 The zoom value at the start of the zoom operation (i.e., the first zoom magnification) is 0.5x, and the zoom value at the end of the zoom operation is 1x. Therefore, the target zoom value in this embodiment includes 1x.
[0154] After the camera application obtains the target zoom value corresponding to the zoom operation, it can send the target zoom value to the ROI module, so that the ROI module can determine the cropping area corresponding to the corresponding FOV size based on the target zoom value.
[0155] Understandably, in some embodiments, the adjustment of the zoom value during zooming may be sequentially increasing or decreasing. Therefore, if the zoom operation involves multiple target zoom values, then based on actual business needs, the camera application, in addition to sending the last target zoom value (i.e., the second zoom ratio) corresponding to the zoom operation to the ROI module, can also send at least one intermediate zoom ratio between the first and second zoom ratios to the ROI module of the camera's HAL, in order to obtain an intermediate preview image corresponding to this intermediate zoom ratio for display.
[0156] For example, if there are four intermediate zoom ratios between 0.5x and 1x, namely 0.6x, 0.7x, 0.8x and 0.9x, then these four intermediate zoom ratios are also considered as target zoom values. The camera application can send all four intermediate zoom ratios to the ROI module, or select one or more intermediate zoom ratios from these four zoom ratios to send to the ROI module. This application embodiment does not impose any limitations on this.
[0157] S702, the ROI module determines the cutting area and the first offset.
[0158] After receiving the target zoom value from the camera application, the ROI module first determines the corresponding FOV size based on the target zoom value. For example, if the target zoom value = 0.5x, then the ROI module can determine that the FOV size corresponds to 0.5x. If the target zoom value = 1x, then the ROI module can determine that the FOV size corresponds to 1x.
[0159] Then, the ROI module determines the cropping region based on the determined FOV size. In this embodiment, the cropping region can be understood as an area with specific positional coordinates and dimensions. In this embodiment, the cropping region determined by the ROI module is centered within the full FOV image, such as... Figure 10 The cropping frames 1010 and 1020 are shown.
[0160] In some embodiments, to facilitate a subsequent second offset cropping, the ROI module needs to reserve an additional margin when determining the cropping area. That is, in this embodiment, the cropping area determined by the ROI module is larger than the area corresponding to the FOV size. Specifically, the ROI module needs to reserve an additional margin according to a preset ratio on top of the area size corresponding to the target Zoom value and the FOV size.
[0161] For example, the preset ratio can be n% of the FOV size corresponding to the target Zoom value, where n ≥ 1. That is, an additional n% margin needs to be added to the original FOV size corresponding to the target Zoom value. Understandably, this n% can be set according to actual needs, and this embodiment does not impose any limitations on it.
[0162] Actual testing revealed that, at the same resolution, a larger FOV (Field of View) reduces the sharpness of the same object. Therefore, in this embodiment, to ensure the sharpness of the image after offset cropping, the preset ratio cannot be set too large.
[0163] In one specific embodiment, n% = 20%. That is, in this embodiment, the ROI module needs to add 20% more edge region to the FOV size corresponding to the target Zoom value. Therefore, the FOV size of the offset cropped image obtained by the first offset cropping will be 20% larger than the FOV size corresponding to the target Zoom value.
[0164] For example, taking a target Zoom value of 1x as an example, Figure 10 A schematic diagram of a cutting area is shown.
[0165] refer to Figure 10Without a second offset cut, the size of the cut area is equal to the size of 1x FOV, such as... Figure 10 The cutout frame shown is 1020.
[0166] In the case where a second offset trimming is required in this embodiment, the trimming area will be larger than the original trimming area corresponding to the FOV by a preset proportion (e.g., 20%). Figure 10 As shown, the cutting frame 1010 is larger than the cutting frame 1020. In this embodiment, the cutting frame 1010 is 20% larger than the cutting frame 1020. That is to say, when performing the second offset cutting, the range that can be offset will not exceed the cutting area corresponding to the cutting frame 1010.
[0167] In this embodiment of the application, in order to achieve two offset cuts, the ROI module needs to determine the offset amount required for the first offset, i.e., the first offset amount, while determining the cut area.
[0168] In one specific embodiment, the inconsistency in the FOV center point is caused by the different camera positions, and the closer the shooting distance, the greater the difference in the FOV center point. Furthermore, the ROI module is not a node for image transmission; the images captured by the camera are not transmitted to the ROI module. Therefore, the ROI module can determine the first offset based on the shooting object distance and the calibration data between the two cameras, which is pre-determined through camera calibration. The calibration data corresponding to the two cameras is mainly used to reflect the difference in the FOV center point between these two different cameras, so the first offset can be understood as the offset of the FOV center points corresponding to the two cameras.
[0169] S703, the TFE module cropped the first cropped image.
[0170] The TFE module receives the cropping region and first offset corresponding to the target Zoom value, determined by the ROI module. Additionally, the TFE module needs to acquire the full FOV image captured by the target camera; that is, it also needs to acquire the first full FOV image. Understandably, the first full FOV image is captured by the target camera and transmitted to the TFE module. Here, the full FOV image refers to the image with the maximum FOV that the camera can capture.
[0171] For example, the full FOV image of an ultra-wide-angle (UW) camera is a 0.5x FOV image. The full FOV image of a wide-angle camera is a 1x FOV image. The full FOV image of a telephoto camera is a 3x FOV image.
[0172] Then, the TFE module, for each intermediate zoom level and the second zoom level in the target zoom value, crops the first cropped image from the first full FOV image according to the corresponding cropping region and the first offset. Whether the first cropped image of the target zoom value obtained by the TFE module is obtained through center-based cropping or offset cropping needs to be determined based on the actual zoom scenario. Specifically:
[0173] The preview image corresponding to a zoom level should be based on the full field of view (FOV) image captured by the camera corresponding to that zoom level. For example, the preview image for a zoom level of 1x and less than 3x should correspond to the full FOV image captured by a wide-angle camera, the preview image for a zoom level less than 1x should correspond to the full FOV image captured by an ultra-wide-angle camera, and the preview image for a zoom level of 3x or greater should correspond to the full FOV image captured by a telephoto camera.
[0174] Meanwhile, in this embodiment, the preview image is obtained by offset cropping the first full FOV image captured by the target camera, which has a smaller FOV, using the FOV center of the non-target camera as a reference. This presents a problem: the target zoom value may happen to be exactly the minimum zoom ratio corresponding to the second camera, i.e., the target zoom value may be exactly 0.5x, 1x, or 3x. In this case, the first full FOV image to be displayed may be smaller than the full FOV image captured by the non-target camera, thus preventing offsetting.
[0175] For example, if the zoom level is adjusted from 0.5x corresponding to the first camera to 1x corresponding to the second camera, the preview image corresponding to 1x will be displayed. Since the FOV of 1x is smaller than that of 0.5x, it is impossible to offset and crop the full FOV image corresponding to 1x to make the FOV center of 1x closer to the FOV center of 0.5x.
[0176] Therefore, when the target zoom value is equal to the minimum zoom level of the camera, the preview image corresponding to this target zoom value does not need to be offset. Instead, the image of the corresponding size can be directly cropped from the full FOV image based on the zoom value and sent as the preview image.
[0177] Therefore, based on the actual target Zoom value, the first cropped image obtained by the TFE module may be a non-offset, centered cropped image, or an offset cropped image. Specifically, it mainly falls into the following three categories.
[0178] Scenario 1: The target zoom values all correspond to the first camera.
[0179] In the first scenario, it means that the zoom operation does not involve switching cameras. Therefore, to ensure a smooth transition of the image during camera switching, the TFE module can obtain preview images corresponding to the target zoom values of all the first cameras through offset cropping.
[0180] For example, taking the zoom from 1x to 1.3x as an example, where the first zoom level is 1x and the target zoom value includes intermediate zoom levels of 1.1x and 1.2x, as well as the second zoom level of 1.3x, since the zoom process does not involve camera switching, to ensure a smooth transition when switching from a wide-angle camera to a telephoto camera to 3x or higher zoom levels, the TFE module can obtain the first cropped images corresponding to the intermediate zoom levels of 1.1x and 1.2x, and the second zoom level of 1.3x, based on the FOV center corresponding to 3x through offset cropping. The offset of the first cropped image is based on a determined first offset, and the offset of the first cropped image will not exceed the first offset. Furthermore, according to the display order, the FOV center of the first cropped image gradually approaches the FOV center of the 3x telephoto camera. Therefore, when switching from the 1x wide-angle camera to the 3x telephoto camera, there is no obvious change in the displayed image at the moment of switching, resulting in a smooth transition.
[0181] The second scenario: The target zoom value is exactly the minimum zoom level corresponding to the camera.
[0182] In the second scenario, the zoom operation involves camera switching, specifically from the first camera to the second camera. However, since the target zoom value is exactly the minimum zoom ratio corresponding to the second camera, the zoom operation ends during the camera switch. In this case, only the zoom ratio at the end of the zoom operation corresponds to the second camera in the target zoom value; that is, only the second zoom ratio corresponds to the second camera. Therefore, for the first cropped image corresponding to the second zoom ratio in the target zoom value, the TFE module directly crops the image from the full FOV image captured by the second camera corresponding to the second zoom ratio, centering the crop. For intermediate zoom ratios in the target zoom value that are not the second zoom ratio, since they correspond to the first camera, the TFE module still uses an offset cropping method to crop the full FOV image captured by the first camera to obtain the corresponding first cropped image.
[0183] In addition, a third scenario: the second zoom level in the target zoom value is greater than the minimum zoom level corresponding to the camera.
[0184] In the third scenario, it means that besides the second zoom level corresponding to the second camera, the intermediate zoom levels included in the target zoom value also include one corresponding to the second camera. This implies that one of the intermediate zoom levels is the minimum zoom level corresponding to the camera. Therefore, the first cropped image corresponding to this intermediate zoom level (i.e., the second intermediate zoom level) does not need to be offset but is cropped in the center.
[0185] Furthermore, since the number of cameras configured in an electronic device is ultimately limited, there will always be one camera with the smallest FOV. Therefore, there is no camera with a smaller FOV to use as an offset reference for this camera. Thus, based on the offset-based cropping method of this application embodiment, there will naturally be cameras whose corresponding preview images cannot be offset at all. This camera whose corresponding preview image cannot be offset at all is the camera with the largest focal length range (i.e., the smallest FOV). For example, the telephoto camera in the three cameras described in this application embodiment.
[0186] Therefore, in addition to the second intermediate zoom ratio, there is also an intermediate zoom ratio (i.e., the third intermediate zoom ratio) that corresponds to the first cropped image that needs to be centered and cannot be offset during cropping.
[0187] Apart from the second and third intermediate zoom ratios, the remaining intermediate zoom ratios are the intermediate zoom ratios that can be offset and cropped for the first cropped image, which are referred to as the first intermediate zoom ratio in this application embodiment.
[0188] Understandably, the relationship between the third intermediate zoom level, the first intermediate zoom level, and the minimum zoom level differs depending on whether the zoom operation increases or decreases the zoom magnification. Furthermore, because the direction of the increase and decrease in zoom magnification differs, the camera with the largest focal length range could be either the first or the second camera. Therefore, whether the third intermediate zoom level corresponds to a centered or offset crop of the first cropped image also differs.
[0189] The first scenario: Increasing the zoom ratio. That is, the second zoom ratio is greater than the first zoom ratio.
[0190] In the first scenario, the first intermediate zoom ratio is an intermediate zoom ratio that is greater than the first zoom ratio and less than the minimum zoom ratio. The third intermediate zoom ratio is an intermediate zoom ratio that is greater than the minimum zoom ratio and less than the second zoom ratio.
[0191] For example, taking a zoom range of 1.5x to 3.5x as an example, the minimum zoom ratio is 3x. Then the first intermediate zoom ratio is the zoom ratio greater than 1.5x and less than 3x, and the third intermediate zoom ratio is the zoom ratio greater than 3x and less than 3.5x. 1.5x is the first zoom ratio, and 3.5x is the second zoom ratio.
[0192] In the first scenario, the first cropped image corresponding to the first intermediate zoom level is obtained through offset cropping. The first cropped image corresponding to the third intermediate zoom level is obtained through offset cropping when the second camera corresponding to the second zoom level is the camera with the largest focal length range. However, when the second camera corresponding to the second zoom level is not the camera with the largest focal length range, it is obtained through center cropping.
[0193] The second scenario: reducing the zoom ratio. That is, the case where the first zoom ratio is greater than the second zoom ratio.
[0194] In the second scenario, the first intermediate zoom ratio is an intermediate zoom ratio that is less than the minimum zoom ratio. The third intermediate zoom ratio is an intermediate zoom ratio that is less than the first zoom ratio but greater than the minimum zoom ratio.
[0195] For example, taking a zoom range from 2.5x to 0.6x, the first zoom ratio is 2.5x, the second zoom ratio is 0.6x, and the corresponding minimum zoom ratio is 1x. Therefore, the first intermediate zoom ratio is a zoom ratio less than 1x and greater than 0.6x, and the third intermediate zoom ratio is a zoom ratio less than 2.5x and greater than 1x. In the second scenario, the first cropped image corresponding to the first intermediate zoom ratio is also obtained through offset cropping.
[0196] However, the first cropped image corresponding to the third intermediate zoom level is obtained by centering the crop when the first camera corresponding to the first zoom level is the camera with the largest focal length range. When the first camera corresponding to the first zoom level is not the camera with the largest focal length range, it is obtained by offset cropping.
[0197] Similarly, in the third case, whether the first cropped image corresponding to the second zoom level in the target zoom value is centered or offset also depends on the actual value of the second zoom level. The principle is the same. For details, please refer to the record of the first intermediate zoom level and the third intermediate zoom level in the third case. It will not be repeated here.
[0198] For example, taking 1x as an example, Figure 11 A schematic diagram of a TFE module performing the first offset cut is shown.
[0199] refer to Figure 11The image corresponding to the offset cropped area is the first cropped image obtained after the first offset cropping. By comparison, it can be seen that after the first offset cropping by the TFE module, the FOV center point of the first cropped image is closer to the FOV center point of the full FOV under the wide-angle camera compared to the cropped image that is centered without offset.
[0200] Therefore, when switching the main camera from an ultra-wide-angle (UW) camera to a wide-angle camera, the FOV center point of the preview image corresponding to the UW camera has already gradually moved closer to the FOV center point of the wide-angle camera during the zoom process before the switch, and may even have already coincided with the FOV center point of the wide-angle camera before the switch. Based on this, the FOV center point will not change at the instant of switching from the UW camera to the wide-angle camera, or if it does change, it will be slight. This avoids noticeable image changes during camera switching and ensures a smooth transition in the displayed image. Additionally, for the first cropped image corresponding to the target Zoom value that needs to be centered, refer to... Figure 4 As shown, this will not be elaborated further.
[0201] S704, the SAT module determines the second offset.
[0202] When the TFE module performs offset cropping (i.e., the first offset cropping) on the target Zoom value, the first offset amount corresponding to the first offset cropping of the TFE module is determined based on the shooting object distance and camera calibration data. This first offset amount may not be completely accurate due to detection errors in the shooting object distance and calibration errors, which may result in inaccurate offsetting in the first offset cropping. Therefore, based on the first offset cropping, this embodiment of the application further redetermines the second offset amount based on image alignment, and performs a second offset cropping based on the second offset amount.
[0203] In this embodiment, since the SAT module is the image transmission node, it means that the SAT module can receive the full FOV image captured by the camera. Therefore, the second offset corresponding to the second offset cropping can be determined by the SAT module based on image alignment. In a specific embodiment, in order to improve the accuracy of the offset, the SAT module mainly determines the offset of the FOV center point of the two images by aligning the two images, thereby obtaining the second offset.
[0204] The two images used for image alignment by the SAT module are the first cropped image obtained from the first offset cropping or the first center cropping, and the full FOV image captured by the non-target camera (i.e., the second full FOV image). That is, after receiving the first cropped image transmitted by the TFE module and acquiring the second full FOV image captured by the non-target camera, the SAT module can start aligning the first cropped image and the second full FOV image to obtain the second offset.
[0205] Understandable. Figure 7 The shooting process shown involves the non-target camera directly transmitting the second full FOV image to the SAT module. However... Figure 7 This is merely one example of image transmission in the embodiments of this application and does not constitute a limitation on image transmission. That is, the second full FOV image can be directly transmitted to the SAT module after being captured by a non-target camera. Alternatively, it can be captured by a non-target camera, transmitted to the TFE module first, and then transmitted to the SAT module together with the first cropped image via the TFE module. This application embodiment does not impose any limitations on this, and the specific method depends on the actual image transmission design in the electronic device.
[0206] Understandably, in electronic devices equipped with multiple cameras, in this embodiment, within the focal length range where camera switching may be involved, two cameras are actually capturing images simultaneously. However, the image displayed is captured by the main camera (i.e., the target camera), which is typically the camera corresponding to the current zoom level. The image captured by the secondary camera (not the target camera), which captures images but does not display them, is mainly used to assist in offsetting and cropping the image captured by the main camera, thereby ensuring a smooth transition of the image during camera switching.
[0207] In a specific embodiment, taking a three-camera setup as an example, for focal lengths less than 1x, the ultra-wide-angle camera (UW) is the main camera, and the wide-angle camera is the secondary camera. The full FOV image captured by the wide-angle camera is used to assist in performing two offset cropping operations on the full FOV image captured by the ultra-wide-angle camera (UW) to obtain a preview image. This ensures a smooth transition of the displayed image at the instant the main camera switches from the ultra-wide-angle camera to the wide-angle camera (UW).
[0208] For focal lengths greater than or equal to 1x and less than 3x, the wide-angle camera is the main camera, and the telephoto camera is the secondary camera. The full FOV image captured by the telephoto camera is used to assist in performing two offset cropping operations on the full FOV image captured by the wide-angle camera to obtain the preview image. This ensures a smooth transition of the displayed image at the instant the main camera switches from the wide-angle camera to the telephoto camera.
[0209] For focal lengths of 3x or greater, the telephoto camera is the main camera. Since there are only three cameras, even if the zoom level is increased further, there will be no need to switch cameras. Therefore, the preview images corresponding to zoom levels of 3x and above do not require the secondary camera to assist in two offset cropping operations. Thus, when the telephoto camera is the main camera, the secondary camera can be considered to be empty, that is, the secondary camera does not exist.
[0210] S705, the IFE+IPE module obtains the second cropped image from the first cropped image.
[0211] The IFE+IPE module receives the second offset determined by the SAT module. Then, based on the second offset, it performs a second cropping from the first cropped image to obtain the second cropped image. Understandably, the second cropped image is based on the actual target zoom value and can be obtained through offset cropping or center cropping, following the same principle as the cropping process of the first cropped image, which will not be elaborated further. Simply put, if the first cropped image is obtained through center cropping by the TFE module, then the corresponding second cropped image is also obtained by center cropping the first cropped image through the IFE+IPE module. If the first cropped image is obtained through offset cropping by the TFE module, then the corresponding second cropped image is also obtained by offset cropping the first cropped image through the IFE+IPE module. The only difference is that when the IFE+IPE module performs offset cropping, the offset is based on the second offset, and the offset of all second cropped images does not exceed the second offset. Furthermore, the area discarded by the IFE+IPE module during cropping is equal in size to the edge area retained by the TFE module. For example, the IFE+IPE module discards 20% by cropping, making the FOV size of the second cropped image the same as the FOV size required for the corresponding target Zoom value.
[0212] For example, Figure 12 This diagram illustrates a second offset cut performed by an IFE+IPE module.
[0213] refer to Figure 12 After the second offset cropping, the position of the FOV center point can be further brought closer to the position of the FOV center point under wide-angle 1xFOV. Therefore, a smooth transition of the image can be ensured at the moment of camera switching.
[0214] The IFE+IPE module obtains the second cropped image. Depending on the actual situation, if the image processing business requires additional image processing on the second cropped image, the IFE+IPE module can transmit the second cropped image to the backend image processing module (not shown in the attached diagram) for additional image processing. Then, after the backend image processing module performs the corresponding image processing on the second cropped image, it sends the processed image to the camera application for display. In this case, the preview image in the preview area 210 is the image output by the backend image processing module.
[0215] If the image processing workflow no longer requires additional image processing on the second cropped image, the IFE+IPE module can directly send the second cropped image to the camera application for display. In this case, the second cropped image is the preview image in preview area 210. Figures 7-9 As shown. In other words, the preview image is obtained based on the second cropped image. The preview image can be the second cropped image or a processed version of the second cropped image.
[0216] Therefore, in the first shooting method provided in this application embodiment, when it is necessary to crop the first full FOV image captured by the target camera according to the target Zoom value to obtain a preview image of the FOV size corresponding to the target Zoom value, during the cropping process, calibration data that can reflect the difference between the FOV center points of the two cameras and a second full FOV image that can reflect the FOV center point of the non-target camera are used as aids to perform two offset cropping operations on the first full FOV image captured by the target camera to obtain a preview image. This allows the FOV center point to gradually approach or even overlap with the FOV center point of the non-target camera, thereby avoiding significant changes in the FOV center point at the moment of camera switching, thus ensuring a smooth transition of the display screen at the moment of switching.
[0217] refer to Figure 8 The second shooting method provided in this application embodiment includes steps S801-S806.
[0218] S801, the camera application determines the target zoom value.
[0219] S802, the ROI module determines the cutting area.
[0220] The specific implementations of S801 and S802 are described in the above-mentioned S701 and S702, and the principles are the same, so they will not be repeated here.
[0221] The S803 miniSAT module determines the first offset.
[0222] In the second shooting method, the first offset is determined by the nodes on the image transmission path, and the miniSAT module determines it through simple image alignment. Specifically, the miniSAT module receives the first and second full FOV images transmitted from the target camera and a non-target camera. Then, to improve processing speed and reduce resource consumption, the miniSAT module downsamples the first and second full FOV images, and then performs image alignment on the downsampled first full FOV image (i.e., the first downsampled image) and the second full FOV image (the second downsampled image) to obtain the first offset.
[0223] The miniSAT module sends the calculated first offset, the first full FOV image, and the second full FOV image to the TFE module, enabling the TFE module to crop the first cropped image based on the first offset. Simultaneously, it facilitates the subsequent SAT module in determining the second offset based on the second full FOV image and sending it to the IFE+IPE module for cropping the second cropped image.
[0224] S804, the TFE module cropped the first cropped image.
[0225] S805, the SAT module determines the second offset.
[0226] S806, the IFE+IPE module obtains the second cropped image from the first cropped image.
[0227] The specific implementations of S804-S806 can be found in the descriptions of S703-S705 above, as the principles are the same, and will not be repeated here.
[0228] Therefore, in the second shooting method provided in this application embodiment, when it is necessary to crop the first full FOV image captured by the target camera according to the target Zoom value to obtain a preview image of the FOV size corresponding to the target Zoom value, the cropping process mainly uses the second full FOV image captured by the non-target camera, which can reflect the center point of the FOV corresponding to the secondary road camera, as an auxiliary to perform two offset cropping operations on the first full FOV image captured by the non-target camera to obtain the preview image, thereby ensuring a smooth transition of the display screen at the moment of camera switching.
[0229] Therefore, Figure 7 The shooting method shown and Figure 8 The difference in the shooting methods shown lies in the way the first offset corresponding to the first offset crop is determined. Figure 7 In the shooting method shown, the first offset is determined by the ROI module based on the shooting distance and the camera's calibration data. Figure 8In the shooting method shown, the first offset is obtained by the miniSAT module through simple and fast image alignment based on the downsampled small-volume image. This is understandable because... Figure 8 The first offset of the shooting method shown is obtained directly from the image, so compared to Figure 7 The method shown, which determines the first offset based on the shooting distance and calibration value, has a higher accuracy in determining the offset.
[0230] refer to Figure 9 The third shooting method provided in this application embodiment includes steps S901-S907.
[0231] S901, camera application determines target zoom value.
[0232] S902, the ROI module determines the cropping area and the comparison offset.
[0233] The specific implementations of S901 and S902 are described in the above descriptions of S701 and S702, and the principles are the same, so they will not be repeated here. It should be noted that in the third shooting method, the contrast offset in S902 is the same as the first offset recorded in S702 in the first shooting method.
[0234] S903, the miniSAT module determines the first offset.
[0235] The specific implementation of S903 can be referred to the above description of S803, as the principle is the same, and will not be repeated here.
[0236] The S904 miniSAT module determines the offset difference based on the comparison offset and the first offset.
[0237] The miniSAT module obtains a first offset through downsampling and image alignment. After receiving a comparison offset determined by the ROI module, it further compares the comparison offset with the first offset to obtain the offset difference between the two offsets. In a specific embodiment, the offset difference is the difference between the comparison offset and the first offset.
[0238] Then, miniSAT compares the offset difference with a preset difference threshold. If the offset difference is less than or equal to the difference threshold, it indicates that the offsets determined by the two methods are not significantly different. Therefore, it is determined that two offset clipping operations can be performed, and the first offset clipping operation mainly uses the first offset determined by the miniSAT module. Thus, S905-S907 are executed.
[0239] If the offset difference exceeds the difference threshold, it indicates a significant discrepancy between the offsets determined by the two methods, potentially leading to unforeseen circumstances. To prevent the two offsets from affecting normal image capture, only one offset and two cropping operations can be performed. Therefore, S908-S910 are executed.
[0240] S905, the TFE module cuts to obtain the first cropped image.
[0241] S906, the SAT module determines the second offset.
[0242] S907, the IFE+IPE module obtains the second cropped image from the first cropped image.
[0243] The specific implementations of S905-S907 can be found in the descriptions of S703-S705 above, as the principles are the same, and will not be repeated here.
[0244] S908, the TFE module crops the first full FOV image according to the cropping area to obtain the first cropped image.
[0245] In this step, because it's determined that no double offset will be performed, the TFE module can only receive the cropping region determined by the ROI module from the miniSAT module, as well as the first and second full FOV images captured by the camera. That is, the first offset is empty. Therefore, the TFE module directly crops the first full FOV image based on the cropping region determined by the ROI to obtain the first cropped image. It can be understood that the first cropped image in S908, regardless of whether the actual target zoom value is equal to the minimum magnification range, is a cropped image without offset, such as... Figure 10 The image area corresponding to the cropping frame 1010.
[0246] S909, the SAT module determines the second offset.
[0247] S910, the IFE+IPE module obtains the second cropped image from the first cropped image.
[0248] For details on the specific implementations of S909 and S910, please refer to S906 and S907, as the principles are the same, and will not be elaborated further.
[0249] In general, Figure 9 The shooting method shown combines Figure 7 and Figure 8 The two shooting methods are shown. That is to say, for the third shooting method provided in the embodiments of this application, two offset cropping is only selected when the first offset is determined to be accurate, so as to avoid unpredictable accidental effects and further improve the accuracy of the two offset cropping.
[0250] For example, Figure 13 and Figure 14 Based on two zoom scenarios—increasing and decreasing zoom magnification—illustrated diagrams show a smooth image transition for each. Figure 13 The diagram shown illustrates a scenario with increased zoom magnification. Figure 14 The diagram shown illustrates a scenario with reduced zoom magnification.
[0251] like Figure 13 As shown, in scenarios where the zoom ratio increases from 1x to 3x, it's necessary to switch from a wide-angle camera to a telephoto camera. Simultaneously, Figure 13 The example also exemplifies intermediate zoom ratios of 1.5x and 2.9x between the first zoom ratio of 1x and the second variable zoom ratio of 3x. That is, Figure 13 In the scenario shown, the target zoom values include intermediate zoom ratios of 1.5x and 2.9x, and a second variable zoom ratio of 3x.
[0252] By comparison Figure 13 As shown in (1), (2), (3), and (4), in scenarios with increased zoom magnification, because the intermediate zoom magnifications of 1.5x and 2.9x are offset and cropped based on the FOV center of the wide-angle camera, the FOV center of the intermediate preview image gradually approaches the FOV center of the telephoto camera. Figure 13 As shown in (3), up to 2.9x, the FOV center of the corresponding intermediate preview image almost coincides with the FOV center of 3x. At the second zoom level of 3x, as... Figure 13 As shown in (4), since it is exactly the minimum zoom ratio corresponding to a telephoto camera, therefore Figure 13 The second preview image is centered and cropped. Figure 13 The FOV center of the second preview image coincides with the FOV center of the telephoto camera. Therefore, Figure 13 The entire zoom process shown in (1), (2), (3) and (4) is a smooth transition, so that when switching from a wide-angle camera to a telephoto camera, the transition is smooth.
[0253] Similarly, such as Figure 14 As shown, in scenarios where the zoom ratio decreases from a first zoom ratio of 1x to a second zoom ratio of 0.5x, it is necessary to switch from a wide-angle camera to an ultra-wide-angle camera. Meanwhile, Figure 14 Examples also illustrate intermediate zoom ratios of 0.9x and 0.6x between the first zoom ratio of 1x and the second variable zoom ratio of 0.5x. That is, Figure 14In the scenario shown, the target zoom values include intermediate zoom ratios of 0.9x and 0.6x, and a second variable zoom ratio of 0.5x.
[0254] By comparison Figure 14 As shown in (1), (2), (3), and (4), in scenarios where the zoom ratio is reduced, because the intermediate zoom ratios of 0.9x and 0.6x are offset and cropped based on the FOV center of the ultra-wide-angle camera, the FOV center of the intermediate preview image gradually approaches the FOV center of the ultra-wide-angle camera. Figure 14 As shown in (2), at 0.9x after the switch, the FOV center of the corresponding intermediate preview image almost coincides with the FOV center at 0.5x. And, as... Figure 14 As shown in (4), at the second zoom ratio of 0.5x, since it is exactly the minimum zoom ratio corresponding to the ultra-wide-angle camera, Figure 14 The second preview image is centered and cropped. Figure 14 The FOV center of the second preview image coincides with the FOV center of the ultra-wide-angle camera. Therefore, Figure 14 The entire zoom reduction process shown in (1), (2), (3) and (4) is a smooth transition, so that when switching from a wide-angle camera to an ultra-wide-angle camera, the transition is smooth.
[0255] It should be noted that, Figure 13 and Figure 14 The direction of gradually approaching the FOV center corresponding to the telephoto and ultra-wide-angle cameras shown is only an example in the embodiments of this application, and does not constitute any limitation on the direction of gradual approach. The direction of gradual approach can change due to the actual arrangement of the cameras on the electronic device.
[0256] Another embodiment of this application provides an electronic device, including: at least two cameras, one or more processors, and a memory. The cameras and the memory are coupled to the processors respectively; the cameras are used to capture images; the memory stores one or more computer program codes, the computer program codes including computer instructions; when the processor executes the computer instructions, the electronic device implements the shooting method of any of the above embodiments.
[0257] Another embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor in an electronic device, causes the electronic device to implement the shooting method of any of the above embodiments.
[0258] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps described in the above method embodiments.
[0259] This application also provides a chip system, such as... Figure 15 As shown, the chip system 150 includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 and the interface circuit 1502 are interconnected via lines. For example, the interface circuit 1502 can be used to receive signals from other devices (e.g., a computer's memory). As another example, the interface circuit 1502 can be used to send signals to other devices (e.g., the processor 1501).
[0260] For example, interface circuit 1502 can read instructions stored in memory and send those instructions to processor 1501. When the instructions are executed by processor 1501, the computer can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, and this application embodiment does not specifically limit this.
[0261] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0262] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0263] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0264] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0265] If the function of the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0266] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A shooting method, characterized in that, Applied to an electronic device, the electronic device including at least two cameras; the method includes: The shooting interface includes a first preview image, which corresponds to a first zoom level and a first camera. Receive a zoom operation, the zoom operation triggering a change from the first zoom magnification to the second zoom magnification; Display at least one intermediate preview image and a second preview image corresponding to the second zoom level; Wherein, there is at least one intermediate zoom ratio between the first zoom ratio and the second zoom ratio; the at least one intermediate preview image is obtained by performing offset cropping preprocessing and target offset cropping on the first full field of view image captured by the target camera based on the corresponding intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera; In the first camera and the second camera, the camera with a large field of view is the target camera, and the camera with a small field of view is the non-target camera; the offset amount of the target offset cropping is determined by image alignment of the first full field of view image and the second full field of view image acquired by the non-target camera; The second camera is a camera whose focal length range is adjacent to that of the first camera; The field-of-view center of the at least one intermediate preview image and the second preview image gradually approaches or coincides with the field-of-view center of the non-target camera.
2. The method according to claim 1, characterized in that, The second zoom ratio corresponds to the second camera, and the second zoom ratio is the minimum zoom ratio corresponding to the second camera; The second preview image is obtained by centering and cropping the full field-of-view image captured by the second camera based on the second zoom magnification; the center of the field of view of the at least one intermediate preview image gradually approaches the center of the field of view of the non-target camera, and the center of the field of view of the second preview image coincides with the center of the field of view of the non-target camera.
3. The method according to claim 1 or 2, characterized in that, The second zoom level corresponds to the second camera, and the second zoom level is not the minimum zoom level corresponding to the second camera; The intermediate preview image corresponding to the intermediate zoom ratio between the first zoom ratio and the minimum zoom ratio is obtained by performing offset cropping preprocessing and target offset cropping on the first full field of view image captured by the target camera based on the corresponding intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera. The intermediate preview image corresponding to the intermediate zoom ratio between the minimum zoom ratio and the second zoom ratio is obtained by centering and cropping the full field-of-view image captured by the second camera based on the corresponding intermediate zoom ratio. The second preview image is obtained by centering and cropping the full field-of-view image captured by the second camera based on the second zoom magnification.
4. The method according to any one of claims 1-3, characterized in that, The second zoom ratio corresponds to the second camera, the second zoom ratio is greater than the minimum zoom ratio corresponding to the second camera, and the second zoom ratio is greater than the first zoom ratio; the method further includes: For a first intermediate zoom ratio greater than the first zoom ratio and less than the minimum zoom ratio, based on the first intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain the corresponding first intermediate preview image; the center of the field of view of the first intermediate preview image gradually approaches the center of the field of view of the non-target camera. For a second intermediate zoom ratio equal to the minimum zoom ratio, the full field-of-view image captured by the second camera is centered and cropped based on the second intermediate zoom ratio to obtain a corresponding second intermediate preview image; the center of the field of view of the second intermediate preview image coincides with the center of the field of view of the second camera.
5. The method according to claim 4, characterized in that, The method further includes: For the third intermediate zoom ratio and the second zoom ratio, which are greater than the minimum zoom ratio, if the second camera is not the camera with the largest focal length range, based on the third intermediate zoom ratio and the second zoom ratio, and the difference in the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain the corresponding third intermediate preview image and the second preview image; the center of the field of view of the third intermediate preview image and the second preview image gradually approaches the center of the field of view of the non-target camera; If the second camera is the camera with the largest focal length range, the third intermediate preview image and the second preview image are obtained by center-cropping the full field of view image captured by the second camera based on the third intermediate zoom ratio and the second zoom ratio, respectively; the center of the field of view of the third intermediate preview image and the second preview image coincides with the center of the field of view of the second camera.
6. The method according to any one of claims 1-3, characterized in that, The second zoom ratio corresponds to the second camera, the second zoom ratio is greater than the minimum zoom ratio corresponding to the second camera, and the second zoom ratio is less than the first zoom ratio; the method further includes: For the first intermediate zoom ratio and the second zoom ratio, which are less than the minimum zoom ratio but greater than the second zoom ratio, based on the first intermediate zoom ratio and the second zoom ratio, and the difference in the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain the corresponding first intermediate preview image and second preview image; the center of the field of view of the first intermediate preview image and the second preview image gradually approaches the center of the field of view of the non-target camera; For a second intermediate zoom ratio equal to the minimum zoom ratio, the full field-of-view image captured by the second camera is centered and cropped based on the second intermediate zoom ratio to obtain a corresponding second intermediate preview image; the center of the field of view of the second intermediate preview image coincides with the center of the field of view of the second camera.
7. The method according to claim 6, characterized in that, The method further includes: For a third intermediate zoom ratio that is less than the first zoom ratio but greater than the minimum zoom ratio, if the first camera is the camera with the largest focal length range, the full field-of-view image captured by the second camera is centered and cropped based on the third intermediate zoom ratio to obtain the corresponding third intermediate preview image; the center of the field of view of the third intermediate preview image coincides with the center of the field of view of the second camera. If the first camera is not the camera with the largest focal length range, based on the third intermediate zoom ratio and the difference between the center points of the field of view of the first camera and the second camera, the first full field of view image captured by the target camera is subjected to offset cropping preprocessing and target offset cropping to obtain the corresponding third intermediate preview image; the center of the field of view of the third intermediate preview image gradually approaches the center of the field of view of the non-target camera.
8. The method according to any one of claims 1-7, characterized in that, The second zoom level corresponds to the first camera; The second preview image is obtained by performing offset cropping preprocessing and target offset cropping on the first full field-of-view image captured by the target camera based on the second zoom magnification and the difference between the center points of the field of view of the first camera and the second camera. The offset of the target offset cropping is determined by image alignment of the first full field of view image and the second full field of view image captured by the non-target camera; the field of view centers of the at least one intermediate preview image and the second preview image gradually approach the field of view center of the target camera.
9. The method according to any one of claims 1-3, characterized in that, The method further includes: The first full-field-of-view image is downsampled to obtain a first downsampled image, and the second full-field-of-view image is downsampled to obtain a second downsampled image; Image alignment is performed on the first downsampled image and the second downsampled image to determine the first offset; For each of the intermediate zoom ratios, a first cropped image corresponding to the offset cropping preprocessing is obtained from the first full field of view image based on the first offset; wherein, the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom ratio by a preset ratio; the offset corresponding to the first cropped image is smaller than the first offset; and the center of the field of view of the first cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the first cropped image cropped earlier. The first cropped image and the second full-field-of-view image are aligned to determine the second offset; A second cropped image corresponding to the target offset cropping is obtained by cropping from the first cropped image based on the second offset, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field of view of the second cropped image is equal to the field of view of the corresponding intermediate zoom ratio; the offset of the second cropped image is less than the second offset; and the center of the field of view of the second cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image cropped earlier.
10. The method according to any one of claims 1-3, characterized in that, The method further includes: The first offset is determined based on the shooting distance and preset camera calibration data; wherein, the camera calibration data includes the difference between the center points of the field of view of the first camera and the second camera; For each of the intermediate zoom ratios, a first cropped image corresponding to the offset cropping preprocessing is obtained from the first full field of view image based on the first offset; wherein, the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom ratio by a preset ratio; the offset corresponding to the first cropped image is smaller than the first offset; and the center of the field of view of the first cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the first cropped image cropped earlier. The first cropped image and the second full-field-of-view image are aligned to determine the second offset; A second cropped image corresponding to the target offset cropping is obtained by cropping from the first cropped image based on the second offset, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field of view of the second cropped image is equal to the field of view of the corresponding intermediate zoom ratio; the offset of the second cropped image is less than the second offset; and the center of the field of view of the second cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image cropped earlier.
11. The method according to any one of claims 1-3, characterized in that, The method further includes: A first offset and a comparison offset are determined; wherein the first offset is obtained by image alignment of the downsampled first full-field-of-view image and the second full-field-of-view image; the comparison offset is determined based on the shooting object distance and preset camera calibration data; When the difference between the first offset and the comparison offset is less than or equal to a difference threshold, for each intermediate zoom magnification, a first cropped image corresponding to the offset cropping preprocessing is obtained from the first full field of view image based on the first offset; wherein, the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom magnification by a preset ratio; the offset corresponding to the first cropped image is less than the first offset; and the center of the field of view of the first cropped image after cropping is closer to the center of the field of view of the non-target camera than the center of the field of view of the first cropped image after cropping. The first cropped image and the second full-field-of-view image are aligned to determine the second offset; A second cropped image corresponding to the target offset cropping is obtained by cropping from the first cropped image based on the second offset, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field of view of the second cropped image is equal to the field of view of the corresponding intermediate zoom ratio; the offset of the second cropped image is less than the second offset; and the center of the field of view of the second cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image cropped earlier.
12. The method according to claim 11, characterized in that, The method further includes: When the difference between the first offset and the comparison offset is greater than the difference threshold, first cropped images corresponding to each intermediate zoom ratio are cropped from the first full field of view image; wherein, the field of view size of the first cropped image is larger than the field of view size corresponding to the corresponding intermediate zoom ratio by a preset ratio; and the center of the field of view of the first cropped image coincides with the center of the field of view of the first full field of view image. The first cropped image and the second full-field-of-view image are aligned to determine the second offset; A second cropped image corresponding to the target offset cropping is obtained by cropping from the first cropped image based on the second offset, and a corresponding intermediate preview image is obtained based on the second cropped image; wherein, the field of view of the second cropped image is equal to the field of view of the corresponding intermediate zoom ratio; the offset of the second cropped image is less than the second offset; and the center of the field of view of the second cropped image cropped later is closer to the center of the field of view of the non-target camera than the center of the field of view of the second cropped image cropped earlier.
13. An electronic device, characterized in that, include: At least two cameras, one or more processors and memory, wherein the cameras and the memory are respectively coupled to the processor; The camera is used to capture images; the memory stores one or more computer program codes, the computer program codes including computer instructions; when the processor executes the computer instructions, the electronic device performs the shooting method as described in any one of claims 1-12.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor of the electronic device, the electronic device performs the shooting method as described in any one of claims 1-12.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor in an electronic device, the electronic device performs the shooting method as described in any one of claims 1-12.