An image display method, an electronic device, and a computer-readable storage medium
By mapping the zoom level to a unified reference coordinate system, the visual abruptness problem during camera switching is solved, achieving a smooth image transition and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2023-12-29
- Publication Date
- 2026-06-26
AI Technical Summary
In electronic devices, the inconsistent field of view of different cameras can cause visual jumps when switching images, affecting the user experience.
By mapping the scaling factor from the first camera coordinate system to a unified reference coordinate system, the mapping factor is determined, and the image is then cropped and displayed, avoiding screen jumps caused by inconsistent FOV near the switching point.
It achieves a smooth transition between the images before and after camera switching, improving the user experience and avoiding visual abrupt changes.
Smart Images

Figure CN120282016B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to an image display method, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In pursuit of better shooting results, installing multiple cameras on electronic devices has become a burgeoning trend. By using multiple cameras on electronic devices, such as main cameras, wide-angle cameras, and telephoto cameras, more shooting methods are provided, resulting in different images for users to choose from and use.
[0003] Currently, users can adjust the field of view captured by the camera according to their actual needs. Electronic devices can switch between the appropriate cameras based on the zoom level to obtain the image required by the user. However, since different cameras capture different fields of view, that is, the field of view (FOV) of different cameras differs, switching cameras often results in visually abrupt changes in the presented image due to the inconsistent FOV. Summary of the Invention
[0004] Based on this, this application provides an image display method, an electronic device, and a computer-readable storage medium, which avoids the visual jump phenomenon caused by inconsistent FOV near the camera switching point, thus ensuring the user experience.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] In a first aspect, this application provides an image display method applied to an electronic device including multiple cameras, the multiple cameras including a first camera. In this method, the electronic device receives a user's selection operation for a first magnification, and in response to the selection operation, can display a first preview image captured by the first camera at a second magnification based on the relationship between the coordinate system of the first camera and a reference coordinate system at different magnifications.
[0007] 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, a corresponding preview image is obtained and displayed based on this mapped scaling factor. This avoids visual jumps in the displayed image caused by inconsistent FOV near the switching point, ensuring a smooth transition between images before and after camera switching and guaranteeing a positive user experience.
[0008] In one possible implementation of the first aspect, the mapping relationship can be determined by mapping the switching magnification. Specifically, the switching magnification of the first camera can be mapped onto a reference coordinate system to obtain the mapped switching magnification. Then, the mapping relationship is determined based on the mapped switching magnification and the switching magnification of the second camera.
[0009] In the above method, the reference coordinate system can be a unified coordinate system. For example, the multiple cameras mentioned above may also include a second camera, and the reference coordinate system can be the coordinate system of that second camera. The first camera can be a wide-angle camera and / or a telephoto camera, and the second camera can be the main camera. Taking a wide-angle camera as the first camera as an example, different magnifications can be mapped from the coordinate system of the wide-angle camera to the coordinate system of the main camera, ensuring a smooth transition in the image presented to the user before and after switching from the wide-angle camera to the main camera. In addition, setting the main camera as the second camera conforms to the processing method in actual use and ensures the user's usage habits. Based on the mapping of the switching magnification and obtaining the mapping relationship with the switching magnification of the first camera, the computational load is small and the real-time performance is good.
[0010] In one possible implementation of the first aspect, the mapping switching ratio can be determined through the following process: firstly, a mapping ratio can be determined based on a first FOV and a second FOV; then, the mapping switching ratio can be determined based on the mapping ratio and the switching ratio of the second camera. Wherein, the first FOV is the FOV corresponding to the switching ratio of the first camera, and the second FOV is the FOV corresponding to the switching ratio of the second camera; the mapping ratio is used to indicate the proportional relationship between the first FOV and the second FOV in the second camera coordinate system.
[0011] In the above method, the mapping ratio can be represented by the ratio of the imaging width under the first FOV to the imaging width under the second FOV. There is a relationship between the camera's FOV, its imaging width under that FOV, and its focal length. Based on this relationship, the final mapping switching ratio can be determined based on the switching ratio of the second FOV, the first FOV, and the second camera. This determination process is convenient and has good real-time performance.
[0012] In one possible implementation of the first aspect, the electronic device displays a first preview image captured by the first camera at a second magnification. Specifically, this can be achieved by first determining the field of view (FOV) corresponding to the second magnification, then cropping the image captured by the first camera based on the FOV corresponding to the second magnification to obtain the cropped first preview image, and then displaying the first preview image to the user.
[0013] In the above method, the FOV of the display is determined based on the second magnification, which avoids the visual jump phenomenon in the presented picture caused by the inconsistency of the FOV of the display near the switching point.
[0014] Secondly, this application provides an image display method applied to an electronic device including multiple cameras, including a first camera and a second camera. In this method, the electronic device receives a user's selection operation for a first magnification, and in response to the operation, displays a first preview image obtained by cropping an image captured by the first camera based on a target field of view (FOV).
[0015] As an example, after receiving a user's selection of a first magnification, the electronic device can determine the target FOV based on the first magnification and the mapping relationship. It can then crop the image captured by the first camera to obtain a first preview image based on the target FOV and display the first preview image. This mapping relationship can unify the FOV of the first and second cameras at the switching point.
[0016] This technical solution, when the user inputs a first magnification, can determine the target FOV based on the mapping relationship between the first magnification and the FOV that unifies the first and second cameras near the switching point. The original image is then cropped based on the target FOV to obtain the first preview image, which is then displayed. This avoids the problem of inconsistent FOVs near the switching point that cause abrupt changes in the preview image, ensuring a smooth transition of the displayed image during camera switching and improving the user experience.
[0017] In one possible implementation of the second aspect, the mapping relationship can be determined based on the switching magnification of the first camera, the first FOV, the switching magnification of the second camera, and the second FOV.
[0018] For example, the above mapping relationship can be obtained by using a fitting function to perform curve fitting based on the switching magnification of the first camera, the first FOV, the switching magnification of the second camera, and the second FOV.
[0019] In other words, by performing curve fitting on the switching magnification of different cameras and the corresponding original FOV, a smooth curve, i.e., a mapping relationship, is obtained. In this curve fitting process, the switching magnification of the different cameras and the corresponding original FOV are known parameters of the cameras and can be obtained directly without spending extra work to collect data, thus reducing processing costs.
[0020] 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.
[0021] Fourthly, an electronic device is provided, comprising: a memory, a plurality of cameras, and one or more processors; the memory, cameras, and processors are coupled together.
[0022] 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.
[0023] 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.
[0024] 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.
[0025] 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.
[0026] 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
[0027] Figure 1 A schematic diagram of an image display method provided for related technologies;
[0028] Figure 2 A schematic diagram illustrating FOV transitions during camera switching, provided for related technologies;
[0029] Figure 3 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;
[0030] Figure 4 This application provides a schematic flowchart of an image display method. Figure 1 ;
[0031] Figure 5 This application provides a schematic diagram of a method for determining a mapping relationship.
[0032] Figure 6 This application provides an illustration of an image mapping relationship. Figure 1 ;
[0033] Figure 7 This application provides a schematic flowchart of an image display method. Figure 2 ;
[0034] Figure 8 This application provides an illustration of an image mapping relationship. Figure 2 ;
[0035] Figure 9 This application provides another schematic flowchart of an image display method. Figure 1 ;
[0036] Figure 10 This application provides a schematic diagram of image size alignment as an embodiment.
[0037] Figure 11 This application provides an illustration of an image display method. Figure 1 ;
[0038] Figure 12 This application provides another schematic flowchart of an image display method. Figure 2 ;
[0039] Figure 13 This application provides an illustration of an image display method. Figure 2 ;
[0040] Figure 14 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0041] 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.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] First, some terms used in the embodiments of this application will be explained to facilitate understanding by those skilled in the art.
[0046] 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.
[0047] 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.
[0048] 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°.
[0049] 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), 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.
[0050] 5. Switching magnification (Switch Ratio): This indicates the default magnification for different cameras. Different types of cameras have different Switch Ratios. For example, a wide-angle camera has a Switch Ratio of 0.5X. A short-focal-length camera has a Switch Ratio of 1X. A telephoto camera has a Switch Ratio of 2.5X. The camera's Switch Ratio corresponds to its original FOV. For example, a 0.5X Switch Ratio for a wide-angle camera corresponds to an original FOV of 118°. Switch Ratios for the same type of camera produced by different manufacturers may also differ. It should be noted that the above-mentioned Switch Ratio is merely an exemplary command for the camera's default magnification, and the naming of the camera's default magnification in this application embodiment is not limited to this.
[0051] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0052] 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.
[0053] 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 1 Control 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 shown in (b) is shown in the image.
[0054] Because the zoom level input by the user varies, the field of view (FOV) acquired by 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 field of view determined by the user's zoom level, the phone will switch cameras to capture the desired image. After switching cameras, the native FOV will be equal to the native FOV of the new camera.
[0055] However, before and after switching cameras (i.e., near the switching point), the displayed FOV is inconsistent near the switching point, causing a visual jump in the presented image. For example, combined with... Figure 2As shown, when the switching point is 1X, the electronic device will switch the wide-angle camera to the main camera. In this case, the displayed FOV may jump from 90° to 84° of the main camera. This will cause a positional deviation of the subject in the image presented to the user. For example, before the camera switch, the subject in the displayed image might be at the center of the image, but after the switch, the subject might not be at the center, resulting in a positional deviation that gives the user a jerky feeling and affects the viewing experience.
[0056] To avoid visual jumps in the displayed image due to inconsistencies in the field of view (FOV) near the switching point, related technologies calculate the corresponding scaling factor based on the affine transformation relationship between different cameras and depth data after receiving the user's input scaling factor. The image captured by the camera is then cropped according to the calculated FOV and displayed. However, these technologies have at least two shortcomings: First, inaccurate depth data leads to inaccurate scaling factors, resulting in an inaccurate FOV used for image cropping, thus still causing visual jumps in the displayed image. Second, the calculation process for determining the scaling factor using depth data is difficult and lacks real-time performance.
[0057] To address the aforementioned issues, this application provides an image display method. By mapping the scaling factor from the first camera coordinate system to a unified reference coordinate system, a mapped scaling factor is obtained. 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 displayed 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 improved real-time performance.
[0058] For example, the image display method provided in this application embodiment can be applied to electronic devices. These electronic devices can be devices including multiple cameras, such as mobile phones, tablets, smartwatches, desktop computers, laptops, handheld computers, ultra-mobile personal computers (UMPCs), netbooks, cellular phones, personal digital assistants (PDAs), augmented reality (AR) / virtual reality (VR) devices, etc. This application embodiment does not impose any special limitations on the specific form of the electronic device.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0063] 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 that are used 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 obtain the corresponding zoom level 2 based on the mapping relationship when the mobile phone 300 receives a user's selection operation for zoom level 1, so that the camera can capture images based on zoom level 2, ensuring that the field of view (FOV) is aligned when switching between different cameras, thereby avoiding visual jumps in the presented image.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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.
[0070] 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.
[0071] The mobile phone 300 can achieve shooting functions through ISP, camera 393, video codec, GPU, display 394 and application processor.
[0072] 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.
[0073] 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.
[0074] 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 selects a zoom level of 1, then in response, the first camera can capture a preview image based on a zoom level of 2 corresponding to zoom level 1, and present it to the user through the display screen 394.
[0075] 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.
[0076] 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.
[0077] 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.
[0078] The sensor module 380 may include a pressure sensor 380A, a fingerprint sensor 380B, a temperature sensor 380C, a touch sensor 380D, etc.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] S401. Display the preview image captured by the first camera.
[0084] S402. Receive the user's operation to adjust the scaling factor from 1 to 2.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] For example, after receiving an operation from a user 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.
[0093] In some examples, continuing with the example in S402, taking the first camera as a wide-angle camera, with zoom level 1 at 0.5X and zoom level 2 at 0.8X as an example, after the electronic device receives the user's operation to adjust the zoom level from 0.5X to 0.8X, in response, the electronic device 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 example, the determined mapping zoom level is 0.72X. Then, the electronic device can display the preview image captured by the wide-angle camera at the 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. For example, 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.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] like,
[0101] 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).
[0102] In this way, the original FOV (i.e., the first FOV) of the first camera, the imaging width of the camera at that original FOV, and the focal length (f) of the first camera can be obtained. uw The relationship is: (Second FOV).
[0103] The original FOV (i.e., the second FOV) of the second camera, the imaging width of the camera within that original FOV, and the focal length (f) of the second camera. w The relationship is: (First FOV)
[0104] 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.
[0105] The replaced relationship is as follows: (First FOV).
[0106] Based on the above:
[0107] The mapping ratio can be determined using the following formula (1):
[0108]
[0109] Where α1 is the first FOV and α2 is the second FOV. Continuing with the above example, 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.
[0110] Then, the mapping switching ratio can be determined based on the determined mapping ratio and the switching ratio of the main camera.
[0111] For example, the mapping switching ratio can be determined using the following formula (2):
[0112]
[0113] That is, Map switch magnification = 5.5 * main camera switching magnification. Wherein, if the main camera switching magnification is 1X, then according to the above formula, Map switch magnification = 5.5 * 1 = 5.5.
[0114] Then, the above mapping relationship can be determined based on the determined mapping switching magnification and the switching magnification of the wide-angle camera.
[0115] For example, the above mapping relationship can be represented by the following formula (3):
[0116] Map zoom = F * zoom Formula (3)
[0117] 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.
[0118] 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 field of view (FOV) near the switching point is aligned.
[0119] 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.72X). 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.
[0120] 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.
[0121] Based on the principle of determining the mapping switching ratio, we know that:
[0122] Mapping magnification = Mapping ratio * Second camera switching magnification. And mapping ratio = tan θ / tanα2, where X is the FOV corresponding to the mapping magnification, and α2 is the original FOV of the second camera.
[0123] Therefore, the mapping magnification = (tanX / tanα2) * the switching magnification of the second camera.
[0124] X = arctan[(mapping magnification / switching magnification of the second camera) * tanα2] Formula (4).
[0125] 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°.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] S701. Displays a preview image captured by the first camera.
[0132] S702. Receives the user's operation to adjust the scaling factor from 1 to 2.
[0133] 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.
[0134] 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.
[0135] The preview image in S703 is the first preview image in the embodiment of this application.
[0136] 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 the preview image.
[0137] 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 the electronic device receives the user's operation to adjust the zoom level from 0.5X to 0.8X, in response, the electronic device can determine the target FOV corresponding to 0.8X based on the mapping relationship. For example, the electronic device can obtain the target FOV corresponding to 0.8X as 110° 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.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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.
[0142] Combination Figure 8 As shown, taking a first camera comprising multiple cameras, such as a wide-angle camera and a telephoto camera, and a second camera as the main camera as an example, the switching magnification and corresponding original FOV of the wide-angle camera (e.g., 0.5X, 118°), the switching magnification and corresponding original FOV of the telephoto camera (e.g., 2.5X, 26.8°), and the switching magnification and corresponding original FOV of the main camera (1X, 84°) are curve-fitted 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] The following combination Figure 9 and Figure 12 The above process will be described in detail in the embodiments shown.
[0148] Figure 9 This application provides another schematic flowchart of an image display method. Figure 1 The method may include: S901-S902.
[0149] S901. Receives the user's operation to adjust the scaling factor from 1 to 2.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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 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.
[0159] 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.
[0160] 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, which can specifically 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.
[0161] 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.
[0162] 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.
[0163] 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, 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.
[0164] 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.
[0165] As an example, the proportion of the current adjustment in the total adjustment can be determined by the following formula (5):
[0166] Ratio rate = (Scaling ratio 2 - Scaling ratio 1) / (Second switching ratio - First switching ratio) Formula (5)
[0167] 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.
[0168] The first offset corresponding to this scaling factor adjustment can be determined by the following formula (6):
[0169] Use offset = offset* Ratio rate formula (6)
[0170] 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.
[0171] 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.
[0172] 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):
[0173] Use offset=total offset* Ratio rate formula (7)
[0174] 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.
[0175] 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):
[0176] Use offset=remain offset * Ratio rate formula (8)
[0177] 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 to be (0.8X - 0.6X) / (1X - 0.5X) = 0.4. Then, based on the above formula for the first offset, the use offset is determined to be 8 * 0.4 = 3.2cm.
[0178] 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.
[0179] 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.
[0180] Figure 12 This application provides another schematic flowchart of an image display method. Figure 2 The method may include: S1201-S1202.
[0181] S1201. Receive the user's operation to adjust the scaling factor from 1 to 2.
[0182] 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.
[0183] The specific descriptions of S1201-S402 can be found in the specific descriptions of the corresponding contents in S401-S402 in the above embodiments, and will not be repeated here.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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.
[0191] 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, and this application embodiment does not specifically limit this.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] 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.
[0196] 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.
[0197] 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.
[0198] 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.
[0199] 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 in that, Applied to an electronic device including multiple cameras, said multiple cameras including a first camera and a second camera, the method includes: Receive the user's selection of the first scaling factor; In response to the selection operation, a first preview image captured by the first camera at a second magnification is displayed; Wherein, the second magnification and the first magnification satisfy a mapping relationship, the mapping relationship is used to indicate the relationship of different magnifications from the coordinate system of the first camera to the reference coordinate system, the reference coordinate system being the coordinate system of the second camera; the mapping relationship is obtained based on the switching magnification of the first camera, the first FOV corresponding to the switching magnification of the first camera, the switching magnification of the second camera, and the second FOV corresponding to the switching magnification of the second camera.
2. The method according to claim 1, characterized in that, The method further includes: A mapping ratio is determined based on the first FOV and the second FOV; the mapping ratio is used to indicate the proportional relationship between the first FOV and the second FOV in the second camera coordinate system; Based on the mapping ratio and the switching magnification of the second camera, the mapping switching magnification is determined; The mapping relationship is determined based on the mapping switching magnification and the switching magnification of the first camera.
3. The method according to claim 1 or 2, characterized in that, The display of the first preview image captured by the first camera at a second magnification includes: Determine the FOV corresponding to the second multiplier; Based on the FOV corresponding to the second magnification, the image captured by the first camera is cropped to obtain the first preview image; Display the first preview image.
4. The method according to claim 1 or 2, characterized in that, The second camera is the main camera of the electronic device; The first camera includes a wide-angle camera and / or a telephoto camera of the electronic device.
5. An image display method, characterized in that, Applied to an electronic device including multiple cameras, said multiple cameras including a first camera and a second camera, the method includes: Receive the user's selection of the first multiplier; In response to the selection operation, a first preview image captured by the first camera is displayed; the first preview image is obtained by cropping the image captured by the first camera based on the target FOV; the target FOV and the first magnification satisfy a mapping relationship, and the mapping relationship is used to unify the FOV of the first camera and the second camera at the switching point; the mapping relationship is obtained based on the switching magnification of the first camera, the first FOV corresponding to the switching magnification of the first camera, the switching magnification of the second camera, and the second FOV corresponding to the switching magnification of the second camera.
6. The method according to claim 5, characterized in that, The mapping relationship is obtained by curve fitting using a fitting function based on the switching magnification and first FOV of the first camera, the switching magnification and second FOV of the second camera.
7. The method according to claim 5 or 6, characterized in that, The display of the first preview image captured by the first camera includes: The target FOV corresponding to the first multiplier is determined based on the mapping relationship; Based on the target FOV, the image captured by the first camera is cropped to obtain the first preview image; Display the first preview image.
8. The method according to claim 5 or 6, characterized in that, The second camera is the main camera of the electronic device; The first camera includes a wide-angle camera and / or a telephoto camera of the electronic device.
9. An electronic device, characterized in that, The electronic device includes: a memory, a plurality of cameras, and one or more processors; the memory, the cameras, and the processors are coupled together. 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 method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, Includes computer instructions; When the computer instructions are executed on the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-8.