Image display method, electronic equipment and computer readable storage medium
By receiving user magnification adjustment operations on the electronic device, determining the offset and image cropping or establishing mapping relationships, the problem of object position jumping in the image caused by camera position is solved, and a smooth image transition is achieved and user experience is improved.
Patent Information
- Application Number
- CN202311871342.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-12-29
AI Technical Summary
When multiple cameras are installed on electronic devices, the physical distance of the camera position causes the object position in the image to jump during the switching process, affecting the user experience.
By receiving user magnification adjustment operations, the offset is determined and image cropping is performed, the mapping relationship between magnification and offset is established, or the offset is determined through feature point matching and tracking, and the image position is adjusted to avoid jumping.
It realizes a smooth transition of object positions in the image during camera switching, improves the user experience, and has a simple processing process and good real-time performance.
Smart Images

Figure CN120282017A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of multi-camera technologies, and in particular, to an image display method, an electronic device, and a computer-readable storage medium. Background Art
[0002] In order to pursue better shooting effects, installing multiple cameras on an electronic device has shown a booming trend. By means of multiple cameras installed on the electronic device, such as a main camera, a wide-angle camera, and a telephoto camera, etc., more shooting modes are provided, so as to present different pictures for users to select and use. However, since multiple cameras are arranged out of position on the electronic device, there is a physical distance between the positions of the cameras. During the process of switching between different cameras, due to the different positions of the cameras, the objects in the captured pictures will jump. For example, before and after switching the cameras, the positions of the same object in the same scene in the images captured by different cameras deviate greatly. Summary of the Invention
[0003] Based on this, the present application provides an image display method, an electronic device, and a computer-readable storage medium, which avoid the phenomenon of position jumping of the photographed object in the preview images presented to the user before and after switching the cameras, and ensure the user experience.
[0004] To achieve the above object, the embodiments of the present application adopt the following technical solutions:
[0005] In a first aspect, the present application provides an image display method, which is applied to an electronic device including at least a first camera and a second camera. In this method, the electronic device receives an operation of the user to adjust the first magnification to the second magnification, and in response to this operation, the electronic device can 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 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 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 a first switching magnification, and the second image is the image captured by the second camera at a second switching magnification.
[0006] Exemplarily, when receiving an operation of the user to adjust 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 is cropped based on the first offset, so as to obtain the cropped first preview image and display it.
[0007] Exemplarily, the above first camera 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] Among them, the first magnification can be the magnification corresponding to the preview interface displayed to the user after the electronic device receives the user's operation of opening the camera, that is, the default magnification. It can also be the magnification adjusted by the user last time.
[0009] After the electronic device receives the user's operation of adjusting the first magnification to the second magnification, it can obtain the first offset corresponding to the adjustment from the first magnification to the second magnification. Then, based on the first adjustment amount, the image is cropped to obtain the first preview image. This avoids the phenomenon that the position of the object being photographed jumps in the preview images presented to the user before and after switching the camera due to the physical distance of the camera, ensuring the user experience.
[0010] In an implementable manner 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. Then, 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. Determine the second offset according to the offset between the positions. After determining the second offset, determine the offset corresponding to the adjustment from the first magnification to the second magnification based on the second offset, that is, the first offset.
[0011] For the above method, the determination of the second offset can be based on feature point matching / feature point tracking. Specifically, based on the feature point matching / feature point tracking of the target object in the first image and the target object in the second image, the pixel value is determined. Then, the difference is made according to the pixel value to determine the second offset. By determining the position deviation of the same target object in the first image and the second image through feature point tracking and feature point matching, the position deviation of the target object in the images captured by different cameras caused by the physical distance due to the camera arrangement is determined, that is, the second offset, and the calculation is simple. Then, according to the second offset difference, the first offset after adjusting the first magnification to the second magnification is determined. By using the first offset to crop the currently displayed image, it is ensured that the position of the target object in the displayed image does not change significantly during the process of the user adjusting the zoom magnification.
[0012] In an implementable manner of the first aspect, before determining the second offset, the sizes of the first image and the second image can be unified to the same size; then, based on the positions of the target object in the first image and the target object in the second image after unifying the sizes, the first offset is determined.
[0013] In an implementable manner of the first aspect, after determining the second offset, the first offset may be determined based on the second deviation, the first magnification, and the second magnification. In this embodiment, the proportion of the current magnification adjustment amount from the first magnification to the second magnification in the total adjustment amount from the first switching magnification to the second switching magnification is obtained. In the case where this magnification adjustment is the first adjustment, the first offset is determined based on the proportion and the second offset. In the case where this magnification adjustment is not the first adjustment, the first offset is determined based on the proportion and the remaining offset in the second offset. By determining the first offset corresponding to the current zoom magnification adjustment in the above method, the first offset is determined using a simple linear calculation relationship, which is convenient to calculate and has good real-time performance.
[0014] In a second aspect, the present application provides an image display method applied to an electronic device including a plurality of cameras, where the plurality of cameras include a first camera. In this method, the electronic device receives an operation by the user to adjust the first magnification to the second magnification, and in response to this operation, displays a first preview image collected by the first camera. The first preview image may be obtained by cropping an image collected by the first camera at the second magnification based on the first offset.
[0015] Exemplarily, after receiving the operation by the user, the first offset may be determined according to the adjusted second magnification and the mapping relationship, so that the first preview image obtained by cropping the image collected by the first camera at the second magnification based on the first offset is sent for display.
[0016] Exemplarily, the second camera may be the main camera of the electronic device; the first camera may include the wide-angle camera and / or the telephoto camera of the electronic device.
[0017] By establishing a mapping relationship between different magnifications and offsets as described above, in the case where the user adjusts the first magnification to the second magnification, the first offset is determined based on the second magnification and the mapping relationship, and the original image is cropped based on the first offset, and then the first preview image is obtained and sent for display. By obtaining the offset corresponding to the current magnification adjustment through the established mapping relationship and cropping the image based on this offset and then sending it for display, the problem of the position change of the target object in the image caused by the physical distance between the cameras during the camera switching process is solved, ensuring a smooth transition during the camera switching and improving the user experience.
[0018] In an implementable manner of the second aspect, the above-mentioned plurality of cameras may further include a second camera. The mapping relationship may be determined based on the second switching magnification and the second offset of the second camera.
[0019] Exemplarily, based on the second switching magnification and the second offset of the second camera, an inverse proportional function can be used for function curve fitting to obtain the above mapping relationship. 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 collected by the first camera at the first switching magnification, and the second image is the image collected by the second camera at the second switching magnification.
[0020] That is to say, by using the second switching magnification and the second offset of the second camera to perform curve fitting with an inverse proportional function, a smooth inverse proportional function curve, i.e., the mapping relationship, is obtained. During the determination of this mapping relationship, the second offset corresponding to the second switching magnification of the second camera is a parameter known to the camera and can be directly obtained without spending extra effort to collect data information, reducing the processing cost.
[0021] In a third aspect, the present application provides an image display device, which has the function of implementing the behavior of the electronic device in the methods of the above first aspect and second aspect. 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. For example, a receiving unit or module, a control unit or module, and a display unit or module.
[0022] In a fourth aspect, an electronic device is provided, which includes: 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 processor;
[0023] wherein, the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device is caused to execute the image display method in the above first aspect, second aspect, and any implementation manner thereof.
[0024] In a fifth aspect, a computer-readable storage medium is provided, which includes a computer program. When the computer program runs on the electronic device, the electronic device can be caused to execute the image display method in the first aspect, second aspect, and any implementation manner thereof.
[0025] In a sixth aspect, a computer program product containing instructions is provided. When it runs on the electronic device, the electronic device can be caused to execute the image display method in the above first aspect and any implementation manner thereof.
[0026] In a seventh aspect, an embodiment of the present application provides a chip system, which includes a processor for invoking a computer program in a memory to execute the image display method in any implementation manner of the first aspect or the second aspect. It can be understood that for the beneficial effects that can be achieved by the device 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, reference may be made to the beneficial effects in the first aspect, the second aspect, and any possible implementation manner thereof, which will not be elaborated herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Schematic diagram of an image display method provided for the related art;
[0028] Figure 2 Schematic diagram of a misaligned arrangement of cameras provided for the related art;
[0029] Figure 3 Schematic diagram of the structure of a terminal device provided for an embodiment of the present application;
[0030] Figure 4 Schematic flowchart of an image display method provided for an embodiment of the present application Figure 1 ;
[0031] Figure 5 Schematic diagram of a method for determining a mapping relationship provided for an embodiment of the present application;
[0032] Figure 6 Schematic diagram of an image mapping relationship provided for an embodiment of the present application Figure 1 ;
[0033] Figure 7 Schematic flowchart of an image display method provided for an embodiment of the present application Figure 2 ;
[0034] Figure 8 Schematic diagram of an image mapping relationship provided for an embodiment of the present application Figure 2 ;
[0035] Figure 9 Schematic flowchart of another image display method provided for an embodiment of the present application Figure 1 ;
[0036] Figure 10 Schematic diagram of image size alignment provided for an embodiment of the present application;
[0037] Figure 11 Schematic diagram of an image display method provided for an embodiment of the present application Figure 1 ;
[0038] Figure 12Another schematic flowchart of an image display method provided by an embodiment of the present application Figure 2 ;
[0039] Figure 13 A schematic diagram of an image display method provided by an embodiment of the present application Figure 2 ;
[0040] Figure 14 A schematic structural diagram of a chip system provided by an embodiment of the present application. Detailed implementation manners
[0041] In the description of the present application, unless otherwise specified, "and / or" in the present application is merely an association relationship describing associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. These three situations, where A and B may be singular or plural.
[0042] In the description of the present application, unless otherwise specified, "a plurality of" means two or more than two. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single item (s) or plural item (s). For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c may be single or multiple.
[0043] For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the words such as "first" and "second" do not limit the quantity and execution order, and the words such as "first" and "second" do not necessarily limit being different.
[0044] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" aims to present relevant concepts in a specific manner for easy understanding.
[0045] First, some terms in the embodiments of the present application are explained to facilitate the understanding of those skilled in the art.
[0046] 1. Refractive power. The refractive power is the degree of deviation of the light ray from the relative straight - line route when it enters from one substance into another. The stronger the refractive power, the greater the degree of deviation of the route, that is, the greater the bending degree of the light ray after passing through a convex lens.
[0047] 2. Focal length. The magnitude of the focal length indicates the refractive power. The shorter the focal length, the greater the refractive power. The focal length of the optical lens included in the camera determines the size of the image generated by the object being photographed on the imaging plane. Assuming that the same object is photographed at the same distance, the longer the focal length of the optical lens, the greater the magnification of the image generated by the object being photographed on the imaging plane, such as the photosensitive element.
[0048] 3. Original field of view (FOV), also known as FOV, is used to indicate the maximum angular range that the camera can photograph, or the maximum field of view range that can be photographed. Generally speaking, the angle formed by the limit of the range that the camera can see is called the original FOV. When the object being photographed is within the original FOV of the camera, the object being photographed will be captured by the camera. When the object being photographed is not within the original FOV of the camera, the object being photographed will not be captured by the camera. The original FOVs of different types of cameras are not the same. For example, the original FOV of a wide-angle camera is generally 118°, the original FOV of a short-focus camera is generally 84°, and the original FOV of a long-focus camera is generally 26.8°. The original FOVs of the same type of cameras produced by different manufacturers may also be different. For example, the original FOV of the wide-angle camera produced by manufacturer 1 is 118°, and the original FOV of the wide-angle camera produced by manufacturer 2 is 115°.
[0049] 4. Zoom ratio, also known as magnification ratio, Zoom ratio, zoom magnification ratio, magnification ratio, etc., is a parameter in the optical lens included in a camera, and refers to the ratio of the size of the image of an object formed on the imaging plane, such as the photosensitive element, through the lens to the actual size of the object. By adjusting the zoom ratio of the optical lens, images with different field of view ranges are displayed. Among them, the zoom ratio is related to the field of view range of the image to be presented. For the sake of simplicity of description, in this application, the field of view range of the image to be presented is called the display FOV (or, the real-time display FOV). For example, the zoom ratio is inversely proportional to the display FOV. Since the original FOVs of different cameras are different, that is, the maximum field of view ranges that can be photographed are different, when the original FOV of the camera cannot meet the requirements of the display FOV, the electronic device can switch the camera for photographing so as to obtain an image that meets the requirements of the display FOV and present it to the user.
[0050] 5. Switch magnification, which is used to indicate the default magnification of different cameras. The switch magnifications of different types of cameras are different. For example, the switch magnification of a wide-angle camera is 0.5X. The switch magnification of a short-focus camera is 1X. The switch magnification of a telephoto camera is 2.5X. The switch magnification of a camera corresponds to the original FOV of the camera. For example, for a wide-angle camera with a switch magnification of 0.5X, its corresponding original FOV of the wide-angle camera is 118°. The switch magnifications of the same type of cameras produced by different manufacturers may also be different. It should be noted that the above switch magnification is only an exemplary command for the default magnification of the camera, and the naming of the default magnification of the camera in the embodiments of the present application is not limited to this.
[0051] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.
[0052] With the evolution of services on electronic devices, it has become a development trend to install multiple cameras on electronic devices. For example, dual-camera electronic devices, triple-camera electronic devices, etc. Among them, taking an electronic device including three cameras as an example, the three cameras of the electronic device may include a short-focus camera (or called a main camera), a wide-angle camera, and a telephoto camera. By switching between multiple cameras on the electronic device, pictures with different field-of-view ranges are presented for the user to select. Among them, the user can operate on the corresponding control on the preview interface of the electronic device, such as the control for adjusting the zoom magnification, to achieve the purpose of presenting pictures corresponding to different field-of-view ranges for the user. It can be understood that since the original FOVs of different cameras are different, that is, the maximum field-of-view ranges that can be captured are different, and the larger the zoom magnification, the smaller the transmitted FOV, so the electronic device can select a suitable camera for shooting according to the zoom magnification.
[0053] Exemplarily, as Figure 1 shown, the electronic device is demonstrated as a mobile phone. When the user wants to use the camera to take pictures or record videos, the user can open the camera application of the mobile phone. For example, the user can click on the icon of the camera application on the main screen of the electronic device. In response, the mobile phone can turn on the camera of the mobile phone and display the preview interface 11 as shown in (a) of Figure 1 . The preview interface 11 includes a preview image of the current scene. In addition, the preview interface 11 also includes a control for adjusting the zoom magnification, such as Figure 1The control 12 shown in (a) therein. By operating the control 12, the user can adjust the zoom ratio. The mobile phone determines the transmission display FOV according to the zoom ratio, so as to display the pictures of different field of view ranges of the current scene. It can be understood that different transmission display FOVs result in different preview images presented in the preview interface, specifically reflected in the different imaging sizes of the photographed object in the current scene. The larger the zoom ratio, the larger the imaging size of the photographed object. As Figure 1 shown in (b) therein, the user performs a sliding operation at the control 12 (adjusting the zoom ratio from 1X to 1.5X). In response, the mobile phone can obtain the picture corresponding to the transmission display FOV according to the adjusted zoom ratio, that is, 1.5X, and display it. Among them, the displayed interface can be the preview interface 13 shown in (b) of Figure 1 therein.
[0054] Since the zoom ratios input by the user are different, the transmission display FOVs obtained by the electronic device will be different. And the original FOVs corresponding to different cameras are also different. For example, the original FOV of the wide-angle camera is 118°, that is, the wide-angle camera can take pictures of the scene within a maximum field of view of 118°. The original FOV of the main camera is 84°, that is, the main camera can take pictures of the scene within a maximum field of view of 84°. Therefore, when the original FOV of a camera cannot meet the transmission display FOV determined according to the zoom ratio input by the user, that is, the camera cannot meet the field of view range that the user wants to collect, the mobile phone will switch the camera for shooting to meet the shooting needs of the user.
[0055] However, before and after the camera is switched, due to the misaligned arrangement of different cameras on the electronic device, the target object in the presented picture will visually jump. For example, as shown in combination with Figure 2 shown, the misaligned arrangement between multiple cameras will result in a physical distance between different cameras. As shown in (a) of Figure 2 therein, there is a physical distance between camera 1 and camera 2. For example, there is a physical distance x in the horizontal direction and a physical distance y in the vertical direction. As a result, the position of the target object in the presented picture changes during the camera switching process. For example, as shown in (b) of Figure 2 therein, the target object changes from position 1 corresponding to the 0.6X image to position 2 corresponding to the 1X image, with a position deviation of Tx in the horizontal direction and a position deviation of Ty in the vertical direction, that is, the target object in the picture presented to the user will have a jumping phenomenon.
[0056] To avoid the problem of the position change of the target object in the image caused by the physical distance between cameras, in a related technology, when the user input magnification is in the switching magnification range, the switching magnification is mainly determined based on the focal length of the camera and the scale of the image; so that when the user input magnification reaches the switching magnification, the processed first image and second image have the same scale and field of view angle to achieve the purpose of target alignment. However, although this related technology ensures target alignment before and after switching, there will still be a phenomenon of position jump of the target object during the switching process, which will give the user a sense of jump.
[0057] In another related technology, the corresponding zoom parameter is mainly determined according to the user input magnification and the switching magnification of the camera, and the final image is obtained by adjusting through stereo rectification according to the zoom parameter, so as to display the switched image. In this process, stereo rectification is more suitable for rectification between planes, and the rectification effect on some images with depth is not very good. And the logic of calculating image and image rectification in stereo rectification is complex and the real-time performance is poor.
[0058] To solve the above problems, an embodiment of the present application provides an image display method. After the electronic device receives the operation of the user to adjust the zoom magnification, it determines the corresponding offset at different zoom magnifications to adjust the position of the target object in the image, that is, determines the corresponding first offset at different zoom magnifications, and obtains and displays a preview image by cropping the collected image according to the first offset. The problem of the position change of the target object in the image caused by the physical distance between cameras is avoided, and the processing process is simple, the effect is good, and the real-time performance is good.
[0059] Exemplarily, taking the mobile phone 300 as an example of the above electronic device, Figure 3 shows a schematic structural diagram of the mobile phone 300. As Figure 3 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, a button 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 can be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the mobile phone 300. In some other embodiments of the present application, the mobile phone 300 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0061] The processor 310 may include one or more processing units. For example, the processor 310 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0062] The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0063] A memory may also be provided in the processor 310 for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store the instructions or data that the processor 310 has just used or recycled. If the processor 310 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 310, and thus improves the efficiency of the system. In the embodiments of the present application, the processor 310 can be used to determine the offset corresponding to the adjustment of the zoom ratio 1 to the zoom ratio 2 based on the operation when the mobile phone 300 receives the operation of the user adjusting the zoom ratio 1 to the zoom ratio 2, so that the camera can collect images based on this offset, ensuring that the position of the target object changes with the magnification adjustment when different cameras are switched, thereby avoiding the phenomenon that the position of the target object in the presented picture jumps visually.
[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 interface 311 is an interface compliant with the USB standard specification, which can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 311 can be used to connect a charger to charge the mobile phone 300, and can also be used for data transmission between the mobile phone 300 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices, etc.
[0066] The charging management module 330 is used to receive charging input from a charger. Among them, the charger can be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 330 can receive the charging input of the wired charger through the USB interface 311. In some embodiments of wireless charging, the charging management module 330 can receive the wireless charging input through 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 through the power management module 340. The power management module 340 is used to connect the battery 341, the charging management module 330, and the processor 310. The power management module 340 receives the input from the battery 341 and / or the charging management module 330 and supplies power to the processor 310, the internal memory 321, the display screen 394, the wireless communication module 360, etc. The power management module 340 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 340 can also be provided in the processor 310. In some other embodiments, the power management module 340 and the charging management module 330 can also be provided in the same device.
[0067] The wireless communication function of the mobile phone 300 can be implemented through antenna 1, antenna 2, the mobile communication module 350, the wireless communication module 360, the modulation and demodulation processor, and the baseband processor, etc.
[0068] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone 300 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: Antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0069] The mobile communication module 350 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G applied to the mobile phone 300. The mobile communication module 350 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 350 can receive electromagnetic waves through the antenna 1, filter, amplify and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The wireless communication module 360 can provide solutions for wireless communications such as 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 technology (IR), etc. applied to the mobile phone 300.
[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, so that the mobile phone 300 can communicate with the network and other devices through wireless communication technologies.
[0071] The mobile phone 300 can implement the shooting function through the ISP, camera 393, video codec, GPU, display screen 394, and application processor, etc.
[0072] The GPU is a microprocessor for image processing, connected to the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or change display information.
[0073] The display screen 394 is used to display images, videos, etc. The display screen 394 includes a display panel. For example, the display screen 394 can be a touch screen. In some embodiments of the present application, after the user opens the camera application, the display screen 394 can be used to display the preview interface of the FOV corresponding to different magnifications in the coordinate system of the second camera. The user can perform a selection operation on the first magnification on the preview interface.
[0074] The camera 393 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the mobile phone may include N cameras 393, where N is a positive integer greater than 1. In some embodiments of the present application, these N cameras 393 may include a first camera and a second camera. After the mobile phone receives the operation of 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, the camera 393 can be used to collect a preview image and present it to the user through the display screen 394. When the currently collected preview image is captured by the first camera, if the user's operation to adjust the zoom ratio 1 to the zoom ratio 2 is received, then in response, the first camera can collect the preview image based on the offset corresponding to the zoom ratio 2 adjusted from the zoom ratio 1, and present it to the user through the display screen 394.
[0075] The external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 300.
[0076] The internal memory 321 can be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 321 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the mobile phone 300 (such as audio data, phone book, etc.). In addition, the internal memory 321 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 310 executes various functions and data processing of the mobile phone 300 by running the instructions stored in the internal memory 321, and / or the instructions stored in the memory provided in the processor 310.
[0077] The audio module 370 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 370 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 370 can be disposed in the processor 310, or some functional modules of the audio module 370 can be disposed 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] The keys 390 include a power-on key, a volume key, etc. The keys 390 can be mechanical keys or touch keys. The mobile phone 300 can receive key inputs and generate key signal inputs related to the user settings and function controls of the mobile phone 300.
[0080] The motor 391 can generate a vibration prompt. The motor 391 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. The indicator 392 can be an indicator light and can be used to indicate the charging state, the change in battery level, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 395 is used to connect to the SIM card. The SIM card can be inserted into or removed from the SIM card interface 395 to achieve contact and separation from the mobile phone 300.
[0081] Since the adjustment of the zoom ratio may cause a camera switch, in order to avoid the phenomenon of screen jump during camera switching, in some embodiments, after receiving the user's operation of adjusting the zoom ratio, the electronic device can determine the mapped ratio corresponding to the adjusted zoom ratio through a mapped ratio mechanism, and thus crop the image captured by the camera based on the display FOV corresponding to the mapped ratio to obtain a preview image and display it. In other embodiments, after receiving the user's operation of adjusting the zoom ratio, the electronic device can determine the display FOV corresponding to the adjusted zoom ratio through a mapped ratio mechanism, and thus crop the image captured by the camera based on the corresponding display FOV to obtain a preview image and display it. This ratio mapping mechanism can unify the display FOVs of different cameras near the switching point to avoid the phenomenon of screen jump near the switching point. The following combines Figure 4 the embodiments shown and Figure 7 the embodiments shown to introduce the above two solutions in detail.
[0082] As Figure 4 shown, Figure 4 FIG. shows a schematic flowchart of an image display method provided by an embodiment of the present application Figure 1 , and the method may include: S401 - S403.
[0083] S401. Display the preview image captured by the first camera.
[0084] S402. Receive the operation of the user to adjust the zoom ratio 1 to the zoom ratio 2.
[0085] Multiple cameras are installed on the electronic device for the user to use. For example, the electronic device includes a main camera, a wide-angle camera, and a telephoto camera. The first camera can be a wide-angle camera or a telephoto camera.
[0086] Among them, the electronic device can allow the user to mobilize the camera through applications such as the camera application to take pictures of the current scene. Exemplarily, taking the mobilization of the camera through the camera application to take pictures as an example. The electronic device receives the operation of the user to open the camera application. In response, the electronic device can turn on the camera and display a preview interface, which includes the preview image captured by the camera. For example, taking the first camera currently turned on by the electronic device as the wide-angle camera, when the wide-angle camera is turned on, the preview interface can include the preview image captured by the wide-angle camera.
[0087] Generally, after the camera is turned on, the delivered FOV is defaulted to the original FOV of the camera, that is, the zoom ratio is the switching ratio corresponding to the original FOV. For example, taking the switching ratio of the wide-angle camera as 0.5X and the original FOV as 118° as an example, after the wide-angle camera is turned on, it can take pictures of the visual field range corresponding to the original FOV to obtain an image, such as called the original image. Then, the electronic device can obtain the preview image based on the delivered FOV, which is also 118° at this time, and display it through the display screen. Since the delivered FOV is the same as the original FOV at this time, it can be considered that the electronic device directly displays the original image as the preview image.
[0088] The preview interface can also include a control for adjusting the zoom ratio for the user to adjust the visual field range of the picture to be presented. For example, the user can perform an adjustment operation on the zoom ratio according to the shooting needs. For example, if the user adjusts the zoom ratio from zoom ratio 1 (such as 0.5X) to zoom ratio 2 (such as 0.8X), then the electronic device can receive the adjustment operation of the zoom ratio by the user.
[0089] Among them, the above zoom ratio 2 can be the first ratio in the embodiments of the present application. The operation in S402 can be the selection operation in the embodiments of the present application.
[0090] S403. In response to the operation in S402, display the preview image captured by the first camera at the mapping ratio, and the mapping ratio and the zoom ratio 2 satisfy a mapping relationship, which is used to indicate the relationship of different ratios mapped from the coordinate system of the first camera to the reference coordinate system.
[0091] Among them, the second camera can be the above-mentioned main camera. The above mapping magnification can be the second magnification in the embodiments of the present application, and the preview image in S403 is the first preview image in the embodiments of the present application.
[0092] Exemplarily, after the electronic device receives the operation of the user adjusting the zoom magnification 1 to the zoom magnification 2, in response to this operation, it can display the preview image captured by the first camera at the mapping magnification obtained through the mapping magnification mechanism. This mapping magnification (or called Map zoom magnification) is determined based on the above zoom magnification 2.
[0093] In some examples, in combination with the example in S402, continue to take the first camera as a wide-angle camera, the zoom magnification 1 as 0.5X, and the zoom magnification 2 as 0.8X as an example. After the electronic device receives the operation of the user adjusting the zoom magnification from 0.5X to 0.8X, in response, the electronic device can determine the mapping magnification corresponding to 0.8X through the mapping magnification mechanism. For example, the electronic device can obtain the mapping magnification corresponding to 0.8X based on the pre-acquired mapping relationship. For example, the determined mapping magnification is 0.72X. Then, the electronic device can display the preview image captured by the wide-angle camera at the mapping magnification of 0.72X. That is, the electronic device can obtain the image of the field of view range corresponding to 0.72X, that is, obtain the preview image and display it. For example, the electronic device can determine the corresponding display FOV based on the mapping magnification, and thus crop the original image captured by the wide-angle camera based on the display FOV to obtain the preview image and display it.
[0094] As described in the foregoing embodiments, the jump of the preview screen when switching cameras is caused by the inconsistency of the display FOV near the switching point. The inconsistency of the display FOV near the switching point is due to different cameras having different original FOVs, that is, the corresponding relationships between the display FOVs of different cameras and the zoom magnification are different. The corresponding relationships between the display FOVs of different cameras and the zoom magnification can be considered as different coordinate systems of different cameras. In this embodiment, through the above mapping magnification mechanism, the zoom magnifications under different cameras can be mapped to a unified coordinate system, such as a unified mapping to the reference coordinate system, so as to achieve the purpose of making the corresponding relationships between the display FOVs of different cameras and the zoom magnification roughly unified. In the embodiments of the present application, the mapping relationship from the coordinate system of the first camera to the reference coordinate system for different magnifications can be determined in advance. And the pre-determined mapping relationship is configured in the electronic device. In this way, it can be ensured that the display FOV near the switching point does not jump, so that the preview screen does not jump.
[0095] Among them, the reference coordinate system can be the coordinate system of any one of the multiple cameras included in the electronic device. For example, it can be the coordinate system of the wide-angle camera, or the coordinate system of the telephoto camera, or the coordinate system of the main camera. The reference coordinate system can also be a coordinate system different from the coordinate systems of the multiple cameras included in the electronic device, and no specific limitation is made here.
[0096] Next, continue to take the first camera as the wide-angle camera, and take the reference coordinate system as the coordinate system of the second camera, and the second camera as the main camera as an example to illustrate the above mapping magnification mechanism, that is, the determination process of the mapping relationship.
[0097] First, map the switching magnification of the wide-angle camera to the coordinate system of the main camera to obtain the mapped switching magnification (Map switch magnification).
[0098] Among them, the mapping ratio can be determined first. The mapping ratio is used to indicate the proportional relationship between the first FOV and the second FOV in the coordinate system of the second camera. Among them, the first FOV is the FOV corresponding to the switching magnification of the first camera, that is, the original FOV of the first camera. The second FOV is the FOV corresponding to the switching magnification of the second camera, that is, the original FOV of the second camera.
[0099] Exemplarily, combined with 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 according to Figure 5 C1 and C2 shown.
[0100] For example,
[0101] Generally, the original FOV of the camera is related to the imaging width of the camera under the original FOV and the focal length of the camera. For example, imaging width / focal length = tan(original FOV).
[0102] In this way, the relationship between the original FOV of the first camera (i.e., the first FOV) and the imaging width of the camera under the original FOV and the focal length f uw of the first camera is:
[0103] The relationship between the original FOV of the second camera (i.e., the second FOV) and the imaging width of the camera under the original FOV and the focal length f w of the second camera is:
[0104] Then, the magnification corresponding to the first camera can be mapped from the coordinate system of this camera to the coordinate system of the second camera by replacing the focal length of the first camera in the above relationship with the focal length of the camera to be mapped, that is, the focal length of the second camera.
[0105] Among them, the relationship after replacement is:
[0106] Based on the above:
[0107] That is, the mapping ratio can be determined by the following formula (1):
[0108]
[0109] Among them, α1 is the first FOV, and α2 is the second FOV. Continuing with the above example, taking the first camera as the wide-angle camera and the second camera as the main camera as an example, α1 is 118°, and α2 is 84°, so as to determine the mapping ratio = 5.5.
[0110] Then, the mapping switching magnification can be determined according to the determined mapping ratio and the switching magnification of the main camera.
[0111] For example, the mapping switching magnification can be determined by the following formula (2):
[0112]
[0113] That is, the Map switch magnification = 5.5 * the switching magnification of the main camera. Among them, when the switching magnification of the main camera is 1X, according to the above formula, the Map switch magnification = 5.5 * 1 = 5.5 can be determined.
[0114] After that, based on the determined mapping switching magnification and the switching magnification of the wide-angle camera, the above mapping relationship can be determined.
[0115] Exemplarily, the above mapping relationship can be represented by the following formula (3):
[0116] Map zoom = F * zoom Formula (3)
[0117] Among them, 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 an example, taking zoom magnification 2 as 0.8X, inputting 0.8X into the above formula (3), the corresponding mapping magnification can be obtained, such as the mapping magnification is 0.72X.
[0118] After determining the mapping relationship in the above manner, it can be ensured that during the process of camera switching, the transmitted display FOV near the switching point is consistent, so that the picture presented to the user is a smoothly changing picture. That is, the change in the transmitted display FOV caused by adjusting the zoom ratio is continuous, as Figure 6 shown, thus ensuring that the transmitted display FOV near the switching point is aligned.
[0119] After obtaining the mapping magnification, the electronic device can display the first camera, such as the preview image captured by the wide-angle camera at this mapping magnification (such as 0.72X). That is, the electronic device can obtain the image within the field of view corresponding to 0.72X, that is, obtain and display the preview image.
[0120] Among them, the electronic device can first determine the FOV corresponding to this mapping magnification according to the mapping magnification. The FOV corresponding to the mapping magnification is the transmitted display FOV at this time.
[0121] According to the principle of determining the mapping switching magnification, it can be known that:
[0122] Mapping magnification = mapping ratio * switching magnification of the second camera. And the 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] Then, the mapping magnification = (tanX / tanα2) * switching magnification of the second camera, then,
[0124] X = arctan[(mapping magnification / switching magnification of the second camera) * tanα2] Formula (4).
[0125] Continuing with the above example, taking the switching magnification of the second camera as 1X and α2 as 84° as an example, then according to the above formula (4), X can be obtained as 110°. That is, when the zoom ratio input by the user is 0.8X, the actual transmitted display FOV after internal processing by the electronic device is 110°. Similarly, if the zoom ratio input by the user is 0.95X, the actual transmitted display FOV after internal processing by the electronic device is 86°. It can be understood that the transmitted display FOV near the switching point of 1X approaches the transmitted display FOV after switching the camera (main camera), such as 84°.
[0126] After determining the FOV corresponding to the mapping magnification, that is, determining the transmitted display FOV at this time, the electronic device can crop the image captured by the first camera based on this transmitted display FOV. Exemplarily, the electronic device can crop the image captured by the first camera under the original FOV (such as called the original image) based on this transmitted display FOV. After that, the cropped image, that is, the preview image, can be displayed to the user.
[0127] It should be noted that the mapping relationship obtained in the above embodiments can be understood as the mapping relationship corresponding to the first camera, which is used to implement the mapping of the zoom ratio during the shooting process using 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 the zoom ratio during the shooting process using 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 the zoom ratio when shooting using 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. In this way, if an operation for adjusting the zoom ratio is received during the shooting process using the wide-angle camera, the zoom ratio mapping can be implemented based on this mapping relationship. The mapping relationship corresponding to the telephoto camera can also be obtained. In this way, if an operation for adjusting the zoom ratio is received during the shooting process using the telephoto camera, the zoom ratio mapping can be implemented based on this mapping relationship.
[0128] In addition, the above embodiments are described by taking the coordinate system of the second camera as the reference coordinate system as an example. Then, in the current situation of shooting using the second camera, if an operation for adjusting the zoom ratio is received by the user, there is no need to perform the zoom ratio mapping according to the above process. Instead, the captured image is directly cropped and displayed according to the transmitted display FOV corresponding to the adjusted zoom ratio. In other embodiments, if the reference coordinate system is different from the coordinate systems of the first camera and the second camera in the above embodiments, then, in addition to determining the mapping relationship corresponding to the second camera to implement the mapping of the zoom ratio when shooting using the second camera, it is also necessary to determine the mapping relationship corresponding to the first camera to implement the mapping of the zoom ratio when shooting using the first camera. The specific process of determining the mapping relationship and implementing the zoom ratio mapping can refer to the description of the above embodiments and will not be elaborated here in detail.
[0129] With this technical solution, by mapping the zoom ratio from the first camera coordinate system to a unified reference coordinate system, the mapped zoom ratio is obtained. Then, the corresponding transmitted display FOV is determined according to the mapped zoom ratio, and then cropping and display are performed. This avoids the phenomenon that the presented picture visually jumps due to inconsistent transmitted display FOVs near the switching point, ensuring the user experience. And there is no longer a need to rely on depth data to calculate the zoom ratio, and the real-time performance is better.
[0130] As Figure 7 shown, Figure 7 FIG. is a schematic flowchart of an image display method provided by an embodiment of the present application Figure 2 , and the method may include: S701 - S703.
[0131] S701. Display the preview image captured by the first camera.
[0132] S702. Receive the operation of the user to adjust the zoom ratio 1 to the zoom ratio 2.
[0133] Among them, the specific descriptions of S701 - S702 can refer to the specific descriptions of the corresponding content in S401 - S402 in the above - mentioned embodiments, and will not be elaborated here in detail.
[0134] S703. In response to the operation in S702, display the preview image captured by the first camera; the preview image is obtained by cropping the image captured by the first camera based on the target FOV; the target FOV and the zoom ratio 2 satisfy a mapping relationship, and the mapping relationship is used to unify the FOVs of the first camera and the second camera near the switching point.
[0135] Among them, the preview image in S703 is the first preview image in the embodiments of the present application.
[0136] Exemplarily, after the electronic device receives the operation of the user to adjust the zoom ratio 1 to the zoom ratio 2, in response to this operation, it can determine the target FOV as the FOV for display based on the zoom ratio 2 and the mapping relationship, and obtain and display the preview image based on the target FOV. For example, the electronic device can crop the image captured by the first camera under the original FOV (such as called the original image) based on the target FOV to obtain and display the preview image.
[0137] For example, taking the first camera as a wide - angle camera, the zoom ratio 1 as 0.5X, and the zoom ratio 2 as 0.8X as an example. After the electronic device receives the operation of the user to adjust the zoom ratio from 0.5X to 0.8X, as a 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 under the original FOV (such as 118°) based on 110° to obtain and display the 110° preview image.
[0138] Among them, the mapping relationship is used to unify the FOVs of the first camera and the second camera near the switching point. It can be understood that for the same zoom ratio, the target FOV determined based on the mapping relationship is different from the FOV determined based on this zoom ratio in the related art. For example, the FOV corresponding to 0.95X determined in the related art is 90°, while the FOV corresponding to 0.95X determined in the present application is 86°. Compared with the related art, near the switching point where the first camera and the second camera are switched, the FOV for display can be basically kept consistent.
[0139] In the embodiments of the present application, the above 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, curve fitting can be performed 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, that is, the mapping relationship.
[0140] Among them, curve fitting can refer to selecting an appropriate curve type to fit the observed data. In this embodiment, there are various ways of curve fitting, such as quadratic function, cubic function, B-spline, Bezier curve, etc. The embodiments of the present application do not make specific limitations here.
[0141] The above first camera can be a wide-angle camera or a telephoto camera. The second camera can be the main camera. Then, by performing the above curve fitting process, the transmitted FOV can be basically kept consistent near the switching point where the first camera and the second camera are switched. The first camera can also include multiple cameras, such as including a wide-angle camera and a telephoto camera. Then, the switching magnification and the original FOV corresponding to the switching magnification of each camera among these multiple cameras are used for curve fitting. In this way, the transmitted FOV can be basically kept consistent near the switching point where these multiple cameras and the second camera are switched.
[0142] Combined Figure 8 As shown, taking the first camera including multiple cameras, such as including a wide-angle camera and a telephoto camera, and the second camera being the main camera as an example, the switching magnification and the corresponding original FOV of the wide-angle camera, such as (0.5X, 118°), the switching magnification and the corresponding original FOV of the telephoto camera, such as (2.5X, 26.8°), are curve-fitted with the switching magnification and the corresponding original FOV of the main camera, (1X, 84°), so as to obtain a curve as shown in Figure 8 As shown, that is, the above mapping relationship is obtained. In this way, during the process of the user adjusting the zoom magnification, the corresponding target FOV can be determined based on this mapping relationship as the transmitted FOV to realize the display of the preview image.
[0143] Adopting this technical solution, the target FOV corresponding to the zoom magnification is obtained through the mapping magnification mechanism, so that the transmitted FOV near the switching point where different cameras are switched can be basically kept consistent. It avoids the phenomenon that the presented picture jumps visually due to the inconsistent transmitted FOV near the switching point, and ensures the user experience. And it is no longer necessary to rely on depth data to calculate the zoom magnification, and the real-time performance is better.
[0144] As can be understood from the above embodiments, after receiving the zoom ratio input by the user, the electronic device can determine the actual FOV to be displayed, i.e., the displayed FOV, according to the input zoom ratio, and then crop the image captured by the camera based on the displayed FOV and display it. However, for an electronic device including multiple cameras, different cameras are set at different positions of the electronic device, that is, there is a physical distance between different cameras. In this way, when switching between different cameras, due to the physical distance between different cameras, the position of the object being photographed in the preview image presented to the user before and after switching cameras changes, resulting in parallax for the user and poor user experience.
[0145] In order to ensure that the position of the object being photographed in the preview image presented to the user before and after switching cameras does not jump, in the embodiments of the present application, after receiving the operation of the user to adjust the zoom ratio, the electronic device can determine the corresponding offset at different zoom ratios to adjust the position of the object being photographed in the preview image, so that the position of the object being photographed in the preview image presented to the user before and after switching cameras remains basically the same.
[0146] Among them, the object to be photographed whose position needs to be basically the same in the above can be called the target object in this embodiment. The target object can be any one or more of the objects to be photographed included in the current scene. For example, the target object can at least include the object to be photographed at the center position of the current scene.
[0147] The following will Figure 9 and Figure 12 illustrate the above process in detail with reference to the embodiments shown.
[0148] Figure 9 Another schematic flowchart of an image display method provided by an embodiment of the present application Figure 1 includes: S901 - S902.
[0149] S901. Receive the operation of the user to adjust the zoom ratio 1 to the zoom ratio 2.
[0150] Among them, the zoom ratio 1 can be the first ratio in the embodiments of the present application, and the zoom ratio 2 can be the second ratio in the present application.
[0151] S902. In response to the operation in S901, display the 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 zoom ratio 2 based on the first offset; the first offset is related to the second offset and the ratio adjustment amount.
[0152] Among them, 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 collected by the first camera at the first switching magnification, and the second image is an image collected by the second camera at the second switching magnification.
[0153] Exemplarily, after the electronic device receives the operation of the user to adjust the zoom magnification 1 to the zoom magnification 2 and responds to this operation, the electronic device can determine the display FOV corresponding to the zoom magnification 2. The electronic device can also determine the first offset (e.g., referred to as use offset). Then, the electronic device can crop the image (or referred to as the original image) collected by the first camera under the original FOV based on the display FOV and the first offset to obtain the display image, that is, the above-mentioned first preview image.
[0154] For example, taking the first camera as a wide-angle camera as an example. When the zoom magnification 1 is 0.5X and the zoom magnification 2 is 0.6X, after the electronic device receives the operation of the user to adjust the zoom magnification 1 to the zoom magnification 2, it can determine the display FOV corresponding to 0.6X and determine the first offset corresponding to this zoom magnification adjustment. Then, the electronic device can crop the original image collected by the first camera based on the display FOV and the first offset corresponding to this zoom magnification adjustment to obtain the display image and display it. Then, the user adjusts the zoom magnification again, such as adjusting the zoom magnification from 0.6X to 0.8X. In response to this operation, it can determine the display FOV corresponding to 0.8X and determine the first offset corresponding to the second zoom magnification adjustment, and based on this, obtain the preview image and display it.
[0155] It should be noted that the electronic device can use the method of the above Figure 4 or Figure 7 shown embodiment to determine the display FOV corresponding to the zoom magnification 2. In some other embodiments, the electronic device can also use the method in the related technology to determine the display FOV corresponding to the zoom magnification 2, and the embodiments of the present application do not make specific limitations here.
[0156] Among them, the above-mentioned first offset is related to the second offset (total offset) and the magnification adjustment amount. Among them, the second offset refers to the total offset required during the switching of the two cameras.
[0157] Exemplarily, taking two cameras as the first camera and the second camera as an example. The total offset required during the switching process of the first camera and the second camera, that is, the second offset, can be determined based on the offset between the target objects in the first image acquired by the first camera at the first switching magnification and the second image acquired by the second camera at the second switching magnification. For example, if the first camera is a wide-angle camera, the second camera is the main camera, the first switching magnification is 0.5X, and the second switching magnification is 1X, then the total offset, that is, the second offset, can be determined according to the position of the target object in the first image acquired by the wide-angle camera at 0.5X and the position of the target object in the second image acquired by the main camera at 1X.
[0158] Among them, the positions of the target object in the first image and the second image can be determined by feature point matching or feature point tracking. The so-called feature point matching can refer to finding matching feature points in two images and calculating the pixel difference to obtain the offset of the same feature point. Then, through feature point matching, the offset of the same target object in the first image and the second image can be obtained, and this offset is the above-mentioned second offset. For example, if the target object corresponds to feature point A in the first image, and the pixel of feature point A is (300, 400), and the target object corresponds to feature point B in the second image, and the pixel of feature point B is (600, 800), then by determining the pixel difference between feature point A and feature point B, the above-mentioned second offset can be determined.
[0159] The so-called feature point tracking can refer to finding obvious feature points in the image, tracking the obvious feature points, and calculating the pixel difference of the feature points before and after tracking to obtain the offset of the same feature point. Then, through feature point tracking, the change amount of the position of the same target object in the first image and the second image can be obtained, and this change amount is the above-mentioned second offset. For example, if the target object corresponds to feature point C in the first image and corresponds to feature point D in the second image, then by determining the pixel difference between feature point C and feature point D, the above-mentioned second offset can be determined.
[0160] In addition, since the sizes of the images acquired by different cameras are not the same, before determining the second offset, the sizes of the images acquired by different cameras can be unified first. For example, to determine the second offset based on the positions of the target object in the first image and the second image, specifically, it can include: unifying the sizes of the first image and the second image. After that, the second offset can be determined based on the position of the target object in the first image with the unified size and the position of the target object in the second image.
[0161] Exemplarily, taking the first camera as a wide-angle camera and the second camera as the main camera, the transmitted FOV is based on the above Figure 4 or Figure 7The embodiment shown is taken as an example. Figure 10 As shown, the size of the image 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 in FIG. 101 , the size of the image captured by the main camera at the switching magnification is 3600*2400, that is, the size of the second image is 3600*2400, as shown in FIG. Figure 10 Then, the sizes of the first image and the second image are unified, for example, the first image is reduced so that the size of the reduced first image is the same as the size of the second image, for example, the reduced first image is called the third image, that is, the size of the third image is 3600*2400, as shown in FIG. Figure 10 After the above-mentioned sizes are scaled to be consistent, the offset between the position of the target object in the second image and the position of the target object in the third image is determined, such as, Figure 10 103 in A and Figure 10 The distance between B in 102 can obtain the above-mentioned second offset.
[0162] It should be noted that the above embodiment is described by reducing the first image to unify the sizes of the first image and the second image. In some other implementations, the sizes of the first image and the second image may be unified by enlarging the second image, which is not specifically limited here.
[0163] In another exemplary embodiment, the first camera is a wide-angle camera, the second camera is a main camera, and the FOV is based on the above Figure 4 or Figure 7 The embodiment shown is determined as an example. Figure 10 As shown, the size of the image 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 in FIG. 101 , the size of the image captured by the main camera at the switching magnification is 3600*2400, that is, the size of the second image is 3600*2400, as shown in FIG. Figure 10 Then, the sizes of the first image and the second image are unified. For example, the sizes of the first image and the second image can be scaled to a unified size, such as 300*400, to obtain a corresponding scaled image, such as the third image 1. Figure 10 As shown in 104 and the third image 2, as Figure 10 After the above-mentioned sizes are scaled 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 104 C and Figure 10 The second offset can be obtained by calculating the distance between D in 105.
[0164] In this way, after receiving the operation of the user to adjust the zoom ratio from zoom ratio 1 to zoom ratio 2, the electronic device can determine the first offset corresponding to the current zoom ratio adjustment based on the above-mentioned second offset, zoom ratio 1, and zoom ratio 2. Combining Figure 11 , specifically, first, the proportion of the current adjustment amount from zoom ratio 1 to zoom ratio 2 in the total adjustment amount from the first switching ratio to the second switching ratio can be obtained. After that, the first offset corresponding to the current zoom ratio adjustment can be determined based on this proportion and the third offset.
[0165] Among them, as an example, the proportion of the above-mentioned current adjustment amount in the total adjustment amount can be determined by the following formula (5):
[0166] Ratio rate = (zoom ratio 2 - zoom ratio 1) / (second switching ratio - first switching ratio) Formula (5)
[0167] Among them, Ratio rate is the proportion of the above-mentioned 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 corresponding to the second camera.
[0168] The first offset corresponding to the current zoom ratio adjustment can be determined by the following formula (6):
[0169] Use offset = offset * Ratio rate Formula (6)
[0170] Among them, Ratio rate is the proportion of the above-mentioned current adjustment amount in the total adjustment amount, Use offset is the first offset corresponding to the current zoom ratio adjustment, and offset is the third offset.
[0171] If the current adjustment of the zoom ratio is the first adjustment of the zoom ratio by the user after the camera is turned on, the third offset can be the above-mentioned second offset. If the current adjustment of the zoom ratio is not the first adjustment, the third offset is the remaining offset (remain offset) in the second offset. Among them, the remaining offset can be obtained by subtracting the cumulative offset from the second offset. The cumulative offset is the cumulative sum of the offset adjustments before the current adjustment of the zoom ratio.
[0172] Exemplarily, in the case where the current adjustment of the zoom ratio is the first adjustment of the zoom ratio by the user, the first offset corresponding to the current zoom ratio 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, the first switching magnification as 0.5X, the second camera as the main camera, and the second switching magnification as 1X as an example. The user adjusts the zoom magnification from zoom magnification 1 to zoom magnification 2, such as from 0.5X to 0.6X. The second offset is 10 cm. According to the above proportion formula (6), Ratio rate = (0.6X - 0.5X) / (1X - 0.5X) = 0.2 can be determined. Then, according to the above formula (7), the first offset Useoffset = 10 * 0.2 = 2 cm corresponding to this zoom magnification adjustment can be determined.
[0175] Exemplarily, when this adjustment of the zoom magnification is not the first adjustment, the first offset corresponding to this zoom magnification adjustment can be determined through the following formula (8):
[0176] Use offset = remain offset * Ratio rate Formula (8)
[0177] Exemplarily, for example, the user adjusts from zoom magnification 1 to zoom magnification 2, such as from 0.6X to 0.8X. The remaining offset in the second offset is 8 cm. According to the above proportion formula, Ratio rate = (0.8X - 0.6X) / (1X - 0.5X) = 0.4 is determined. Then, according to the above formula for the first offset, Use offset = 8 * 0.4 = 3.2 cm is determined.
[0178] After determining the first offset and the displayed FOV, the electronic device can crop the image (or the so-called original image) collected by the first camera under the original FOV based on the displayed FOV and the first offset to obtain the displayed image, that is, the above first preview image.
[0179] Adopting this technical solution, after receiving the operation of the user to adjust the zoom magnification, the electronic device can determine the corresponding offsets at different zoom magnifications to adjust the position of the photographed object in the preview image, so that the position of the photographed object in the preview image presented to the user remains basically the same before and after switching the camera. And it no longer relies on stereo correction to adjust the position of the photographed object in the preview image, and the real-time performance is better.
[0180] Figure 12 Another schematic flowchart of an image display method provided by an embodiment of the present application Figure 2 This method may include: S1201 - S1202.
[0181] S1201. Receive the operation of the user to adjust the zoom magnification 1 to the zoom magnification 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 zoom ratio of 2 based on the first offset; the first offset and the zoom ratio of 2 satisfy a mapping relationship, and the mapping relationship includes the corresponding relationship between different ratios and offsets.
[0183] Among them, the specific descriptions of S1201 - S402 can refer to the specific descriptions of the corresponding contents in S401 - S402 in the above embodiments, and will not be elaborated here in detail.
[0184] The implementation process in this embodiment is similar to Figure 9 However, the difference is that the process of determining the first offset in this embodiment is different from that in Figure 9 the embodiment. Specifically, in this embodiment, the first offset is determined based on the mapping relationship.
[0185] Among them, the mapping relationship includes the corresponding relationship between different ratios and offsets. The above mapping relationship can be determined based on the second switching ratio and the second offset of the second camera. Since the first camera is switched to the second camera, the mapping relationship can be determined based on the second switching ratio 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. For example, the second switching ratio and the second offset of the main camera are used to form a curve function to obtain a smooth curve, that is, the mapping relationship.
[0186] Exemplarily, the function curve can be an inverse - proportion function. That is to say, based on the second switching ratio and the second offset of the second camera, the above - mentioned mapping relationship can be determined using the inverse - proportion function. For example, the determined mapping relationship can be as Figure 13 shown.
[0187] It should be noted that the above embodiments are described by taking the first camera as a wide - angle camera as an example. In some other embodiments, when the first camera includes multiple cameras, such as including a wide - angle camera and a telephoto camera, the determination of the mapping relationship can refer to the overview of the corresponding content in S703, and will not be overviewed here.
[0188] Adopting this technical solution, the electronic device can, after receiving the operation of the user to adjust the zoom ratio, determine the corresponding offset at different zoom ratios to adjust the position of the object to be photographed in the preview image, so that the position of the object to be photographed in the preview image presented to the user is basically the same before and after switching the camera. In addition, it no longer relies on stereo correction to adjust the position of the object to be photographed in the preview image, and the real - time performance is better.
[0189] In summary, by displaying images in the above-described manner, it is possible to ensure that the transmitted FOV near the switching point where different cameras are switched is basically the same, and the position of the object being photographed in the preview image presented to the user is basically the same. Thus, the user experience is guaranteed.
[0190] Some other embodiments of the present application provide an electronic device, which may include: the above-mentioned display screen, multiple cameras, a memory, and one or more processors. The display screen, multiple cameras, memory, and processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform each function or step that the mobile phone performs in the above method embodiments. The structure of the electronic device can refer to Figure 3 the structure of the mobile phone shown.
[0191] Embodiments of the present application also provide a chip system, as Figure 14 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 can be interconnected by a line. For example, the interface circuit 1402 can be used to receive signals from other devices (such as the memory of the electronic device). For another example, the interface circuit 1402 can be used to send signals to other devices (such as the processor 1401). Exemplarily, the interface circuit 1402 can read the instructions stored in the memory and send the instructions to the processor 1401. When the instructions are executed by the processor 1401, the electronic device can perform each step in the above embodiments. Of course, the chip system can also include other discrete devices, and the embodiments of the present application do not make specific limitations on this.
[0192] Embodiments of the present application also provide a computer storage medium, which includes computer instructions. When the computer instructions run on the above-mentioned electronic device, the electronic device performs each function or step that the electronic device performs in the above method embodiments.
[0193] Embodiments of the present application also provide a computer program product. When the computer program product runs on a computer, the computer performs each function or step that the electronic device performs in the above method embodiments.
[0194] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0195] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0196] The units described as separate components may or may not be physically separated. The components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0197] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0198] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store program codes.
[0199] The above content is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. An image display method, characterized in that, Applied to an electronic device including at least a first camera and a second camera, the method includes: Receiving an operation by the user to adjust a first magnification to a second magnification; 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, and the second offset is the 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 according to claim 1, wherein , the method further includes; Determining the second offset based on the position of the target object in the first image and the 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 according to claim 2, wherein , the determining the first offset based on the second offset, the first magnification, and the second magnification includes: Obtaining a proportion of the current magnification adjustment amount from the first magnification to the second magnification in the 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 the case where this magnification adjustment is the first adjustment, the third offset is the second offset; in the case where this magnification adjustment is not the first adjustment, the third offset is the remaining offset in the second offset.
4. The method according to any one of claims 2-3, characterized in that , the determining the second offset based on the position of the target object in the first image and the position of the target object in the second image includes: Unifying the sizes of the first image and the second image to the same size; determining the second offset 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 sizes.
5. The method according to any one of claims 1-4, wherein 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.
6. An image display method, characterized in that, Applied to an electronic device including multiple cameras, the multiple cameras including a first camera, the method includes: Receiving an operation by the user to adjust a first magnification to a second magnification; 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 satisfies a mapping relationship with the second magnification, and the mapping relationship includes a correspondence between different magnifications and offsets.
7. The method according to claim 6, characterized in that, The multiple cameras further include a second camera, and the method further includes: Determine a mapping relationship based on the second switching magnification and the second offset of the second camera; wherein, 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 acquired by the first camera at the first switching magnification, and the second image is an image acquired by the second camera at the second switching magnification.
8. The method according to claim 6 or 7, wherein the second camera is the main camera of the electronic device; the first camera includes the wide-angle camera and / or the 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 and the plurality of cameras are coupled to the processor; wherein, the memory is configured to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device is caused to execute the method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, including computer instructions; when the computer instructions run on the electronic device, the electronic device is caused to execute the method according to any one of claims 1-8.
Citation Information
Patent Citations
Projection system, image processing apparatus, and correction method
CN104811637A
Shooting method and device
CN110445978A
Zoom control method, system, equipment and medium
CN114285992A
Shooting method and electronic equipment
CN114531539A
Driving motor, camera module and electronic equipment
CN117134571A