Lens switching method and device, electronic equipment and storage medium

By detecting the fast zoom status and determining the target lens collection, the preview screen lag caused by lens switching during fast zooming is solved, and a smooth preview image effect is achieved.

CN119676565APending Publication Date: 2025-03-21BEIJING XIAOMI MOBILE SOFTWARE CO LTD

Patent Information

Application Number
CN202311233593.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-21
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

During the fast zoom process, the multi-camera system needs to switch the lens multiple times, which causes time-consuming activation and closing of the lens switching process, causing the preview screen to stutter and reduce the shooting experience.

Method used

By detecting that the electronic device is operating in the fast zoom state, obtain the target zoom range of the lens in the current shooting mode, determine the set of target lenses that need to be turned on, and switch to these target lenses.

Benefits of technology

Pre-determine the set of target lenses activated during the current frame period to avoid the problem of re-activated lenses, ensure the target lenses quickly switch, avoid lag, and achieve the effect of smooth previewing of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676565A_ABST
    Figure CN119676565A_ABST
Patent Text Reader

Abstract

The invention provides a lens switching method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a target zooming range of a lens in a current shooting mode in response to the detection that the electronic equipment works in a rapid zooming state; determining a target lens set needing to be started in the current period in the shooting mode according to the target zoom range; and switching to each target lens in the target lens set. Thus, the target shot set activated in the current frame period can be determined in advance, the problem of reactivating the shot in the current frame period is avoided, it is guaranteed that the target shot in the target shot set is rapidly switched without the jamming phenomenon, and the effect of smoothly previewing the image is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to a lens switching method and device, an electronic device, and a storage medium. Background Art

[0002] An electronic device is usually provided with a multi-camera system, which includes multiple lenses, such as three lenses, four lenses or more.

[0003] In the shooting scene, the user will perform zoom processing according to their needs, for example, magnifying the picture from 1.0X times to 5.0X times. At this time, the multi-camera system will switch lenses with different focal lengths, first pre-activate the lens to be used in the background and then output the picture as the main lens, so that the preview picture can switch smoothly.

[0004] In actual applications, the number of lenses that the hardware platform of an electronic device allows to be activated is fixed. For example, a quad-camera system only allows three to be activated, and usually not all of them can be turned on. When the rapid zoom process requires multiple lens switching, the time spent activating and deactivating the lens switching process will cause the preview screen to become stuck, reducing the shooting experience. Summary of the invention

[0005] The present disclosure provides a lens switching method and device, an electronic device, and a storage medium to solve the above technical problems.

[0006] According to a first aspect of the present disclosure, a lens switching method is provided, which is applied to an electronic device provided with a multi-camera system, and the method includes:

[0007] In response to detecting that the electronic device is operating in a fast zoom state, acquiring a target zoom range of the lens in a current shooting mode;

[0008] Determine, according to the target zoom range, a set of target lenses that need to be opened in the current period in the shooting mode;

[0009] Switch to each target lens in the target lens set.

[0010] Optionally, detecting that the electronic device is operating in a fast zoom state includes:

[0011] Acquire a change rate coefficient of a zoom control in the electronic device; the change rate coefficient represents a change amount of an angular displacement of the zoom control within a single frame period;

[0012] In response to the change rate coefficient being greater than or equal to a first preset coefficient threshold, it is determined that the electronic device is operating in a fast zoom state in a current frame period.

[0013] Optionally, obtaining a change rate coefficient of a zoom control in the electronic device includes:

[0014] Acquire a first angular displacement speed of a zoom control of the electronic device at a first moment and a second angular displacement speed at a second moment;

[0015] Acquire a speed change of the second angular displacement speed and the first angular displacement speed;

[0016] The ratio of the speed change to the single frame period is obtained as a change rate coefficient of the zoom control.

[0017] Optionally, the method further comprises:

[0018] In response to determining that the change rate coefficient is less than a first preset coefficient threshold, acquiring a zoom state of the electronic device in a previous frame period; the zoom state includes a fast zoom state and a normal zoom state;

[0019] In response to the electronic device being in a fast zoom state in a previous frame period, comparing the change rate coefficient with a second preset coefficient threshold;

[0020] In response to the change rate coefficient being greater than or equal to a second preset coefficient threshold, it is determined that the electronic device is operating in a fast zoom state in a current frame period.

[0021] Optionally, the method further comprises:

[0022] In response to the electronic device being in a normal zoom state in a previous frame period, determining that the electronic device operates in a normal zoom state in a current frame period;

[0023] and / or,

[0024] In response to the change rate coefficient being less than a second preset coefficient threshold, it is determined that the electronic device operates in a normal zoom state in the current frame period.

[0025] Optionally, determining a target lens set that needs to be opened in the current period in the shooting mode according to the target zoom range includes:

[0026] Determine a candidate lens set according to the target zoom range; the candidate lens set includes a plurality of lenses, and the zoom ranges of the plurality of lenses are superimposed to form the target zoom range;

[0027] The candidate shot set is adjusted to obtain a target shot set; the target shot set includes shots that need to be activated in the current frame period.

[0028] Optionally, determining a candidate lens set according to the target zoom range includes:

[0029] Determining an avoidance lens that needs to be avoided among multiple lenses of the electronic device according to the target zoom range;

[0030] The remaining shots among the multiple shots except the avoidance shot are determined as the candidate shot set.

[0031] Optionally, when the multi-camera system of the electronic device is a quad-camera system, determining, according to the target zoom range, an avoidance lens to be avoided among the multiple lenses of the electronic device includes:

[0032] In response to a telephoto lens in the quad-camera system being in an off state, determining that the telephoto lens is an avoidance lens.

[0033] Optionally, when the multi-camera system of the electronic device is a quad-camera system, determining, according to the target zoom range, an avoidance lens to be avoided among the multiple lenses of the electronic device includes:

[0034] In response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a photo mode, obtaining a current state of the wide-angle lens in the quad-camera system;

[0035] In response to detecting that the current state of the wide-angle lens is an off state, determining that the wide-angle lens is used as an avoidance lens and using the ultra-wide-angle lens in the quad-camera system as a screen display lens within the zoom range of the wide-angle lens.

[0036] Optionally, the method further comprises:

