Camera display picture switching method, electronic equipment, storage medium and program product
The method addresses display issues during camera lens switching by generating a static image from the current lens's feed to transition smoothly to the new lens's feed, ensuring a seamless display experience.
Patent Information
- Application Number
- CN202510362238.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-15
AI Technical Summary
When the performance of mobile phone devices is weak, the camera lens is likely to have lag or black screen problems, resulting in unsmooth changes in the camera display screen.
By generating a real-time picture static picture based on the first lens as a transition, the unsmooth feeling during the lens switching is covered, and the static picture is used to transition in the camera display screen until the real-time picture of the second lens is loaded.
It realizes smooth switching of the camera display screen during the lens switching process, reducing lag and black screen phenomena, and providing a coherent user experience.
Smart Images

Figure CN120321355A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and particularly to a method for switching a camera display screen, an electronic device, a storage medium, and a program product. Background Art
[0002] Some current mobile devices are configured with multiple different lenses to be applicable to different shooting scenarios. Switching between different lenses is involved in some shooting scenarios. When switching lenses during shooting, complex tasks such as hardware scheduling, software optimization, and system resource allocation are often involved. If the performance of the mobile phone is weak, when switching lenses, the camera display screen is prone to problems such as stuttering or black screen. Summary of the Invention
[0003] The present disclosure provides a method for switching a camera display screen, an electronic device, a storage medium, and a program product.
[0004] According to one aspect of the present disclosure, there is provided a method for switching a camera display screen, including: In response to the electronic device receiving a user's operation to turn on a second lens, generating a static picture based on the real-time picture captured by a first lens in an on state of the electronic device and using the static picture as the camera display screen of the electronic device; In response to the second lens of the electronic device being operated to be in an on state by the turn-on operation, switching the camera display screen of the electronic device from the static picture to the real-time picture captured by the second lens.
[0005] The method for switching a camera display screen according to at least one embodiment of the present disclosure, generating a static picture based on the real-time picture captured by a first lens in an on state of the electronic device and using the static picture as the camera display screen of the electronic device, including: displaying the real-time picture captured by the first lens as the camera display screen on a camera picture layer of a display interface for displaying the camera display screen; converting the image data collected by the first lens into the static picture; loading the static picture on an undisplayed overlay layer of the display interface; when the static picture is loaded, displaying the overlay layer above the camera display screen layer so that the static picture displayed on the overlay layer serves as the camera display screen.
[0006] The method for switching a camera display screen according to at least one embodiment of the present disclosure, converting the image data collected by the first lens into the static picture, including: converting the image data collected by the first lens into a bitmap to obtain a target bitmap; Perform a sharpness reduction process on the target bitmap to obtain the static picture.
[0007] According to the camera display screen switching method of at least one embodiment of the present disclosure, Switch the camera display screen of the electronic device from the static picture to the real-time picture captured by the second lens, including: Load the real-time picture captured by the second lens on the camera display screen layer; When the real-time picture captured by the second lens is loaded on the camera display screen layer, hide the overlay layer so that the real-time picture displayed on the camera display screen layer serves as the camera display screen.
[0008] According to the camera display screen switching method of at least one embodiment of the present disclosure, Switch the camera display screen of the electronic device from the static picture to the real-time picture captured by the second lens, further including: Monitor the loading progress of the real-time picture captured by the second lens on the camera display screen layer; Reduce the transparency of the overlay layer based on the mapping relationship between the loading progress and the transparency.
[0009] According to the camera display screen switching method of at least one embodiment of the present disclosure, further including: In response to the electronic device receiving a zoom operation on the camera display screen, obtain the target zoom ratio of the camera display screen; When the target zoom ratio does not match the first lens, determine the zoom operation as the opening operation.
[0010] According to the camera display screen switching method of at least one embodiment of the present disclosure, Obtain the target zoom ratio of the camera display screen, including: Monitor the gesture zoom operation of the user on the camera display screen, where the gesture zoom operation is used to adjust the zoom ratio of the camera display screen; In response to the gesture zoom operation, determine the zoom ratio mapped by the gesture zoom operation as the target zoom ratio.
[0011] According to the camera display screen switching method of at least one embodiment of the present disclosure, When the target zoom ratio does not match the first lens, determine the zoom operation as the opening operation, including: Obtain the zoom ratio range corresponding to the first lens; When the target zoom ratio is outside the zoom ratio range, determine the zoom operation as the opening operation.
[0012] According to a camera display screen switching method of at least one embodiment of the present disclosure, When the target zoom ratio is outside the zoom ratio range, determining the zoom operation as the opening operation includes: When the target zoom ratio is outside the zoom ratio range, stop responding to the zoom operation; Query for a camera lens matching the target zoom ratio, and determine the queried camera lens as the second lens; Trigger the opening event of the second lens.
[0013] According to another aspect of the present disclosure, there is provided an electronic device, including: a memory storing execution instructions; and a processor that executes the execution instructions stored in the memory, such that the processor executes the camera display screen switching method of any one of the embodiments of the present disclosure.
[0014] According to still another aspect of the present disclosure, there is provided a readable storage medium storing execution instructions, and when the execution instructions are executed by a processor, they are used to implement the camera display screen switching method of any one of the embodiments of the present disclosure.
[0015] According to yet another aspect of the present disclosure, there is provided a computer program product including a computer program, and when the computer program is executed by a processor, it implements the camera display screen switching method of any one of the embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, are used to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are included in this specification and form a part of this specification.
[0017] Figure 1 is a flowchart of a camera display screen switching method according to an embodiment of the present disclosure.
[0018] Figure 2 is a schematic diagram of an application scenario of a camera display screen switching method according to an embodiment of the present disclosure.
[0019] Figure 3 is a flowchart of a camera display screen switching method according to an embodiment of the present disclosure.
[0020] Figure 4 is a schematic diagram of an application scenario of a camera display screen switching method according to an embodiment of the present disclosure.
[0021] Figure 5 It is a schematic flowchart of a method for switching camera display screens according to an embodiment of the present disclosure.
[0022] Figure 6 It is a schematic flowchart of a method for switching camera display screens according to an embodiment of the present disclosure.
[0023] Figure 7 It is a schematic flowchart of a method for switching camera display screens according to an embodiment of the present disclosure.
[0024] Figure 8 It is a schematic flowchart of a method for switching camera display screens according to an embodiment of the present disclosure.
[0025] Figure 9 It is a schematic flowchart of a method for switching camera display screens according to an embodiment of the present disclosure.
[0026] Figure 10 It is a schematic flowchart of a method for switching camera display screens according to an embodiment of the present disclosure.
[0027] Figure 11 It is a schematic flowchart of a method for switching camera display screens according to an embodiment of the present disclosure.
[0028] Figure 12 It is a schematic block diagram of the structure of a camera display screen switching device according to an embodiment of the present disclosure.
[0029] Figure 13 It is a schematic block diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed Embodiments
[0030] The following further elaborates on the present disclosure in detail with reference to the accompanying drawings and examples. It can be understood that the specific examples described herein are only for explaining the relevant content and do not limit the present disclosure. Additionally, it should be noted that for ease of description, only parts related to the present disclosure are shown in the accompanying drawings.
[0031] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The technical solutions of the present disclosure will be described in detail below with reference to the accompanying drawings and embodiments.
[0032] Most current mobile phones are equipped with multiple camera lenses to adapt to various shooting scenarios. However, when switching lenses, it usually involves turning off the old lens and turning on the new lens, and it is necessary to correspondingly load the driver to initialize the image signal processor of the new lens. In addition, it also involves the occupation and release of multi-threaded resources and other processing processes. If the performance of the mobile phone is weak, it may cause the change of the camera display screen to be not smooth when switching the camera lens due to the long processing time of the related tasks for switching the lens. For example, problems such as stuttering or even black screen may occur in the camera display screen.
[0033] Embodiments of the present disclosure provide a method for switching a camera display screen. This method can be executed by an electronic device having two or more camera lenses, such as a mobile phone with multiple lenses. The method for switching a camera display screen according to the embodiments of the present disclosure can make the change of the camera display screen smooth when switching the camera lens.
[0034] Figure 1 The overall flowchart of a method M10 for switching a camera display screen according to an embodiment of the present disclosure is shown. As Figure 1 The method shown includes steps S13 to S15.
[0035] Specifically, Figure 1 The method shown includes: S13. In response to the electronic device receiving a user's operation to turn on the second lens, generate a static picture based on the real-time picture captured by the first lens that is in the on state of the electronic device and use it as the camera display screen of the electronic device.
[0036] Herein, the first lens refers to the currently turned-on camera lens. When the first lens is in the on state, the operation to turn on the second lens is used to switch the lens for capturing the real-time picture from the first lens to the second lens. In this process, the first lens refers to the camera lens before switching, and the second lens refers to the camera lens to be switched. That is to say, the first lens and the second lens do not refer to specific types of camera lenses, but are used to refer to the camera lenses before and after switching. For example, when the switching instruction of the camera lens is used to switch a normal lens to a wide-angle lens, the normal lens is the first lens and the wide-angle lens is the second lens. When the switching instruction of the camera lens is used to switch a wide-angle lens to a normal lens, the wide-angle lens is the first lens and the normal lens is the second lens.
[0037] The camera display screen of the electronic device refers to the picture that is displayed in real time on the interface of the camera function when the electronic device enables the camera function. The camera display screen of the electronic device is usually used to display the real-time picture captured by the currently activated camera lens. For example, when starting to capture with the first lens, the camera display screen displays the real-time picture captured by the first lens.
[0038] A static picture generated based on the real-time picture captured by the first lens refers to a single-frame picture in the real-time picture captured by the first lens in real time. Further, the static picture can be a blurred picture obtained by reducing the clarity of a single-frame real-time picture captured by the first lens, so that the static picture shows a blurred effect.
[0039] Generally, during the camera lens switching, it involves the closing of the old camera lens and the opening of the new camera lens. The weaker the performance of the mobile phone, the longer the waiting time from the closing of the old camera lens to the opening of the new camera lens. If there is no content displayed on the camera display screen of the electronic device during the camera lens switching, phenomena such as stuttering or black screen will occur in the camera display screen from the user's perspective, making the user feel that the change of the camera display screen is not smooth. Based on this, in the camera display screen switching method M10 of the present disclosure, when the camera lens is switched, the real-time picture captured by the first lens is switched to a static picture as the display content of the camera display screen of the electronic device, so as to prevent the camera display screen from having no content to display before the second lens is turned on.
[0040] Among them, the static picture is generated from the real-time picture captured by the first lens. Therefore, when the camera display screen of the electronic device changes from displaying the real-time picture captured by the first lens to displaying a static picture and then to displaying the real-time picture captured by the second lens, the static picture is used as the transitional camera display screen during the lens switching. The camera display screen from the user's perspective appears to change coherently from the real-time picture captured by the first lens to the real-time picture captured by the second lens, so as to eliminate the feeling of unsmooth change of the camera display screen during the camera lens switching.
[0041] Please refer to Figure 2 , in an embodiment, when the electronic device receives a camera lens switching instruction, first, a static picture is generated based on step S13 as the camera display screen of the electronic device, and then the first lens is closed and the second lens is opened during the display of the static picture. That is to say, the closing time of the first lens occurs after the static picture is displayed. In this way, it can be ensured that before the static picture is displayed, the first lens is still capturing continuous real-time pictures as the camera display screen, ensuring that the camera display screen displayed before the static picture is a smooth and clear picture.
[0042] In one embodiment, the penultimate nth frame of the real-time image captured by the first lens before it is closed is used to generate a static picture, and the camera display screen continues to display the penultimate (n-1)th to the first frame of the real-time image captured before the first lens is closed. If a static picture has been generated when the first frame of the real-time image is displayed as the camera display screen, the static picture is displayed as the next frame of the camera display screen after the first frame of the real-time image. If a static picture has not been generated when the first frame of the real-time image is displayed as the camera display screen, the first frame of the real-time image is continuously displayed until a static picture is generated, and then the first frame of the real-time image is replaced with the static picture for display. Here, n is a natural number greater than 1. In this way, during the period of waiting for the static picture to be generated, the camera display screen can have a certain degree of dynamic change, which can prevent a frozen frame from being displayed for a long time during the period of waiting for the static picture to be generated, thus avoiding a sense of stuttering.
[0043] S15. In response to the second lens of the electronic device being operated to the on state by an opening operation, the camera display screen of the electronic device is switched from the static picture to the real-time image captured by the second lens.
[0044] Please combine Figure 2 , it takes a certain amount of time from when the second lens is turned on to when the real-time image captured by the second lens is generated. For example, tasks such as executing the driver for loading the second lens and converting the image data collected by the second lens into a picture are performed. During this period, the camera display screen of the electronic device displays a static picture as a transition and listens in the system background whether the real-time image captured by the second lens has been generated. Until the real-time image captured by the second lens has been generated, it is determined that the second lens is in the on state, and the real-time image captured by the second lens is used as the camera display screen of the electronic device to ensure that the real-time image captured by the second lens displayed after the static picture is a smooth and clear picture.
[0045] In summary, in the camera display screen switching method according to the embodiments of the present disclosure, during the switching of the camera lenses, that is, in the process where the camera lens before switching (the first lens) stops outputting the picture and the camera lens after switching (the second lens) has not yet output the picture, a static picture generated based on the real-time image captured by the first lens is used as the camera display screen of the electronic device, so as to use the static picture as the camera display screen for transitional display during the camera lens switching to cover up the unsmooth feeling of the camera display screen when the camera lens is switched. In this way, from the user's perspective, the effect presented by the camera display screen is: briefly changing from a smooth and clear real scene picture to a static picture, and then changing to a smooth and clear real scene picture.
[0046] If the second lens converts to the on state in response to the turn-on operation and outputs the picture at a relatively high speed, the time for which the static picture is displayed as the camera display picture can be shortened. The shorter the time for which the static picture is displayed as the camera display picture, the more difficult it is for the user to perceive that the static picture is static, and the smoother the camera display picture will be.
[0047] When the static picture is a blurred picture obtained by reducing the clarity of a single-frame real-time picture taken by the first lens, the static picture presents the defocusing effect during the zooming of the camera lens, thereby making the switching process of the camera display picture from the user's perspective smooth and coherent.
[0048] Regarding step S13, in some embodiments of the present disclosure, it may include steps S131 to S134 as Figure 3 shown.
[0049] S131. Display the real-time picture taken by the first lens as the camera display picture on the camera picture layer of the display interface for displaying the camera display picture.
[0050] Please refer to Figure 4 . When using the camera function, the interface for displaying the camera display picture is denoted as the display interface of the camera display picture. In one embodiment, the display interface includes a camera picture layer, which is default displayed in the display interface and loaded and displayed in the camera picture layer after the image data collected by the camera lens is converted into a picture. Thus, when the display interface displays the camera picture layer, the picture taken by the camera lens can be displayed. For example, when the first lens is turned on to take a real-time picture, at this time, the display interface of the electronic device displays the camera picture layer, and the camera picture layer displays the real-time picture taken by the first lens, so that the content of the camera display picture of the electronic device is the real-time picture taken by the first lens.
[0051] S132. Convert the image data collected by the first lens into a static picture.
[0052] The camera lens is used to collect image data, and the image data is processed and then converted into a picture. Continuous image data is converted into continuous multiple frames of pictures for display to obtain the picture taken by the camera lens. Based on this, the picture obtained by converting the image data collected by the first lens is blurred to obtain a static picture.
[0053] In one embodiment, when the electronic device responds to the switching instruction of the camera lens, the first lens is still in the on state. The picture obtained by converting the latest frame of image data collected by the first lens at this time is blurred to obtain a static picture, and the on state of the first lens is still maintained during this period so that the camera display picture displayed on the display interface is the real-time picture taken by the first lens, ensuring that the camera display picture displayed on the display interface is smooth before the static picture is generated.
[0054] S133. Load a static picture on the overlay layer of the display interface.
[0055] S134. When the static picture is loaded, display the overlay layer on the upper layer of the camera screen layer, so that the static picture displayed on the overlay layer serves as the camera display screen.
[0056] Please combine Figure 4 , in one embodiment, the display interface is provided with a camera screen layer and an overlay layer. Among them, the overlay layer is located on the upper layer of the camera screen layer and is default to a hidden state without displaying visible content. For example, the initial state of the overlay layer is configured such that the transparency of the displayed content is 0, that is, the content displayed on the overlay layer is invisible and does not block the camera screen layer, so that the content displayed on the camera screen layer serves as the camera display screen.
[0057] That is to say, when the overlay layer is in the hidden state, the visible content on the display interface is the content of the camera screen layer. When the overlay layer changes from the hidden state to the display state, the content displayed on the overlay layer changes from invisible to visible. At this time, since the overlay layer covers the upper layer of the camera screen layer, the visible content on the display interface becomes the content of the overlay layer. Based on this, after the static picture is generated, load the static picture on the overlay layer. Before the static picture is loaded, the overlay layer is still in the hidden state, and at this time the content of the overlay layer is invisible, and the visible content on the display interface is the content of the camera screen layer, that is, the real-time picture captured by the first lens. When the static picture is loaded, the overlay layer is changed from the hidden state to the display state to display the static picture. At this time, the overlay layer is on the upper layer of the camera screen layer and displays visible content, so the visible content on the display interface becomes the visible content displayed on the overlay layer, making the camera display screen on the display interface change from the real-time picture captured by the first lens of the camera screen layer to the static picture of the overlay layer.
[0058] In one embodiment, a TextureView component can be set as the camera screen layer of the display interface, and the TextureView component is used to display the real-time picture captured based on the first lens. And, an ImageView control is set on the upper layer of the TextureView component as the overlay layer of the display interface, and the ImageView control is used to display the static picture. Among them, the ImageView control is default to the hidden state and does not display the picture. When the static picture is loaded in the ImageView control, the static picture is displayed in the ImageView control, so that the static picture covers the content displayed by the TextureView component, so that the content displayed on the display interface becomes the static picture. In other embodiments, other view components can also be used as the camera screen layer of the display interface, such as using a SurfaceView control, etc., which are not limited here.
[0059] Regarding step S131, in some embodiments of the present disclosure, it may include steps S1311 to S1312 as Figure 5 shown.
[0060] S1311. Convert the image data collected by the first lens into a bitmap to obtain a target bitmap.
[0061] The original image data collected by the first lens is usually not a common picture format, such as the YUV format, and needs to be converted into a common picture format for processing and display. In this solution, a picture of a certain format is required as a conversion bridge between the image data collected by the first lens and the static picture. It is desired that the image data can be efficiently and quickly converted into a picture of this format, and it is also desired that the picture of this format is convenient for blurring processing of the picture. Based on this, the embodiments of the present disclosure use a picture in bitmap format as the conversion bridge, convert the image data collected by the first lens into a bitmap to obtain a target bitmap, and the target bitmap is used for blurring processing in subsequent steps to obtain a blurred image. Since the bitmap is an image data structure natively supported by most systems and has a high data conversion efficiency, the image data collected by the first lens can be efficiently and quickly converted into a bitmap. Moreover, when performing a blur algorithm on the bitmap, no decoding operation is required, so the latency of blurring the picture in bitmap format is lower, and a static picture can be obtained faster.
[0062] S1312. Perform clarity reduction processing on the target bitmap to obtain a static picture.
[0063] In one embodiment, Gaussian blur can be used to perform clarity reduction processing on the target bitmap to obtain a static picture with a blurred effect. The static picture obtained after Gaussian blur processing is relatively close to the blurred effect when the camera lens is zoomed. In other embodiments, other blur processing methods such as mean blur and median blur can also be used to perform clarity reduction processing on the target bitmap, which is not limited here.
[0064] Regarding step S15, in some embodiments of the present disclosure, it may include steps S151 to S154 as Figure 6 shown.
[0065] S151. Load the real-time picture taken by the second lens on the camera screen layer.
[0066] When loading the real-time image captured by the second lens on the camera image layer, the overlay is displayed as a static image on the upper layer of the camera image layer. At this time, the camera image layer is blocked by the static image displayed by the overlay. Therefore, before the real-time image captured by the second lens is completely loaded on the camera image layer, the static image masks the camera image layer and is displayed as the camera display image to mask phenomena such as stuttering or black screen during the waiting for the image loading of the camera image layer.
[0067] S154. When the real-time image captured by the second lens is completely loaded on the camera image layer, hide the overlay so that the real-time image displayed on the camera image layer serves as the camera display image.
[0068] Among them, hiding the overlay can be to make the content displayed by the overlay become invisible. For example, make the transparency of the foreground, background, and the static image displayed by the overlay all 0, so that the overlay appears transparently on the upper layer of the camera image layer and does not block the content displayed by the camera image layer.
[0069] When the real-time image captured by the second lens is completely loaded on the camera image layer, the content displayed on the camera image layer is the real-time image captured by the second lens. At this time, hide the overlay, and the content displayed on the display interface of the electronic device will become the content displayed on the camera image layer, making the real-time image displayed on the camera image layer serve as the camera display image. In this way, by switching the display state and the hidden state of the overlay, the display and hiding of the static image can be switched.
[0070] Furthermore, in one embodiment, when the overlay is converted to the hidden state, delete the static image cached in the overlay. In this way, even if an error occurs where the overlay is misdisplayed at an inappropriate time, the static image will not be displayed.
[0071] In another implementation, when the real-time image captured by the second lens is completely loaded on the camera image layer, the layout of the display interface can be adjusted to move the camera image layer to the upper layer of the overlay. In this way, the content displayed on the camera image layer can block the content displayed by the overlay, making the camera display image become the content displayed on the camera image layer. Since the camera image layer is on the upper layer of the overlay, it can be ensured that the image loaded on the overlay will not block the camera image layer. Based on this, when the electronic device responds to the camera lens switching instruction next time, adjust the overlay to the upper layer of the camera image layer in the hidden state to prepare for displaying the static image on the upper layer of the camera image layer.
[0072] Regarding step S15, in some embodiments of the present disclosure, it may further include steps S152 to S153 as Figure 7 shown.
[0073] S152. Monitor the loading progress of the real-time image captured by the second lens on the camera image layer.
[0074] Before step S174 occurs in step S172. The progress of loading the real-time image captured by the second lens on the camera image layer is monitored, aiming to determine the timing when the real-time image captured by the second lens is completely loaded on the camera image layer, so as to ensure that the real-time image captured by the second lens can be displayed in a timely manner when it is loaded completely.
[0075] S153. Dynamically reduce the transparency of the overlay based on the mapping relationship between the loading progress and the transparency.
[0076] Among them, the transparency of the overlay includes the transparency of the foreground, background and other layout images of the overlay, as well as the transparency of the images displayed on the overlay, that is, the transparency of the static images. When the transparency of the overlay decreases, it means that the transparency of all visible contents of the whole overlay decreases.
[0077] Before step S174 occurs in step S173, aiming to make the overlay present a "fade-out" effect before hiding the overlay. In the mapping relationship between the loading progress and the transparency, the loading progress is inversely proportional to the transparency. That is to say, the closer the loading progress is to 100%, the lower the transparency. As the loading progress increases, the transparency of the overlay gradually decreases; when the loading progress is 100%, it means that the real-time image captured by the second lens is completely loaded on the camera image layer, and at this time the overlay becomes completely invisible. In this way, during the process of the overlay changing from visible to invisible, through the gradual transition of the decreasing transparency, the overlay does not disappear suddenly, reducing the abruptness when the overlay disappears and making the visual effect of switching from the static image to the real-time image captured by the second lens smoother.
[0078] In some embodiments of the present disclosure, the camera display screen switching method M10 may further include steps S11 to S12 as Figure 8 shown.
[0079] S11. In response to the electronic device receiving a zoom operation on the camera display screen, obtain the target zoom ratio of the camera display screen.
[0080] Among them, the zoom operation on the camera display screen is used to adjust the current zoom ratio of the camera display screen. The target zoom ratio is the zoom ratio obtained after adjusting the zoom operation on the camera display screen.
[0081] In one embodiment, the camera display screen is configured with a reference screen zoom ratio, which is a zoom ratio of 100%. For example, the field of view of the image captured by the normal camera lens configured in the electronic device at a zoom factor of 1x can be used as the reference screen zoom ratio. When the camera display screen is zoomed in and the field of view of the camera display screen is reduced by 50%, the zoom ratio of the camera display screen becomes 50%. When the camera display screen is zoomed out and the field of view of the camera display screen is enlarged by 50%, the zoom ratio of the camera display screen becomes 150%.
[0082] In one embodiment, when using the camera service of the electronic device, the zoom ratio of the camera display screen is the default zoom ratio. For example, the default zoom ratio when the default camera is turned on is 100%. The electronic device listens for zoom operation events on the camera display screen to respond to the zoom operation on the camera display screen. The zoom operation event is used to adjust the current zoom ratio of the camera display screen, and the adjusted zoom ratio is recorded as the target zoom ratio. When the zoom operation event occurs, in response to the zoom operation on the camera display screen, the proportional change amount adjusted by the zoom operation is obtained, and the current zoom ratio of the camera display screen is adjusted according to the proportional change amount to obtain the adjusted target zoom ratio. Then, the optical zoom ratio and / or digital zoom ratio of the currently activated camera lens are adjusted so that the field of view of the image captured by the camera lens is enlarged or reduced to reach the target zoom ratio.
[0083] S12. When the target zoom ratio does not match the first lens, determine the zoom operation as an activation operation.
[0084] When the target zoom ratio does not match the first lens, it means that the field of view of the image that the first lens can capture cannot reach the target zoom ratio even when it is enlarged to the maximum or reduced to the minimum. At this time, continuing the zoom operation cannot further enlarge or reduce the zoom ratio of the camera display screen. It is necessary to switch to the second lens to capture an image so that the camera display screen obtained by shooting with the second lens can reach the target zoom ratio.
[0085] That is to say, when shooting a live image with the first lens, continuing the zoom operation when the target zoom ratio does not match the first lens cannot further enlarge or reduce the zoom ratio of the camera display screen. At this time, the requirement is to switch to the second lens to shoot a live image so that the zoom ratio of the camera display screen can be further enlarged or reduced based on the gesture operation on the basis of shooting the live image with the second lens. Therefore, when shooting a live image with the first lens, when the target zoom ratio does not match the first lens, the continued zoom operation can be determined as the activation operation of the second lens. After the second lens is activated, the zoom ratio of the camera display screen is further enlarged or reduced based on the zoom operation so that the zoom ratio of the camera display screen reaches the target zoom ratio.
[0086] In one embodiment, the field of view ratio of the largest picture that a camera lens can capture is recorded as the maximum picture threshold of the camera lens. The maximum picture threshold of the second lens is greater than that of the first lens. When the target zoom ratio is greater than the maximum picture threshold of the first lens, the zoom operation is determined as the opening operation of the second lens, so as to obtain a camera display picture that can reach the target zoom ratio by using the second lens for shooting.
[0087] In one embodiment, the field of view ratio of the smallest picture that a camera lens can capture is recorded as the minimum picture threshold of the camera lens. The minimum picture threshold of the second lens is less than that of the first lens. When the target zoom ratio is less than the minimum picture threshold of the first lens, the zoom operation is determined as the opening operation of the second lens, so as to obtain a camera display picture that can reach the target zoom ratio by using the second lens for shooting.
[0088] Based on the method of steps S11 to S15, the electronic device can automatically switch to the second lens for shooting when the target zoom ratio of the camera display picture changes to not match the first lens. In this way, it is not necessary for the user to manually click the switching button of different lenses according to the situation displayed on the camera display picture, and the camera lens can be automatically switched during the user's zoom operation on the camera display picture, making the switching process of the camera lens smooth.
[0089] Regarding step S11, in some embodiments of the present disclosure, it may include steps S111 to S112 as Figure 9 shown.
[0090] S111. Monitor the gesture zoom operation of the user on the camera display picture, and the gesture zoom operation is used to adjust the zoom ratio of the camera display picture.
[0091] In the embodiment of step S111, the user can use the gesture zoom operation to adjust the zoom ratio of the camera display picture. In other embodiments, the zoom operation on the camera display picture can also be realized by inputting the zoom operation on the camera display picture through the volume keys, displaying a draggable zoom bar for zooming the camera display picture on the display interface of the camera display picture, etc., which are not limited herein.
[0092] S112. In response to the gesture zoom operation, determine the zoom ratio mapped by the gesture zoom operation as the target zoom ratio.
[0093] In one embodiment, the zoom module of the electronic device is used to calculate the zoom ratio mapped by the gesture zoom operation. For example, the listening module of the electronic device obtains the coordinate changes of consecutive touch points of the gesture zoom operation in the camera display screen. The zoom module calculates the change distance of the distance between two fingers based on the coordinate changes of the gesture zoom operation, and calculates the zoom ratio mapped by the change distance of the distance between two fingers to obtain the target zoom ratio.
[0094] In one embodiment, the listening module of the electronic device listens for touch events on the screen of the electronic device to identify the user's gesture zoom operation. For example, the listening module creates a ScaleGestureDetector class to receive the gesture zoom operation that occurs in the camera display screen. The zoom module of the electronic device determines whether the gesture zoom operation is to enlarge or reduce the scale of the camera display screen based on the onScale method, and determines the zoom ratio mapped by the gesture zoom operation to obtain the target zoom ratio.
[0095] Regarding step S12, in some embodiments of the present disclosure, it may include steps S121 to S122 as Figure 10 shown.
[0096] S121. Obtain the zoom ratio range corresponding to the first lens.
[0097] The zoom ratio range corresponding to the first lens refers to the maximum magnification ratio, the minimum reduction ratio supported by the first lens, and each ratio between the maximum magnification ratio and the minimum reduction ratio. For example, if the minimum reduction ratio supported by the first lens is 50% and the maximum magnification ratio supported by the first lens is 150%, then the zoom ratio range corresponding to the first lens is [50%, 150%].
[0098] S122. When the target zoom ratio is outside the zoom ratio range, determine the zoom operation as an opening operation.
[0099] When the target zoom ratio is outside the zoom ratio range, it may be when the target zoom ratio is greater than the maximum magnification ratio supported by the first lens, or when the target zoom ratio is less than the minimum reduction ratio supported by the first lens. That is, when the target zoom ratio exceeds the zoom ratio range supported by the first lens, it is necessary to switch to the second lens for shooting. Therefore, the zoom operation is converted into an opening operation to stop continuously zooming the image captured based on the first lens and to turn on the second lens.
[0100] In one embodiment, the electronic device is configured with a zoom module and a lens switching module. The zoom module is used to obtain the zoom ratio of the camera display screen, and is used to adjust the zoom magnification of the camera lens so that the image captured by the camera lens adapts to the zoom ratio of the camera display screen, and is used to determine whether the target zoom ratio of the camera display screen matches the currently activated camera lens (i.e., the first lens). The lens switching module is used to control the activation or deactivation of the lens of the electronic device. When the target zoom ratio is outside the zoom ratio range, the zoom module can determine that the target zoom ratio does not match the first lens, stop adjusting the zoom magnification of the first lens, determine the zoom operation as the activation operation of the second lens, and notify the lens switching module. When the lens switching module receives the notification from the zoom module, it executes the activation event of the second lens.
[0101] Regarding step S122, in some embodiments of the present disclosure, it may include steps S1221 to S1223 as Figure 11 shown.
[0102] S1221. When the target zoom ratio is outside the zoom ratio range, stop responding to the zoom operation.
[0103] In one embodiment, the electronic device is configured with a zoom module. When the target zoom ratio is outside the zoom ratio range, the zoom module stops adjusting the zoom magnification of the first lens and no longer responds to the user's zoom operation on the camera display screen. After completing the subsequent step of activating the second lens, it resumes responding to the user's zoom operation on the camera display screen.
[0104] S1222. Query the camera lens that matches the target zoom ratio, and determine the queried camera lens as the second lens.
[0105] In one embodiment, the electronic device is configured with a zoom module. When the target zoom ratio is outside the zoom ratio range, the zoom module traverses the zoom ratio ranges of each camera lens, queries the camera lens that matches the target zoom ratio, and determines the queried camera lens as the second lens.
[0106] Thus, the camera display screen switching method M10 of the present disclosure is not limited to switching between two lenses. For example, an electronic device is configured with three camera lenses: a normal lens, a wide-angle lens, and a telephoto lens, and the currently shooting lens is the normal lens. When the target zoom ratio is outside the zoom ratio range of the normal lens, there are two cases: The first case is that the target zoom ratio is greater than the maximum magnification ratio supported by the normal lens. In this case, the telephoto lens should be switched to for shooting; the second case is that the target zoom ratio is less than the minimum magnification ratio supported by the normal lens. In this case, the wide-angle lens should be switched to for shooting. Based on this, when the target zoom ratio is outside the zoom ratio range of the normal lens, the ratio scaling module traverses the zoom ratio ranges of the telephoto lens and the wide-angle lens respectively. If the zoom ratio range of the telephoto lens matches the target zoom ratio, the telephoto lens is determined as the second lens; if the zoom ratio range of the wide-angle lens matches the target zoom ratio, the wide-angle lens is determined as the second lens. Thus, when an electronic device is configured with multiple camera lenses, which lens should be switched to can be determined according to the target zoom ratio.
[0107] S1223. Trigger the opening event of the second lens.
[0108] In one embodiment, the electronic device is configured with a lens switching module. When the ratio scaling module determines the second lens, the received zoom operation is determined as the opening operation of the second lens and notified to the lens switching module, so that the lens switching module triggers the opening event of the second lens when receiving the notification sent by the ratio scaling module to open the second lens.
[0109] Based on any of the above embodiments, the present disclosure further provides a camera lens switching device. Figure 12 It is a structural schematic diagram of a camera lens switching device according to an embodiment of the present disclosure.
[0110] As Figure 12 shown, the camera lens switching device includes: A static picture display module 110, configured to generate a static picture based on the real-time picture captured by the first lens in the on state of the electronic device in response to the electronic device receiving a user's opening operation on the second lens, and use it as the camera display screen of the electronic device.
[0111] A camera display screen switching module 120, configured to switch the camera display screen of the electronic device from the static picture to the real-time picture captured by the second lens in response to the second lens of the electronic device being operated to the on state by the opening operation.
[0112] The above camera lens switching device may be computer software, and its various modules may be computer software modules. The implementation processes of the functions and roles of the various modules in the above camera lens switching device are specifically described in the implementation processes of the corresponding steps in the above method, and will not be elaborated here.
[0113] Based on any one of the above embodiments, the present disclosure also provides an electronic device, which can execute the camera display screen switching method of any one of the above embodiments described in the present disclosure.
[0114] Figure 13 It is a structural schematic diagram of an electronic device 1000 according to an embodiment of the present disclosure.
[0115] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, a memory 1300, and / or hardware modules together. The bus 1100 can also connect various other circuits 1400 such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.
[0116] The bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only one connection line is shown in this figure, but it does not mean that there is only one bus or one type of bus.
[0117] The present disclosure also provides a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the above method. The "readable storage medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples of the readable storage medium include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0118] The present disclosure also provides a computer program product. The methods of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, the processes or functions of the present disclosure are executed in whole or in part.
[0119] The computer program or instructions can be stored in a readable storage medium, or transmitted from one readable storage medium to another. For example, the computer program or instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner. The readable storage medium can be any available medium that can be accessed, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc; or it can be a semiconductor medium, such as a solid state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or can include both volatile and non-volatile types of storage media.
[0120] Those skilled in the art should understand that the embodiments of the present disclosure can be provided as a method, system, or computer program product. Therefore, the present disclosure can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0121] The present disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable camera lens switching devices to produce a machine, such that the instructions executed by the processor of the computer or other programmable camera lens switching devices produce means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0122] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable camera lens switching device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in the process Figure 1 one process or a plurality of processes and / or blocks Figure 1 or the functions specified in a block or a plurality of blocks.
[0123] These computer program instructions can also be loaded onto a computer or other programmable camera lens switching device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the process Figure 1 one process or a plurality of processes and / or blocks Figure 1 or the functions specified in a block or a plurality of blocks.
[0124] In the description of this specification, the descriptions with reference to the terms "one embodiment / way", "some embodiments / ways", "example", "specific example", or "some examples", etc. mean that the specific features, structures, or characteristics described in connection with the embodiment / way or example are included in at least one embodiment / way or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / way or example. Moreover, the specific features, structures, or characteristics described can be combined in any one or more embodiments / ways or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments / ways or examples described in this specification and the features of different embodiments / ways or examples.
[0125] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of the present disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically defined.
[0126] Those skilled in the art should understand that the above embodiments are merely for clearly explaining the present disclosure and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications can be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
Claims
1. A method for switching a camera display screen, characterized in that including: In response to the electronic device receiving a user's operation to turn on the second lens, generating a static picture based on the real-time picture captured by the first lens in the on state of the electronic device and using it as the camera display picture of the electronic device; and In response to the second lens of the electronic device being operated to the on state by the turn-on operation, switching the camera display picture of the electronic device from the static picture to the real-time picture captured by the second lens.
2. The method for switching a camera display screen according to claim 1, wherein Generating a static picture based on the real-time picture captured by the first lens in the on state of the electronic device and using it as the camera display picture of the electronic device, including: Displaying the real-time picture captured by the first lens as the camera display picture on the camera picture layer of the display interface for displaying the camera display picture; Converting the image data collected by the first lens into the static picture; Loading the static picture on the overlay layer that is not displayed on the display interface; and When the static picture is loaded, displaying the overlay layer on the upper layer of the camera display picture layer, so that the static picture displayed on the overlay layer is used as the camera display picture.
3. The camera display screen switching method according to claim 2, wherein Switching the camera display picture of the electronic device from the static picture to the real-time picture captured by the second lens, including: Loading the real-time picture captured by the second lens on the camera picture layer; and When the real-time picture captured by the second lens is loaded on the camera picture layer, hiding the overlay layer, so that the real-time picture displayed on the camera picture layer is used as the camera display picture.
4. The method for switching a camera display screen according to claim 3, characterized in that, Switching the camera display picture of the electronic device from the static picture to the real-time picture captured by the second lens further includes: Monitoring the loading progress of the real-time picture captured by the second lens on the camera picture layer; and Reducing the transparency of the overlay layer based on the mapping relationship between the loading progress and the transparency.
5. The method for switching a camera display screen according to claim 1, wherein It further includes: In response to the electronic device receiving a user's zoom operation on the camera display picture, obtaining the target zoom ratio of the camera display picture; and When the target zoom ratio does not match the first lens, determining the zoom operation as the turn-on operation.
6. The camera display screen switching method according to claim 5, wherein Obtaining the target zoom ratio of the camera display picture, including: Monitoring the user's gesture zoom operation on the camera display picture, where the gesture zoom operation is used to adjust the zoom ratio of the camera display picture; and In response to the gesture zoom operation, determining the zoom ratio mapped by the gesture zoom operation as the target zoom ratio.
7. The method for switching a camera display screen according to claim 5, wherein When the target zoom ratio does not match the first lens, determining the zoom operation as the turn-on operation, including: Obtaining the zoom ratio range corresponding to the first lens; and When the target zoom ratio is outside the zoom ratio range, determining the zoom operation as the turn-on operation.
8. The method for switching a camera display screen according to claim 7, wherein When the target zoom ratio is outside the zoom ratio range, determining the zoom operation as the turn-on operation, including: When the target zoom ratio is outside the zoom ratio range, stopping responding to the zoom operation; Querying the camera lens that matches the target zoom ratio and determining the queried camera lens as the second lens; and Trigger the opening event of the second lens.
9. An electronic device, characterized in that, Comprising: a memory that stores execution instructions; and a processor that executes the execution instructions stored in the memory, so that the processor executes the camera display screen switching method according to any one of claims 1 to 8.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the camera display screen switching method according to any one of claims 1 to 8.