An image display method, an electronic device, and a computer-readable storage medium

By determining the offset before camera switching in the electronic device and cropping the image, the problem of target object position jump caused by camera switching is solved, improving the user experience and achieving a smooth image transition effect.

CN120282017BActive Publication Date: 2026-01-30HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311871342.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2026-01-30
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

When multiple cameras are installed on electronic devices, the physical distance between the cameras causes the position of the target object in the image to change during switching, which affects the user experience.

Method used

By determining the offset before camera switching, the image is cropped based on feature point matching or mapping relationships to ensure a smooth transition of the target object's position at different magnifications.

Benefits of technology

It effectively avoids the phenomenon of target object position jump when switching cameras, improves user experience, and the processing is simple and has good real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120282017B_ABST
    Figure CN120282017B_ABST
Patent Text Reader

Abstract

This application discloses an image display method, electronic device, and computer-readable storage medium, relating to the field of terminal technology, which avoids the phenomenon of the position of the photographed object changing in the preview image presented to the user before and after switching cameras, thus ensuring a good user experience. This solution can be applied to electronic devices that include at least a first camera and a second camera. Specifically, the solution can be: receiving an operation from the user to adjust the magnification from a first magnification to a second magnification; responding to the operation, displaying a first preview image captured by the first camera, wherein the first preview image is obtained by cropping the image captured by the first camera at the second magnification based on a first offset, the first offset being related to a second offset and the magnification adjustment amount, and the second offset being the offset between the target object in the first image and the target object in the second image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multi-camera technology, and in particular to an image display method, electronic device, and computer-readable storage medium. Background Technology

[0002] In pursuit of better shooting results, installing multiple cameras on electronic devices has become a rapidly growing trend. By using multiple cameras, such as main cameras, wide-angle cameras, and telephoto cameras, more shooting methods are provided, resulting in different images for users to choose from. However, because multiple cameras are arranged in a staggered manner on electronic devices, there is a physical distance between the cameras. When switching between different cameras, the different camera positions can cause objects in the captured images to appear disjointed. For example, the same object in the same scene may show a significant shift in position in the images captured by different cameras before and after switching cameras. Summary of the Invention

[0003] Based on this, this application provides an image display method, an electronic device, and a computer-readable storage medium, which avoids the phenomenon of the position of the photographed object changing in the preview image presented to the user before and after switching cameras, thus ensuring the user's experience.

[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0005] In a first aspect, this application provides an image display method applied to an electronic device including at least a first camera and a second camera. In this method, the electronic device receives an operation from a user to adjust a first magnification to a second magnification. In response to this operation, the electronic device can display a first preview image captured by the first camera. The first preview image is obtained by cropping an image captured by the first camera at the second magnification based on a first offset; the first offset is related to a second offset and a magnification adjustment amount, and the second offset is the offset between a target object in the first image and the target object in the second image; the first image is an image captured by the first camera at the first switched magnification, and the second image is an image captured by the second camera at the second switched magnification.

[0006] For example, upon receiving a user's adjustment of the magnification from the first magnification to the second magnification, a corresponding first offset can be determined, and the image captured by the first camera at the second magnification can be cropped based on the first offset to obtain and display the cropped first preview image.

[0007] For example, the first camera described above may include a wide-angle camera and / or a telephoto camera of the electronic device; the second camera is the main camera of the electronic device.

[0008] The first magnification can be the magnification displayed to the user's preview interface after the electronic device receives the user's camera activation command; this is the default magnification. Alternatively, it can be the magnification adjusted by the user last time.

[0009] After receiving the user's command to adjust the magnification from the first to the second, the electronic device can obtain the first offset corresponding to the adjustment. Then, based on the first adjustment, the image is cropped to obtain the first preview image. This avoids the phenomenon of the subject's position changing in the preview image presented to the user before and after switching cameras due to the physical distance of the camera, thus ensuring a better user experience.

[0010] In one possible implementation of the first aspect, the first offset can be determined through the following process: First, determine the first image corresponding to the first switching magnification of the first camera, and then determine the position of the target object in the first image. Next, determine the second image corresponding to the second switching magnification of the second camera, and then determine the position of the target object in the second image. A second offset is determined based on the offset between the positions. After determining the second offset, the offset corresponding to the adjustment of the first magnification to the second magnification, i.e., the first offset, is determined based on the second offset.

[0011] The second offset in the above method can be determined based on feature point matching / tracking. Specifically, pixel values ​​are determined by feature point matching / tracking of the target object in the first and second images. The difference between these pixel values ​​is then used to determine the second offset. By determining the positional deviation of the same target object in the first and second images through feature point tracking and matching, the positional deviation of the target object in the images captured by different cameras due to the physical distance caused by the camera arrangement is determined—this is the second offset, and the calculation is simple. Next, the first offset after adjusting the zoom level from the first to the second is determined based on the second offset difference. Cropping the currently displayed image using the first offset ensures that the position of the target object in the displayed image does not change significantly when the user adjusts the zoom level.

[0012] In one possible implementation of the first aspect, before determining the second offset, the size of the first image and the size of the second image can be unified to the same size; then, the first offset is determined based on the position of the target object in the first image and the position of the target object in the second image after unifying the size.

[0013] In one possible implementation of the first aspect, after determining the second offset, the first offset can be determined based on the second offset, the first scaling factor, and the second scaling factor. In this embodiment, the proportion of the current scaling factor adjustment (from the first scaling factor to the second scaling factor) to the total adjustment from the first switching scaling factor to the second switching scaling factor is obtained. If this scaling factor adjustment is the first adjustment, the first offset is determined based on the proportion and the second offset. If this scaling factor adjustment is not the first adjustment, the first offset is determined based on the remaining offset between the proportion and the second offset. By determining the first offset corresponding to the current scaling factor adjustment using the above method, and utilizing a simple linear calculation relationship, the calculation is convenient and has good real-time performance.

[0014] Secondly, this application provides an image display method applied to an electronic device including multiple cameras, wherein the multiple cameras include a first camera. In this method, the electronic device receives an operation from a user to adjust a first magnification to a second magnification, and in response to this operation, displays a first preview image captured by the first camera. This first preview image can be obtained by cropping an image captured by the first camera at the second magnification based on a first offset.

[0015] For example, after receiving the user's operation, a first offset can be determined based on the adjusted second magnification and mapping relationship, and then a first preview image can be obtained by cropping the image captured by the first camera at the second magnification based on the first offset, and the first preview image can be sent for display.

[0016] For example, the second camera may be the main camera of the electronic device; the first camera may include a wide-angle camera and / or a telephoto camera of the electronic device.

[0017] The above method establishes a mapping relationship between different magnifications and offsets. When the user adjusts the magnification from the first to the second, the first offset is determined based on the second magnification and the mapping relationship. The original image is then cropped based on the first offset to obtain the first preview image, which is then displayed. By obtaining the offset corresponding to the current magnification adjustment through the established mapping relationship and cropping the image based on this offset before displaying, the problem of the target object's position changing in the image due to the physical distance between cameras during camera switching is solved. This ensures a smooth transition when switching cameras and improves the user experience.

[0018] In one possible implementation of the second aspect, the plurality of cameras may further include a second camera. The mapping relationship can be determined based on the second switching magnification and the second offset of the second camera.