[0037] In response to detecting that the current state of the wide-angle lens is an activated state, it is determined that there is no circumvention lens in the current frame period.

[0038] Optionally, when the multi-camera system of the electronic device is a quad-camera system, determining, according to the target zoom range, an avoidance lens to be avoided among the multiple lenses of the electronic device includes:

[0039] In response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a video recording mode, obtaining a current state of the periscope lens in the quad-camera system;

[0040] In response to detecting that the current state of the periscope lens is an activated state, determining that the wide-angle lens in the quad-camera system is used as an avoidance lens and the zoom range of the wide-angle lens uses the ultra-wide-angle lens in the quad-camera system as a screen display lens;

[0041] In response to detecting that the current state of the periscope lens is an off state, determining that the periscope lens in the quad-camera system is used as an avoidance lens and the zoom range of the periscope lens uses the telephoto lens as a screen display lens.

[0042] Optionally, the method further comprises:

[0043] In response to detecting that the periscope lens and the wide-angle lens are in an activated state, it is determined that there is no circumvention lens in the current frame period.

[0044] Optionally, adjusting the candidate shot set to obtain a target shot set includes:

[0045] Determine the current screen display lens (master) and the current auxiliary lens (slave);

[0046] In response to determining that the current screen-displayed lens is an avoidance lens, updating the current screen-displayed lens to a first target lens;

[0047] In response to determining that the current auxiliary lens and the current screen display lens are the same lens, updating the current auxiliary lens to a second target lens;

[0048] A third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0049] Optionally, the method further comprises:

[0050] In response to determining that the current auxiliary lens is different from the current screen display lens, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined to be a pre-activated lens, and the current screen display lens, the current auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0051] Optionally, the method further comprises:

[0052] In response to determining that the current auxiliary lens is an avoidance lens, updating the current auxiliary lens to a first target lens;

[0053] In response to determining that the current screen display lens and the current auxiliary lens are the same lens, updating the auxiliary lens to a second target lens;

[0054] A third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0055] Optionally, the method further comprises:

[0056] In response to determining that the current screen display lens and the current auxiliary lens are different lenses, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined to be a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0057] Optionally, the method further comprises:

[0058] In response to determining that neither the current screen display lens nor the current auxiliary lens is an avoidance lens, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined to be a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0059] According to a second aspect of the present disclosure, a lens switching device is provided, which is applied to an electronic device provided with a multi-camera system, and the device includes:

[0060] A shooting mode acquisition module, configured to acquire a target zoom range of the lens in a current shooting mode in response to detecting that the electronic device is operating in a fast zoom state;

[0061] A target set acquisition module, used to determine the target lens set that needs to be opened in the current period under the shooting mode according to the target zoom range;

[0062] The target mode switching module is used to switch to each target lens in the target lens set.

[0063] Optionally, the shooting mode acquisition module includes:

[0064] The acceleration coefficient acquisition submodule is used to acquire the change rate coefficient of the zoom control in the electronic device; the change rate coefficient represents the change amount of the angular displacement of the zoom control within a single frame period;

[0065] The fast zoom state determination submodule is used to determine that the electronic device is operating in a fast zoom state in a current frame period in response to the change rate coefficient being greater than or equal to a first preset coefficient threshold.

[0066] Optionally, the acceleration coefficient acquisition submodule includes:

[0067] an angular displacement speed acquisition unit, configured to acquire a first angular displacement speed of a zoom control of the electronic device at a first moment and a second angular displacement speed at a second moment;

[0068] a speed variation acquisition unit, configured to acquire speed variations of the second angular displacement speed and the first angular displacement speed;

[0069] The acceleration coefficient acquisition unit is used to obtain the ratio of the speed change to the single frame period as the change rate coefficient of the zoom control.

[0070] Optionally, the shooting mode acquisition module further includes:

[0071] A zoom state acquisition submodule, configured to acquire the zoom state of the electronic device in a previous frame period in response to determining that the change rate coefficient is less than a first preset coefficient threshold; the zoom state includes a fast zoom state and a normal zoom state;

[0072] a coefficient threshold comparison submodule, configured to compare the change rate coefficient with a second preset coefficient threshold in response to the electronic device being in a fast zoom state in a previous frame period;

[0073] The fast zoom determination submodule is used to determine that the electronic device is operating in a fast zoom state in a current frame period in response to the change rate coefficient being greater than or equal to a second preset coefficient threshold.

[0074] Optionally, the shooting mode acquisition module further includes:

[0075] A normal zoom state determination module, configured to determine that the electronic device operates in the normal zoom state in the current frame period in response to the electronic device being in the normal zoom state in the previous frame period;

[0076] and / or,

[0077] The normal zoom state determination module is further used to determine that the electronic device operates in a normal zoom state in the current frame period in response to the change rate coefficient being less than a second preset coefficient threshold.

[0078] Optionally, the target set acquisition module includes:

[0079] A candidate lens determination submodule, configured to determine a candidate lens set according to the target zoom range; the candidate lens set includes a plurality of lenses, and the zoom ranges of the plurality of lenses are superimposed to form the target zoom range;

[0080] The target shot acquisition submodule is used to adjust the candidate shot set to obtain a target shot set; the target shot set includes the shots that need to be activated in the current frame period.

[0081] Optionally, the candidate shot determination submodule includes:

[0082] an avoidance lens determining unit, configured to determine an avoidance lens to be avoided among a plurality of lenses of the electronic device according to the target zoom range;

[0083] The candidate shot determining unit is used to determine the remaining shots among the multiple shots except the avoidance shot as the candidate shot set.

[0084] Optionally, when the multi-camera system of the electronic device is a quad-camera system, the avoidance shot determination unit includes:

[0085] The avoidance lens determination subunit is used to determine that the telephoto lens in the quad-camera system is an avoidance lens in response to the telephoto lens in the quad-camera system being in an off state.

[0086] Optionally, when the multi-camera system of the electronic device is a quad-camera system, the avoidance shot determination unit includes:

[0087] a current state acquisition subunit, configured to acquire a current state of the wide-angle lens in the quad-camera system in response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a photo mode;

[0088] The avoidance lens determination subunit is used to determine that the wide-angle lens is used as the avoidance lens in response to detecting that the current state of the wide-angle lens is the off state, and the ultra-wide-angle lens in the four-camera system is used as the screen display lens within the zoom range of the wide-angle lens.

