Motor Detection Method, Device and System for Electric Lens
Through periodic detection and determination of movement step numbers, the problem of inconsistency in the signal line sequence of the electric lens is solved, and the adaptation between the lens motor signal line sequence of the hardware design signal line sequence of different manufacturers is realized, thereby improving the compatibility and reliability of the electric lens.
Patent Information
- Application Number
- CN202110220931.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-26
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-02-26
AI Technical Summary
In the hardware circuit design of existing electric lenses, the signal line sequence is inconsistent with the signal line sequence of the lens motor, which makes it inability to compatible with lens motors from different manufacturers, and the signal line sequence is fixed and cannot be changed, so that the lens motors of other signal line sequences cannot be driven.
Through the periodic detection method, each candidate signal line is traversed and controlled to combine the output control signal to the electric lens, and the image is acquired until the differentiation conditions are met, the signal line sequence of the motor is determined, and the function is determined by the number of motion steps of the motor in the opposite direction.
It realizes compatibility between lens motor signal line sequences from different manufacturers and hardware design signal line sequences when the signal line sequence cannot be determined, and the motor function is determined, which improves the compatibility and reliability of the electric lens.
Smart Images

Figure CN114979617B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of imaging devices. Specifically, this application relates to a method, device, and system for detecting motors of an electric lens. Background Art
[0002] In current electric lenses, there are differences and no unification in the regulations for the signal line sequences of the motors driving the lenses. Therefore, when designing the hardware circuit, it is necessary to consider that the signal line sequence of the hardware design is consistent with the signal line sequence of the lens motor. Once an error occurs in the designed signal line sequence, the motor of the lens cannot be controlled to work to achieve the corresponding functions. And once the hardware design is completed, the signal line sequence is fixed and cannot be changed, and only the lens motor corresponding to this signal line sequence can be driven, and the lens motors with other signal line sequences cannot be compatible. Summary of the Invention
[0003] This application provides a method, device, system, and computer-readable storage medium for detecting motors of an electric lens. It can determine the signal line sequences of each motor of the lens through a periodic detection method when the signal line sequences of the lens motors cannot be determined, and realize the adaptability between the signal line sequences of lens motors from different manufacturers and the signal line sequences of the hardware design. The technical solutions are as follows:
[0004] In a first aspect, a method for detecting motors of an electric lens is provided. The method includes:
[0005] Periodically detecting the signal line sequences of each motor of the electric lens. Wherein, the detection process of one period includes:
[0006] According to the set of candidate signal lines in this period, traverse and control each candidate signal line combination to output a control signal to the electric lens, and obtain at least two images collected by the electric lens until any two of the images meet the dissimilarity condition.
[0007] Wherein, the candidate signal line combination includes the designed number of candidate signal lines in the set, and the designed number is the number of signal lines required for one motor;
[0008] Determine the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of one of the motors.
[0009] In a possible implementation, the traversing and controlling each candidate signal line combination to output a control signal to the electric lens and obtaining at least two images collected by the electric lens includes:
[0010] During the process of traversing and controlling each candidate signal line combination to output a control signal, obtain at least two images collected by the electric lens.
[0011] In another possible implementation, the process of traversing and controlling each candidate signal line combination to output a control signal includes:
[0012] Traversing and controlling the control signal output by each candidate signal line combination to be at a first level.
[0013] In yet another possible implementation, after determining the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of one of the motors, it further includes:
[0014] Removing the candidate signal line combination corresponding to one of the motors from the set of candidate signal lines in this cycle to obtain the set of candidate signal lines in the next cycle, and performing detection in the next cycle until the set of candidate signal lines is empty.
[0015] In yet another possible implementation, it further includes:
[0016] By traversing and controlling the signal lines corresponding to each motor to output control signals, controlling each motor to move back and forth in two opposite directions, and determining the number of movement steps of each motor when moving from one extreme position to the other extreme position;
[0017] Determining the functions of the motors according to the movement steps of the motors of the electric lens.
[0018] In yet another possible implementation, the controlling each motor to move back and forth in two opposite directions and determining the number of movement steps of each motor when moving from one extreme position to the other extreme position includes:
[0019] Controlling a motor to move in a first direction, and when it is detected that two adjacent images obtained in the first direction satisfy the similarity condition, controlling the motor to move in a second direction opposite to the first direction;
[0020] When it is detected that two adjacent images obtained in the second direction satisfy the similarity condition, recording the movement steps of the motor.
[0021] In a second aspect, there is provided a motor detection device for an electric lens, which is used to periodically detect the signal line sequences of the motors of the electric lens. The device includes:
[0022] A control module, configured to, according to the set of candidate signal lines in this cycle, traverse and control each candidate signal line combination to output a control signal to the electric lens, and acquire at least two images collected by the electric lens until any two of the images satisfy the dissimilarity condition, where the candidate signal line combination includes the designed number of candidate signal lines in the set; the designed number is the number of signal lines required for one motor;
[0023] A determination module, configured to determine a candidate signal line combination corresponding to the dissimilarity condition as a signal line sequence of one of the motors.
[0024] In a third aspect, a motor detection device for an electric lens is provided. The device includes:
[0025] n signal lines, configured to be communicatively connected to the signal line sequences of the respective motors of the electric lens, where n is equal to the number of signal lines in the signal line sequences required by the respective motors of the electric lens;
[0026] An image sensor, configured to be communicatively connected to the electric lens, acquire an image collected by the electric lens, and transmit the image to a processor;
[0027] A processor, configured to be communicatively connected to the image sensor and the n signal lines, and periodically detect the signal line sequences of the respective motors of the electric lens. Wherein, the detection process in one period includes: according to the set of candidate signal lines in this period, traversing and controlling each candidate signal line combination to output an effective control signal to the electric lens, and acquiring at least two images collected by the electric lens until any two of the images satisfy the dissimilarity condition. Wherein, the candidate signal line combination includes the designed number of candidate signal lines in the set, and the designed number is the number of signal lines required by one motor; determining the candidate signal line combination corresponding to the dissimilarity condition as a signal line sequence of one of the motors.
[0028] In a fourth aspect, a motor detection system for an electric lens is provided, including: an electric lens and a motor detection device for an electric lens as shown in the third aspect of the present application;
[0029] The electric lens includes a lens body, at least two motors, and signal line sequence interfaces of the respective motors;
[0030] The signal lines with the designed number of the motor detection device are communicatively connected to the signal line sequence interfaces of the respective motors of the electric lens;
[0031] The image sensor of the motor detection device is communicatively connected to the lens body;
[0032] The processor of the motor detection device is communicatively connected to the image sensor and the n signal lines.
[0033] In a fifth aspect, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium. When the program is executed by a processor, it implements the motor detection method for an electric lens as shown in the first aspect of the present application.
[0034] The beneficial effects brought by the technical solution provided in this application at least include:
[0035] During a cycle of detection, according to the set of candidate signal lines in this cycle, each candidate signal line combination is traversed to control the output of a control signal to the motorized lens, and at least two images collected by the motorized lens are obtained until any two images meet the dissimilarity condition. The candidate signal line combination corresponding to the dissimilarity condition is determined as the signal line sequence of a motor. Through this periodic detection method, the signal line sequences of the motors of the motorized lens can be determined.
[0036] Therefore, the above solution of the embodiment of this application can, in the case where the signal line sequence of the lens motor cannot be determined, determine the signal line sequences of the lenses of each motor through a periodic detection method, and realize the adaptability between the signal line sequences of the lens motors of different manufacturers and the signal line sequences of the hardware design.
[0037] Additional aspects and advantages of this application will be given in part in the following description, and these will become apparent from the following description, or can be learned through the practice of this application. Description of the Drawings
[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments of this application.
[0039] Figure 1 Schematic diagram of the motor wire sequence of the motorized lens in the related art;
[0040] Figure 2a Schematic diagram of the correspondence between the hardware design wire sequence and the motor wire sequence of the motorized lens in the related art;
[0041] Figure 2b Schematic diagram of the non-correspondence between the hardware design wire sequence and the motor wire sequence of the motorized lens in the related art;
[0042] Figure 3 Flow chart of a method for detecting the motors of a motorized lens provided by an embodiment of this application;
[0043] Figure 4 Schematic diagram of the hardware design wire sequence and the motor wire sequence of a motorized lens in a method for detecting the motors of a motorized lens provided by an embodiment of this application;
[0044] Figure 5 Flow chart of determining the signal line sequences of each motor in a method for detecting the motors of a motorized lens provided by an embodiment of this application;
[0045] Figure 6 Flow chart of determining the functions of each motor in a method for detecting the motors of a motorized lens provided by an embodiment of this application;
[0046] Figure 7 Schematic structural diagram of a motor detection device for an electric lens provided by an embodiment of the present application;
[0047] Figure 8 Schematic structural diagram of a motor detection system for an electric lens provided by an embodiment of the present application.
[0048] Description of reference numerals:
[0049] 10 - Electric lens;
[0050] 11 - Lens body, 12 - At least two motors, 13 - Signal line sequence interface 13 of each motor, Indicating one motor;
[0051] 20 - Motor detection device;
[0052] 21 - n signal lines, 22 - Image sensor, 23 - Processor. Detailed implementation manners
[0053] The embodiments of the present application will be described in detail below. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and should not be construed as a limitation to the present invention.
[0054] Those skilled in the art of the present technology can understand that unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "including" used in the specification of the present application means the presence of the described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more related listed items.
[0055] Those skilled in the art can understand that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as the general understanding of those of ordinary skill in the art to which the present invention belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless specifically defined as herein.
[0056] Currently, the motor signal line sequences of common electric lenses are as shown in the two attached Figure 1 ones, including lens motor line sequence 1 and lens motor line sequence 2. There are differences in the line sequences of ZOOMB+ / - and FOCUSA+ / - in these two lens motor signal line sequences. When designing the hardware circuit, it is necessary to confirm that the line sequence of the hardware design is exactly the same as that of the lens motor, otherwise the lens cannot be driven to achieve the functions of zooming and focusing. After the hardware circuit design is completed, since the signal line sequence cannot be changed, only the lens motor corresponding to this signal line sequence can be driven, and the lens motors with other signal line sequences cannot be compatible.
[0057] In view of this, the inventors of the present application propose a solution that, when the signal line sequence of the lens motor cannot be determined, determines the signal line sequences of each motor of the lens through a periodic detection method, and further determines the functions of each motor, so as to achieve the adaptability between the signal line sequences of lens motors from different manufacturers and the signal line sequences of the hardware design.
[0058] Specifically, by periodically detecting the signal line sequences of each motor of the electric lens, and on the basis of determining the signal line sequences of each motor, respectively controlling each motor to move back and forth in the near-focus direction and the far-focus direction to obtain the movement steps of each motor, and then determining the functions corresponding to each motor according to the movement steps of each motor.
[0059] To make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments in conjunction with the drawings. These specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the drawings.
[0060] As shown in Figure 2 is the hardware topology structure diagram involved in the present application, and the design single board can be docked with lenses of different line sequences. Figure 2a For the case where the line sequence of the hardware design corresponds one-to-one with the motor line sequence of the electric lens, the motor can be normally controlled to work at this time; Figure 2b For the case where the line sequence of the hardware design does not correspond one-to-one with the motor line sequence of the electric lens, the situation where the lens motor cannot be controlled to work will occur at this time.
[0061] In view of the above situation, the inventors of the present application detected the lens motors from the following two aspects. First, the signal line sequences corresponding to each motor were determined. Second, by separately controlling the signal lines of each motor, each motor was made to run through the entire stroke, and the functions of each motor were determined based on the number of steps required for each motor to run through the entire stroke. Thus, in the case where the signal line sequence of the lens motor cannot be determined, the signal line sequences of each lens motor can be determined by a periodic detection method, and the functions of each motor can be further determined, thereby realizing the adaptability between the signal line sequences of lens motors from different manufacturers and the signal line sequences of the hardware design.
[0062] In an embodiment of the present application, a method for detecting a motor of an electric lens is provided, as Figure 3 shown, the method includes:
[0063] Periodically detecting the signal line sequences of each motor of the electric lens, wherein the detection process of one cycle includes:
[0064] S101. According to the set of candidate signal lines in this cycle, traverse and control each candidate signal line combination to output a control signal to the electric lens, and obtain at least two images collected by the electric lens until any two images meet the dissimilarity condition.
[0065] Among them, the candidate signal line combination includes the designed number of candidate signal lines in the set; the designed number is the number of signal lines required for one motor.
[0066] S102. Determine the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of one motor.
[0067] It should be understood that in this embodiment, the detection of each cycle corresponds to the detection of the signal line sequence of one motor of the electric lens. By periodic detection, the signal line sequences of each motor of the electric lens can be determined.
[0068] Specifically, in this embodiment, in S101, traversing and controlling each candidate signal line combination to output a control signal to the electric lens and obtaining at least two images collected by the electric lens may include:
[0069] During the process of traversing and controlling each candidate signal line combination to output a control signal, obtain at least two images collected by the electric lens.
[0070] That is to say, in this embodiment, the control signal output by traversing and controlling each candidate signal line combination can be the first level. For example: in this embodiment, the first level can be a high level, that is: when the control signal of the motor is a high level, the motor can be controlled to work.
[0071] It should be understood that based on the design of the motor drive circuit, the first level can also be a low level. That is to say, in some cases, when the control signal of the motor is at a low level, the motor can be controlled to operate.
[0072] Specifically, in this embodiment, assuming that the set of candidate signal lines in this cycle includes m candidate signal line combinations, the specific implementation process of S101 can be as follows:
[0073] Control the first candidate signal line combination to output a control signal to the electric lens, and obtain at least two first images collected by the electric lens;
[0074] If it is determined that any two first images meet the dissimilarity condition, then determine the first candidate signal line combination as the signal line sequence of a motor;
[0075] If at least two first images do not meet the dissimilarity condition, then sequentially control other candidate signal line combinations in the set to output control signals to the electric lens, and obtain at least two images collected by the electric lens until any two images among the at least two images corresponding to the i-th candidate signal line combination meet the dissimilarity condition, where i takes a number from 2 to m.
[0076] That is to say, within one detection cycle, by traversing each candidate signal line combination to output a control signal to the electric lens and obtaining at least two images collected by the electric lens until any two images meet the dissimilarity condition, the candidate signal line combination corresponding to the signal line sequence of a motor can be determined. Thus, in the case where the signal line sequence of the lens motor cannot be determined, the signal line sequences of each motor of the lens can be determined through a periodic detection method, realizing the adaptability between the signal line sequences of lens motors from different manufacturers and the signal line sequences of the hardware design.
[0077] A possible implementation manner is provided in the embodiment of the present application. After S102, it further includes:
[0078] S103. Remove the candidate signal line combination corresponding to a motor from the set of candidate signal lines in this cycle to obtain the set of candidate signal lines in the next cycle, and perform the detection in the next cycle until the set of candidate signal lines is empty.
[0079] Specifically, in this embodiment, when the detection of one cycle ends and the signal line sequence corresponding to a motor is determined, then enter the detection of the next cycle to determine the signal line sequences corresponding to other motors. Before entering the detection of the next cycle, it is necessary to update the set of candidate signal lines to obtain the set of candidate signal lines in the next cycle. The specific implementation manner of updating the set of candidate signal lines is to remove the signal line sequence corresponding to the motor determined in the above one cycle from the set of candidate signal lines in the above one cycle.
[0080] For example, if the candidate signal lines included in the set of candidate signal lines for one cycle are 1, 2, 3, 4, 5, and 6, the candidate signal line combinations may include 1 and 2, 1 and 3, 1 and 4, 1 and 5, and 1 and 6. Assume that when the detection for the above one cycle ends, the signal line sequence corresponding to a motor is determined to be 1 and 3. Then, the candidate signal lines included in the set of candidate signal lines for the next cycle are 2, 4, 5, and 6, and the candidate signal line combinations may include 2 and 4, 2 and 5, and 2 and 6.
[0081] That is to say, during the detection process for the next cycle, traverse and control each candidate signal line combination among 2 and 4, 2 and 5, and 2 and 6 to output a control signal to the motorized lens, and acquire at least two images collected by the motorized lens until any two images meet the dissimilarity condition. Determine the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of a motor. For example, determine the signal line sequence corresponding to a motor to be 2 and 4.
[0082] It should be noted that in this embodiment, the number of periodic detections depends on the number of motors. For example, if the lens includes 2 motors, perform the detection process for 2 cycles, or perform one cycle of detection. After determining the signal line sequence of the first motor, determine the signal line sequence of the second motor as the signal line sequence corresponding to the remaining candidate signal lines after excluding the candidate signal lines corresponding to the signal line sequence of the first motor from the set of candidate signal lines.
[0083] In a possible implementation provided in the embodiment of the present application, after the signal line sequences corresponding to the motors of the motorized lens are determined, the method further includes:
[0084] S104. Traverse and control the signal lines corresponding to each motor to output a control signal, and control each motor to move back and forth in two opposite directions until the number of movement steps of each motor when moving from one extreme position to the other extreme position is determined based on multiple images collected by the motorized lens;
[0085] S105. Determine the functions of each motor according to the movement steps of each motor of the motorized lens.
[0086] Specifically, in this embodiment, S104 may specifically include:
[0087] Control a motor to move in the first direction. When it is detected that two adjacent images obtained in the first direction meet the similarity condition, control the motor to move in the second direction opposite to the first direction;
[0088] When it is detected that two adjacent images obtained in the second direction meet the similarity condition, record the movement steps of the motor.
[0089] That is to say, for any motor included in the motorized lens, a control signal can be output through the signal line corresponding to the motor to control the motor to move in the first direction. When it is detected that the image obtained in the first direction does not change, it indicates that the motor has moved to one end limit position. At this time, the motor is controlled to move in the second direction opposite to the first direction. When it is detected that the image obtained in the second direction does not change, it indicates that the motor has moved to the other end limit position. At this point, the motor has completed the full stroke. At this time, the movement steps of the motor are recorded.
[0090] Among them, the first direction and the second direction are respectively the near-focus direction or the far-focus direction of the motorized lens. It can be understood that if the first direction is the near-focus direction, then the second direction is the far-focus direction, and vice versa.
[0091] Specifically, in this embodiment, the specific implementation process of S105 is as follows:
[0092] Determine the functions of the motors according to the movement steps of the motors of the motorized lens and the standard movement steps of the motors of the motorized lens obtained.
[0093] That is to say, in this embodiment, after determining the actual movement steps of the motors of a motorized lens, the functions of the motors can be determined by querying the corresponding relationship between the standard movement steps and functions of the motors of the motorized lens.
[0094] Therefore, for the motor detection method of a motorized lens provided in the above embodiment, during a cycle detection process, according to the set of candidate signal lines in this cycle, each candidate signal line combination is traversed to control the output of a control signal to the motorized lens, and at least two images collected by the motorized lens are obtained until any two images meet the dissimilarity condition. The candidate signal line combination corresponding to the dissimilarity condition is determined as the signal line sequence of a motor.
[0095] After adopting the above periodic detection method to determine the signal line sequences of the motors of the motorized lens, then by traversing to control the output of the control signal of the signal line corresponding to each motor, each motor is controlled to move back and forth in two opposite directions until the movement steps of each motor are determined based on the multiple images collected by the motorized lens, and according to the movement steps of the motors of the motorized lens, the functions of the motors are determined. In the case where the signal line sequences of the lens motors cannot be determined, the signal line sequences of the lens motors can be determined by the periodic detection method, and further the functions of the motors can be determined, realizing the adaptability of the signal line sequences of the lens motors of different manufacturers to the hardware design signal line sequences.
[0096] In the above text, in combination with Figure 3A technical solution of a motor detection method for an electric lens provided by an embodiment of the present application has been described in detail. The following will be combined with the attached Figures 4 - 6 The technical solution of the embodiment of the present application will be further described.
[0097] As can be seen from the above content, a motor detection method for an electric lens provided by an embodiment of the present application includes two aspects of motor detection. One aspect is the detection of the motor signal line sequence, so that the motor inside the lens can be controlled; the other aspect is the detection of the motor function on the basis of determining the motor signal line sequence. Therefore, the following will be combined with Figures 4 - 6 The detection processes of these two solutions will be described in detail.
[0098] Such as Figure 4 , a zoom lens will have at least two stepper motors to be driven, and each motor requires 4 drive signals. First, it is necessary to distinguish the 4 signals of each motor for corresponding.
[0099] Since in the line sequence definition of the lens, generally the positive and negative poles of each path are arranged together, the actual line sequence can be defined as four paths of ZOOMA, ZOOMB, FOCUSA, and FOCUSB, as shown in Table 1 below.
[0100] Table 1
[0101]
[0102] Since a stepper motor needs to be controlled by four signals to make it work, in the case of unknown motor line sequence, the detection is carried out in the manner shown in Table 2 below.
[0103] Table 2
[0104] Motor signal line sequence Logic 1 Logic 2 Logic 3 Line sequence 1 1 1 1 Line sequence 2 1 0 0 Line sequence 3 0 1 0 Line sequence 4 0 0 1
[0105] Based on the connection method as Figure 4 shown, control the output of the control signal of the first motor to be high level, and sequentially control the output of the control signals of the other motors to be high level until it is detected that the image changes, indicating that the motor is controlled to work. In this way, the two signals corresponding to the first motor can be found. Repeat the above operation to find the corresponding two signals of the second motor. In this way, the control signals corresponding to the two motors can be found respectively.
[0106] Specifically, as Figure 5 shown, the process of determining the signal line sequence of the control signal corresponding to each motor includes:
[0107] S201. Control the control signal output by any one of the unmatched signal lines to be high level, and the control signals output by other signal lines to be low level.
[0108] Specifically, in this embodiment, assume that: initially, the unmatched signal lines include the signal lines with sequences 1, 2, 3, 4, 5, and 6. Select one of them. For example, select the signal line with sequence 1 (hereinafter referred to as line sequence 1). Then, the control signal output by line sequence 1 is at a high level, and the control signals output by the signal lines with sequences 2, 3, 4, 5, and 6 (hereinafter referred to as line sequences 2, 3, 4, 5, and 6) are at a low level.
[0109] S202. Control the control signal output by the next signal line among the unmatched signal lines to be at a high level.
[0110] Specifically, in this embodiment, the next signal line among the unmatched signal lines to be controlled can be line sequence 2, that is, control the control signal output by line sequence 2 to be at a high level.
[0111] S203. Determine whether adjacent images are different. If so, execute S204; if not, execute S202.
[0112] Specifically, in this embodiment, when the control signals output by line sequences 1 and 2 are at a high level, if the image captured by the lens changes, it indicates that the motor is driven. Then, line sequences 1 and 2 (which is a candidate signal line combination in the above text) are the line sequences corresponding to a motor.
[0113] If the image captured by the lens does not change, it indicates that the motor is not working. At this time, a line sequence can be continuously selected from the unmatched signal lines (line sequences 3, 4, 5, and 6) in turn, control the control signal output by it to be at a high level, and continue to determine whether the image captured by the lens changes. Assume that when the control signals output by line sequences 1 and 3 are at a high level, if the image captured by the lens changes, it indicates that the motor is driven. Then, line sequences 1 and 3 are the line sequences corresponding to a motor.
[0114] S204. Determine the signal line sequence corresponding to a motor.
[0115] Specifically, in this embodiment, assume that it is determined through S203 that line sequences 1 and 3 are the line sequences corresponding to a motor. Then, the unmatched signal lines are line sequences 2, 4, 5, and 6. Select line sequence 2 from them and control the control signal output by it to be at a high level.
[0116] Through the above steps, a cycle of the detection process can be completed, and the signal line sequence corresponding to a motor can be determined. Therefore, to obtain the signal line sequences corresponding to multiple motors of the lens, the method shown in S202 - S203 above can be repeatedly executed until the signal line sequences corresponding to each motor of the lens are obtained.
[0117] Specifically, in this embodiment, during the process of repeatedly executing S202 - S203, in S202, the next signal line among the unmatched signal lines can be the signal line with line sequence 4, that is, control the control signal output by line sequence 2 to be at a high level.
[0118] Then the determination process in S203 can be: when the control signals output by line sequences 2 and 4 are at a high level, if the image captured by the lens changes, it indicates that the motor is driven, then line sequences 2 and 4 are the line sequences corresponding to another motor.
[0119] If the image captured by the lens does not change, it indicates that the motor is not working. At this time, a signal line can be sequentially selected from the unmatched signal lines (line sequences 5, 6), control the control signal output by it to be at a high level, and continue to determine whether the image captured by the lens changes. Assume that when the control signals output by line sequences 2 and 5 are at a high level, if the image captured by the lens changes, it indicates that the motor is driven, then line sequences 2 and 5 are the line sequences corresponding to another motor.
[0120] It should be noted that in this embodiment, if there are 2 stepping motors included in the lens, then the S201 - S203 in the method shown in Figure 5 can be adopted. After determining the line sequence corresponding to one motor according to S203, the remaining line sequence is the line sequence corresponding to the other motor.
[0121] If there are multiple stepping motors included in the lens, for example, N motors, then after determining the line sequences corresponding to N - 1 motors respectively by using the method shown in 5, the remaining line sequence can be determined as the line sequence corresponding to the Nth motor.
[0122] In the above text, in combination with the content of the attached Figure 4 and 5 , the technical solution for determining the signal line sequences corresponding to each motor is described in detail. Next, in combination with the attached Figure 6 describe the functions corresponding to each motor.
[0123] In the case of unknown motor functions, first, control each signal line to run the motor to one end limit position, and then run the full stroke in sequence, and determine according to the number of steps required to run the full stroke.
[0124] Specifically, as shown in Figure 6 , the specific process of determining the functions of each motor includes:
[0125] S301. Control the control signal output by the signal line corresponding to one motor to control the movement of the motor in the first direction.
[0126] S302. Detect whether the image collected in the first direction has changed. If so, execute S301; if not, execute S303.
[0127] S303. Control the motor to move in the second direction opposite to the first direction.
[0128] S304. Detect whether the image collected in the first direction has changed. If so, execute S303; if not, execute S305.
[0129] S305. Record the number of steps the motor has moved.
[0130] Specifically, in this embodiment, during the process of controlling a motor to move in the first direction, multiple images collected by the electric lens are obtained, and then it is determined whether the images have changed by determining whether any two images meet the identity condition. If any two images meet the identity condition (that is, the ratio of the two images being the same is greater than the preset ratio), then the images obtained in the first direction no longer change, indicating that the motor has reached the limit position in the first direction. At this time, control the motor to move in the second direction opposite to the first direction.
[0131] During the process of controlling the motor to move in the second direction, multiple images collected by the electric lens are obtained, and then it is determined whether the images have changed by determining whether any two images meet the identity condition. If any two images meet the identity condition, then the images obtained in the second direction no longer change, indicating that the motor has reached the limit position in the second direction. At this time, the motor has completed the entire travel, and record the number of steps the motor has run.
[0132] Through the above steps, the number of steps the motor has moved can be determined. Therefore, to obtain the number of steps each of the multiple motors of the lens has moved, the method shown in S301 - S305 above can be repeatedly executed until the number of steps each motor of the lens is obtained, and then according to the number of steps each motor has moved, determine the function of each motor.
[0133] Specifically, in this embodiment, by executing S301 - S305, the number of steps the motor has moved can be obtained. If there are N motors in the electric lens, then S301 - S305 need to be repeatedly executed N times to obtain the number of steps each of the N motors has moved, where N is a positive integer greater than or equal to 2.
[0134] After obtaining the number of steps each of the N motors has moved, the function of each of the N motors can be obtained by querying the corresponding relationship between the standard number of steps the motor has moved and its function.
[0135] For example: In this embodiment, the electric lens may be a zoom lens, and the motors inside it include a zoom ZOOM motor and a focus FOCUS motor. Then, S301 - S305 can be repeatedly executed 2 times to obtain the movement steps of the two motors respectively.
[0136] Since the number of steps of the FOCUS motor is greater than that of the ZOOM motor, the function of the motor with more steps can be determined as the focus FOCUS motor by comparing the movement steps of the two motors, and the motor with fewer steps is the ZOOM motor.
[0137] It should be noted that in the embodiments of the present application, the motors of the electric lens may be two or more. For example, the motors may include: a zoom motor, a focus motor, an aperture motor, etc. The present application does not make any limitations in this regard. In addition, the specific implementation process of determining whether two adjacent images meet the dissimilarity condition (the images are different) or the similarity condition (the images are the same) involved in the above embodiments can be implemented by using existing image discrimination methods. For the sake of brevity of description, it will not be elaborated here, and the embodiments of the present application also do not make any limitations in this regard.
[0138] In the above text, in combination with the attached Figures 3 - 6 , the technical solution of a method for detecting motors of an electric lens provided by the embodiments of the present application has been described in detail. Next, in combination with the attached Figure 7 and 8 , the technical solutions of a device and a system for detecting motors of an electric lens provided by the embodiments of the application are described in detail.
[0139] As Figure 7 shown, the embodiments of the present application provide a device for detecting motors of an electric lens. The device 40 for detecting motors of the electric lens is used to periodically detect the signal line sequences of each motor of the electric lens, and may include: a control module 401 and a determination module 402, where,
[0140] The control module 401 is configured to traverse and control each candidate signal line combination to output a control signal to the electric lens according to the set of candidate signal lines in this period, and acquire at least two images collected by the electric lens until any two images meet the dissimilarity condition, where the candidate signal line combination includes the designed number of candidate signal lines in the set; the designed number is the number of signal lines required for one motor;
[0141] The determination module 402 is configured to determine the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of one motor.
[0142] Specifically, in this embodiment, the control module 402 is specifically configured to acquire at least two images collected by the electric lens during the process of traversing and controlling each candidate signal line combination to output a control signal.
[0143] Among them, the control signal for traversing and controlling the output of each candidate signal line combination is at the first level.
[0144] In some embodiments, the control module 401 is further configured to exclude the candidate signal line combination corresponding to one motor from the set of candidate signal lines in the current cycle to obtain the set of candidate signal lines in the next cycle, and perform the detection in the next cycle until the set of candidate signal lines is empty.
[0145] In some embodiments, the control module 401 is further configured to control the signal lines corresponding to each motor to output control signals by traversing, control each motor to move back and forth in two opposite directions, and determine the number of movement steps when each motor moves from one extreme position to the other extreme position;
[0146] The determination module 402 is further configured to determine the functions of each motor according to the number of movement steps of each motor of the electric lens.
[0147] Specifically, in this embodiment, the control module 401 is specifically configured to control a motor to move in the first direction, and when it is detected that two adjacent images obtained in the first direction meet the same condition, control the motor to move in the second direction opposite to the first direction;
[0148] When it is detected that two adjacent images obtained in the second direction meet the same condition, record the number of movement steps of the motor.
[0149] For the content not described in detail in the motor detection device of the electric lens provided in the embodiments of the present application, reference may be made to the motor detection method of the electric lens provided in the above embodiments. The beneficial effects that the motor detection device of the electric lens provided in the embodiments of the present application can achieve are the same as those of the motor detection method of the electric lens provided in the above embodiments, and will not be elaborated here.
[0150] Based on the same inventive concept, the embodiments of the present application also provide a motor detection device for an electric lens. The motor detection device for an electric lens may include:
[0151] n signal lines, configured to communicate with the signal line sequence interfaces of the motors of the electric lens, where n is equal to the number of signal lines in the signal line sequences required by the motors of the electric lens;
[0152] An image sensor, configured to communicate with the electric lens, acquire the images collected by the electric lens, and transmit the images to the processor;
[0153] A processor is used to communicate with an image sensor and n signal lines, and periodically detect the signal line sequences of each motor of an electric lens. The detection process of one cycle includes: according to the set of candidate signal lines in this cycle, traversing and controlling each candidate signal line combination to output an effective control signal to the electric lens, and acquiring at least two images collected by the electric lens until any two images meet the dissimilarity condition. Among them, the candidate signal line combination includes the designed number of candidate signal lines in the set, and the designed number is the number of signal lines required for one motor; determining the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of one motor.
[0154] For the content not detailed in the motor detection device of the electric lens provided in the embodiments of the present application, reference may be made to the motor detection method of the electric lens provided in the above embodiments. The beneficial effects that the motor detection device of the electric lens provided in the embodiments of the present application can achieve are the same as those of the motor detection method of the electric lens provided in the above embodiments, and will not be elaborated here.
[0155] Based on the same inventive concept, the embodiments of the present application also provide a motor detection system for an electric lens, as Figure 8 shown. The motor detection system for the electric lens may include: an electric lens 10 and the motor detection device 20 of the electric lens in the above embodiments; wherein,
[0156] The electric lens 10 includes a lens body 11, at least two motors 12, and a signal line sequence interface 13 for each motor;
[0157] The motor detection device 20 includes n signal lines 21, an image sensor 22, and a processor 23;
[0158] The designed number of signal lines 21 of the motor detection device 20 is communicatively connected to the signal line sequence interfaces 13 of each motor of the electric lens;
[0159] The image sensor 22 of the motor detection device 20 is communicatively connected to the lens body 11;
[0160] The processor 23 of the motor detection device 20 is communicatively connected to the image sensor 22 and n signal lines 21.
[0161] Specifically, in this embodiment, the processor 23 is configured to periodically detect the signal line sequences of the motors of the electric lens. Wherein, the detection process of one period includes: according to the set of candidate signal lines in this period, traversing and controlling each candidate signal line combination to output an effective control signal to the electric lens, and acquiring at least two images collected by the electric lens until any two of the images meet the dissimilarity condition. Wherein, the candidate signal line combination includes the designed number of candidate signal lines in the set, and the designed number is the number of signal lines required for one motor; determining the candidate signal line combination corresponding to meeting the dissimilarity condition as the signal line sequence of one of the motors.
[0162] For the content not described in detail in the motor detection system of the electric lens provided in the embodiments of the present application, reference may be made to the motor detection method of the electric lens provided in the above embodiments. The beneficial effects that the motor detection system of the electric lens provided in the embodiments of the present application can achieve are the same as those of the motor detection method of the electric lens provided in the above embodiments, and will not be elaborated here.
[0163] In the above embodiment, the processor may be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in combination with the disclosure of the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0164] The embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When it runs on a computer, it enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the prior art, it is possible to determine the signal line sequences of the motors of the lens through a periodic detection method when the signal line sequences of the lens motors cannot be determined, and to achieve the adaptation of the signal line sequences of the lens motors of different manufacturers to the hardware design signal line sequences.
[0165] It should be understood that although the steps in the flowchart of the accompanying drawings are shown sequentially according to the indication of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this document, there is no strict order restriction for the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0166] The above are only some embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for detecting an electric motor of an electric lens, characterized in that Including: Periodically detecting the signal line sequences of the motors of the electric lens, and the detection process of one period includes: According to the set of candidate signal lines in this period, traversing and controlling each candidate signal line combination to output a control signal to the electric lens, and acquiring at least two images collected by the electric lens until any two of the images meet the dissimilarity condition; the candidate signal line combination includes the designed number of candidate signal lines in the set, and the designed number is the number of signal lines required for one motor; Determining the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of one of the motors; By traversing and controlling the signal lines corresponding to each motor to output control signals, controlling each motor to move back and forth in two opposite directions, and determining the number of movement steps when each motor moves from one extreme position to the other extreme position; Determining the functions of the motors according to the movement steps of the motors of the electric lens.
2. The method according to claim 1, characterized in that The traversing and controlling each candidate signal line combination to output a control signal to the electric lens and acquiring at least two images collected by the electric lens includes: During the process of traversing and controlling each candidate signal line combination to output a control signal, acquiring at least two images collected by the electric lens.
3. The method according to claim 2, characterized in that, The process of traversing and controlling each candidate signal line combination to output a control signal includes: Traversing and controlling the control signal output by each candidate signal line combination to be the first level.
4. The method according to claim 1, wherein After determining the candidate signal line combination corresponding to the dissimilarity condition as the signal line sequence of one of the motors, it further includes: Excluding the candidate signal line combination corresponding to one of the motors from the set of candidate signal lines in this period to obtain the set of candidate signal lines in the next period, and performing the detection of the next period until the set of candidate signal lines is empty.
5. The method according to claim 1, wherein The controlling each motor to move back and forth in two opposite directions and determining the number of movement steps when each motor moves from one extreme position to the other extreme position includes: Controlling a motor to move in the first direction, and when it is detected that two adjacent images obtained in the first direction meet the similarity condition, controlling the motor to move in the second direction opposite to the first direction; When it is detected that two adjacent images obtained in the second direction meet the similarity condition, recording the movement steps of the motor.
6. An electric lens motor detection device, characterized in that, The device is used for periodically detecting the signal line sequences of the motors of the electric lens, and the device includes: A control module, configured to traverse and control each candidate signal line combination to output a control signal to the electric lens according to the set of candidate signal lines in this period, and acquire at least two images collected by the electric lens until any two of the images meet the dissimilarity condition, where the candidate signal line combination includes the designed number of candidate signal lines in the set; the designed number is the number of signal lines required for one motor; and, by traversing and controlling the signal lines corresponding to each motor to output control signals, controlling each motor to move back and forth in two opposite directions, and determining the number of movement steps when each motor moves from one extreme position to the other extreme position; A determination module, configured to determine a candidate signal line combination corresponding to the dissimilarity condition as a signal line sequence of one of the motors, and determine the functions of the motors according to the movement steps of each motor of the electric lens.
7. An electric lens motor detection device, characterized in that, Comprising: n signal lines, configured to be communicatively connected to the signal line sequences of the motors of the electric lens through interfaces, where n is equal to the number of signal lines in the signal line sequences required by the motors of the electric lens; An image sensor, configured to be communicatively connected to the electric lens, acquire an image captured by the electric lens, and transmit the image to a processor; A processor, configured to be communicatively connected to the image sensor and the n signal lines, and periodically detect the signal line sequences of the motors of the electric lens. The detection process in one period includes: according to the set of candidate signal lines in this period, traversing and controlling each candidate signal line combination to output an effective control signal to the electric lens, and acquiring at least two images captured by the electric lens until any two of the images satisfy the dissimilarity condition. The candidate signal line combination includes the designed number of candidate signal lines in the set, and the designed number is the number of signal lines required by one motor; determining the candidate signal line combination corresponding to the dissimilarity condition as a signal line sequence of one of the motors, and by traversing and controlling the signal lines corresponding to each motor to output control signals, controlling each motor to move back and forth in two opposite directions, and determining the movement steps of each motor when moving from one extreme position to the other extreme position; determining the functions of the motors according to the movement steps of each motor of the electric lens.
8. An electric lens motor detection system, characterized in that Comprising: An electric lens and a motor detection device for the electric lens as claimed in claim 7; The electric lens includes a lens body, at least two motors, and signal line sequence interfaces of each motor; The designed number of the signal lines of the motor detection device are communicatively connected to the signal line sequence interfaces of the motors of the electric lens; The image sensor of the motor detection device is communicatively connected to the lens body; The processor of the motor detection device is communicatively connected to the image sensor and the n signal lines.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is used to cause the processor to execute the motor detection method for the electric lens according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method for providing 3D image data and system for taking x-ray images
US20080031403A1
Scanning apparatus for reading an image
US5133025A