[0019] For example, the above mapping relationship can be obtained by fitting a function curve using an inverse proportional function based on the second switching magnification and the second offset of the second camera. Here, the second offset is the offset between the target object in the first image and the target object in the second image; the first image is the image captured by the first camera at the first switching magnification, and the second image is the image captured by the second camera at the second switching magnification.

[0020] In other words, by using an inverse proportional function to fit the second switching magnification and the second offset of the second camera, a smooth inverse proportional function curve, i.e., a mapping relationship, is obtained. In determining this mapping relationship, the second offset corresponding to the second switching magnification of the second camera is a known parameter of the camera and can be directly obtained without requiring additional data collection, thus reducing processing costs.

[0021] Thirdly, this application provides an image display device that has the function of implementing the electronic device behavior described in the methods of the first and second aspects above. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, such as a receiving unit or module, a control unit or module, and a display unit or module.

[0022] Fourthly, an electronic device is provided, comprising: a memory, a first camera, a second camera, and one or more processors; the memory, the first camera, and the second camera are coupled to the processors;

[0023] The memory is used to store computer program code, which includes computer instructions; when the computer instructions are executed by the processor, the electronic device performs the image display method as described in the first aspect, the second aspect, and any implementation thereof.

[0024] Fifthly, a computer-readable storage medium is provided, comprising a computer program that, when run on an electronic device, enables the electronic device to perform an image display method as described in the first aspect, the second aspect, and any implementation thereof.

[0025] In a sixth aspect, a computer program product containing instructions is provided, which, when run on an electronic device, enables the electronic device to execute the image display method described in the first aspect and any implementation thereof.

[0026] In a seventh aspect, embodiments of this application provide a chip system including a processor, which is configured to invoke a computer program in memory to execute an image display method as described in any implementation of the first or second aspect.

[0027] It is understood that the beneficial effects achievable by the apparatus described in the third aspect, the electronic device described in the fourth aspect, the computer-readable storage medium described in the fifth aspect, the computer program product described in the sixth aspect, and the chip system described in the seventh aspect can be referred to the beneficial effects in the first aspect, the second aspect, and any possible implementation thereof, and will not be repeated here. Attached Figure Description

[0028] Figure 1 A schematic diagram of an image display method provided for related technologies;

[0029] Figure 2 A schematic diagram of a misaligned arrangement of cameras provided for related technologies;

[0030] Figure 3 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0031] Figure 4 This application provides a schematic flowchart of an image display method. Figure 1 ;

[0032] Figure 5 This application provides a schematic diagram of a method for determining a mapping relationship.

[0033] Figure 6 This application provides an illustration of an image mapping relationship. Figure 1 ;

[0034] Figure 7 This application provides a schematic flowchart of an image display method. Figure 2 ;

[0035] Figure 8 This application provides an illustration of an image mapping relationship. Figure 2 ;

[0036] Figure 9 This application provides another schematic flowchart of an image display method. Figure 1 ;

[0037] Figure 10 This application provides a schematic diagram of image size alignment as an embodiment.

[0038] Figure 11 This application provides an illustration of an image display method. Figure 1 ;

[0039] Figure 12 This application provides another schematic flowchart of an image display method. Figure 2 ;

[0040] Figure 13 This application provides an illustration of an image display method. Figure 2 ;

[0041] Figure 14 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation

[0042] In the description of this application, unless otherwise stated, "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural.

[0043] In the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0044] To facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0045] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.

[0046] First, some terms used in the embodiments of this application will be explained to facilitate understanding by those skilled in the art.

[0047] 1. Refractive power: Refractive power refers to the degree to which light deviates from its straight path when entering another substance. A strong refractive power results in a large deviation from the straight path, meaning the light rays bend significantly after passing through a convex lens.

[0048] 2. Focal length: The focal length indicates the refractive power of light; the shorter the focal length, the greater the refractive power. The focal length of the optical lens in a camera determines the size of the image of the subject captured by that lens on the imaging plane. Assuming the same subject is photographed from the same distance, the longer the focal length of the optical lens, the greater the magnification of the image of the subject on the imaging plane, such as the photosensitive element.

[0049] 3. Original Field of View (FOV), also known as FOV, indicates the maximum angular range that a camera can capture, or the maximum field of view it can capture. Simply put, the angle formed by the limit of the range that the camera can see is called the original FOV. If the subject is within the camera's original FOV, it will be captured by the camera. If the subject is outside the camera's original FOV, it will not be captured by the camera. Different types of cameras have different original FOVs. For example, the original FOV of a wide-angle camera is generally 118°, that of a short-focus camera is generally 84°, and that of a telephoto camera is generally 26.8°. The original FOV of the same type of camera produced by different manufacturers may also differ; for example, a wide-angle camera from manufacturer 1 may have an original FOV of 118°, while a wide-angle camera from manufacturer 2 may have an original FOV of 115°.

[0050] 4. Zoom ratio, also known as magnification, zoom scale, or magnification, is a parameter in the optical lens of a camera. It refers to the ratio of the image size of an object projected onto an imaging plane (such as a photosensitive element) through the lens to the actual size of the object. By adjusting the zoom ratio of the optical lens, different fields of view can be displayed. The zoom ratio is related to the required field of view. For simplicity, in this application, the required field of view is referred to as the display FOV (or real-time display FOV). For example, the zoom ratio is inversely proportional to the display FOV. Since different cameras have different original FOVs (i.e., different maximum fields of view that can be captured), when the original FOV of a camera cannot meet the display FOV requirements, the electronic device can switch cameras to capture an image that meets the display FOV requirements and present it to the user.

[0051] 5. Switching magnification (SMM) indicates the default magnification for different cameras. Different types of cameras have different switching magnifications. For example, a wide-angle camera has a switching magnification of 0.5X. A short-focal-length camera has a switching magnification of 1X. A telephoto camera has a switching magnification of 2.5X. The switching magnification corresponds to the camera's original FOV. For example, a 0.5X switching magnification for a wide-angle camera corresponds to an original FOV of 118°. Switching magnifications for the same type of camera produced by different manufacturers may also differ. It should be noted that the above-mentioned switching magnification is merely an exemplary command for the default magnification of a camera, and the naming of the default magnification in this application embodiment is not limited to this.

[0052] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0053] With the evolution of business applications on electronic devices, installing multiple cameras has become a trend. Examples include dual-camera and triple-camera electronic devices. Taking a three-camera electronic device as an example, the three cameras can include a short-focal-length camera (or main camera), a wide-angle camera, and a telephoto camera. By switching between these multiple cameras, different fields of view are presented for the user to choose from. Users can operate corresponding controls on the preview interface of the electronic device, such as controls for adjusting the zoom level, to achieve the purpose of presenting different fields of view. It is understandable that different cameras have different original FOVs (fields of view), i.e., different maximum fields of view for shooting. A higher zoom level results in a smaller FOV. Therefore, the electronic device can select the appropriate camera for shooting based on the zoom level.