[0089] Optionally, the avoidance shot determination unit further includes:

[0090] The avoidance shot determination subunit is configured to determine that there is no avoidance shot in the current frame period in response to detecting that the current state of the wide-angle lens is an activated state.

[0091] Optionally, when the multi-camera system of the electronic device is a quad-camera system, the avoidance shot determination unit includes:

[0092] a current state acquisition subunit, configured to acquire a current state of the periscope lens in the quad-camera system in response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a video recording mode;

[0093] an avoidance lens determination subunit, configured to, in response to detecting that the current state of the periscope lens is an activated state, determine that the wide-angle lens in the quad-camera system is used as the avoidance lens and that the zoom range of the wide-angle lens uses the ultra-wide-angle lens in the quad-camera system as the screen display lens;

[0094] The avoidance lens determination subunit is also used to determine, in response to detecting that the current state of the periscope lens is a closed state, that the periscope lens in the quad-camera system is used as an avoidance lens and the zoom range of the periscope lens uses the telephoto lens as a screen display lens.

[0095] Optionally, the avoidance shot determination unit further includes:

[0096] The avoidance lens determination subunit is used to determine that there is no avoidance lens in the current frame period in response to detecting that the periscope lens and the wide-angle lens are in an activated state.

[0097] Optionally, the target shot acquisition submodule includes:

[0098] A lens determination unit, used to determine the current screen display lens and the current auxiliary lens;

[0099] a screen display lens updating unit, configured to update the current screen display lens to a first target lens in response to determining that the current screen display lens is an avoidance lens;

[0100] an auxiliary lens updating unit, configured to update the current auxiliary lens to a second target lens in response to determining that the current auxiliary lens and the current screen display lens are the same lens;

[0101] The target lens determining unit is used to determine a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0102] Optionally, the target shot acquisition submodule further includes:

[0103] The target lens determining unit is used to determine, in response to determining that the current auxiliary lens is different from the current screen display lens, the current auxiliary lens and the avoidance lens, a third target lens as a pre-activated lens, and the current screen display lens, the current auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0104] Optionally, the target shot acquisition submodule further includes:

[0105] an auxiliary lens updating unit, configured to update the current auxiliary lens to the first target lens in response to determining that the current auxiliary lens is the avoidance lens;

[0106] The auxiliary lens updating unit is further used to update the auxiliary lens to a second target lens in response to determining that the current screen display lens and the current auxiliary lens are the same lens;

[0107] The target lens determining unit is used to determine a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0108] Optionally, the target shot acquisition submodule further includes:

[0109] The target lens determining unit is used to determine, in response to determining that the current screen display lens and the current auxiliary lens are different lenses, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0110] Optionally, the target shot acquisition submodule further includes:

[0111] The target lens determining unit is used to determine, in response to determining that neither the current screen display lens nor the current auxiliary lens is an avoidance lens, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0112] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0113] Multi-camera system, processor and memory;

[0114] The memory is used to store a computer program executable by the processor;

[0115] The processor is configured to execute the computer program in the memory to implement the method as described in any one of the first aspects.

[0116] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, and when an executable computer program in the storage medium is executed by a processor, the method described in any one of the first aspects can be implemented.

[0117] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0118] The solution of this embodiment can respond to the detection that the electronic device is working in a fast zoom state, obtain the target zoom range of the lens in the current shooting mode; then, determine the target lens set that needs to be turned on in the current period in the shooting mode according to the target zoom range; finally, switch to each target lens in the target lens set. In this way, this embodiment can predetermine the target lens set activated in the current frame period, avoid the problem of reactivating the lens in the current frame period, ensure that the target lens in the target lens set is quickly switched without freezing, and achieve the effect of smooth preview of the image.

[0119] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0120] Figure 1 The present invention is a flowchart of a lens switching method according to an embodiment of the present invention.

[0121] Figure 2 The present invention is a flowchart of obtaining a zoom status according to an embodiment of the present invention.

[0122] Figure 3 The present invention is a flowchart of obtaining a target shot set according to an embodiment of the present invention.

[0123] Figure 4 The present invention is a flowchart of obtaining a target shot set according to an embodiment of the present invention.

[0124] Figure 5 The present invention is a flowchart of outputting images of multiple shots according to an embodiment of the present invention.

[0125] Figure 6 The present invention is a block diagram of a lens switching device according to an embodiment of the present invention.

[0126] Figure 7 The present invention is a block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0127] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.

[0128] In the related art, when the fast zoom process requires multiple lens switching, the preview screen may freeze. Take the multi-camera system of an electronic device with four cameras as an example, including an ultra-wide-angle lens (ultraWide, UW), a main wide-angle lens (wide, W), a telephoto lens (tele3x or tele2x, etc., T) and a periscope lens (ultraTele, UT). Among them, the focal length of the ultra-wide-angle lens UW is 0.5x-1x, the focal length of the main wide-angle lens W is 1x-3x, the focal length of the telephoto lens T is 3x-5x, and the focal length of the periscope lens UT is above 5x. During the preview process, when the user zooms quickly, the zoom ratio of three consecutive frames of images may be 0.5x, 3x, and 6x, which means that the hardware layer of the electronic device needs to turn off the main wide-angle lens W within the time of three frames of images, and turn on the telephoto lens T and the periscope lens UT, in the order shown in Table 1.

[0129] Table 1 Lens opening sequence

[0130] Frame rate / zoom ratio First frame / 0.5x Second frame / 3x The third frame / 6x Open lens UW+W T+UT UT+T

[0131] In Table 1, UW+W means that UW is turned on as the screen display lens (also called the main lens or Master lens); W is turned on in the background as the auxiliary lens (Slave lens). The screen display lens refers to the lens that generates an image and sends the image to the display screen for preview; the auxiliary lens refers to the lens that generates an image but does not display it; and the pre-activated lens in the subsequent embodiments is a lens that is only activated but does not generate an image or display it.

[0132] If the hardware platform only allows three lenses to be turned on at the same time, the second frame needs to wait until the UW lens or one of the W lenses is turned off before the T lens and UT lens can be turned on at the same time, resulting in a lag of about 160ms in the second frame image.

