Group initialization method and device and electronic equipment
Through dynamic initialization of step size and parallel driving of multi-groups, the collision risk and long time problems during multi-zoom lens group initialization are solved, the lens initialization speed and compatibility are improved, and efficient group initialization is achieved.
Patent Information
- Application Number
- CN202411111592.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-13
AI Technical Summary
In the field of lens control, there are problems such as collision risk and long initialization time when initializing multi-zoom lens groups. The existing technology has poor compatibility, and each model needs to be analyzed and adapted separately, resulting in cumbersome and possible initialization failure.
Through dynamic initialization step size and parallel driving multi-groups, we filter risk-free initialization lenses, analyze relative positions in real time and configure group initialization dynamically to reduce the risk of collision between lenses and improve the initialization speed.
It effectively reduces the workload of lens parameter adaptation, improves the initialization speed of lens, reduces the risk of collision, and enhances the universality and accuracy of the algorithm.
Smart Images

Figure CN119211719A_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, higher and higher requirements are placed on the performance of lenses commonly used in front-end cameras, such as wider focal lengths, faster speeds, higher precision, and longer lifespan. In order to improve rigid indicators such as focal length under limited equipment volume, a multi-group zoom group movement lens design scheme will be adopted. The zoom and focus systems under this scheme 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 and realize the movement of each lens. The process of finding the optical coupler (PI) is called group initialization.
[0003] In the current lens control field, the movement lens is generally composed of a zoom group and a focus group, and a sequential initialization method is adopted: that is, the focus group initialization is completed first, and then the zoom group initialization is completed. The initialization process is generally to first drive a lens towards the optical coupler with a fixed large step length. After the optical coupler (PI) level state changes, the step length is reduced to drive the lens in the reverse direction to search for the optical coupler, and the above steps are repeated until the step length is reduced to zero. This position is considered to be the reference position and the group is successfully initialized. However, the total travel of the multi-zoom lens movement is long, and the zoom and focus travels overlap with each other, resulting in 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, which are used to solve 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, obtaining the adjustment direction of the lens in each group;
[0008] 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;
[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] Further, 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 includes:
[0012] Obtaining the adjustment range pre-saved for each lens; and obtaining the direction in which each lens is located at the corresponding optical coupling position;
[0013] For each of the lenses, according to the adjustment direction of the lens and the optical coupling position of the group corresponding to the lens, a candidate lens with an optical coupling position in the adjustment direction of the optical coupling position of the lens is determined, and a target candidate lens whose adjustment range coincides with the adjustment range of the lens is screened out; if the direction of each of the target candidate lenses 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 that currently has no collision risk with other lenses.
[0014] Further, adjusting the position of each target lens based on the adjustment direction of each target lens includes:
[0015] Obtaining the adjustment step length 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 length 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] Further, 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 adjustment direction of the target lens adjusted this time;
[0022] If yes, the last adjustment step length is determined as the current adjustment step length;
[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] Further, determining the step length adjusted after the last adjustment as the current adjustment step length includes:
[0025] The difference between the last adjustment step and the preset value is determined as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, the candidate adjustment step is determined as the current adjustment step; otherwise, the second preset step is determined as the current adjustment step.
[0026] Further, determining the step length adjusted after the last adjustment as the current adjustment step length 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, used for acquiring, for each group that has not completed initialization, an adjustment direction of the lens in each group that is currently adjusted;
[0033] A determination module, used for 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;
[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, 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.
[0035] Furthermore, the determination module is specifically used to obtain an adjustment range pre-saved for each lens; and obtain the direction of each lens at a corresponding optical coupling position; for each lens, according to 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 from the candidate lenses; 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 other lenses.
[0036] Furthermore, the processing module is specifically used to obtain the adjustment step of each target lens for this adjustment; 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 of each target lens; and determine the adjustment direction of each target lens after adjustment.
[0037] Further, the processing module is specifically used to determine, for each target lens, whether it 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.
[0038] Further, 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 adjusted 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 a 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] Furthermore, the processing module 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.
[0041] Furthermore, the processing module 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.
[0042] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising a processor, the processor being configured to implement steps of a group initialization method when executing a computer program stored in a memory.
[0043] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the steps of the group initialization method when executed by a processor.
[0044] In an embodiment of the present application, the electronic device repeats the following steps until each group has completed initialization; obtains each group that has not completed initialization, and for each group that has not completed initialization, obtains the adjustment direction of the lens in each group that has been adjusted this time; determines each target lens in each lens that currently has no risk of collision with other lenses based on the pre-saved optical coupling position of each group and the adjustment direction of each lens; adjusts the position of each target lens based on the adjustment direction of each target lens; determines whether there is a group that has completed initialization in the group corresponding to each target lens based on each adjusted target lens, and if it is determined that the group corresponding to any target lens has completed initialization, deletes the group in the group that has not completed initialization. Because in an embodiment of the present application, after determining 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 has no risk of collision with other lenses, and adjusts the position of each target lens that has no risk of collision in parallel, thereby reducing the problem of lens collision when initializing the lens, and after a group of target lenses has completed initialization, continues to perform parallel processing on the lenses in other groups that have not completed initialization to achieve initialization of each group. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 A schematic diagram of a group initialization process provided by 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 of 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] Fig. 9 A detailed process diagram of group initialization provided in an embodiment of the present application;
[0055] Fig.10 A schematic diagram of the structure of a group initialization device provided in an embodiment of the present application;
[0056] Fig.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 the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.
[0058] In order to solve the problem of collision risk in group initialization in the related art, the embodiments of the present application provide a group initialization method, device and electronic device.
[0059] The group initialization method comprises: repeating the following steps in a loop 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 according to the pre-saved optical 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 there is a group that has completed initialization in the group corresponding to each target lens based on each adjusted target lens, and if it is determined that the group corresponding to any target lens has completed initialization, deleting the group in the group that has not completed initialization.
[0060] Embodiment 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. The electronic device 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 intelligent 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 has completed initialization. Specifically, when the lens in a group moves to the optical coupling position of the group, it can be determined that the group has completed initialization. How to determine whether a group has completed initialization is a prior art and will not be described in detail 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 completed initialization, and after obtaining each group that has not completed initialization, obtain the adjustment direction of the lens in each group that is adjusted this time.
[0069] Specifically, the electronic device can save, for each group, the adjustment direction of the lens in the group when the PI level state corresponding to the group is high, and the adjustment direction of the lens in the group when the PI level state corresponding to the group is low. The electronic device can determine the PI level state corresponding to the group, and determine the adjustment direction corresponding to the lens in the group according to whether the PI level state is high or low, and the adjustment direction is the adjustment direction of the lens in the group this time. What kind of PI level state is high and what kind of PI level state is low is a prior art and will not be repeated here.
[0070] S102: Determine each target lens in each lens that currently has no collision risk with other lenses according to the pre-saved photocoupler 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 a possible implementation, the electronic device pre-stores a lens detection model, and the electronic device inputs the optical coupler position of each group and the adjustment direction of the lens in each group into the lens detection model, and the lens detection model can output each target lens without collision risk. It should be noted that the lens detection model can output the identification of each target lens without collision risk. Among them, the identification of 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 there is no collision risk for each target lens, 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 the 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 which driver chip controls each lens, and the driver chip and the corresponding channel of the image acquisition device adjust the position of the target lens. Among them, in the current field of lens control, the movement lens is generally composed of a single focus group and a single zoom group. The lenses of most groups are controlled by one driver chip. The ALPHA channel of the driver chip controls a certain lens, and the BETA channel controls another lens. Multi-group movement lenses are generally composed of multiple focus groups or multiple zoom groups. Common configurations include: 2 zoom groups and 1 focus group, 2 zoom groups and 1 focus group. Two driver chips are required to complete the control, and the control method combination is varied.
[0077] Specifically, when the electronic device adjusts each target lens, in order to optimize the lens adjustment process and ensure that each adjustment can be 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 is adjusted during the group initialization. Based on this information, the electronic device can access a preset or dynamically updated database / table to 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 for this 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 a 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 of the focus group 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 (the left and right described here are Figure 2 The maximum moving distance of the left and right (shown) 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 (the left and right described here are Figure 2 The maximum moving distance of the zoom group 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 (the left and right described here are Figure 2 The maximum moving distance of the left and right (shown) 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 is equivalent to providing a method for fast automatic initialization of a multi-zoom group movement lens. 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 stroke of the multi-zoom group movement lens group is long, the zoom and focus strokes overlap each other, and the optical coupling position is flexible and changeable, resulting in long group initialization time and high initialization collision risk. The movement lens structure in different multi-zoom groups is also very different. It is cumbersome to analyze and adapt different lenses when introducing lenses, and the common initialization methods have poor compatibility. The group structure of different multi-zoom group movement lenses is ever-changing. The existing technical solutions need to analyze and adapt each model when initializing. The process is cumbersome, and the lens stroke is long, which is prone to initialization failure or long search time after group collision. The embodiment of the present application proposes a method of dynamic initialization step size and simultaneous driving of multiple groups to improve efficiency, and the method provided by the embodiment of the application can be directly embedded in the movement group initialization method, which is still applicable to the initialization of a single focus lens or a single zoom lens. During the initialization process, the adjustment step size of the lens will be dynamically allocated, and the adjustment of multiple groups will be driven at the same time to improve the initialization speed of the movement lens and the lens of the multi-group movement. And effectively reduce the workload of adapting different lens parameters in the initialization method. During initialization, the method for selecting risk-free initialization lenses in the embodiment of the present application can analyze the relative positions between lenses in real time, dynamically configure the initialization of different groups, greatly reduce the risk of collision between lenses, and the algorithm is universal, which is conducive to the accurate and rapid completion of initialization actions for different lenses. And under the premise of low complexity, by selecting risk-free initialization lens modules and multi-group simultaneous driving solutions, the problems of high lens collision risk, long initialization time, and poor algorithm compatibility are improved.
[0086] Because 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 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, and after a group of target lenses has completed initialization, continues to perform parallel processing on the lenses in other groups that have not completed initialization, thereby achieving initialization of each group.
[0087] Embodiment 2:
[0088] In order to determine each target lens that does not have a collision risk, based on the above embodiment, in the embodiment of the present application, the method of determining each target lens that does not currently have a collision risk with other lenses among the lenses according to the pre-saved optical coupling position of each lens and the adjustment direction of each lens includes:
[0089] Obtaining the adjustment range pre-saved for each lens; and obtaining the direction in which each lens is located at the corresponding optical coupling position;
[0090] For each of the lenses, according to the adjustment direction of the lens and the optical coupling position of the group corresponding to the lens, a candidate lens with an optical coupling position in the adjustment direction of the optical coupling position of the lens is determined, and a target candidate lens whose adjustment range coincides with the adjustment range of the lens is screened out; if the direction of each of the target candidate lenses 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 that currently has no collision risk with other lenses.
[0091] In order to determine each target lens without collision risk, the electronic device locally stores an adjustment range for each lens in advance, and the adjustment range can also be called a total stroke. The adjustment range is the adjustable range of the lens. The electronic device also obtains the direction of the optical coupler of the lens in the group for each group.
[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 they include group one, group two (Z1), group three (Z2), group four (F), and group five (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 A detailed schematic diagram of multiple groups is 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 described 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 construction 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 (the left and right described here are Figure 4 The maximum moving distance (left and right) shown is 5.76mm.
[0097] Figure 4 The lens in 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 (the left and right described here are Figure 4 The maximum moving distance (left and right) is 5.3mm. Figure 4 The 0.25 and 0.4 in the figure are preset to build multiple groups for improved safety and to reserve safe moving distances.
[0098] Figure 4 The lens of the middle group F-P1 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, and the right side of the optocoupler (the left and right sides described here are 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 to improve safety and reserve safe moving distance. Figure 4 It can be seen that lens F-P1 has an overlapping adjustment range 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 the candidate lens whose optical coupling position is in the adjustment direction of the optical coupling position of the lens according to the adjustment direction of the lens and the optical coupling position of the optical coupling in the group to which the lens belongs. For example, if the adjustment direction is the right side (the left and right described here are the left and right of the movement direction corresponding to the lens), the electronic device can determine the candidate lens whose optical coupling position is on the right side of the optical coupling position of the lens. For another example, if the adjustment direction is the left side (the left and right described here are the left and right of the movement direction corresponding to the lens), the electronic device can determine the candidate lens whose optical coupling position is on the left side of the optical coupling position of the lens. After determining each candidate lens corresponding to the lens, the electronic device can determine the target candidate lens whose adjustment range overlaps with the adjustment range of the lens from among the candidate lenses. In a possible implementation, since the target lens is adjusted in the adjustment direction, the target lens will only collide with a lens with an adjustment range that overlaps in the adjustment direction. Therefore, the electronic device can determine that the candidate lens is a target candidate lens for each candidate lens if the candidate lens has an adjustment range that overlaps in the adjustment direction of the optical coupling position of the target lens. After determining the target candidate lens, the electronic device can determine 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 for each target candidate lens. If they are opposite, the lens and the target candidate lens are adjusted at the same time, and there is no 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 other lenses.
[0100] When determining a target lens that has no collision risk with other lenses, it may be determined in sequence along a preset direction for each lens 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 by taking 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 optocoupler (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 moving distance (left and right) as shown is 365mm, and the lenses in the group Zoom1 do not have overlapping adjustment ranges with other lenses.
[0104] Group Zoom2 is on the left side of the optocoupler (the left and right are described here). Figure 5 The maximum moving distance of the focus group 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 (the left and right described here are Figure 5 The farthest moving distance (as shown in the left and right) is 576mm. The lens in the group Zoom2 and the lens in the group Focus have overlapping adjustment ranges. Specifically, there is an overlapping adjustment range on the right side of the optical coupler of the lens in the group Zoom2.
[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 of the focus group 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 (the left and right described here are Figure 5 The farthest moving distance (as shown on the left and right) 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 the right side, and the candidate lens whose optical coupler position is on the right side of the optical coupler position of the lens can be determined, and the lens in the group Zoom3 can be determined as 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, so 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 state 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 state of each lens, and determine the adjustment direction of each lens based on the PI level state.
[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 select target candidate lenses whose adjustment ranges overlap with the adjustment range of the lens from among the candidate lenses.
[0112] Specifically, if the lens is on the left side of the optical coupling position, determine whether the lens is affected by the right lens, 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 initialization of the group. If the lens is on the right side of the optical coupling position, determine whether the lens is affected by the left lens, 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 initialization of the group.
[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, the lens is determined to be a target lens that currently has no collision risk with other lenses.
[0114] Embodiment 3:
[0115] In order to adjust each target lens, based on the above embodiments, in the embodiment of the present application, the position of each target lens is adjusted based on the adjustment direction of each target lens, including:
[0116] Obtaining the adjustment step length 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 length 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 still 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 of each target lens for this adjustment. In a possible implementation, the preset step can be determined as the adjustment step of 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 length 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 without collision risk with other lenses is re-determined.
[0128] Embodiment 4:
[0129] In order to adjust the target lens, based on the above embodiments, in the embodiment of the present application, the step of obtaining the adjustment step 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 in 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, and the first preset step length 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 with the maximum adjustment step length, wherein the maximum adjustment step length of the target lens in the adjustment direction may refer to the step length between the optical coupling position of the target lens and the boundary of the target lens in the adjustment direction. If this group initialization is not the first time to adjust the target lens, the last adjustment step length of the target lens can be obtained, and the current adjustment step length is determined according to 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 length 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 when initializing 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 state 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] Embodiment 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, the step of determining the current adjustment step size according to 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 adjustment direction of the target lens adjusted this time;
[0140] If yes, the last adjustment step length is determined as the current adjustment step length;
[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 the last adjustment step is adjusted 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, the step size after the last adjustment step size is adjusted is determined as the current adjustment step size, including:
[0144] The difference between the last adjustment step and the preset value is determined as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, the candidate adjustment step is determined as the current adjustment step; otherwise, the second preset step is determined 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, the step size after the last adjustment step size is adjusted is determined as the current adjustment step size, including:
[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 initialize the lens accurately and effectively, 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] Fig. 9 A detailed process diagram of group initialization provided in an embodiment of the present application, the process includes the following steps:
[0154] S901: Acquire each group that has not completed initialization.
[0155] S902: Obtain the adjustment direction of the lenses 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 photocoupler positions of each group and the adjustment directions of the lenses in each group.
[0157] S904: Based on the adjustment direction of each target lens, adjust the position 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 yes, execute S906; if not, execute S902.
[0159] S906: Deleting 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 yes, execute S908; if no, 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] Embodiment 6:
[0165] Based on the above embodiments, Fig.10 A schematic diagram of the structure of a group initialization device provided in an embodiment of the present application, the device includes:
[0166] Repeat the following steps until each lens is initialized.
[0167] An acquisition module 1001 is used to acquire, for each group that has not completed initialization, an adjustment direction of the lens in each group that is currently adjusted;
[0168] A determination module 1002 is used to 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;
[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, 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.
[0170] Further, the determination module 1002 is specifically used 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, according to 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 coincides with the adjustment range of the lens from the candidate lenses; 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 other lenses.
[0171] Further, the processing module 1003 is specifically used to obtain the adjustment step of each target lens for this adjustment; 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 of each target lens; and determine the adjustment direction of each target lens after adjustment.
[0172] Further, the processing module 1003 is specifically used to determine, for each target lens, whether it 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.
[0173] Further, 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 adjusted this time; if so, the last adjustment step length is determined as the current adjustment step length; if not, the step length after the 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.
[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] Further, 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 the initialization and the number of cycles reaches a preset number.
[0177] Embodiment 7:
[0178] Based on the above embodiments, the present application also provides an electronic device, Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.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, obtaining the adjustment direction of the lens in each group;
[0182] 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;
[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 according to the pre-saved optical coupler position of each group and the adjustment direction of each lens includes:
[0186] Obtaining the adjustment range pre-saved for each lens; and obtaining the direction in which each lens is located at the corresponding optical coupling position;
[0187] For each of the lenses, according to the adjustment direction of the lens and the optical coupling position of the group corresponding to the lens, a candidate lens with an optical coupling position in the adjustment direction of the optical coupling position of the lens is determined, and a target candidate lens whose adjustment range coincides with the adjustment range of the lens is screened out; if the direction of each of the target candidate lenses 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 that currently has no collision risk with other lenses.
[0188] In a possible implementation manner, adjusting the position of each target lens based on the adjustment direction of each target lens includes:
[0189] Obtaining the adjustment step length 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 length 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 manner, obtaining the adjustment step size of each target lens adjusted this time 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 manner, determining the current adjustment step size according to 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 adjustment direction of the target lens adjusted this time;
[0196] If yes, the last adjustment step length is determined as the current adjustment step length;
[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 manner, determining the step size adjusted after the last adjustment step size as the current adjustment step size includes:
[0199] The difference between the last adjustment step and the preset value is determined as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, the candidate adjustment step is determined as the current adjustment step; otherwise, the second preset step is determined as the current adjustment step.
[0200] In a possible implementation manner, determining the step size adjusted after the last adjustment step size 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 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 electronic device and other devices. The memory may include a random access memory (RAM) and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may 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 (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, 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] Embodiment 8:
[0207] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor implements the following steps when executing:
[0208] Repeat the following steps until each group is initialized.
[0209] For each group that has not completed initialization, obtaining the adjustment direction of the lens in each group;
[0210] 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;
[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 according to the pre-saved optical coupler position of each group and the adjustment direction of each lens includes:
[0214] Obtaining the adjustment range pre-saved for each lens; and obtaining the direction in which each lens is located at the corresponding optical coupling position;
[0215] For each of the lenses, according to the adjustment direction of the lens and the optical coupling position of the group corresponding to the lens, a candidate lens with an optical coupling position in the adjustment direction of the optical coupling position of the lens is determined, and a target candidate lens whose adjustment range coincides with the adjustment range of the lens is screened out; if the direction of each of the target candidate lenses 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 that currently has no collision risk with other lenses.
[0216] In a possible implementation manner, adjusting the position of each target lens based on the adjustment direction of each target lens includes:
[0217] Obtaining the adjustment step length 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 length 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 manner, obtaining the adjustment step size of each target lens adjusted this time 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 manner, determining the current adjustment step size according to 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 adjustment direction of the target lens adjusted this time;
[0224] If yes, the last adjustment step length is determined as the current adjustment step length;
[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 manner, determining the step size adjusted after the last adjustment step size as the current adjustment step size includes:
[0227] The difference between the last adjustment step and the preset value is determined as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, the candidate adjustment step is determined as the current adjustment step; otherwise, the second preset step is determined as the current adjustment step.
[0228] In a possible implementation manner, determining the step size adjusted after the last adjustment step size 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 may be provided as methods, systems, or computer program products. Therefore, the present application may 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 may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include 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 box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 capable of directing a computer or other programmable data processing device to operate 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 A 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 operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0236] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also 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, obtaining the adjustment direction of the lens in each group; 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; 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 according to the pre-saved optical coupler position of each group and the adjustment direction of each lens comprises: Obtaining the adjustment range pre-saved for each lens; and obtaining the direction in which each lens is located at the corresponding optical coupling position; For each of the lenses, according to the adjustment direction of the lens and the optical coupling position of the group corresponding to the lens, a candidate lens with an optical coupling position in the adjustment direction of the optical coupling position of the lens is determined, and a target candidate lens whose adjustment range coincides with the adjustment range of the lens is screened out; if the direction of each of the target candidate lenses 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 that currently has no collision risk with other lenses.
3. The method according to claim 1, characterized in that The step of adjusting the position of each target lens based on the adjustment direction of each target lens comprises: Obtaining the adjustment step length 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 length 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, characterized in that: The obtaining of the adjustment step length 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 The determining the current adjustment step length according to the last adjustment step length comprises: Obtaining the last adjustment direction of the target lens, and determining whether the last adjustment direction is the same as the adjustment direction of the target lens adjusted this time; If yes, the last adjustment step length is determined as the current adjustment step length; 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 after the last adjustment step size is determined as the current adjustment step size, comprising: The difference between the last adjustment step and the preset value is determined as a candidate adjustment step; if the candidate adjustment step is greater than a second preset step, the candidate adjustment step is determined as the current adjustment step; otherwise, the second preset step is determined as the current adjustment step.
7. The method according to claim 5, characterized in that The step size adjusted after 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, used for acquiring, for each group that has not completed initialization, an adjustment direction of the lens in each group that is currently adjusted; A determination module, used for 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; The 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, delete the group from the groups that have not completed initialization.
10. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used 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
Zoom lens and imaging device
CN114002835A
Method and device for assembling multiple lens groups and method for assembling camera module
CN115716190A
Camera shooting device
CN206863447U
The aging apparatus of the meats
KR102363543B1
Focusing apparatus and method, and electronic device
WO2024082699A1