[0054] For example, such as Figure 1 As shown, a mobile phone is used as an example of an electronic device. When a user wants to take a photo or record a video using the camera, the user can open the phone's camera app. For example, the user can tap the camera app icon on the electronic device's home screen. In response, the phone can open its camera and display something like... Figure 1 The preview interface 11 shown in (a) is shown in the image. This preview interface 11 includes a preview image of the current scene. Additionally, this preview interface 11 includes controls for adjusting the zoom level, such as... Figure 1Control 12 is shown in (a) above. Users can adjust the zoom level by operating control 12. The phone determines the field of view (FOV) based on the zoom level, thus displaying different areas of the current scene. It is understandable that different FOVs result in different preview images displayed on the preview interface, specifically different image sizes of the subject in the current scene. A larger zoom level results in a larger image size of the subject. For example... Figure 1 As shown in (b), the user performs a sliding operation at control 12 (adjusting the zoom level from 1X to 1.5X). In response, the phone can acquire and display the corresponding field of view (FOV) based on the adjusted zoom level of 1.5X. The displayed interface can be as follows: Figure 1 The preview interface 13 is shown in (b) of the image.

[0055] Because the zoom level input by the user varies, the field of view (FOV) of the electronic device will differ. Different cameras also have different native FOVs. For example, a wide-angle camera has a native FOV of 118°, meaning it can capture a scene within a maximum 118° field of view. A main camera has a native FOV of 84°, meaning it can capture a scene within a maximum 84° field of view. Therefore, if a camera's native FOV cannot meet the required FOV based on the user's zoom level, the phone will switch cameras to capture the desired field of view.

[0056] However, switching cameras can cause visual changes in the displayed object due to the misalignment of different cameras on the electronic device. For example, combining... Figure 2 As shown, the staggered arrangement of multiple cameras results in physical distances between different cameras, such as... Figure 2 As shown in (a), there is a physical distance between camera 1 and camera 2, such as a physical distance x in the horizontal direction and a physical distance y in the vertical direction. This causes the position of the target object in the displayed image to change during camera switching, for example, as... Figure 2 As shown in (b), the target object changes from position 1 corresponding to the 0.6X image to position 2 corresponding to the 1X image. There is a positional deviation of Tx in the horizontal direction and a positional deviation of Ty in the vertical direction. That is, the target object in the screen presented to the user will exhibit a jump phenomenon.

[0057] To avoid the problem of target object position changes in images due to the physical distance between cameras, one related technology determines the switching magnification primarily based on the camera's focal length and image scale when the user input magnification is within the switching magnification range. This ensures that when the user input magnification reaches the switching magnification, the processed first and second images have the same scale and field of view, achieving target alignment. However, while this technology ensures target alignment before and after switching, the target object's position can still change abruptly during the switching process, giving the user a sense of jarring shifts.

[0058] In another related technology, the zoom parameters are determined based on the user's input magnification and the camera's switching magnification. These parameters are then adjusted using stereo correction to obtain the final image, which is then displayed. However, stereo correction is more suitable for inter-planar correction and is less effective for images with depth. Furthermore, stereo correction involves complex image calculations and correction logic, resulting in poor real-time performance.

[0059] To address the aforementioned issues, this application provides an image display method. After receiving a user's zoom adjustment command, the electronic device determines the corresponding offset at different zoom levels to adjust the position of the target object in the image. Specifically, it determines a first offset at different zoom levels, and then crops the acquired image based on this first offset to obtain a preview image, which is then displayed. This method avoids the problem of target object position changes in the image due to the physical distance between cameras, and features a simple processing procedure, good results, and good real-time performance.

[0060] For example, mobile phone 300 is used as an example of the aforementioned electronic device. Figure 3 A structural schematic diagram of mobile phone 300 is shown. (For example...) Figure 3 As shown, the mobile phone 300 may include a processor 310, an external memory interface 320, an internal memory 321, a charging management module 330, a power management module 340, a battery 341, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a sensor module 380, buttons 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc.

[0061] It is understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the mobile phone 300. In other embodiments of this application, the mobile phone 300 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.

[0062] Processor 310 may include one or more processing units, such as application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.

[0063] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0064] The processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store instructions or data that the processor 310 has just used or is using repeatedly. If the processor 310 needs to use the instruction or data again, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system. In this embodiment, the processor 310 can be used to determine the offset corresponding to the scaling factor 2 when the mobile phone 300 receives an operation from the user to adjust the scaling factor 1 to the scaling factor 2, so that the camera can capture images based on the offset, ensuring that the position of the target object changes with the scaling factor adjustment when switching between different cameras, thereby avoiding the visual jump of the target object's position in the displayed image.

[0065] In some embodiments, the processor 310 may include one or more interfaces. The interfaces may include a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0066] The USB port 311 is a USB standard compliant interface, which can be a Mini USB port, Micro USB port, USB Type-C port, etc. The USB port 311 can be used to connect a charger to charge the mobile phone 300, and can also be used for data transfer between the mobile phone 300 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0067] The charging management module 330 receives charging input from a charger, which can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 330 receives charging input from the wired charger via a USB interface 311. In some wireless charging embodiments, the charging management module 330 receives wireless charging input via the wireless charging coil of the mobile phone 300. While charging the battery 341, the charging management module 330 can also supply power to the mobile phone 300 via the power management module 340. The power management module 340 connects the battery 341, the charging management module 330, and the processor 310. The power management module 340 receives input from the battery 341 and / or the charging management module 330 to supply power to the processor 310, internal memory 321, display screen 394, and wireless communication module 360, etc. The power management module 340 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In other embodiments, the power management module 340 can also be located within the processor 310. In other embodiments, the power management module 340 and the charging management module 330 may also be housed in the same device.

[0068] The wireless communication function of mobile phone 300 can be realized through antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, modem processor and baseband processor.

[0069] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 300 can be used to cover one or more communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0070] The mobile communication module 350 can provide wireless communication solutions for mobile phone 300, including 2G / 3G / 4G / 5G. The mobile communication module 350 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves via antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The wireless communication module 360 ​​can provide wireless communication solutions for mobile phone 300, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), and other wireless communication technologies.

[0071] In some embodiments, the antenna 1 of the mobile phone 300 is coupled to the mobile communication module 350, and the antenna 2 is coupled to the wireless communication module 360, enabling the mobile phone 300 to communicate with the network and other devices through wireless communication technology.

[0072] The mobile phone 300 can achieve shooting functions through ISP, camera 393, video codec, GPU, display 394 and application processor.

[0073] A GPU is a microprocessor for image processing, connected to the display screen 394 and the application processor. The GPU performs mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0074] Display screen 394 is used to display images, videos, etc. Display screen 394 includes a display panel. For example, display screen 394 can be a touchscreen. In some embodiments of this application, after the user opens the camera application, display screen 394 can be used to display a preview interface of the field of view (FOV) corresponding to different magnifications in the coordinate system of the second camera. The user can select a first magnification on the preview interface.

[0075] Camera 393 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element 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 an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the mobile phone may include N cameras 393, where N is a positive integer greater than 1. In some embodiments of this application, these N cameras 393 may include a first camera and a second camera. After receiving an operation from the user to open the camera application, the mobile phone can control the camera 393 to turn on. After the camera 393 is turned on, it can be used to capture a preview image and present it to the user through the display screen 394. If the camera currently capturing the preview image is the first camera, and the user's operation to adjust the zoom level from 1 to 2 is received, then in response, the first camera can capture the preview image based on the offset corresponding to the zoom level adjustment from 1 to 2, and present it to the user through the display screen 394.

[0076] The external storage interface 320 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the mobile phone 300.