[0133] In order to solve the above technical problems, the embodiments of the present disclosure provide a lens switching method and device, an electronic device, and a storage medium, which are applicable to electronic devices with a multi-camera system. The electronic device may include but is not limited to a smart phone, a tablet computer, a smart display, etc. For the convenience of description, the schemes of each embodiment are described below with the electronic device as the execution subject. In some embodiments, the electronic device takes a smart phone as an example, but it does not constitute a limitation on the scheme of the present disclosure.

[0134] Figure 1 Flowchart of a lens switching method according to an embodiment of the present disclosure. Figure 1 , a lens switching method, comprising steps 11 to 13.

[0135] In step 11, in response to detecting that the electronic device is operating in a fast zoom state, a target zoom range of the lens in a current shooting mode is obtained.

[0136] In this embodiment, a multi-camera system is provided in the electronic device, and the multi-camera system includes a camera application (or camera APP) and multiple lenses, and the camera application can call at least one lens. After the electronic device is turned on, a main interface can be displayed, and a camera application (or camera APP) can be displayed in the main interface. When there is a need to shoot, the user can trigger the camera application, and the electronic device switches from the main interface to the shooting interface.

[0137] After the camera application is started, it will send a preview request according to the set period. The preview request is finally sent to the hardware layer to call the matching lens. At this time, the image collected by the lens's image sensor can be processed by image pre-processing, image post-processing and other operations to obtain a preview image, and the preview image is returned to the application layer as a result, and finally displayed in the shooting interface of the camera application.

[0138] In the shooting interface of the camera application, there is a zoom control, which can be implemented in the form of a disk or a slider to adjust the focal length of the lens.

[0139] Taking the zoom control using a disk as an example, during the shooting process, the user may need to adjust the lens focal length, and can operate the disk to adjust the lens focal length. Considering that the operation of the zoom control may be fast or slow, in one example, the zoom state of the electronic device is divided into a fast zoom state and a normal zoom state.

[0140] In this embodiment, the processor of the electronic device can obtain the zoom state of the electronic device. Figure 2 ,include:

[0141] First, the processor can obtain the rate of change coefficient of the zoom control in the electronic device, and the rate of change coefficient can represent the angular displacement change of the zoom control within a single frame period. In one example, the processor can obtain the first angular displacement speed v1 of the zoom control of the electronic device at the first moment and the second angular displacement speed v2 at the second moment. Then, the processor can obtain the speed change (v2-v1) of the second angular displacement speed and the first angular displacement speed. After that, the processor can obtain the ratio of the speed change to the single frame period (1000 / f) as the rate of change coefficient of the zoom control, that is, the angular displacement acceleration coefficient SpeedupCoef, as shown in formula (1).

[0142] SpeedupCoef=(v2-v1) / (1000 / f); (1)

[0143] In formula (1), SpeedupCoef represents the angular displacement acceleration coefficient within a frame period, f represents the frame rate (such as 30fps, 60fps, adjustable), v1 represents the angular displacement speed at the first moment t1, and v2 represents the second angular displacement speed at the second moment t2.

[0144] Then, the processor may obtain the first preset coefficient threshold threshold_1 and / or the second preset coefficient threshold threshold_2. The processor may compare the angular displacement acceleration coefficient SpeedupCoef with the first preset coefficient threshold threshold_1.

[0145] When the angular displacement acceleration coefficient SpeedupCoef is greater than or equal to the first preset coefficient threshold threshold_1, the processor can determine that the electronic device operates in a fast zoom state in the current frame period, that is, the zoom state of the electronic device is a fast zoom state.

[0146] When the angular displacement acceleration coefficient SpeedupCoef is less than the first preset coefficient threshold threshold_1, the processor can obtain the zoom state of the electronic device in the previous frame period; the zoom state in the previous frame period includes a fast zoom state and a normal zoom state.

[0147] When the electronic device is in a fast zoom state in the previous frame period, the processor can compare the change rate coefficient with the second preset coefficient threshold threshold_2. When the change rate coefficient is greater than or equal to the second preset coefficient threshold threshold_2, it is determined that the electronic device is operating in a fast zoom state in the current frame period. When the change rate coefficient is less than the second preset coefficient threshold, the processor can determine that the electronic device is operating in a normal zoom state in the current frame period.

[0148] When the electronic device is in a normal zoom state in a previous frame period, the processor may determine that the electronic device operates in a normal zoom state in a current frame period.

[0149] It should be noted that the first preset coefficient threshold threshold_1 is greater than the second preset coefficient threshold threshold_2, and the interval between the first preset coefficient threshold threshold_1 and the second preset coefficient threshold threshold_2 can be called a buffer area. In the buffer area, the zoom state of the previous frame period can be maintained, and then the lens switching mode of the previous frame period can be maintained, which can avoid stability problems caused by frequent changes in the switching mode.

[0150] In one embodiment, when it is determined that the electronic device is in a normal zoom state, the electronic device may switch the lens according to an existing lens switching method, which will not be described in detail herein.

[0151] In one embodiment, when it is determined that the electronic device is in a fast zoom state, the processor may obtain a target zoom range of the lens in the current shooting mode, including:

[0152] The processor can obtain the current shooting mode, including the photo mode and the video mode. Then, the processor can obtain the target zoom range of the lens in the current shooting mode. For example, when the current shooting mode is the photo mode, the zoom range of the photo mode can be 0.5X-50X times; when the current shooting mode is the video mode, the zoom range of the video mode can be 0.5X-15X times. The technicians can set the classification of shooting modes and the zoom range of various shooting modes according to the specific scenes, such as overlooking scenes, close-up scenes, etc., and the corresponding schemes fall within the protection scope of this disclosure.

[0153] In one embodiment, taking the zoom control using a sliding bar as an example, in one example, a scale is provided between the first end and the second end of the sliding bar, and the scale on the sliding bar can be in a one-to-one correspondence with the angle of the disk; the processor can obtain the speed of the sliding block on the sliding bar at the first moment and the second moment, respectively, and convert the speed into an angular displacement speed in combination with the position at the first moment and the second moment, and then determine the zoom state in combination with the above-mentioned zoom control being a disk. In another example, the processor can obtain the speed of the sliding block on the sliding bar at the first moment and the second moment, respectively, and then calculate the angular displacement speed at the first moment and the second moment based on the conversion relationship between the speed and the angular velocity, and then determine the zoom state in combination with the above-mentioned zoom control being a disk. In this way, the sliding bar can also be used in this embodiment to achieve the effect of sliding zoom and determining the zoom state.

