A group initialization method and device, and an electronic device
By screening lenses without collision risk and adjusting them in parallel and dynamically adjusting the step size, the collision risk and long initialization time problems of lenses in multi-zoom lens movements are solved, achieving fast and accurate group initialization.
Patent Information
- Application Number
- CN202411111592.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-08-13
AI Technical Summary
The group initialization process of multi-zoom lens movement lenses has problems such as high collision risk, long initialization time and poor compatibility of initialization algorithms.
By repeatedly adjusting the lens direction, target lenses with no collision risk are screened out, and parallel adjustments are performed, dynamically adjusting the step size to avoid collisions until each group is initialized.
It reduces the collision risk during lens initialization, improves the initialization speed and algorithm versatility, reduces the workload of parameter adaptation, and ensures that the lens is initialized quickly and accurately.
Smart Images

Figure CN119211719B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of lens control technology, and in particular to a group initialization method, device, and electronic device. Background Art
[0002] With the continuous expansion of the security market and the continuous integration of artificial intelligence (AI) technology, the performance requirements of commonly used lenses in front-end cameras are becoming increasingly higher, such as wider focal lengths, faster speeds, higher precision, and longer lifespans. In order to improve rigid indicators such as focal length within a limited device volume, a multi-group zoom group movement lens design will be adopted. The zoom and focus systems under this solution may have significant changes compared to conventional movements, and lens control becomes complex and changeable. Due to the optical characteristics of movement lenses, at different focal lengths and different object distances, in order to achieve the preset imaging effect, each lens in the movement needs to move to a specific position. Therefore, before the movement, it is necessary to find the optical coupler position of each lens to establish a relative coordinate system to realize the movement of each lens. This process of finding the optical coupler (PI) is called group initialization.
[0003] In the current lens control field, movement lenses typically consist of a zoom group and a focus group, using a sequential initialization method: initializing the focus group first, followed by the zoom group. The initialization process typically involves driving a lens toward an optocoupler with a fixed, large step length. Once the optocoupler (PI) level changes, the step length is reduced and the lens is driven in the opposite direction to search for the optocoupler. This process is repeated until the step length reaches zero, which is considered the reference position and the group is successfully initialized. However, multi-zoom lens movements have a long total travel range, and the zoom and focus travels overlap, leading to a high risk of collision during group initialization. Summary of the Invention
[0004] The embodiments of the present application provide a group initialization method, device, and electronic device for solving the problem of lens collision risk during group initialization in the related art.
[0005] In a first aspect, an embodiment of the present application provides a group initialization method, the method comprising:
[0006] Repeat the following steps until each group is initialized;
[0007] For each group that has not completed initialization, obtain the adjustment direction of the lens in each group;
[0008] Determining each target lens in each lens that currently has no collision risk with other lenses according to the pre-saved optical coupler position of each group and the adjustment direction of each lens;
[0009] Adjusting the position of each target lens based on the adjustment direction of each target lens;
[0010] Based on each adjusted target lens, it is determined whether there is a group corresponding to each target lens that has completed initialization. If it is determined that the group corresponding to any target lens has completed initialization, the group is deleted from the groups that have not completed initialization.
[0011] Furthermore, determining each target lens in each lens that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens includes:
[0012] Obtaining an adjustment range pre-saved for each lens; and obtaining a direction in which each lens is located at a corresponding optical coupler position;
[0013] For each of the lenses, based on the adjustment direction of the lens and the optical coupler position of the group corresponding to the lens, candidate lenses with optical coupler positions in the adjustment direction of the optical coupler position of the lens are determined, and target candidate lenses whose adjustment ranges coincide with the adjustment range of the lens are screened out; if the direction of each target candidate lens at the corresponding optical coupler position is opposite to the direction of the lens at the corresponding optical coupler position, then the lens is determined to be a target lens that currently has no collision risk with other lenses.
[0014] Furthermore, adjusting the position of each target lens based on the adjustment direction of each target lens includes:
[0015] Obtaining the adjustment step size of each target lens for this adjustment;
[0016] Repeat the following steps until the adjustment direction of any target lens changes;
[0017] Based on the adjustment direction and adjustment step of each target lens, the position of each target lens is adjusted; and the adjustment direction of each target lens after adjustment is determined.
[0018] Furthermore, obtaining the adjustment step of each target lens for this adjustment includes:
[0019] For each target lens, determine whether this is the first time to adjust the target lens in this group initialization; if so, determine the adjustment step length to be the first preset step length; if not, determine the current adjustment step length according to the last adjustment step length.
[0020] Furthermore, determining the current adjustment step size according to the last adjustment step size includes:
[0021] Obtaining the last adjustment direction of the target lens, and determining whether the last adjustment direction is the same as the current adjustment direction of the target lens;
[0022] If yes, the last adjustment step size is determined as the current adjustment step size;
[0023] If not, the step length adjusted from the last adjustment step length is determined as the current adjustment step length; wherein the adjusted step length is smaller than the last adjustment step length.
[0024] Furthermore, determining the step size adjusted after the last adjustment as the current adjustment step size includes:
[0025] Determine the difference between the last adjustment step and the preset value as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, determine the candidate adjustment step as the current adjustment step; otherwise, determine the second preset step as the current adjustment step.
[0026] Furthermore, determining the step size adjusted after the last adjustment as the current adjustment step size includes:
[0027] Determine whether the last adjustment step is not greater than the third preset step. If so, determine the second preset step as the current adjustment step, wherein the third preset step is greater than the second preset step. If not, determine the ratio of the last adjustment step to the preset value as the current adjustment step.
[0028] Furthermore, after deleting the group from the groups that have not completed initialization, the method further includes:
[0029] If there are still groups that have not completed initialization and the number of cycles reaches the preset number, it is determined that the initialization has failed.
[0030] In a second aspect, an embodiment of the present application further provides a group initialization device, the device comprising:
[0031] Repeat the following steps until each lens is initialized;
[0032] An acquisition module, configured to acquire, for each group that has not completed initialization, an adjustment direction of the lens in the group;
[0033] a determination module, configured to determine each target lens in each lens that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens;
[0034] A processing module is used to adjust the position of each target lens based on the adjustment direction of each target lens; based on each adjusted target lens, determine whether there is a group corresponding to each target lens that has completed initialization; if it is determined that the group corresponding to any target lens has completed initialization, then delete the group from the groups that have not completed initialization.
[0035] Furthermore, the determination module is specifically configured to obtain an adjustment range pre-saved for each lens; and obtain the direction of each lens at the corresponding optical coupling position; for each lens, based on the adjustment direction of the lens and the optical coupling position of the group corresponding to the lens, determine a candidate lens whose optical coupling position is in the adjustment direction of the optical coupling position of the lens, and screen out a target candidate lens whose adjustment range overlaps with the adjustment range of the lens; if the direction of each target candidate lens at the corresponding optical coupling position is opposite to the direction of the lens at the corresponding optical coupling position, then determine that the lens is a target lens that currently has no collision risk with any other lens.
[0036] Furthermore, the processing module is specifically configured to obtain an adjustment step size for the current adjustment of each target lens; repeatedly loop the following steps until the adjustment direction of any target lens changes; adjust the position of each target lens based on the adjustment direction and adjustment step size of each target lens; and determine the adjustment direction of each target lens after adjustment.
[0037] Furthermore, the processing module is specifically configured to determine, for each target lens, whether this is the first time the target lens is adjusted in this group initialization; if so, determine the adjustment step length to be the first preset step length; if not, determine the current adjustment step length based on the last adjustment step length.
[0038] Furthermore, the processing module is specifically used to obtain the last adjustment direction of the target lens, and determine whether the last adjustment direction is the same as the adjustment direction of the target lens this time; if so, the last adjustment step length is determined as the current adjustment step length; if not, the step length after adjustment of the last adjustment step length is determined as the current adjustment step length; wherein the adjusted step length is smaller than the last adjustment step length.
[0039] Furthermore, the processing module is specifically used to determine the difference between the last adjustment step and the preset value as a candidate adjustment step. If the candidate adjustment step is greater than the second preset step, the candidate adjustment step is determined to be the current adjustment step; otherwise, the second preset step is determined to be the current adjustment step.
[0040] Further, the processing module is specifically configured to determine whether the last adjustment step is not greater than a third preset step, if yes, determine the second preset step as the current adjustment step, wherein the third preset step is greater than the second preset step, and if no, determine a ratio of the last adjustment step and a preset value as the current adjustment step.
[0041] Further, the processing module is further configured to determine that the initialization fails if there still exists a group that has not completed initialization and the number of loops reaches a preset number.
[0042] In a third aspect, an electronic device is provided, and the electronic device includes a processor configured to implement the steps of the group initialization method when executing a computer program stored in a memory.
[0043] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is configured to implement the steps of the group initialization method when executed by a processor.
[0044] In the embodiment of the present application, the electronic device repeatedly loops the following steps until each group completes initialization: obtaining each group that has not completed initialization, obtaining the adjustment direction of each lens in each group that has not completed initialization, determining each target lens in each lens that does not have a collision risk with other lenses based on the pre-stored light coupling position of each group and the adjustment direction of each lens, adjusting the position of each target lens based on the adjustment direction of each target lens, and determining whether the group corresponding to each target lens has a group that has completed initialization based on the adjusted each target lens, and if it is determined that the group corresponding to any target lens has completed initialization, deleting the group from the groups that have not completed initialization. In the embodiment of the present application, after the electronic device determines the adjustment direction of the lens in each group that has not completed initialization, the electronic device determines each target lens in each lens that does not have a collision risk with other lenses, and adjusts the position of each target lens that does not have a collision risk in parallel, thereby reducing the problem of lens collision existing when the lens is initialized, and after the group of a certain target lens completes initialization, the electronic device continues to process the lens in other groups that have not completed initialization in parallel, thereby achieving the initialization of each group. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0046] Figure 1 A schematic diagram of a group initialization process provided in an embodiment of the present application;
[0047] Figure 2 A schematic diagram of a group initialization process provided in the related art;
[0048] Figure 3 A schematic diagram of multiple groups provided in an embodiment of the present application;
[0049] Figure 4 A detailed schematic diagram of multiple groups provided in an embodiment of the present application;
[0050] Figure 5 A schematic diagram of the position of a lens provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of a detailed process for determining a target lens provided in an embodiment of the present application;
[0052] Figure 7 A schematic diagram of a process for adjusting each target lens provided in an embodiment of the present application;
[0053] Figure 8 A schematic diagram of a process for adjusting the position of a lens provided in an embodiment of the present application;
[0054] Figure 9 A detailed process diagram of group initialization provided in an embodiment of the present application;
[0055] Figure 10 A schematic diagram of the structure of a group initialization device provided in an embodiment of the present application;
[0056] Figure 11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0058] In order to solve the problem of collision risk in group initialization in the related art, embodiments of the present application provide a group initialization method, device, and electronic device.
[0059] The group initialization method includes: repeating the following steps until each group completes initialization; for each group that has not completed initialization, obtaining the adjustment direction of the lens in each group that has been adjusted this time; determining each target lens in each lens that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens; adjusting the position of each target lens based on the adjustment direction of each target lens; and determining, based on each adjusted target lens, whether there is a group corresponding to each target lens that has completed initialization, and if it is determined that the group corresponding to any target lens has completed initialization, deleting the group from the groups that have not completed initialization.
[0060] Example 1:
[0061] Figure 1 A schematic diagram of a group initialization process provided in an embodiment of the present application, the process includes the following steps:
[0062] Repeat the following steps until each group is initialized.
[0063] The group initialization method provided in the embodiment of the present application is applied to an electronic device, which may be an image acquisition device, a PC, a server, or other intelligent device.
[0064] It should be noted that if the electronic device is another smart device other than the image acquisition device, the electronic device is connected to the image acquisition device that needs to be group initialized.
[0065] The group includes an optical coupler and a movable lens.
[0066] In an embodiment of the present application, the electronic device can repeat the following steps until each group is initialized. Specifically, the lens in a group moves to the optocoupler position of the group, which can determine that the group has completed initialization. How to determine whether a group has completed initialization is a prior art and will not be repeated here.
[0067] S101: For each group that has not completed initialization, obtain the adjustment direction of the lens in each group.
[0068] In order to initialize each group, the electronic device may obtain each group that has not yet completed initialization, and after obtaining each group that has not yet completed initialization, obtain the adjustment direction of the lens in each group that has been adjusted this time.
[0069] Specifically, the electronic device may store, for each group, the adjustment direction of the lenses in the group when the PI level state corresponding to the group is high, and the adjustment direction of the lenses in the group when the PI level state corresponding to the group is low. The electronic device may determine the PI level state corresponding to the group and, based on whether the PI level state is high or low, determine the adjustment direction corresponding to the lenses in the group. The adjustment direction is the adjustment direction of the lenses in the group for the current adjustment. The specific conditions for determining whether the PI level state is high or low are known in the art and will not be further described herein.
[0070] S102: Determine each target lens in each lens that currently has no collision risk with other lenses according to the pre-saved optical coupler position of each group and the adjustment direction of each lens.
[0071] In order to improve the safety of lens adjustment, the electronic device can obtain the pre-saved photocoupler position of each group, wherein the initialization of the group is completed when the lens in a group moves to the photocoupler position of the group.
[0072] The electronic device can determine each target lens in each lens that currently has no collision risk with other lenses based on the optical coupler position of each group and the adjustment direction of each lens.
[0073] In one possible implementation, the electronic device pre-stores a lens detection model. The electronic device inputs the optical coupler position of each group and the adjustment direction of the lenses in each group into the lens detection model. The lens detection model then outputs each target lens that does not pose a collision risk. It should be noted that the lens detection model may output an identifier for each target lens that does not pose a collision risk. The identifier for each lens is different.
[0074] S103: Adjusting the position of each target lens based on the adjustment direction of each target lens.
[0075] After determining that each target lens does not have a collision risk, the electronic device can adjust the position of each target lens based on the adjustment direction of each target lens. Specifically, in order to improve adjustment efficiency, the position of each target lens can be adjusted in parallel.
[0076] It should be noted that it is predetermined which channel of the driver chip controls each lens, and the image acquisition device's corresponding driver chip and corresponding channel adjust the position of the target lens. In the current field of lens control, movement lenses generally consist of a single focus group and a single zoom group. Most groups of lenses are controlled by a single driver chip, with the driver chip's ALPHA channel controlling one lens and the BETA channel controlling another lens. Multi-group movement lenses generally consist of multiple focus groups or multiple zoom groups. Common configurations include: two zoom groups and one focus group, or two zoom groups and one focus group. Two driver chips are required for control, and the control methods vary.
[0077] Specifically, when the electronic device adjusts each target lens, in order to optimize the lens adjustment process and ensure that each adjustment is performed in the most appropriate manner, the electronic device adopts a more refined control strategy when adjusting each target lens. Specifically, the electronic device can record and track the adjustment history of each target lens, including the number of times the target lens has been adjusted during this group initialization. Based on this information, the electronic device can access a preset or dynamically updated database / table and retrieve the optimal adjustment step size corresponding to the current number of adjustments for the target lens. After determining the optimal adjustment step size corresponding to each target lens's current adjustment, each target lens is adjusted according to the adjustment direction and optimal adjustment step size corresponding to each target lens.
[0078] S104: Based on each adjusted target lens, determine whether there is a group corresponding to each target lens that has completed initialization. If it is determined that the group corresponding to any target lens has completed initialization, delete the group from the groups that have not completed initialization.
[0079] In an embodiment of the present application, the electronic device can determine whether there is a group that has completed initialization in the group corresponding to each target lens based on each adjusted target lens. In one possible implementation, the electronic device gradually reduces the adjustment step size of each adjustment each time the electronic device adjusts the position of the target lens. The electronic device can determine that the group corresponding to the target lens has completed initialization when the adjustment step size is a preset step size, for example, 0.
[0080] If it is determined that the group corresponding to any target lens has completed initialization, the electronic device may delete the group from the groups that have not completed initialization.
[0081] After deleting the group that has completed initialization, the electronic device may continue to loop this step to process other groups that have not completed initialization.
[0082] Figure 2This is a schematic diagram of the group initialization process provided in the related art.
[0083] Depend on Figure 2 It can be seen that the focus group can be initialized first. Specifically, the lens of the focus group is on the left side of the optical coupler (the left and right described here are Figure 2 The maximum moving distance is 943mm, and when the lens of the focus group is on the left side of the optical coupler, the PI level state is 1, and the lens of the focus group is on the right side of the optical coupler (left and right as shown here) Figure 2 The maximum moving distance (left and right) is 1057mm. Figure 2 It can be seen that the lens can be controlled to move right 8, left 4, right 2, and left 1 in sequence. After the focus group is initialized, the focus group is initialized again. Specifically, the lens of the zoom group is on the left side of the optical coupler (left and right are described here). Figure 2 The maximum moving distance is 504mm, and when the lens of the zoom group is on the left side of the optical coupler, the PI level state is 1, and the lens of the zoom group is on the right side of the optical coupler (left and right as shown here) Figure 2 The maximum moving distance (left and right) is 480mm. Figure 2 It can be seen that the lens can be controlled to move right 8, left 4, right 2, and left 1 in sequence.
[0084] The embodiment of the present application provides a method for rapid and automatic initialization of multi-zoom group movement lenses. The risk of collision is avoided by the risk-free initialization group screening module, the workload of adapting different lens parameters is reduced, and the versatility of the initialization algorithm under different lenses is enhanced.
[0085] The total travel of the lens groups in multi-zoom group movements is long, the zoom and focus travels overlap, and the optical coupler positions are flexible and variable, leading to problems such as long group initialization time and a high risk of initialization collisions. The movement lens structures in different multi-zoom groups also vary greatly, making it cumbersome to analyze and adapt the different lenses when introducing them, and common initialization methods have poor compatibility. The group structures of different multi-zoom group movement lenses vary greatly. Existing technical solutions require analysis and adaptation for each model during initialization, which is a cumbersome process. The lens travel is long, and it is prone to initialization failure or excessive search time after group collisions. The embodiments of the present application propose a method that uses dynamic initialization steps and simultaneous multi-group drive to improve efficiency. Furthermore, the method provided in the embodiments of the application can be directly embedded in the movement group initialization method and is applicable to the initialization of single focus lenses or single zoom lenses. During the initialization process, the lens adjustment steps are dynamically allocated, and the adjustment of multiple groups is driven simultaneously, which improves the initialization speed of the movement lens and the multi-group movement lens. This effectively reduces the workload of adapting different lens parameters in the initialization method. During initialization, the method for selecting risk-free initialization lenses in this embodiment of the present application analyzes the relative positions of lenses in real time and dynamically configures initialization for different groups, significantly reducing the risk of collisions between lenses. The algorithm is highly versatile, facilitating accurate and rapid initialization of different lenses. Furthermore, while maintaining low complexity, the method, through the selection of risk-free initialization lens modules and the simultaneous multi-group driving scheme, mitigates issues such as high lens collision risk, long initialization times, and poor algorithm compatibility.
[0086] In the embodiment of the present application, after determining the adjustment direction of the lenses in each group that has not completed initialization, the electronic device determines each target lens in each lens group that has no collision risk with other lenses, and adjusts the position of each target lens that has no collision risk in parallel, thereby reducing the problem of lens collision when initializing the lenses. After the initialization of a group of target lenses is completed, the electronic device continues to perform parallel processing on the lenses in other groups that have not completed initialization to achieve initialization of each group.
[0087] Example 2:
[0088] In order to determine each target lens that does not have a collision risk, based on the above embodiment, in an embodiment of the present application, determining each target lens that does not currently have a collision risk with other lenses among the lenses based on the pre-saved optical coupler position of each lens and the adjustment direction of each lens includes:
[0089] Obtaining an adjustment range pre-saved for each lens; and obtaining a direction in which each lens is located at a corresponding optical coupler position;
[0090] For each of the lenses, based on the adjustment direction of the lens and the optical coupler position of the group corresponding to the lens, candidate lenses with optical coupler positions in the adjustment direction of the optical coupler position of the lens are determined, and target candidate lenses whose adjustment ranges coincide with the adjustment range of the lens are screened out; if the direction of each target candidate lens at the corresponding optical coupler position is opposite to the direction of the lens at the corresponding optical coupler position, then the lens is determined to be a target lens that currently has no collision risk with other lenses.
[0091] To ensure that each target lens is free of collision risk, the electronic device locally stores an adjustment range for each lens, also known as the total travel range. This adjustment range represents the range over which the lens can be adjusted. The electronic device also obtains, for each group, the orientation of the lenses within that group relative to the group's optical couplers.
[0092] Figure 3 A schematic diagram of multiple groups provided in an embodiment of the present application.
[0093] Figure 3 The multi-zoom group movement lens shown consists of five groups, Figure 3 It can be seen that there are one group, two groups (Z1), three groups (Z2), four groups (F), and five groups (Z3).
[0094] Figure 4 A detailed schematic diagram of multiple groups provided in an embodiment of the present application.
[0095] Figure 4 for Figure 3 Detailed diagram of multiple groups shown, Figure 4 The lens in the middle group Z1-P1 is on the left side of the optical coupler (the left and right are described here Figure 4 The maximum moving distance is 7.3mm on the right side of the optocoupler (the left and right shown here are Figure 4 The maximum moving distance (left and right) is 43mm. Figure 4 The 0.4 in the figure is a preset multi-group structure to improve safety and reserve a safe moving distance.
[0096] Figure 4 The lens in the middle group Z2-P1 is on the left side of the optical coupler (the left and right are described here). Figure 4 The maximum moving distance is 8.12mm. On the right side of the optocoupler (left and right as shown here) Figure 4 The maximum movement distance (left and right) is 5.76mm.
[0097] Figure 4 The lens of the middle group Z3-P1 is on the left side of the optical coupler (the left and right are described here). Figure 4The maximum moving distance is 2.55mm. On the right side of the optocoupler (left and right as shown here) Figure 4 The maximum moving distance (left and right) is 5.3mm. Figure 4 The 0.25 and 0.4 are preset to build multiple groups to improve safety and reserve safe moving distances.
[0098] Figure 4 The middle lens of the F-P1 group is on the left side of the optical coupler (the left and right are described here). Figure 4 The maximum moving distance is 10.55mm. Figure 4 The maximum moving distance (left and right) is 5.3mm. Figure 4 The 0.89 and 1.2 in the above are preset to build multiple groups in order to improve safety and reserve safe moving distance. Figure 4 It can be seen that lens F-P1 has an adjustment range that overlaps with lens Z2-P1 and lens Z3-P1 respectively. The overlapping distance with lens Z2-P1 is 12.214mm, and the overlapping distance with lens Z3-P1 is 8.04mm.
[0099] For each lens, the electronic device can determine, based on the adjustment direction of the lens and the optical coupler position of the optical coupler in the group to which the lens belongs, a candidate lens whose optical coupler position is in the adjustment direction of the optical coupler position of the lens. For example, if the adjustment direction is right (the left and right described here are the left and right of the movement direction corresponding to the lens), the electronic device can determine a candidate lens whose optical coupler position is to the right of the optical coupler position of the lens. For another example, if the adjustment direction is left (the left and right described here are the left and right of the movement direction corresponding to the lens), the electronic device can determine a candidate lens whose optical coupler position is to the left of the optical coupler position of the lens. After determining each candidate lens corresponding to the lens, the electronic device can determine a target candidate lens from the candidate lenses whose adjustment range overlaps with the adjustment range of the lens. In one possible embodiment, since the target lens is adjusted in the adjustment direction, the target lens will only collide with lenses with overlapping adjustment ranges in the adjustment direction. Therefore, the electronic device can determine, for each candidate lens, that the candidate lens is a target candidate lens if the candidate lens has an overlapping adjustment range in the adjustment direction of the target lens's optical coupling position. After determining the target candidate lens, the electronic device can determine, for each target candidate lens, that the direction of the target candidate lens at the corresponding optical coupling position is opposite to the direction of the lens at the corresponding optical coupling position. If they are opposite, the lens and the target candidate lens are adjusted simultaneously, eliminating the risk of collision. If the direction of each target candidate lens at the corresponding optical coupling position is opposite to the direction of the lens at the corresponding optical coupling position, the lens is determined to be a target lens that currently has no risk of collision with any other lens.
[0100] When determining a target lens that has no collision risk with other lenses, it may be determined for each lens in turn along a preset direction whether the lens is a target lens that has no collision risk.
[0101] Considering that there are no more than 4 lenses in a common multi-group movement lens, the embodiment of the present application is introduced using 4 lenses as an example.
[0102] Figure 5 A schematic diagram of the position of a lens provided in an embodiment of the present application.
[0103] Depend on Figure 5 It can be seen that the lens in group Zoom1 is on the left side of the optical coupler (the left and right described here are Figure 5 The maximum moving distance of the lens is 2150mm, and when the lens is on the left side of the optical coupler, the PI level state is 1, and the lens of the group is on the right side of the optical coupler (the left and right described here are Figure 5 The maximum movement distance (left and right) shown is 365mm. The lenses in group Zoom1 do not have overlapping adjustment ranges with other lenses.
[0104] Group Zoom2 is on the left side of the optocoupler (left and right are described here). Figure 5 The maximum moving distance is 812mm, and when the lens is on the left side of the optical coupler, the PI level state is 1, and the lens of the focus group is on the right side of the optical coupler (left and right as shown here) Figure 5 The maximum movement distance (left and right) shown is 576mm. The lenses in the Zoom2 group and the Focus group have overlapping adjustment ranges. Specifically, there is an overlapping adjustment range on the right side of the optical coupler of the lens in the Zoom2 group.
[0105] The lens in the group Focus is on the left side of the optical coupler (the left and right described here are Figure 5 The maximum moving distance is 943mm, and when the lens is on the left side of the optical coupler, the PI level state is 1, and the lens of the focus group is on the right side of the optical coupler (left and right as shown here) Figure 5 The maximum moving distance (left and right) as shown is 1057mm. The lenses in group Zoom2 and group Zoom3 have overlapping adjustment ranges with the lenses in group Focus, respectively. Specifically, the left side of the optical coupler of the lens in group Focus has an overlapping adjustment range with the lens in group Zoom2, and the right side of the optical coupler of the lens in group Focus has an overlapping adjustment range with the lenses in group Zoom2 and group Zoom3.
[0106] by Figure 5Taking the lens shown as an example, when determining whether the lens in the group Focus is a target lens that has no collision risk with other lenses, if the lens in the group Focus is on the left side of the corresponding optical coupler, it can be determined that the adjustment direction of the lens in the group Focus is right, and the candidate lens whose optical coupler position is to the right of the optical coupler position of the lens can be determined. It can be determined that the lens in the group Zoom3 is the candidate lens, and the right side of the optical coupler position of the lens in the group Focus has an overlapping adjustment range with the lens in the group Zoom3. Therefore, the lens in the group Zoom3 can be determined as the overlapping target candidate lens.
[0107] In the embodiment of the present application, the PI level status is updated in real time during the initialization process, and the initialized lens and the initialization adjustment step are dynamically adjusted to improve the initialization speed.
[0108] Figure 6 A schematic diagram of a detailed process for determining a target lens provided in an embodiment of the present application.
[0109] S601: Determine the adjustment direction of each lens.
[0110] Specifically, the electronic device may obtain the PI level status of each lens, and determine the adjustment direction of each lens based on the PI level status.
[0111] S602: For each lens, determine candidate lenses whose optical coupling positions are in the adjustment direction of the optical coupling position of the lens, and filter out target candidate lenses whose adjustment ranges overlap with the adjustment range of the lens.
[0112] Specifically, if the lens is on the left side of the optical coupling position, determine whether the lens is affected by the lens on the right side, that is, determine whether there is a target candidate lens corresponding to the lens. If there is no target candidate lens, determine that there is no collision risk in the group initialization. If the lens is on the right side of the optical coupling position, determine whether the lens is affected by the lens on the left side, that is, determine whether there is a target candidate lens corresponding to the lens. If there is no target candidate lens, determine that there is no collision risk in the group initialization.
[0113] S603: For each lens, if the direction of each target candidate lens corresponding to the lens at the corresponding optical coupling position is opposite to the direction of the lens at the corresponding optical coupling position, then the lens is determined to be a target lens with no collision risk with other lenses.
[0114] Example 3:
[0115] In order to adjust each target lens, based on the above embodiments, in the embodiment of the present application, adjusting the position of each target lens based on the adjustment direction of each target lens includes:
[0116] Obtaining the adjustment step size of each target lens for this adjustment;
[0117] Repeat the following steps until the adjustment direction of any target lens changes;
[0118] Based on the adjustment direction and adjustment step of each target lens, the position of each target lens is adjusted; and the adjustment direction of each target lens after adjustment is determined.
[0119] Since there is no risk of collision between each target lens and other lenses when the adjustment direction of each target lens has not changed, in order to improve the efficiency of initialization, in an embodiment of the present application, the electronic device can obtain the adjustment step size of each target lens for this adjustment. In one possible implementation, the preset step size can be determined as the adjustment step size for this adjustment, and the following steps are repeated until the adjustment direction of any target lens changes. It should be noted that if the adjustment direction of any target lens changes, the target lens may collide with other lenses.
[0120] Based on the determined adjustment direction and adjustment step of each target lens, the position of each target lens is adjusted in a refrigerator; after one adjustment, the electronic device can determine the PI level state corresponding to each target lens, and based on the PI level state corresponding to each target lens, the adjustment direction of each target lens for the next adjustment can be determined, and the adjustment direction of each target lens for the next adjustment may not have changed. At this time, it can be determined that each target lens is a lens that currently does not have a collision risk with other lenses, and each target lens can be adjusted here until the adjustment direction of any target lens changes.
[0121] Figure 7 A schematic diagram of a process for adjusting each target lens provided in an embodiment of the present application.
[0122] S701: Obtain the adjustment step size of each target lens for this adjustment.
[0123] S702: Adjust the position of each target lens based on the adjustment direction and adjustment step of each target lens.
[0124] S703: Determine the adjustment direction of each adjusted target lens.
[0125] S704: Determine whether the adjustment direction of any target lens has changed. If so, execute S705; if not, execute S702.
[0126] S705: End.
[0127] It should be noted that the end described here refers to the end of the adjustment of the position of each target lens. Specifically, if the adjustment direction of any target lens is changed, a lens with no collision risk with other lenses is re-determined.
[0128] Example 4:
[0129] In order to adjust the target lens, based on the above embodiments, in the embodiment of the present application, obtaining the adjustment step size of each target lens for this adjustment includes:
[0130] For each target lens, determine whether this is the first time to adjust the target lens in this group initialization; if so, determine the adjustment step length to be the first preset step length; if not, determine the current adjustment step length according to the last adjustment step length.
[0131] In order to adjust the target lens, the electronic device can determine for each target lens whether the target lens is adjusted for the first time during this group initialization. If it is the first time to adjust the target lens, the adjustment step length corresponding to the target lens is determined as the first preset step length, which can be 16 mm. In a possible implementation, if the maximum adjustment step length of the target lens in the adjustment direction is less than the first preset step length, the first preset step length is updated using the maximum adjustment step length, wherein the maximum adjustment step length of the target lens in the adjustment direction can refer to the step length between the optical coupler position of the target lens and the boundary of the target lens in the adjustment direction. If this is not the first time to adjust the target lens during group initialization, the last adjustment step length of the target lens can be obtained, and the current adjustment step length can be determined based on the last adjustment step length. In a possible implementation, the difference between the last adjustment step length and the first preset step length can be determined as the current adjustment step length.
[0132] Based on the above-described method, the adjustment step size of each target lens can be determined.
[0133] In the related art, the starting step length of each lens is consistent, and there is a problem of poor step length compatibility in the initialization of the multi-zoom group movement group, which leads to a large deviation in the initialization progress of each group. In the embodiment of the present application, the adjustment step length of each lens will be determined according to the actual situation of the lens, and the problem of large deviation in initialization progress will not occur.
[0134] In a possible implementation, if the number of times a target lens is adjusted along the same adjustment direction reaches a threshold, it may indicate that the target lens is abnormal, and lenses without collision risks may be rescreened.
[0135] Figure 8 A schematic diagram of a process for adjusting the position of a lens provided in an embodiment of the present application.
[0136] Depend on Figure 8 It can be seen that risk-free and uninitialized target lenses can be screened, the target lenses can be adjusted based on the PI level status corresponding to the target lenses, and the adjustment step size and direction of the target lenses can be updated. Based on the updated step size and direction, risk-free and uninitialized lenses can be re-screened.
[0137] Example 5:
[0138] In order to determine the adjustment step size of the target lens, based on the above embodiments, in the embodiment of the present application, determining the current adjustment step size based on the last adjustment step size includes:
[0139] Obtaining the last adjustment direction of the target lens, and determining whether the last adjustment direction is the same as the current adjustment direction of the target lens;
[0140] If yes, the last adjustment step size is determined as the current adjustment step size;
[0141] If not, the step length adjusted from the last adjustment step length is determined as the current adjustment step length; wherein the adjusted step length is smaller than the last adjustment step length.
[0142] In order to determine the adjustment step of the target lens, the electronic device can obtain the last adjustment direction of the target lens and determine whether the last adjustment direction is the same as the adjustment direction of this adjustment. If the last adjustment direction is the same as the adjustment direction of this adjustment, the electronic device can determine the last adjustment step as the current adjustment step. If the last adjustment direction is different from the adjustment direction of this adjustment, the step after adjustment of the last adjustment step can be determined as the current adjustment step, wherein the adjusted step is smaller than the last adjustment step.
[0143] In order to determine the adjustment step size of the target lens, based on the above embodiments, in the embodiment of the present application, determining the step size after the last adjustment step size is adjusted as the current adjustment step size includes:
[0144] Determine the difference between the last adjustment step and the preset value as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, determine the candidate adjustment step as the current adjustment step; otherwise, determine the second preset step as the current adjustment step.
[0145] In order to determine the adjustment step of the target lens, the electronic device can determine the difference between the last adjustment step and a preset value, and determine the difference as a candidate adjustment step. If the candidate adjustment step is greater than a second preset step, the candidate adjustment step can be determined as the current adjustment step, wherein the second preset step can be 0. If the candidate adjustment step is not greater than the second preset step, the second preset step can be determined as the current adjustment step.
[0146] In order to determine the adjustment step size of the target lens, based on the above embodiments, in the embodiment of the present application, determining the step size after the last adjustment step size is adjusted as the current adjustment step size includes:
[0147] Determine whether the last adjustment step is not greater than the third preset step. If so, determine the second preset step as the current adjustment step, wherein the third preset step is greater than the second preset step. If not, determine the ratio of the last adjustment step to the preset value as the current adjustment step.
[0148] In order to determine the adjustment step of the target lens, the electronic device can determine whether the last adjustment step is not greater than a third preset step, wherein the third preset step can be 1. If the last adjustment step is not greater than the third preset step, the second preset step can be determined as the current adjustment step, and the third preset step is greater than the second preset step. If the last adjustment step is greater than the third preset step, the ratio of the last adjustment step to the preset value can be determined as the current adjustment step, wherein the preset value can be 2.
[0149] Taking the first preset step size as 16, the third preset step size as 1, and the preset value as 2 as an example, the adjustment steps determined in sequence are 16, 8, 4, 2, 1, and 0.
[0150] In order to accurately and effectively initialize the lens, based on the above embodiments, in the embodiment of the present application, after deleting the target lens from the lenses that have not completed initialization, the method further includes:
[0151] If there are still lenses that have not completed initialization and the number of cycles reaches the preset number, it is determined that the initialization has failed.
[0152] In the embodiment of the present application, after deleting the target lens that has completed initialization from the lenses that have not completed initialization, if there are lenses that have not completed initialization and the number of cycles reaches a preset number, it can be determined that the initialization has failed.
[0153] Figure 9 A detailed process diagram of group initialization provided in an embodiment of the present application includes the following steps:
[0154] S901: Acquire each group that has not completed initialization.
[0155] S902: Obtain the adjustment direction of the lens in each group.
[0156] S903: Determine each target lens in each lens that currently has no collision risk with other lenses according to the pre-saved optical coupler positions of each group and the adjustment directions of the lenses in each group.
[0157] S904: Adjust the position of each target lens based on the adjustment direction of each target lens.
[0158] S905: Based on each adjusted target lens, determine whether there is a group that has completed initialization in the group corresponding to each target lens. If so, execute S906; if not, execute S902.
[0159] S906: Delete the group corresponding to the target lens from the groups that have not completed initialization.
[0160] S907: Determine whether there is a group that has not completed initialization. If so, execute S908; if not, execute S810.
[0161] S908: Determine whether the number of cycles reaches the preset number. If so, execute S909; if not, execute S901.
[0162] S909: Determine that initialization has failed and end.
[0163] S910: Determine that the initialization is successful and end.
[0164] Example 6:
[0165] Based on the above embodiments, Figure 10 A schematic diagram of the structure of a group initialization device provided in an embodiment of the present application, the device comprising:
[0166] Repeat the following steps until each lens is initialized;
[0167] An acquisition module 1001 is configured to acquire, for each group that has not completed initialization, an adjustment direction of the lens in the group;
[0168] A determination module 1002 is configured to determine each target lens in each lens group that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens;
[0169] The processing module 1003 is used to adjust the position of each target lens based on the adjustment direction of each target lens; based on each adjusted target lens, determine whether there is a group corresponding to each target lens that has completed initialization; if it is determined that the group corresponding to any target lens has completed initialization, then delete the group from the groups that have not completed initialization.
[0170] Furthermore, the determination module 1002 is specifically configured to obtain an adjustment range pre-saved for each lens; and obtain the direction of each lens at the corresponding optical coupling position; for each lens, based on the adjustment direction of the lens and the optical coupling position of the group corresponding to the lens, determine a candidate lens whose optical coupling position is in the adjustment direction of the optical coupling position of the lens, and screen out a target candidate lens whose adjustment range overlaps with the adjustment range of the lens; if the direction of each target candidate lens at the corresponding optical coupling position is opposite to the direction of the lens at the corresponding optical coupling position, then determine that the lens is a target lens that currently has no collision risk with any other lens.
[0171] Furthermore, the processing module 1003 is specifically configured to obtain an adjustment step size for each target lens; repeat the following steps until the adjustment direction of any target lens changes; adjust the position of each target lens based on the adjustment direction and adjustment step size of each target lens; and determine the adjustment direction of each target lens after adjustment.
[0172] Furthermore, the processing module 1003 is specifically configured to determine, for each target lens, whether this is the first time the target lens is adjusted in this group initialization; if so, determine the adjustment step length to be the first preset step length; if not, determine the current adjustment step length based on the last adjustment step length.
[0173] Furthermore, the processing module 1003 is specifically used to obtain the last adjustment direction of the target lens, and determine whether the last adjustment direction is the same as the adjustment direction of the target lens this time; if so, the last adjustment step size is determined as the current adjustment step size; if not, the step size after adjusting the last adjustment step size is determined as the current adjustment step size; wherein the adjusted step size is smaller than the last adjustment step size.
[0174] Furthermore, the processing module 1003 is specifically used to determine the difference between the last adjustment step and the preset value as a candidate adjustment step. If the candidate adjustment step is greater than the second preset step, the candidate adjustment step is determined to be the current adjustment step; otherwise, the second preset step is determined to be the current adjustment step.
[0175] Furthermore, the processing module 1003 is specifically used to determine whether the last adjustment step is not greater than the third preset step; if so, the second preset step is determined to be the current adjustment step, wherein the third preset step is greater than the second preset step; if not, the ratio of the last adjustment step to the preset value is determined to be the current adjustment step.
[0176] Furthermore, the processing module 1003 is further configured to determine that the initialization has failed if there are still groups that have not completed initialization and the number of cycles reaches a preset number.
[0177] Example 7:
[0178] Based on the above embodiments, the present application also provides an electronic device, Figure 11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 11 As shown, it includes: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104;
[0179] The memory 1103 stores a computer program. When the program is executed by the processor 1101, the processor 1101 performs the following steps:
[0180] Repeat the following steps until each group is initialized;
[0181] For each group that has not completed initialization, obtain the adjustment direction of the lens in each group;
[0182] Determining each target lens in each lens that currently has no collision risk with other lenses according to the pre-saved optical coupler position of each group and the adjustment direction of each lens;
[0183] Adjusting the position of each target lens based on the adjustment direction of each target lens;
[0184] Based on each adjusted target lens, it is determined whether there is a group corresponding to each target lens that has completed initialization. If it is determined that the group corresponding to any target lens has completed initialization, the group is deleted from the groups that have not completed initialization.
[0185] In a possible implementation, determining each target lens in each lens that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens includes:
[0186] Obtaining an adjustment range pre-saved for each lens; and obtaining a direction in which each lens is located at a corresponding optical coupler position;
[0187] For each of the lenses, based on the adjustment direction of the lens and the optical coupler position of the group corresponding to the lens, candidate lenses with optical coupler positions in the adjustment direction of the optical coupler position of the lens are determined, and target candidate lenses whose adjustment ranges coincide with the adjustment range of the lens are screened out; if the direction of each target candidate lens at the corresponding optical coupler position is opposite to the direction of the lens at the corresponding optical coupler position, then the lens is determined to be a target lens that currently has no collision risk with other lenses.
[0188] In a possible implementation, adjusting the position of each target lens based on the adjustment direction of each target lens includes:
[0189] Obtaining the adjustment step size of each target lens for this adjustment;
[0190] Repeat the following steps until the adjustment direction of any target lens changes;
[0191] Based on the adjustment direction and adjustment step of each target lens, the position of each target lens is adjusted; and the adjustment direction of each target lens after adjustment is determined.
[0192] In a possible implementation, obtaining the adjustment step size of each target lens for the current adjustment includes:
[0193] For each target lens, determine whether this is the first time to adjust the target lens in this group initialization; if so, determine the adjustment step length to be the first preset step length; if not, determine the current adjustment step length according to the last adjustment step length.
[0194] In a possible implementation, determining the current adjustment step size based on the last adjustment step size includes:
[0195] Obtaining the last adjustment direction of the target lens, and determining whether the last adjustment direction is the same as the current adjustment direction of the target lens;
[0196] If yes, the last adjustment step size is determined as the current adjustment step size;
[0197] If not, the step length adjusted from the last adjustment step length is determined as the current adjustment step length; wherein the adjusted step length is smaller than the last adjustment step length.
[0198] In a possible implementation, determining the step size adjusted after the last adjustment as the current adjustment step size includes:
[0199] Determine the difference between the last adjustment step and the preset value as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, determine the candidate adjustment step as the current adjustment step; otherwise, determine the second preset step as the current adjustment step.
[0200] In a possible implementation, determining the step size adjusted after the last adjustment as the current adjustment step size includes:
[0201] Determine whether the last adjustment step is not greater than the third preset step. If so, determine the second preset step as the current adjustment step, wherein the third preset step is greater than the second preset step. If not, determine the ratio of the last adjustment step to the preset value as the current adjustment step.
[0202] In a possible implementation manner, after deleting the group from the groups that have not completed initialization, the method further includes:
[0203] If there are still groups that have not completed initialization and the number of cycles reaches the preset number, it is determined that the initialization has failed.
[0204] The communication bus mentioned in the above-mentioned electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface 602 is used for communication between the above-mentioned electronic device and other devices. The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0205] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processing processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0206] Example 8:
[0207] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program executable by a processor. When the program runs on the processor, the processor implements the following steps:
[0208] Repeat the following steps until each group is initialized;
[0209] For each group that has not completed initialization, obtain the adjustment direction of the lens in each group;
[0210] Determining each target lens in each lens that currently has no collision risk with other lenses according to the pre-saved optical coupler position of each group and the adjustment direction of each lens;
[0211] Adjusting the position of each target lens based on the adjustment direction of each target lens;
[0212] Based on each adjusted target lens, it is determined whether there is a group corresponding to each target lens that has completed initialization. If it is determined that the group corresponding to any target lens has completed initialization, the group is deleted from the groups that have not completed initialization.
[0213] In a possible implementation, determining each target lens in each lens that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens includes:
[0214] Obtaining an adjustment range pre-saved for each lens; and obtaining a direction in which each lens is located at a corresponding optical coupler position;
[0215] For each of the lenses, based on the adjustment direction of the lens and the optical coupler position of the group corresponding to the lens, candidate lenses with optical coupler positions in the adjustment direction of the optical coupler position of the lens are determined, and target candidate lenses whose adjustment ranges coincide with the adjustment range of the lens are screened out; if the direction of each target candidate lens at the corresponding optical coupler position is opposite to the direction of the lens at the corresponding optical coupler position, then the lens is determined to be a target lens that currently has no collision risk with other lenses.
[0216] In a possible implementation, adjusting the position of each target lens based on the adjustment direction of each target lens includes:
[0217] Obtaining the adjustment step size of each target lens for this adjustment;
[0218] Repeat the following steps until the adjustment direction of any target lens changes;
[0219] Based on the adjustment direction and adjustment step of each target lens, the position of each target lens is adjusted; and the adjustment direction of each target lens after adjustment is determined.
[0220] In a possible implementation, obtaining the adjustment step size of each target lens for the current adjustment includes:
[0221] For each target lens, determine whether this is the first time to adjust the target lens in this group initialization; if so, determine the adjustment step length to be the first preset step length; if not, determine the current adjustment step length according to the last adjustment step length.
[0222] In a possible implementation, determining the current adjustment step size based on the last adjustment step size includes:
[0223] Obtaining the last adjustment direction of the target lens, and determining whether the last adjustment direction is the same as the current adjustment direction of the target lens;
[0224] If yes, the last adjustment step size is determined as the current adjustment step size;
[0225] If not, the step length adjusted from the last adjustment step length is determined as the current adjustment step length; wherein the adjusted step length is smaller than the last adjustment step length.
[0226] In a possible implementation, determining the step size adjusted after the last adjustment as the current adjustment step size includes:
[0227] Determine the difference between the last adjustment step and the preset value as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, determine the candidate adjustment step as the current adjustment step; otherwise, determine the second preset step as the current adjustment step.
[0228] In a possible implementation, determining the step size adjusted after the last adjustment as the current adjustment step size includes:
[0229] Determine whether the last adjustment step is not greater than the third preset step. If so, determine the second preset step as the current adjustment step, wherein the third preset step is greater than the second preset step. If not, determine the ratio of the last adjustment step to the preset value as the current adjustment step.
[0230] In a possible implementation manner, after deleting the group from the groups that have not completed initialization, the method further includes:
[0231] If there are still groups that have not completed initialization and the number of cycles reaches the preset number, it is determined that the initialization has failed.
[0232] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0233] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as 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 a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0234] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0235] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0236] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A group initialization method, characterized in that: The method comprises: Repeat the following steps until each group is initialized; For each group that has not completed initialization, obtain the adjustment direction of the lens in each group; Determining each target lens in each lens that currently has no collision risk with other lenses according to the pre-saved optical coupler position of each group and the adjustment direction of each lens; Adjusting the position of each target lens based on the adjustment direction of each target lens; Based on each adjusted target lens, it is determined whether there is a group corresponding to each target lens that has completed initialization. If it is determined that the group corresponding to any target lens has completed initialization, the group is deleted from the groups that have not completed initialization.
2. The method according to claim 1, characterized in that The step of determining each target lens in each lens that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens includes: Obtaining an adjustment range pre-saved for each lens; and obtaining a direction in which each lens is located at a corresponding optical coupler position; For each of the lenses, based on the adjustment direction of the lens and the optical coupler position of the group corresponding to the lens, candidate lenses with optical coupler positions in the adjustment direction of the optical coupler position of the lens are determined, and target candidate lenses whose adjustment ranges coincide with the adjustment range of the lens are screened out; if the direction of each target candidate lens at the corresponding optical coupler position is opposite to the direction of the lens at the corresponding optical coupler position, then the lens is determined to be a target lens that currently has no collision risk with other lenses.
3. The method according to claim 1, characterized in that The adjusting the position of each target lens based on the adjustment direction of each target lens includes: Obtaining the adjustment step size of each target lens for this adjustment; Repeat the following steps until the adjustment direction of any target lens changes; Based on the adjustment direction and adjustment step of each target lens, the position of each target lens is adjusted; and the adjustment direction of each target lens after adjustment is determined.
4. The method according to claim 1, wherein The obtaining of the adjustment step size of each target lens for this adjustment includes: For each target lens, determine whether this is the first time to adjust the target lens in this group initialization; if so, determine the adjustment step length to be the first preset step length; if not, determine the current adjustment step length according to the last adjustment step length.
5. The method according to claim 4, characterized in that Determining the current adjustment step size based on the last adjustment step size includes: Obtaining the last adjustment direction of the target lens, and determining whether the last adjustment direction is the same as the current adjustment direction of the target lens; If yes, the last adjustment step size is determined as the current adjustment step size; If not, the step length adjusted from the last adjustment step length is determined as the current adjustment step length; wherein the adjusted step length is smaller than the last adjustment step length.
6. The method according to claim 5, characterized in that The step size adjusted from the last adjustment step size is determined as the current adjustment step size, comprising: Determine the difference between the last adjustment step and the preset value as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, determine the candidate adjustment step as the current adjustment step; otherwise, determine the second preset step as the current adjustment step.
7. The method according to claim 5, characterized in that The step size adjusted from the last adjustment step size is determined as the current adjustment step size, comprising: Determine whether the last adjustment step is not greater than the third preset step. If so, determine the second preset step as the current adjustment step, wherein the third preset step is greater than the second preset step. If not, determine the ratio of the last adjustment step to the preset value as the current adjustment step.
8. The method according to claim 1, characterized in that After deleting the group from the groups that have not completed initialization, the method further includes: If there are still groups that have not completed initialization and the number of cycles reaches the preset number, it is determined that the initialization has failed.
9. A group initialization device, characterized in that: The device comprises: Repeat the following steps until each lens is initialized; An acquisition module, configured to acquire, for each group that has not completed initialization, an adjustment direction of the lens in the group; a determination module, configured to determine each target lens in each lens that currently has no collision risk with other lenses based on the pre-saved optical coupler position of each group and the adjustment direction of each lens; The processing module is configured to adjust the position of each target lens based on the adjustment direction of each target lens; determine, based on each adjusted target lens, whether there is a group corresponding to each target lens that has completed initialization; and if it is determined that the group corresponding to any target lens has completed initialization, delete the group from the groups that have not completed initialization.
10. An electronic device, characterized in that: The electronic device includes a processor, and the processor is configured to implement the steps of the group initialization method according to any one of claims 1 to 8 when executing a computer program stored in a memory.
Citation Information
Patent Citations
Method and device for assembling multiple lens groups and method for assembling camera module
CN115716190A
Focusing apparatus and method, and electronic device
WO2024082699A1