[0077] Internal memory 321 can be used to store computer executable program code, which includes instructions. Internal memory 321 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of mobile phone 300 (such as audio data, phonebook, etc.). Furthermore, internal memory 321 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 310 executes various functions of mobile phone 300 and data processing by running instructions stored in internal memory 321 and / or instructions stored in memory located in processor 310.

[0078] The audio module 370 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. The audio module 370 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 370 may be located in the processor 310, or some functional modules of the audio module 370 may be located in the processor 310.

[0079] The sensor module 380 may include a pressure sensor 380A, a fingerprint sensor 380B, a temperature sensor 380C, a touch sensor 380D, etc.

[0080] Keypad 390 includes a power button, volume buttons, etc. Keypad 390 can be a mechanical keypad or a touch-sensitive keypad. Mobile phone 300 can receive keypad input and generate key signal inputs related to user settings and function control of mobile phone 300.

[0081] Motor 391 can generate vibration alerts. Motor 391 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 392 can be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc. SIM card interface 395 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 395 to achieve contact and separation with the mobile phone 300.

[0082] Since adjusting the zoom level may cause camera switching, to avoid screen jumps during camera switching, in some embodiments, after receiving a user's zoom level adjustment operation, the electronic device can determine the mapping ratio corresponding to the adjusted zoom level through a mapping ratio mechanism. Based on the corresponding field of view (FOV) of display, the image captured by the camera is then cropped to obtain a preview image for display. In other embodiments, after receiving a user's zoom level adjustment operation, the electronic device can determine the corresponding FOV of display through a mapping ratio mechanism. Based on the corresponding FOV of display, the image captured by the camera is then cropped to obtain a preview image for display. This zoom level mapping mechanism can unify the FOV of display for different cameras near the switching point, thus avoiding screen jumps near the switching point. The following is combined with... Figure 4 The illustrated embodiments and Figure 7 The illustrated embodiments provide a detailed description of the two solutions described above.

[0083] like Figure 4 As shown, Figure 4 This application provides a schematic flowchart of an image display method. Figure 1 The method may include: S401-S403.

[0084] S401. Display the preview image captured by the first camera.

[0085] S402. Receive the user's operation to adjust the scaling factor from 1 to 2.

[0086] Electronic devices are equipped with multiple cameras for user use. For example, an electronic device may include a main camera, a wide-angle camera, and a telephoto camera. The first camera can be either a wide-angle camera or a telephoto camera.

[0087] In this scenario, the electronic device allows the user to use a camera app or similar application to capture the current scene. For example, consider capturing a scene using a camera app. The electronic device receives a user's request to open the camera app. In response, the electronic device can activate the camera and display a preview interface, which includes a preview image captured by the camera. For instance, taking the currently activated camera as the first camera, such as a wide-angle camera, the preview interface can include the preview image captured by the wide-angle camera when the wide-angle camera is activated.

[0088] Generally, when a camera is turned on, the displayed FOV defaults to the camera's original FOV, meaning the zoom level is the switching magnification corresponding to that original FOV. For example, taking a wide-angle camera with a switching magnification of 0.5X and an original FOV of 118°, after the wide-angle camera is turned on, it can capture the field of view corresponding to the original FOV, obtaining an image, which is called the original image. Then, the electronic device can obtain a preview image based on the displayed FOV, which is also 118°, and display it on the screen. Since the displayed FOV is the same as the original FOV, it can be assumed that the electronic device directly displays this original image as the preview image.

[0089] The preview interface can also include controls for adjusting the zoom level, allowing users to adjust the field of view of the image they want to display. For example, users can adjust the zoom level according to their shooting needs, such as changing the zoom level from zoom level 1 (e.g., 0.5X) to zoom level 2 (e.g., 0.8X), and the electronic device can receive the user's zoom level adjustment.

[0090] Wherein, the aforementioned scaling factor 2 can be the first scaling factor in this application embodiment. The operation in S402 can be the selection operation in this application embodiment.

[0091] S403. In response to the operation in S402, display the preview image captured by the first camera at the mapping magnification, wherein the mapping magnification and the scaling magnification 2 satisfy a mapping relationship, which is used to indicate the relationship between different magnifications from the coordinate system of the first camera to the reference coordinate system.

[0092] The second camera can be the aforementioned main camera. The aforementioned magnification can be the second magnification in this embodiment, and the preview image in S403 is the first preview image in this embodiment.

[0093] For example, after receiving a user's operation to adjust the zoom level from 1 to 2, the electronic device can respond to this operation by displaying a preview image captured by the first camera at the zoom level obtained through the mapping zoom mechanism. This mapping zoom level (or Map zoom level) is determined based on the aforementioned zoom level 2.

[0094] In some examples, continuing with the example in S402, let's take the first camera as a wide-angle camera, with zoom level 1 at 0.5X and zoom level 2 at 0.8X. After receiving the user's operation to adjust the zoom level from 0.5X to 0.8X, the electronic device, in response, can determine the mapping zoom level corresponding to 0.8X through a mapping zoom level mechanism. For example, the electronic device can obtain the mapping zoom level corresponding to 0.8X based on a pre-acquired mapping relationship. For instance, the determined mapping zoom level might be 0.72X. Next, the electronic device can display the preview image captured by the wide-angle camera at a mapping zoom level of 0.72X. That is, the electronic device can acquire the image of the field of view corresponding to 0.72X, i.e., obtain and display the preview image. Alternatively, the electronic device can determine the corresponding display FOV based on the mapping zoom level, and then crop the original image captured by the wide-angle camera based on the display FOV to obtain and display the preview image.

[0095] As described in the preceding embodiments, the jump in the preview image when switching cameras is due to inconsistencies in the displayed FOV near the switching point. This inconsistency in the displayed FOV near the switching point is because different cameras have different original FOVs, meaning the correspondence between the displayed FOV and the scaling factor differs for different cameras. This correspondence between the displayed FOV and the scaling factor can be considered as different coordinate systems for different cameras. In this embodiment, through the aforementioned scaling factor mapping mechanism, the scaling factors under different cameras can be mapped to a unified coordinate system, such as a unified reference coordinate system, to achieve a roughly uniform correspondence between the displayed FOV and the scaling factor for different cameras. In this application embodiment, the mapping relationship from the coordinate system of the first camera to the reference coordinate system for different scaling factors can be predetermined and configured in the electronic device. This ensures that the displayed FOV near the switching point does not jump, thus preventing jumps in the preview image.

[0096] The reference coordinate system can be the coordinate system of any one of the multiple cameras included in the electronic device, such as the coordinate system of a wide-angle camera, a telephoto camera, or the main camera. The reference coordinate system can also be a coordinate system distinct from the coordinate systems of the multiple cameras included in the electronic device; no specific limitation is made here.

[0097] The following explanation will continue using the first camera as the wide-angle camera and the reference coordinate system as the coordinate system of the second camera, with the second camera being the main camera, to illustrate the above-mentioned mapping magnification mechanism, i.e., the process of determining the mapping relationship.

[0098] First, the switching magnification of the wide-angle camera is mapped to the coordinate system of the main camera to obtain the mapped switching magnification.

[0099] First, the mapping ratio can be determined. This mapping ratio indicates the proportional relationship between the first FOV and the second FOV in the second camera coordinate system. The first FOV is the FOV corresponding to the switching magnification of the first camera, which is the original FOV of the first camera. The second FOV is the FOV corresponding to the switching magnification of the second camera, which is the original FOV of the second camera.