[0154] In step 12, a target lens set that needs to be opened in the current period in the shooting mode is determined according to the target zoom range.

[0155] In this embodiment, the processor can determine the target lens set that needs to be opened in the current period under the shooting mode according to the target zoom range. Figure 3 , including step 31 and step 32.

[0156] In step 31, a candidate lens set is determined according to the target zoom range; the candidate lens set includes a plurality of lenses, and the zoom ranges of the plurality of lenses are superimposed to form the target zoom range.

[0157] In this step, the processor may determine the avoidance lens that needs to be avoided among the multiple lenses of the electronic device according to the target zoom range. Then, the processor may determine the remaining lenses among the multiple lenses except the avoidance lens as the candidate lens set.

[0158] Taking the four-camera system as an example, the processor can obtain the previous frame lens set, that is, multiple lenses used in the previous frame period, at which time these lenses are activated, and determine the avoidance lens based on the previous frame lens set, including:

[0159] In one example, when the telephoto lens T in the quad-camera system is in an off state, the processor may determine that the telephoto lens T is an avoidance lens.

[0160] In one example, when the telephoto lens T in the quad-camera system is in an activated state and the shooting mode of the electronic device is a photo mode, the processor can obtain the current state of the wide-angle lens W in the quad-camera system.

[0161] When it is detected that the current state of the wide-angle lens W is off, the processor can determine that the wide-angle lens W is used as an avoidance lens and that the ultra-wide-angle lens UW in the quad-camera system is used as the screen display lens within the zoom range of the wide-angle lens W.

[0162] When it is detected that the current state of the wide-angle lens W is the activated state, the processor may determine that there is no avoidance lens in the current frame period.

[0163] In one example, when it is detected that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a video recording mode, a current state of the periscope lens in the quad-camera system is obtained;

[0164] When it is detected that the current state of the periscope lens UT is activated, the processor can determine that the wide-angle lens W in the four-camera system is used as the avoidance lens, and the zoom range of the wide-angle lens W uses the ultra-wide-angle lens UW in the four-camera system as the screen display lens.

[0165] When it is detected that the current state of the periscope lens UT is closed, the processor can determine that the periscope lens UT in the quad-camera system is used as an avoidance lens, and the zoom range of the periscope lens UT uses the telephoto lens T as the screen display lens.

[0166] In one example, when it is detected that the periscope lens UT and the wide-angle lens W are in an activated state, the processor may determine that there is no circumvention lens in the current frame period.

[0167] For example, the target zoom range in the photo mode is 0.5X-50X times. When the zoom is adjusted to 20.X times, a preview window will be added to the shooting interface. The preview window is used to zoom and display the local image in the preview image. At this time, the preview window will use the periscope lens UT; at 0.5X-1.0X times, only the ultra-wide-angle lens UW can be used as a screen display lens. In combination with the above content, the candidate lens set of lenses that need to be turned on in the photo mode includes at least the periscope lens UT and the ultra-wide-angle lens UW; considering the continuity of the target zoom range, it is also necessary to select a lens between the wide-angle lens W and the telephoto lens T to add to the candidate lens set, that is, the candidate lens combination of the photo mode is {UW, W, UT} or {UW, T, UT}.

[0168] For another example, the target zoom range in the video recording mode is 0.5X-15X times and there is no preview window function. The periscope lens UT can be avoided and the ultra-wide-angle lens UW can be retained. At this time, the candidate lens combination in the video recording mode is {UW, W, T}.

[0169] It should be noted that, when obtaining the previous frame lens set in this step, the activated lens can be used as much as possible to avoid the time consumption caused by closing and restarting other lenses.

[0170] In step 32, the candidate shot set is adjusted to obtain a target shot set; the target shot set includes shots that need to be activated in the current frame period.

[0171] In this step, the processor can call the above candidate shot set to obtain the target shot set, see Figure 4 ,include:

[0172] First, the processor can determine the current display lens Master and the current auxiliary lens slave. Taking the target zoom range of 0.5X-2.0X as an example, when the focal length is zoomed from 1.0X to 2.0X, the processor can determine that the display lens Master is a wide-angle lens W and the auxiliary lens slave is a telephoto lens T; when the focal length is zoomed from 1.0X to 0.5X, the processor can determine that the display lens Master is an ultra-wide-angle lens UW and the auxiliary lens slave is a wide-angle lens W. In this way, the processor can determine the current display lens Master and the current auxiliary lens slave.

[0173] Then, the processor can determine whether there is an avoidance lens in the current screen display lens Master and the current auxiliary lens slave.

[0174] When the current screen-displayed lens Master is an avoidance lens, the processor may update the current screen-displayed lens to the first target lens.

[0175] Then, the processor may determine whether the current auxiliary lens and the current screen display lens are the same lens.

[0176] When it is determined that the current auxiliary lens and the current screen display lens are the same lens, the processor may update the current auxiliary lens to the second target lens; and determine that a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0177] When it is determined that the current auxiliary lens is different from the current screen display lens, the processor can keep the current auxiliary lens, and determine that a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is a pre-activated lens, and the current screen display lens, the current auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0178] In one example, when the current auxiliary lens is determined to be an avoidance lens, the processor may update the current auxiliary lens to the first target lens. Then, the processor determines whether the current screen display lens and the current auxiliary lens are the same lens.

[0179] When it is determined that the current screen display lens and the current auxiliary lens are the same lens, the processor can update the auxiliary lens to the second target lens, and determine that a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0180] When it is determined that the current screen display lens and the current auxiliary lens are different lenses, the processor may determine that a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens serve as target lenses in the target lens set.

[0181] In one example, when the current screen display lens and the current auxiliary lens are not avoidance lenses, the processor may determine that a third target lens other than the current screen display lens, the current auxiliary lens, and the avoidance lens is a pre-activated lens, and the screen display lens, the auxiliary lens, and the pre-activated lens serve as target lenses in the target lens set.

[0182] It should be noted that the first target lens Recommend sensor_1, the second target lens Recommend sensor_2, and the third target lens Early active sensor are target lenses in the target lens set, and their replacement rules are shown in Table 2.

[0183] Table 2 Rules for replacing the current display lens and the current auxiliary lens

[0184] Avoid the camera Recommend sensor_1 Recommend sensor_2 Early active sensor W UW T UT T W UT UW UT T W UW

[0185] It should also be noted that in the above embodiment, a pre-activated lens Early active sensor is added, and the pre-activated lens Early active sensor can be in an activated state but does not collect images. For example, the pre-activated lens Early active sensor can be adjusted to a pre-activated (i.e., early) mode; for another example, the pre-activated lens is only powered on, and an image pre-processing channel realtime pipe is created for the activated lens, but the output image is discarded, or an image pre-processing channel realtime pipe is created for the activated lens but a buffer area (RDI buffer) is not set so that its image cannot be stored, etc. When the pre-activated lens becomes a screen display lens or an auxiliary lens, an image pre-processing channel realtime pipe, a buffer area (RDI buffer), etc. are created for it so that it can output images normally.

[0186] In step 13, switch to each target shot in the target shot set.

[0187] In this step, the processor may activate each target lens in the target lens set, and switch to each target lens in the target lens set in response to the operation of the zoom control. Figure 5 , the processor can create an image pre-processing channel realtime_1pipeline for the current screen display lens master, and create an image pre-processing channel realtime_2pipeline for the current auxiliary lens slave, and the current screen display lens master and the current auxiliary lens slave share the image post-processing channel offline pipeline.

[0188] After the image sensors of the current display lens master and the current auxiliary lens slave capture images and go through their respective image pre-processing channels (cropping and image quality adjustment), they can be sent to the image post-processing channel offline pipeline respectively. The SAT algorithm is first used for alignment calculation and display selection, and the displayed image is then image post-processed (secondary cropping and partial image quality adjustment based on the alignment calculation results), and then it can be sent to the camera application APP for preview display.

[0189] It is understandable that in this step, the pre-activated lens does not capture images, so the image post-processing channel offlinepipeline only needs to wait for the image pre-processing channels of the current display lens master and the current auxiliary lens slave to capture images, which can reduce waiting time and avoid lag.

[0190] At this point, the solution of this embodiment can respond to detecting that the electronic device is working in a fast zoom state, obtain the target zoom range of the lens in the current shooting mode; then, determine the target lens set that needs to be turned on in the current period in the shooting mode according to the target zoom range; then, finally, switch to each target lens in the target lens set. In this way, this embodiment can predetermine the target lens set activated in the current frame period, avoid the problem of reactivating the lens in the current frame period, ensure that the target lens in the target lens set is quickly switched without freezing, and achieve the effect of smooth preview of the image.

[0191] The present disclosure provides a lens switching method, and the present disclosure also provides a lens switching device. Figure 6 , the device comprises:

[0192] A shooting mode acquisition module 61 is used to acquire a target zoom range of the lens in the current shooting mode in response to detecting that the electronic device is operating in a fast zoom state;

[0193] A target set acquisition module 62, configured to determine a target lens set that needs to be opened in the current period under the shooting mode according to the target zoom range;

[0194] The target mode switching module 63 is used to switch to each target lens in the target lens set.

[0195] Optionally, the shooting mode acquisition module includes:

[0196] The acceleration coefficient acquisition submodule is used to acquire the change rate coefficient of the zoom control in the electronic device; the change rate coefficient represents the change amount of the angular displacement of the zoom control within a single frame period;

[0197] The fast zoom state determination submodule is used to determine that the electronic device is operating in a fast zoom state in a current frame period in response to the change rate coefficient being greater than or equal to a first preset coefficient threshold.

[0198] Optionally, the acceleration coefficient acquisition submodule includes:

[0199] an angular displacement speed acquisition unit, configured to acquire a first angular displacement speed of a zoom control of the electronic device at a first moment and a second angular displacement speed at a second moment;

[0200] a speed variation acquisition unit, configured to acquire speed variations of the second angular displacement speed and the first angular displacement speed;

[0201] The acceleration coefficient acquisition unit is used to obtain the ratio of the speed change to the single frame period as the change rate coefficient of the zoom control.

[0202] Optionally, the shooting mode acquisition module further includes:

[0203] A zoom state acquisition submodule, configured to acquire the zoom state of the electronic device in a previous frame period in response to determining that the change rate coefficient is less than a first preset coefficient threshold; the zoom state includes a fast zoom state and a normal zoom state;

[0204] a coefficient threshold comparison submodule, configured to compare the change rate coefficient with a second preset coefficient threshold in response to the electronic device being in a fast zoom state in a previous frame period;

[0205] The fast zoom determination submodule is used to determine that the electronic device is operating in a fast zoom state in a current frame period in response to the change rate coefficient being greater than or equal to a second preset coefficient threshold.

[0206] Optionally, the shooting mode acquisition module further includes:

[0207] A normal zoom state determination module, configured to determine that the electronic device operates in the normal zoom state in the current frame period in response to the electronic device being in the normal zoom state in the previous frame period;

[0208] and / or,

[0209] The normal zoom state determination module is further used to determine that the electronic device operates in a normal zoom state in the current frame period in response to the change rate coefficient being less than a second preset coefficient threshold.

[0210] Optionally, the target set acquisition module includes:

[0211] A candidate lens determination submodule, configured to determine a candidate lens set according to the target zoom range; the candidate lens set includes a plurality of lenses, and the zoom ranges of the plurality of lenses are superimposed to form the target zoom range;

[0212] The target shot acquisition submodule is used to adjust the candidate shot set to obtain a target shot set; the target shot set includes the shots that need to be activated in the current frame period.

[0213] Optionally, the candidate shot determination submodule includes:

[0214] an avoidance lens determining unit, configured to determine an avoidance lens to be avoided among a plurality of lenses of the electronic device according to the target zoom range;

[0215] The candidate shot determining unit is used to determine the remaining shots among the multiple shots except the avoidance shot as the candidate shot set.

[0216] Optionally, when the multi-camera system of the electronic device is a quad-camera system, the avoidance shot determination unit includes:

[0217] The avoidance lens determination subunit is used to determine that the telephoto lens in the quad-camera system is an avoidance lens in response to the telephoto lens in the quad-camera system being in an off state.