[0100] For example, in combination Figure 5 The mapping ratio can be determined by the imaging width under the first FOV and the imaging width under the second FOV. For example, it can be determined by... Figure 5 C1 and C2 are shown.

[0101] like, .

[0102] Generally, the original FOV of a camera is related to the image width of the camera within that original FOV and the focal length of the camera. For example, image width / focal length = tan(original FOV).

[0103] In this way, the original FOV (i.e., the first FOV) of the first camera, the imaging width of the camera under that original FOV, and the focal length of the first camera can be obtained. The relationship is: .

[0104] The original FOV (i.e., the second FOV) of the second camera, the imaging width of the camera at that original FOV, and the focal length of the second camera ( The relationship is:

[0105] Therefore, by replacing the focal length of the first camera in the above relationship with the focal length of the camera to be mapped, i.e., the focal length of the second camera, the magnification corresponding to the first camera can be mapped from the coordinate system of the first camera to the coordinate system of the second camera.

[0106] The replaced relationship is as follows: .

[0107] Based on the above:

[0108] The mapping ratio can be determined using the following formula (1):

[0109] = Formula (1)

[0110] Where α1 is the first FOV and α2 is the second FOV. Continuing with the example above, taking the first camera as a wide-angle camera and the second camera as the main camera, α1 is 118° and α2 is 84°, thus determining the mapping ratio = 5.5.

[0111] Then, the mapping switching ratio can be determined based on the determined mapping ratio and the switching ratio of the main camera.

[0112] For example, the mapping switching ratio can be determined by the following formula (2):

[0113] Formula (2)

[0114] That is, the Map switch magnification = 5.5 * the main camera's switching magnification. Wherein, if the main camera's switching magnification is 1X, then according to the above formula, the Map switch magnification = 5.5 * 1 = 5.5.

[0115] Then, the above mapping relationship can be determined based on the determined mapping switching magnification and the switching magnification of the wide-angle camera.

[0116] For example, the above mapping relationship can be represented by the following formula (3):

[0117] Map zoom = F * zoom formula (3)

[0118] Where F is related to the mapping switching magnification and the switching magnification of the wide-angle camera, Map zoom is the mapping magnification, and zoom is the zoom magnification currently selected by the user. For example, if the user adjusts the zoom magnification from zoom magnification 1 to zoom magnification 2, then zoom here is zoom magnification 2. In one example, taking zoom magnification 2 as 0.8X, 0.8X is input into the above formula (3) to obtain the corresponding mapping magnification, such as a mapping magnification of 0.72X.

[0119] After establishing the mapping relationship using the above method, it can be ensured that the displayed FOV remains consistent near the switching point during camera switching, resulting in a smooth change in the image presented to the user. That is, the change in displayed FOV caused by adjusting the zoom level is continuous, such as... Figure 6 As shown, this ensures that the display FOV near the switching point is aligned.

[0120] After obtaining the magnification, the electronic device can display the preview image captured by the first camera, such as a wide-angle camera, at that magnification (e.g., 0.72 X). In other words, the electronic device can acquire the image of the field of view corresponding to 0.72X, thus obtaining and displaying the preview image.

[0121] In this process, the electronic device can first determine the FOV corresponding to the mapping ratio. The FOV corresponding to the mapping ratio is the FOV for display at this time.

[0122] Based on the principle of determining the mapping switching ratio, we know that:

[0123] Mapping magnification = Mapping ratio * Switching magnification of the second camera. The mapping ratio = tanθ / tanα², where X is the FOV corresponding to the mapping magnification, and α² is the original FOV of the second camera.

[0124] So, ,but,

[0125] Formula (4).

[0126] Continuing with the previous example, taking the second camera's switching magnification as 1X and α2 as 84°, then according to the above formula (4), X is 110°. That is, when the user inputs a scaling factor of 0.8X, the actual FOV sent after processing by the electronic device is 110°. Similarly, if the user inputs a scaling factor of 0.95X, then the actual FOV sent after processing by the electronic device is 86°. It can be understood that the FOV sent near the 1X switching point is close to the FOV sent after switching the camera (main camera), such as 84°.

[0127] After determining the FOV corresponding to the mapping magnification, i.e., determining the current display FOV, the electronic device can crop the image captured by the first camera based on the display FOV. For example, the electronic device can crop the image (referred to as the original image) captured by the first camera at the original FOV based on the display FOV. The cropped image, i.e., the preview image, can then be displayed to the user.

[0128] It should be noted that the mapping relationships obtained in the above embodiments can be understood as mapping relationships corresponding to the first camera, used to implement the mapping of scaling factor during shooting with the first camera. For example, if the first camera is a wide-angle camera, the mapping relationship corresponding to the wide-angle camera can be obtained to implement the mapping of scaling factor during shooting with the wide-angle camera. It can be understood that if the first camera includes multiple cameras, the mapping relationship corresponding to each of these multiple cameras can be obtained separately to implement the mapping of scaling factor when shooting with the corresponding camera. For example, if the first camera includes a wide-angle camera and a telephoto camera, the mapping relationship corresponding to the wide-angle camera can be obtained. Thus, if a user's operation to adjust the scaling factor is received during shooting with the wide-angle camera, the scaling factor can be mapped based on this mapping relationship. Similarly, the mapping relationship corresponding to the telephoto camera can be obtained. Thus, if a user's operation to adjust the scaling factor is received during shooting with the telephoto camera, the scaling factor can be mapped based on this mapping relationship.

[0129] Furthermore, the above embodiments are illustrated using the second camera's coordinate system as the reference coordinate system. Therefore, when using this second camera for shooting, if a user's operation to adjust the zoom level is received, there is no need to perform zoom mapping as described above. Instead, the captured image is directly cropped and displayed based on the FOV corresponding to the adjusted zoom level. In other embodiments, if the reference coordinate system is different from the first camera's coordinate system and the second camera's coordinate system as described in the above embodiments, then in addition to determining the mapping relationship corresponding to the second camera to implement the zoom level mapping when shooting with the second camera, it is also necessary to determine the mapping relationship corresponding to the first camera to implement the zoom level mapping when shooting with the first camera. The specific process of determining the mapping relationship and implementing the zoom level mapping can be found in the description of the above embodiments, and will not be elaborated upon here.

[0130] This technical solution maps the scaling factor from the first camera coordinate system to a unified reference coordinate system, obtaining the mapped scaling factor. Then, the corresponding display field of view (FOV) is determined based on the mapped scaling factor, followed by cropping and display. This avoids visual jumps in the presented image caused by inconsistent display FOVs near switching points, ensuring a better user experience. Furthermore, it eliminates the need to rely on depth data to calculate the scaling factor, resulting in better real-time performance.

[0131] like Figure 7 As shown, Figure 7 This application provides a schematic flowchart of an image display method. Figure 2 The method may include: S701-S703.

[0132] S701. Displays a preview image captured by the first camera.

[0133] S702. Receive the user's operation to adjust the scaling factor from 1 to 2.

[0134] The specific descriptions of S701-S702 can be found in the specific descriptions of the corresponding contents in S401-S402 of the above embodiments, and will not be repeated here.

[0135] S703. In response to the operation in S702, a preview image captured by the first camera is displayed; the preview image is obtained by cropping the image captured by the first camera based on the target FOV; the target FOV and the scaling factor 2 satisfy a mapping relationship, which is used to unify the FOV of the first camera and the second camera near the switching point.

[0136] The preview image in S703 is the first preview image in the embodiment of this application.

[0137] For example, after receiving an operation from a user to adjust the zoom level from 1 to 2, the electronic device responds to this operation by determining the target FOV as the display FOV based on the zoom level 2 and the mapping relationship, and obtains and displays a preview image based on the target FOV. For instance, the electronic device can crop the image captured by the first camera at the original FOV (e.g., the original image) based on the target FOV to obtain and display a preview image.

[0138] For example, taking a wide-angle camera as the first camera, with a zoom level of 0.5X for zoom 1 and 0.8X for zoom 2, after receiving the user's operation to adjust the zoom level from 0.5X to 0.8X, the electronic device can, in response, determine the target FOV corresponding to 0.8X based on the mapping relationship. For instance, the electronic device can obtain a target FOV of 110° corresponding to 0.8X based on the mapping relationship. Then, the electronic device can crop the image captured by the wide-angle camera at the original FOV (e.g., 118°) based on 110° to obtain and display a 110° preview image.

[0139] The mapping relationship is used to unify the field of view (FOV) of the first and second cameras near the switching point. It is understandable that, for the same zoom level, the target FOV determined based on the mapping relationship will differ from the FOV determined based on the same zoom level in related technologies. For example, the FOV corresponding to 0.95X is 90° in related technologies, while the FOV corresponding to 0.95X is 86° in this application. Compared to related technologies, the displayed FOV can be kept essentially consistent near the switching point where the first and second cameras switch.

[0140] In this embodiment, the mapping relationship can be determined based on the switching magnification of the first camera, the original FOV corresponding to the switching magnification of the first camera, the switching magnification of the second camera, and the original FOV corresponding to the switching magnification of the second camera. For example, a curve can be fitted based on the switching magnification of the first camera and the original FOV corresponding to the switching magnification of the first camera, the switching magnification of the second camera, and the original FOV corresponding to the switching magnification of the second camera to obtain a smooth curve, i.e., the mapping relationship.

[0141] Curve fitting refers to selecting an appropriate curve type to fit the observed data. In this embodiment, various curve fitting methods are possible, such as quadratic functions, cubic functions, B-splines, Bézier curves, etc. This application does not impose specific limitations on these methods.

[0142] The first camera mentioned above can be a wide-angle camera or a telephoto camera. The second camera can be a main camera. By performing the curve fitting process described above, the displayed FOV near the switching point where the first camera switches to the second camera can be kept basically consistent. The first camera can also include multiple cameras, such as wide-angle cameras and telephoto cameras. Then, the switching magnification and the original FOV corresponding to each of these multiple cameras are used for curve fitting, so that the displayed FOV near the switching point where these multiple cameras switch to the second camera can be kept basically consistent.

[0143] Combination Figure 8 As shown, taking a first camera that includes multiple cameras, such as a wide-angle camera and a telephoto camera, and a second camera that is the main camera as an example, the switching magnification and corresponding original FOV of the wide-angle camera, such as (0.5X, 118°), the switching magnification and corresponding original FOV of the telephoto camera, such as (2.5X, 26.8°), are curve-fitted with the switching magnification and corresponding original FOV of the main camera, (1X, 84°), to obtain the following... Figure 8 The curve shown illustrates the mapping relationship described above. Thus, when the user adjusts the zoom level, this mapping relationship can be used to determine the corresponding target FOV as the display FOV, enabling the display of the preview image.

[0144] This technical solution uses a mapping magnification mechanism to obtain the target FOV corresponding to the scaling factor, ensuring that the displayed FOV near the switching point between different cameras remains largely consistent. This avoids visual jumps in the presented image caused by inconsistent displayed FOV near the switching point, thus guaranteeing a better user experience. Furthermore, it eliminates the need to rely on depth data to calculate the scaling factor, resulting in improved real-time performance.

[0145] As can be understood from the above embodiments, after receiving the zoom level input by the user, the electronic device can determine the actual field of view (FOV) to be displayed, i.e., the display FOV, based on the input zoom level, and then crop the image captured by the camera before displaying it. However, for electronic devices with multiple cameras, the different cameras are set in different positions on the electronic device, meaning there is a physical distance between the different cameras. Thus, when switching between different cameras, the physical distance between them causes a change in the position of the subject in the preview image presented to the user before and after the camera switch, resulting in parallax and a poor user experience.

[0146] To ensure that the position of the subject in the preview image presented to the user does not change before and after switching cameras, in this embodiment of the application, the electronic device can determine the corresponding offset under different zoom levels after receiving the user's operation to adjust the zoom level, and adjust the position of the subject in the preview image accordingly, so that the position of the subject in the preview image presented to the user remains basically consistent before and after switching cameras.

[0147] In this embodiment, the subjects that need to maintain a substantially consistent position can be referred to as target objects. The target object can be any one or more of the subjects included in the current scene. For example, the target object can include at least the subject located at the center of the current scene.

[0148] The following combination Figure 9 and Figure 12 The above process will be described in detail in the embodiments shown.

[0149] Figure 9 This application provides another schematic flowchart of an image display method. Figure 1 The method may include: S901-S902.

[0150] S901. Receives the user's operation to adjust the scaling factor from 1 to 2.

[0151] Wherein, scaling factor 1 can be the first scaling factor in the embodiments of this application, and scaling factor 2 can be the second scaling factor in this application.

[0152] S902. In response to the operation in S901, display a first preview image captured by the first camera; wherein the first preview image is obtained by cropping the image captured by the first camera at a scaling factor of 2 based on a first offset; the first offset is related to a second offset and a scaling factor adjustment.

[0153] The second offset is the offset between the target object in the first image and the target object in the second image. The first image is an image captured by the first camera at the first switching magnification, and the second image is an image captured by the second camera at the second switching magnification.

[0154] For example, after receiving an operation from the user to adjust the zoom level from 1 to 2, the electronic device, in response to this operation, can determine the display field of view (FOV) corresponding to zoom level 2. The electronic device can also determine a first offset (e.g., referred to as the use offset). Subsequently, the electronic device can crop the image (or original image) captured by the first camera at the original FOV based on the display FOV and the first offset to obtain the display image, i.e., the aforementioned first preview image.

[0155] For example, taking a wide-angle camera as the first camera. With zoom level 1 at 0.5X and zoom level 2 at 0.6X, after receiving a user's operation to adjust zoom level 1 to zoom level 2, the electronic device can determine the display FOV corresponding to 0.6X and the first offset corresponding to this zoom level adjustment. Then, the electronic device can crop the original image captured by the first camera based on the display FOV and the first offset corresponding to this zoom level adjustment to obtain and display the display image. Later, if the user adjusts the zoom level again, such as from 0.6X to 0.8X, in response to this operation, the display FOV corresponding to 0.8X can be determined, and the first offset corresponding to the second zoom level adjustment can be determined, based on which a preview image can be obtained and displayed.

[0156] It should be noted that electronic devices can adopt the above-mentioned... Figure 4 or Figure 7 The method of the illustrated embodiment determines the display FOV corresponding to scaling factor 2. In other embodiments, the electronic device may also use methods from related technologies to determine the display FOV corresponding to scaling factor 2, and this application embodiment does not impose specific limitations here.

[0157] The first offset is related to the second offset (total offset) and the magnification adjustment. The second offset refers to the total offset required during the switching between the two cameras.

[0158] For example, consider two cameras, a first camera and a second camera. The total offset required during the switching process between the first and second cameras can be determined based on the offset between the target object in the first image captured by the first camera at a first switching magnification and the second image captured by the second camera at a second switching magnification; this is the second offset. If the first camera is a wide-angle camera and the second camera is a main camera, with a first switching magnification of 0.5X and a second switching magnification of 1X, the total offset can be determined based on the position of the target object in the first image captured by the wide-angle camera at 0.5X and the position of the target object in the second image captured by the main camera at 1X; this is the second offset.

[0159] The position of the target object in the first and second images can be determined through feature point matching or feature point tracking. Feature point matching involves finding matching feature points in the two images, calculating the pixel difference, and obtaining the offset of the same feature point. Therefore, feature point matching can be used to obtain the offset of the same target object's position in the first and second images; this offset is the aforementioned second offset. For example, if the target object corresponds to feature point A in the first image, with pixels (300, 400), and the target object corresponds to feature point B in the second image, with pixels (600, 800), then determining the pixel difference between feature point A and feature point B will determine the aforementioned second offset.

[0160] Feature point tracking refers to finding obvious feature points in an image, tracking these points, and calculating the pixel difference between the feature points before and after tracking to obtain the offset of the same feature point. Therefore, feature point tracking can determine the change in position of the same target object in a first image and a second image; this change is the aforementioned second offset. For example, if the target object corresponds to feature point C in the first image and to feature point D in the second image, then determining the pixel difference between feature point C and feature point D will determine the aforementioned second offset.

[0161] Furthermore, since images captured by different cameras are not of the same size, the dimensions of the images captured by different cameras can be standardized before determining the second offset. For example, the second offset can be determined based on the position of the target object in the first and second images. Specifically, this can include standardizing the dimensions of the first and second images. Then, the second offset can be determined based on the position of the target object in the standardized first image and the position of the target object in the standardized second image.

[0162] For example, the first camera is a wide-angle camera, the second camera is the main camera, and the displayed FOV is based on the above. Figure 4 or Figure 7The illustrated embodiment is used as an example. For instance... Figure 10 As shown, the image size captured by the wide-angle camera at its switching magnification is 4000*3000, that is, the size of the first image is 4000*3000. Figure 10 As shown in 101, the image size captured by the main camera at its switching magnification is 3600*2400, meaning the size of the second image is also 3600*2400. Figure 10 As shown in 102. Next, the sizes of the first and second images are unified. For example, the first image is reduced in size so that its size is the same as the second image. The reduced-size first image is then referred to as the third image, with dimensions of 3600*2400. Figure 10 As shown in 103. After scaling the above dimensions to be consistent, determine the offset between the position of the target object in the second image and the position of the target object in the third image, such as... Figure 10 In the 103, A and Figure 10 The second offset can be obtained by calculating the distance between B in 102.

[0163] It should be noted that the above embodiment is illustrated by reducing the size of the first image to achieve a uniform size between the first and second images. In other embodiments, the uniform size of the first and second images can also be achieved by enlarging the second image, which is not specifically limited here.

[0164] For example, using the first camera as a wide-angle camera and the second camera as the main camera, the displayed FOV is based on the above. Figure 4 or Figure 7 The illustrated embodiment is taken as an example. Continuing with... Figure 10 As shown, the image size captured by the wide-angle camera at its switching magnification is 4000*3000, that is, the size of the first image is 4000*3000. Figure 10 As shown in 101, the image size captured by the main camera at its switching magnification is 3600*2400, meaning the size of the second image is also 3600*2400. Figure 10 As shown in 102. Next, the sizes of the first and second images are unified. For example, the sizes of the first and second images can be scaled to a uniform size, such as 300*400, to obtain the corresponding scaled image, which may be called the third image 1. Figure 10 As shown in Figure 104 and the third image 2, as Figure 10 As shown in 105. After scaling the above dimensions to be consistent, the offset between the position of the target object in the third image 1 and the position of the target object in the third image 2 can be determined, such as... Figure 10 C in 104 and Figure 10 The second offset can be obtained by calculating the distance between D in 105.

[0165] Thus, after receiving a user's operation to adjust the scaling factor from scaling factor 1 to scaling factor 2, the electronic device can determine the first offset corresponding to this scaling factor adjustment based on the aforementioned second offset, scaling factor 1, and scaling factor 2. Combined with... Figure 11 Specifically, firstly, the proportion of the current adjustment from scaling factor 1 to scaling factor 2 within the total adjustment from the first switching factor to the second switching factor can be obtained. Then, based on this proportion and a third offset, the first offset corresponding to this scaling factor adjustment can be determined.

[0166] As an example, the proportion of the current adjustment in the total adjustment can be determined by the following formula (5):

[0167] Formula (5)

[0168] Wherein, Ratio rate is the proportion of the current adjustment amount in the total adjustment amount, the first switching ratio is the switching ratio of the first camera, and the second switching ratio is the switching ratio of the second camera.

[0169] The first offset corresponding to this scaling factor adjustment can be determined by the following formula (6):

[0170] Use offset = offset* Ratio rate formula (6)

[0171] Where Ratio rate is the proportion of the current adjustment amount in the total adjustment amount, Use offset is the first offset corresponding to this scaling factor adjustment, and offset is the third offset.

[0172] If this zoom adjustment is the first zoom adjustment made by the user after turning on the camera, then the third offset can be the second offset mentioned above. If this zoom adjustment is not the first adjustment, then the third offset is the remaining offset from the second offset. This remaining offset can be obtained by subtracting the second offset from the cumulative offset. The cumulative offset is the sum of all offset adjustments made before this zoom adjustment.

[0173] For example, if this adjustment to the scaling factor is the user's first adjustment to the scaling factor, the first offset corresponding to this scaling factor adjustment can be determined by the following formula (7):

[0174] Use offset= total offset* Ratio rate formula (7)

[0175] For example, taking the first camera as a wide-angle camera with a first switching magnification of 0.5X and the second camera as the main camera with a second switching magnification of 1X as an example. The user adjusts the zoom ratio from zoom ratio 1 to zoom ratio 2, such as from 0.5X to 0.6X. The second offset is 10cm. According to the above ratio formula (6), the ratio rate can be determined as (0.6X-0.5X) / (1X-0.5X)=0.2. Then, according to the above formula (7), the first offset corresponding to this zoom ratio adjustment can be determined as Useoffset=10*0.2=2cm.

[0176] For example, if this adjustment to the scaling factor is not the first adjustment, the first offset corresponding to this scaling factor adjustment can be determined by the following formula (8):

[0177] Formula (8)

[0178] For example, if a user adjusts the zoom level from 1 to 2, such as from 0.6X to 0.8X, the remaining offset in the second offset is 8cm. Based on the above ratio formula, the ratio rate is determined as (0.8X - 0.6X) / (1X - 0.5X) = 0.4. Then, based on the above formula for the first offset, the use offset is determined as 8 * 0.4 = 3.2cm.

[0179] After determining the first offset and the display FOV, the electronic device can crop the image (or original image) captured by the first camera under the original FOV based on the display FOV and the first offset to obtain the display image, i.e., the first preview image mentioned above.

[0180] Using this technical solution, the electronic device can determine the corresponding offset at different zoom levels after receiving the user's zoom adjustment operation, and adjust the position of the subject in the preview image accordingly. This ensures that the position of the subject in the preview image presented to the user remains essentially consistent before and after switching cameras. Furthermore, it eliminates the need for stereo correction to adjust the subject's position in the preview image, resulting in better real-time performance.

[0181] Figure 12 This application provides another schematic flowchart of an image display method. Figure 2 The method may include: S1201-S1202.

[0182] S1201. Receive the user's operation to adjust the scaling factor from 1 to 2.

[0183] S1202. In response to the operation in S1201, display the first preview image captured by the first camera; wherein the first preview image is obtained by cropping the original image captured by the first camera at a scaling factor of 2 based on the first offset; the first offset and the scaling factor of 2 satisfy a mapping relationship, and the mapping relationship includes the correspondence between different scaling factors and the offset.

[0184] The specific descriptions of S1201-S1202 can be found in the specific descriptions of the corresponding contents in S401-S402 of the above embodiments, and will not be repeated here.

[0185] The implementation process in this embodiment is the same as Figure 9 Similarly, the difference lies in that this embodiment is the same as Figure 9 The process for determining the first offset differs in the embodiments, specifically in that this embodiment determines the first offset based on a mapping relationship.

[0186] This mapping relationship includes the correspondence between different magnifications and offsets. This mapping relationship can be determined based on the second switching magnification and the second offset of the second camera. Since it involves switching from the first camera to the second camera, the mapping relationship can be determined based on the second switching magnification and the second offset of the second camera. Taking the first camera as a wide-angle camera and the second camera as the main camera as an example, the second switching magnification and the second offset of the main camera can be used as a curve function to obtain a smooth curve, which represents the mapping relationship.

[0187] For example, the function curve can be an inverse proportional function. That is, the above mapping relationship can be determined using an inverse proportional function based on the second switching magnification and the second offset of the second camera. For instance, the determined mapping relationship can be as follows: Figure 13 As shown.

[0188] It should be noted that the above embodiments are illustrated using a wide-angle camera as the first camera. In other embodiments, where the first camera includes multiple cameras, such as a wide-angle camera and a telephoto camera, the determination of the mapping relationship can be referred to the overview of the corresponding content in S703, and will not be described again here.

[0189] Using this technical solution, the electronic device can determine the corresponding offset at different zoom levels after receiving the user's zoom adjustment operation, and adjust the position of the subject in the preview image accordingly. This ensures that the position of the subject in the preview image presented to the user remains essentially consistent before and after switching cameras. Furthermore, it eliminates the need for stereo correction to adjust the subject's position in the preview image, resulting in better real-time performance.

[0190] In summary, by displaying images in the manner described above, it is possible to ensure that the field of view (FOV) near the switching points between different cameras remains largely consistent, and that the position of the subject in the preview image presented to the user remains largely consistent. This ensures a positive user experience.

[0191] Other embodiments of this application provide an electronic device that may include: the aforementioned display screen, multiple cameras, a memory, and one or more processors. The display screen, multiple cameras, memory, and processor are coupled. The memory stores computer program code, which includes computer instructions. When the processor executes the computer instructions, the electronic device can perform various functions or steps performed by the mobile phone in the above method embodiments. The structure of the electronic device can be referred to... Figure 3 The structure of the mobile phone is shown.

[0192] This application also provides a chip system, such as... Figure 14 As shown, the chip system 1400 includes at least one processor 1401 and at least one interface circuit 1402. The processor 1401 and the interface circuit 1402 are interconnected via lines. For example, the interface circuit 1402 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, the interface circuit 1402 can be used to send signals to other devices (e.g., the processor 1401). Exemplarily, the interface circuit 1402 can read instructions stored in memory and send those instructions to the processor 1401. When the instructions are executed by the processor 1401, the electronic device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in this application embodiment.

[0193] This application also provides a computer storage medium that includes computer instructions. When the computer instructions are executed on the electronic device, the electronic device performs various functions or steps performed by the electronic device in the above method embodiments.

[0194] This application also provides a computer program product that, when run on a computer, causes the computer to perform various functions or steps performed by the electronic device in the above method embodiments.

[0195] 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.

[0196] 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 device, 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 devices or units may be electrical, mechanical, or other forms.

[0197] 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.

[0198] 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.

[0199] If 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 in other words, 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 described in 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.

[0200] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations 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. An image display method characterized by, The method is applied to an electronic device including at least a first camera and a second camera, and the method comprises: receiving an operation of adjusting a first magnification to a second magnification by a user; in response to the operation, displaying a first preview image captured by the first camera; wherein the first preview image is obtained by cropping an image captured by the first camera at the second magnification based on a first offset; the first offset is related to a second offset and a magnification adjustment amount; the second offset is an offset between a target object in a first image and the target object in a second image; the first image is an image captured by the first camera at a first switching magnification, and the second image is an image captured by the second camera at a second switching magnification.

2. The method of claim 1, wherein The method further comprises: determining the second offset based on a position of the target object in the first image and a position of the target object in the second image; determining the first offset based on the second offset, the first magnification and the second magnification.

3. The method of claim 2, wherein The method further comprises: obtaining a proportion of a current magnification adjustment amount from the first magnification to the second magnification in a total adjustment amount from the first switching magnification to the second switching magnification; determining the first offset based on the proportion and a third offset; wherein, in a case of a first adjustment, the third offset is the second offset; in a case of a non-first adjustment, the third offset is a remaining offset in the second offset.

4. The method according to any one of claims 2-3, characterized in that The method further comprises: unifying a size of the first image and a size of the second image to a same size; and determining the second offset based on a position of the target object in the first image and a position of the target object in the second image after unifying the size.

5. The method of any one of claims 1-3, wherein: the second camera is a main camera of the electronic device; the first camera comprises a wide-angle camera and / or a telephoto camera of the electronic device.

6. An image display method characterized by The method is applied to an electronic device including a plurality of cameras, and the plurality of cameras include a first camera and a second camera, and the method comprises: receiving an operation of adjusting a first magnification to a second magnification by a user; in response to the operation, displaying a first preview image captured by the first camera; The first preview image is obtained by cropping an image captured by the first camera at the second zoom ratio based on a first offset; the first offset and the second zoom ratio satisfy a mapping relationship, the mapping relationship includes a corresponding relationship between different zoom ratios and offsets; the mapping relationship is obtained by using an inverse proportional function to curve fit a second switching zoom ratio of the second camera and a second offset; the second offset is an offset between a target object in the first image and the target object in the second image; the first image is an image captured by the first camera at a first switching zoom ratio, and the second image is an image captured by the second camera at a second switching zoom ratio.

7. The method of claim 6, wherein, the second camera is a main camera of the electronic device; the first camera includes a wide-angle camera and / or a telephoto camera of the electronic device.

8. An electronic device, comprising: The electronic device includes a memory, a plurality of cameras, and one or more processors; the memory, the plurality of cameras, and the processor are coupled; wherein the memory is configured to store computer program code including computer instructions; when the computer instructions are executed by the processor, the electronic device is caused to perform the method of any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, having computer instructions stored thereon; when the computer instructions run on the electronic device, the electronic device is caused to perform the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Shooting method and electronic equipment

    CN114531539A