[0218] Optionally, when the multi-camera system of the electronic device is a quad-camera system, the avoidance shot determination unit includes:

[0219] a current state acquisition subunit, configured to acquire a current state of the wide-angle lens in the quad-camera system in response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a photo mode;

[0220] The avoidance lens determination subunit is used to determine that the wide-angle lens is used as the avoidance lens in response to detecting that the current state of the wide-angle lens is the off state, and the ultra-wide-angle lens in the four-camera system is used as the screen display lens within the zoom range of the wide-angle lens.

[0221] Optionally, the avoidance shot determination unit further includes:

[0222] The avoidance shot determination subunit is configured to determine that there is no avoidance shot in the current frame period in response to detecting that the current state of the wide-angle lens is an activated state.

[0223] Optionally, when the multi-camera system of the electronic device is a quad-camera system, the avoidance shot determination unit includes:

[0224] a current state acquisition subunit, configured to acquire a current state of the periscope lens in the quad-camera system in response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a video recording mode;

[0225] an avoidance lens determination subunit, configured to, in response to detecting that the current state of the periscope lens is an activated state, determine that the wide-angle lens in the quad-camera system is used as the avoidance lens and that the zoom range of the wide-angle lens uses the ultra-wide-angle lens in the quad-camera system as the screen display lens;

[0226] The avoidance lens determination subunit is also used to determine, in response to detecting that the current state of the periscope lens is a closed state, that the periscope lens in the quad-camera system is used as an avoidance lens and the zoom range of the periscope lens uses the telephoto lens as a screen display lens.

[0227] Optionally, the avoidance shot determination unit further includes:

[0228] The avoidance lens determination subunit is used to determine that there is no avoidance lens in the current frame period in response to detecting that the periscope lens and the wide-angle lens are in an activated state.

[0229] Optionally, the target shot acquisition submodule includes:

[0230] A lens determination unit, used to determine the current screen display lens and the current auxiliary lens;

[0231] a screen display lens updating unit, configured to update the current screen display lens to a first target lens in response to determining that the current screen display lens is an avoidance lens;

[0232] an auxiliary lens updating unit, configured to update the current auxiliary lens to a second target lens in response to determining that the current auxiliary lens and the current screen display lens are the same lens;

[0233] The target lens determining unit is used to determine a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0234] Optionally, the target shot acquisition submodule further includes:

[0235] The target lens determining unit is used to determine, in response to determining that the current auxiliary lens is different from the current screen display lens, the current auxiliary lens and the avoidance lens, a third target lens as a pre-activated lens, and the current screen display lens, the current auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0236] Optionally, the target shot acquisition submodule further includes:

[0237] an auxiliary lens updating unit, configured to update the current auxiliary lens to the first target lens in response to determining that the current auxiliary lens is the avoidance lens;

[0238] The auxiliary lens updating unit is further used to update the auxiliary lens to a second target lens in response to determining that the current screen display lens and the current auxiliary lens are the same lens;

[0239] The target lens determining unit is used to determine a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

[0240] Optionally, the target shot acquisition submodule further includes:

[0241] The target lens determining unit is used to determine, in response to determining that the current screen display lens and the current auxiliary lens are different lenses, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0242] Optionally, the target shot acquisition submodule further includes:

[0243] The target lens determining unit is used to determine, in response to determining that neither the current screen display lens nor the current auxiliary lens is an avoidance lens, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are the target lenses in the target lens set.

[0244] It should be noted that the device embodiment shown in this embodiment matches the content of the above method embodiment, and the content of the above method embodiment can be referred to, which will not be repeated here.

[0245] Figure 7 7 is a block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 700 may be a smart phone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0246] Reference Figure 7 The electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , a communication component 716 , and an image acquisition component 718 .

[0247] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute computer programs. In addition, the processing component 702 may include one or more modules to facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702. In an example, the processor 720 may implement the scheme of the above-mentioned power supply control method.

[0248] The memory 704 is configured to store various types of data to support operations on the electronic device 700. Examples of such data include computer programs for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0249] The power supply component 706 provides power to various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 700. The power supply component 706 may include a power supply chip, and the controller may communicate with the power supply chip to control the power supply chip to turn on or off the first switching device, so that the battery supplies power to the mainboard circuit or does not supply power.

[0250] The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the target object. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input information from the target object. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0251] The audio component 710 is configured to output and / or input audio file information. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio file information. The received audio file information can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio file information.

[0252] The I / O interface 712 provides an interface between the processing component 702 and a peripheral interface module, such as a keyboard, a click wheel, a button, etc.

[0253] The sensor component 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor component 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display screen and keypad of the electronic device 700, and the sensor component 714 can also detect the position change of the electronic device 700 or a component, the presence or absence of contact between the target object and the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. In this example, the sensor component 714 can include a magnetic sensor, a gyroscope, and a magnetic field sensor, and can also include an inertial sensor, an image sensor, etc., wherein the magnetic field sensor includes at least one of the following: a Hall sensor, a thin film magnetoresistive sensor, and a magnetic liquid acceleration sensor.

[0254] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0255] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0256] In an exemplary embodiment, the present disclosure also provides a non-transitory computer-readable storage medium, and when an executable computer program in the storage medium is executed by a processor, the above-mentioned method can be implemented.

[0257] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0258] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A lens switching method, characterized in that: Applied to an electronic device provided with a multi-camera system, the method comprises: In response to detecting that the electronic device is operating in a fast zoom state, acquiring a target zoom range of the lens in a current shooting mode; Determine, according to the target zoom range, a set of target lenses that need to be opened in the current period in the shooting mode; Switch to each target lens in the target lens set.

2. The method according to claim 1, characterized in that Detecting that the electronic device is operating in a fast zoom state includes: Acquire a change rate coefficient of a zoom control in the electronic device; the change rate coefficient represents a change amount of an angular displacement of the zoom control within a single frame period; In response to the change rate coefficient being greater than or equal to a first preset coefficient threshold, it is determined that the electronic device is operating in a fast zoom state in a current frame period.

3. The method according to claim 2, characterized in that Obtaining a change rate coefficient of a zoom control in the electronic device includes: Acquire a first angular displacement speed of a zoom control of the electronic device at a first moment and a second angular displacement speed at a second moment; Acquire a speed change of the second angular displacement speed and the first angular displacement speed; The ratio of the speed change to the single frame period is obtained as a change rate coefficient of the zoom control.

4. The method according to claim 2, characterized in that: The method further comprises: In response to determining that the change rate coefficient is less than a first preset coefficient threshold, acquiring a zoom state of the electronic device in a previous frame period; the zoom state includes a fast zoom state and a normal zoom state; In response to the electronic device being in a fast zoom state in a previous frame period, comparing the change rate coefficient with a second preset coefficient threshold; In response to the change rate coefficient being greater than or equal to a second preset coefficient threshold, it is determined that the electronic device is operating in a fast zoom state in a current frame period.

5. The method according to claim 4, characterized in that The method further comprises: In response to the electronic device being in a normal zoom state in a previous frame period, determining that the electronic device operates in a normal zoom state in a current frame period; and / or, In response to the change rate coefficient being less than a second preset coefficient threshold, it is determined that the electronic device operates in a normal zoom state in the current frame period.

6. The method according to claim 1, characterized in that Determining a target lens set that needs to be opened in the current period in the shooting mode according to the target zoom range includes: Determine a candidate lens set according to the target zoom range; the candidate lens set includes a plurality of lenses, and the zoom ranges of the plurality of lenses are superimposed to form the target zoom range; The candidate shot set is adjusted to obtain a target shot set; the target shot set includes shots that need to be activated in the current frame period.

7. The method according to claim 6, characterized in that Determining a candidate lens set according to the target zoom range includes: Determining an avoidance lens that needs to be avoided among multiple lenses of the electronic device according to the target zoom range; The remaining shots among the multiple shots except the avoidance shot are determined as the candidate shot set.

8. The method according to claim 7, characterized in that When the multi-camera system of the electronic device is a quad-camera system, determining the avoidance lens to be avoided among the multiple lenses of the electronic device according to the target zoom range includes: In response to a telephoto lens in the quad-camera system being in an off state, determining that the telephoto lens is an avoidance lens.

9. The method according to claim 7, characterized in that: When the multi-camera system of the electronic device is a quad-camera system, determining the avoidance lens to be avoided among the multiple lenses of the electronic device according to the target zoom range includes: In response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a photo mode, obtaining a current state of the wide-angle lens in the quad-camera system; In response to detecting that the current state of the wide-angle lens is an off state, determining that the wide-angle lens is used as an avoidance lens and using the ultra-wide-angle lens in the quad-camera system as a screen display lens within the zoom range of the wide-angle lens.

10. The method according to claim 9, characterized in that The method further comprises: In response to detecting that the current state of the wide-angle lens is an activated state, it is determined that there is no circumvention lens in the current frame period.

11. The method according to claim 7, characterized in that When the multi-camera system of the electronic device is a quad-camera system, determining the avoidance lens to be avoided among the multiple lenses of the electronic device according to the target zoom range includes: In response to detecting that the telephoto lens in the quad-camera system is in an activated state and the shooting mode of the electronic device is a video recording mode, obtaining a current state of the periscope lens in the quad-camera system; In response to detecting that the current state of the periscope lens is an activated state, determining that the wide-angle lens in the quad-camera system is used as an avoidance lens and the zoom range of the wide-angle lens uses the ultra-wide-angle lens in the quad-camera system as a screen display lens; In response to detecting that the current state of the periscope lens is an off state, determining that the periscope lens in the quad-camera system is used as an avoidance lens and the zoom range of the periscope lens uses the telephoto lens as a screen display lens.

12. The method according to claim 11, characterized in that The method further comprises: In response to detecting that the periscope lens and the wide-angle lens are in an activated state, it is determined that there is no circumvention lens in the current frame period.

13. The method according to claim 7, characterized in that Adjusting the candidate shot set to obtain a target shot set includes: Determine the current on-screen lens and the current auxiliary lens; In response to determining that the current screen-displayed lens is an avoidance lens, updating the current screen-displayed lens to a first target lens; In response to determining that the current auxiliary lens and the current screen display lens are the same lens, updating the current auxiliary lens to a second target lens; A third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

14. The method according to claim 13, characterized in that The method further comprises: In response to determining that the current auxiliary lens is different from the current screen display lens, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined to be a pre-activated lens, and the current screen display lens, the current auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

15. The method according to claim 13, characterized in that The method further comprises: In response to determining that the current auxiliary lens is an avoidance lens, updating the current auxiliary lens to a first target lens; In response to determining that the current screen display lens and the current auxiliary lens are the same lens, updating the auxiliary lens to a second target lens; A third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined as a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

16. The method according to claim 15, characterized in that The method further comprises: In response to determining that the current screen display lens and the current auxiliary lens are different lenses, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined to be a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

17. The method according to claim 13, characterized in that The method further comprises: In response to determining that neither the current screen display lens nor the current auxiliary lens is an avoidance lens, a third target lens other than the current screen display lens, the current auxiliary lens and the avoidance lens is determined to be a pre-activated lens, and the screen display lens, the auxiliary lens and the pre-activated lens are used as target lenses in the target lens set.

18. A lens switching device, characterized in that: Applicable to electronic equipment with a multi-camera system, the device comprises: A shooting mode acquisition module, configured to acquire a target zoom range of the lens in a current shooting mode in response to detecting that the electronic device is operating in a fast zoom state; A target set acquisition module, used to determine the target lens set that needs to be opened in the current period under the shooting mode according to the target zoom range; The target mode switching module is used to switch to each target lens in the target lens set.

19. An electronic device, characterized in that: include: Multi-camera system, processor and memory; The memory is used to store a computer program executable by the processor; The processor is configured to execute the computer program in the memory to implement the method according to any one of claims 1 to 17.

20. A non-transitory computer-readable storage medium, characterized in that: When the executable computer program in the storage medium is executed by a processor, the method according to any one of claims 1 to 17 can be implemented.

Citation Information

Patent Citations

  • Camera switching method and device, storage medium and electronic equipment

    CN112887602A

  • Camera shooting switching method and device and electronic equipment

    CN116546319A

Cited By

  • Lens module control method and device, equipment and storage medium

    CN120881394A