Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
The embodiment of the invention provides a distance measuring method in a terminal, which is provided with a shooting unit and a voice coil motor, wherein the terminal can be any mobile equipment such as a mobile phone, a PAD (PAD application data) and a tablet personal computer, the shooting unit can be a shooting device with a mirror surface, and the mirror surface of the shooting unit can be fixed on the voice coil motor. As shown in fig. 1, the method comprises the following steps:
s11, a current value for controlling the voice coil motor is obtained.
The vcm at least includes a magnet, a coil, a spring, and the like, and changes a position of the vcm by converting an incoming electrical energy into a mechanical energy, and it is understood that the position of the vcm is generally determined after the spring is deformed in the vcm.
The current value of the voice coil motor is controlled by a driver circuit, which may optionally be part of the processor. When the shooting unit collects images, the processor can control the current value of the voice coil motor according to a focusing algorithm, so that the deformation quantity of a spring in the voice coil motor is changed. Specifically, the processor controls a current source, the current source outputs different current values to the voice coil motor according to different instructions of the processor, so that the voice coil motor obtains different electric energy, the voice coil motor converts the different electric energy into corresponding mechanical energy, it can be understood that the different mechanical energy corresponds to different spring deformation, the voice coil motor can traverse all shooting positions along with the change of the current values, and the position with the highest image definition (namely, sharpness) is determined from the different spring deformation. When a photographing position with the highest sharpness is determined, the processor acquires a current value for controlling the voice coil motor corresponding thereto at that time.
S12, based on the acquired current value, position information of the image capturing unit, which is the distance between the mirror surface of the image capturing unit and the image of the subject, is acquired.
As is clear from the definition of the positional information of the imaging means in step S12, the positional information of the imaging means corresponds to the optical image distance. Wherein the distance value may be 2mm, 4mm, etc. Alternatively, the mirror surface of the shooting unit may be the center of the convex lens, and the image of the object may be formed on a photosensitive sensor such as a CCD or a CMOS, which is not particularly limited in the present invention.
Optionally, the vcm includes an inner cavity, the mirror of the photographing unit is located in the inner cavity of the vcm, and along with the movement of the vcm (i.e. the deformation of the spring), the position of the mirror can move synchronously, that is: since the distance between the mirror surface and the image of the subject changes, the moving distance of the voice coil motor can be generally regarded as the position information of the imaging unit.
In addition, it is mentioned in S11 that the driving unit controlling the voice coil motor has a function of controlling the magnitude of the current at the voice coil motor. The magnitude of the current value is in monotone continuous relation with the moving distance of the voice coil motor. The monotonic continuity relationship can be calculated as follows:
I=aS+b;
wherein,
i represents a current value for controlling the voice coil motor;
s represents a moving distance of the voice coil motor, which represents an offset distance between a position where a coil of the voice coil motor is currently located and a position thereof when not energized.
a represents a proportionality coefficient, which is usually a fixed value, and the magnitude of the fixed value is determined by the number of turns, diameter, material, etc. of the voice coil motor;
b represents an offset parameter, which is a fixed value, which represents the position of the coil of the voice coil motor when not energized. For example, when the coil of the voice coil motor is set to a position when no current is applied, the value of b is set to 0.
In summary, the current value I at the voice coil motor is controlled to have a monotonous continuous relationship with the moving distance S of the voice coil motor, and the moving distance S of the voice coil motor can be generally regarded as the position information of the imaging unit, so the current value I at the voice coil motor is controlled to have a monotonous continuous relationship with the position information of the imaging unit, in other words, the position information of the imaging unit can be obtained according to the obtained current value. For example, as shown by a curve 1 in fig. 2, when the current value obtained at the position where the voice coil motor is controlled is 70mA to 100mA, the position information of the photographing unit may be obtained as 0.35 mm; when the current value obtained at the position of controlling the voice coil motor is 40mA, the position information of the shooting unit can be obtained to be about 0.15 mm.
Considering that the photographing unit and the voice coil motor have a certain weight, when the terminal is in different photographing postures, such as vertical, horizontal, inclined, etc., the monotonous continuous relationship between the magnitude of the current at the voice coil motor and the position information of the photographing unit is controlled. Therefore, the monotonous continuous relationship between the magnitude of the current value at the control voice coil motor and the positional information of the photographing unit may be different depending on the photographing posture of the terminal.
Therefore, in order to obtain more accurate measurement data, in an embodiment of the present invention, before acquiring the position information of the photographing unit, the method further includes: and determining the shooting posture of the terminal. In this case, after obtaining the current value for controlling the voice coil motor, the obtaining of the position information of the shooting unit may specifically be: and acquiring the position information of the shooting unit according to the acquired current value and the determined shooting attitude.
Specifically, when the photographing lens of the terminal is laid flat, the monotonically continuous relationship between the magnitude of the current at the voice coil motor and the position information of the photographing unit at this time may be as shown by curve 1 in fig. 2; for another example, when the photographing lens of the terminal is facing upwards, the monotonic continuous relationship between the magnitude of the current at the voice coil motor and the position information of the photographing unit can be as shown in curve 2 in fig. 2; for another example, when the photographing lens of the terminal is facing downward, the monotonically continuous relationship between the magnitude of the current at the voice coil motor and the position information of the photographing unit at this time may be as shown by curve 3 in fig. 2.
It can be understood that the different monotonic continuous relations can be deduced through the weight and the inclination angle of the shooting lens, so that the obtained measurement data are more accurate.
In an embodiment of the present invention, determining the shooting posture of the terminal includes: the user selects the shooting attitude of the terminal by himself or determines the shooting attitude of the terminal through a sensor.
Specifically, the step of selecting the shooting posture of the terminal by the user may specifically include the following steps: firstly, a shooting posture instruction of a terminal by a user is received, and then according to the instruction, shooting posture options of the terminal are displayed, wherein the shooting posture options comprise shooting angle options of the terminal, such as 0 degree, 90 degrees, 180 degrees and the like. Wherein, the shooting angle of the terminal can be defined as follows: the shooting angle of the terminal is a clockwise included angle between the plane of the shooting lens of the terminal and the horizontal plane, and the numerical range can be specified to be more than or equal to 0 degree and less than 360 degrees. For example, when the shooting angle of the terminal is greater than or equal to 0 degree and less than 45 degrees, or greater than or equal to 315 degrees and less than 360 degrees, the shooting posture of the terminal may be considered as: the camera lens of the terminal faces downwards; when the shooting angle of the terminal is greater than or equal to 45 degrees and less than 135 degrees, or greater than or equal to 225 degrees and less than 315 degrees, the shooting attitude of the terminal may be considered as: a camera lens of the terminal is horizontally placed; when the shooting angle of the terminal is 135 degrees or more and less than 225 degrees, the shooting attitude of the terminal may be considered as: the camera lens of the terminal is upward. Then, receiving the user's option for the shooting angle, for example, "30 degrees" selected by the user, the shooting attitude of the terminal can be determined as follows: the camera lens of the terminal faces downwards.
In addition, the shooting attitude of the terminal can be determined by a sensor, such as a gravity sensor.
Further, in one embodiment of the present invention, the method further comprises the steps of: firstly, determining the corresponding relation between the position information of a shooting unit and the shooting attitude of a terminal and a current value; then storing the corresponding relation between the determined position information of the shooting unit, the shooting attitude of the terminal and the current value;
in this case, acquiring the position information of the shooting unit according to the acquired current value and the determined shooting posture specifically includes: and acquiring the position information of the shooting unit according to the acquired current value and the determined shooting attitude, and the stored corresponding relation between the position information of the shooting unit and the shooting attitude of the terminal and the current value.
In this way, after storing the corresponding relationship between the position information of the shooting unit, the shooting attitude of the terminal, and the current value for controlling the voice coil motor, for example, when the shooting unit of the terminal is horizontally placed as acquired by the gravity sensor, after acquiring the magnitude of the current value, the position information of the shooting unit can be determined together with the current value according to the shooting attitude of the shooting unit.
And S13, acquiring distance information corresponding to the position information according to the acquired position information of the shooting unit and the corresponding relation between the position information and the distance information, wherein the distance information is the distance between the shot object and the mirror surface of the shooting unit.
As is clear from the definition of the distance information in step S13, the distance information corresponds to the optical object distance. Wherein the distance value can be 100mm, 300mm, 500mm, etc. In a specific application, for example, when the shooting unit is a lens, the distance information between the object and the shooting unit is the distance information between the object and the lens.
Optionally, in a specific embodiment of the present invention, the correspondence between the position information and the distance information may specifically be: in the case where the focal length of the terminal is known, distance information is calculated from the position information of the photographing unit according to a gaussian imaging formula.
Specifically, as described above, the position information of the shooting unit corresponds to the image distance in the optics, the distance information between the shooting unit and the object corresponds to the object distance in the optics, and since the focal length in the terminal usually exists in a numerical range, the focal length can be preset to any number of values in a certain numerical range, for example, the focal length is preset to 2mm or more and 4mm or less, the focal length is preset to 2mm, 2.1mm, 2.2mm … … 3.9.9 mm, 4mm, etc., and the invention is not particularly limited with respect to the numerical range of the set focal length and the number of values in the range. It will be appreciated that when the value of the focal length is known, then it can be calculated according to the gaussian imaging formula: 1/focal length = 1/object distance (i.e., distance information) + 1/image distance (i.e., position information), and the specific value of the object distance is calculated from the specific value of the image distance. For example, as shown in fig. 3, if the focal length of the terminal is set to 4mm, it can be determined that the shooting unit position information and the distance information between the subject and the shooting unit have the following correspondence: when the position information of the shooting unit is 4mm, the distance information between the shooting unit and the shot object is infinite; when the position information of the photographing unit is 4.05mm, the distance information between the photographing unit and the subject is 324 mm.
After the correspondence between the above-described imaging unit position information and the distance information between the subject and the imaging unit is determined, the correspondence may be stored in a table form in the terminal.
The distance measuring method in the terminal comprises the steps of firstly obtaining a current value for controlling a voice coil motor, and obtaining position information of a shooting unit according to the obtained current value, wherein the position information of the shooting unit refers to the distance between a mirror surface of the shooting unit and an image of a shot object; and then, according to the acquired position information of the shooting unit and the corresponding relation between the position information and the distance information, acquiring distance information corresponding to the position information, wherein the distance information refers to the distance between the shot object and the mirror surface of the shooting unit. From the above, it can be seen that the way of using the current measurement method to realize the distance measurement function is not only different from the prior art, but also can accurately obtain the measurement data.
Optionally, in an embodiment of the present invention, the method further includes the following steps: the correspondence relationship between the position information of the photographing unit and the current value controlling the voice coil motor may be determined first, and the determined correspondence relationship between the position information of the photographing unit and the current value controlling the voice coil motor may be stored.
Specifically, the one-to-one correspondence between the position information of the shooting unit and the current value for controlling the voice coil motor can be obtained as the above monotonic continuous relationship, then the determined correspondence is stored in the terminal in a table form, and when the current value for controlling the voice coil motor is obtained, the position information of the shooting unit can be called out from the pre-stored correspondence quickly and accurately, thereby further improving the data processing capability of the terminal.
Optionally, in an embodiment of the present invention, after step S13, the method further includes the following steps: and displaying the acquired distance information on a display screen.
Specifically, as shown in fig. 4, when the terminal is in a focused state, the acquired distance information is displayed on a display screen of the terminal. The display position of the distance information may be located in the upper right corner of the display screen and displayed in data form, for example, "35 cm". The display position of the distance information may also be located at the lower right corner of the display screen, and the distance information is displayed in a combination manner of a rectangular chart and data, and the display position or the display manner of the distance information is not particularly limited in the present invention.
From the above, it can be seen that the user can directly display the distance information on the display screen of the terminal during the shooting process. By the method, the user can be guided to focus better and shoot better images or pictures in the shooting process, so that the shooting pleasure and experience of the user are improved. In addition, this approach can provide a user with a method for measuring the distance of objects.
Example two
It can be understood that, on the basis of the technical solution of the first embodiment of the present invention, another embodiment, that is, the second embodiment, can be obtained by modification. The following describes in detail a ranging method in a terminal according to a second embodiment of the present invention with reference to specific embodiments.
The second embodiment of the invention provides a distance measuring method in a terminal, wherein the terminal is provided with a voice coil motor and a shooting unit, the terminal can be any mobile equipment such as a mobile phone, a PAD (PAD application program), a tablet personal computer and the like, and the shooting unit can be a shooting device such as a lens (capable of shooting or shooting) and the like. As shown in fig. 5, the method comprises the steps of:
s51, a current value for controlling the voice coil motor is obtained.
This step may refer to S11, and will not be described in detail.
S52, based on the obtained current value and the correspondence between the current value and the distance information, the distance information corresponding to the current value is obtained, the distance information being the distance between the subject and the mirror surface of the imaging unit.
In this step, the current value corresponds to the distance information. Specifically, taking the case where the photographing unit is a lens. The magnitude of the current value at the position of the voice coil motor and the position information of the shooting unit are in the monotone continuous relation, namely the current value and the position information are in one-to-one correspondence. Further, the position information (equivalent to an image distance) and the distance information (equivalent to an object distance) of the lens may be based on the gaussian imaging formula: 1/focal length = 1/object distance + 1/image distance, and in the case that the focal length in the terminal is known, the specific value of the object distance can be calculated through the specific value of the image distance, that is, the position information and the distance information are in one-to-one correspondence. Therefore, it can be known from the above that there is a correspondence between the current value and the distance information, and the specific value of the distance information can be calculated from the current value.
The distance measuring method in the terminal provided by the second embodiment of the invention comprises the following steps of firstly, obtaining a current value for controlling the voice coil motor; and then, according to the obtained current value and the corresponding relation between the current value and the distance information, obtaining the distance information corresponding to the current value, wherein the distance information refers to the distance between the shot object and the mirror surface of the shooting unit. It can be seen from the above that, the distance information is directly obtained through the current value and the stored corresponding relationship, not only can the measurement data be accurately obtained, but also the ranging step is simplified.
Since the shooting state of the terminal may affect the monotonic continuous relationship between the current value and the position information, in order to obtain more accurate measurement data, optionally, in a specific embodiment of the present invention, before obtaining the distance information corresponding to the current value according to the obtained current value and the corresponding relationship between the current value and the distance information, the distance measurement method further includes the following steps:
521, determining the shooting posture of the terminal;
522, according to the obtained current value and the corresponding relationship between the current value and the distance information, obtaining the distance information corresponding to the current value specifically includes: and obtaining the distance information according to the obtained current value, the determined shooting posture and the corresponding relation between the current value, the shooting posture and the distance information.
Further, in an embodiment of the present invention, determining the photographing posture of the terminal includes: the user selects the shooting attitude of the terminal by himself or determines the shooting attitude of the terminal through a sensor. It can be understood that the specific implementation process is similar to the specific implementation process for determining the shooting posture of the terminal in the foregoing embodiment one, and is not described herein again.
Optionally, in an embodiment of the present invention, before obtaining the current value for controlling the voice coil motor, the method further includes the following steps: then determining the corresponding relation between the current value and the distance information; next, storing a correspondence relationship between the current value and the distance information; in this case, after obtaining the current value for controlling the voice coil motor, the distance information corresponding to the current value is specifically: and acquiring distance information corresponding to the current value according to the acquired current value and the stored corresponding relation.
In this way, after determining the correspondence between the current value controlling the voice coil motor and the distance information between the photographing unit and the subject, the correspondence may be stored in a table form in the terminal so as to directly calculate the distance information from the acquired current value.
Optionally, in an embodiment of the present invention, after step S52, the method further includes the following steps: and displaying the acquired distance information on a display screen.
Specifically, still referring to fig. 4, the acquired distance information is displayed on a display screen of the terminal. The display position of the distance information may be located in the upper right corner of the display screen and displayed in data form, for example, "35 cm". The display position of the distance information may also be located at the lower right corner of the display screen, and the distance information is displayed in a combination manner of a rectangular chart and data, and the display position or the display manner of the distance information is not particularly limited in the present invention.
As can be seen from the above, the user can directly display the distance information on the display screen of the terminal during photographing, i.e., when the terminal is in focus. By the method, the user can be guided to focus better and shoot better images or pictures in the shooting process, so that the shooting pleasure and experience of the user are improved. In addition, this approach can provide a user with a method for measuring the distance of objects.
EXAMPLE III
Corresponding to the first embodiment, a third embodiment of the present invention further provides a distance measuring device 600 in a terminal, wherein the terminal is provided with a shooting unit and a voice coil motor, as shown in fig. 6, and the distance measuring device includes:
a current value acquisition unit 601 for acquiring a current value for controlling the voice coil motor;
a position information acquiring unit 602 configured to acquire position information of a shooting unit according to the current value acquired by the current value acquiring unit 601, where the position information of the shooting unit is a distance between a mirror surface of the shooting unit and an image of a subject;
a distance information acquiring unit 603 configured to acquire distance information corresponding to the position information, based on the position information of the shooting unit acquired by the position information acquiring unit 602 and a correspondence between the position information and the distance information, where the distance information is a distance between the subject and the mirror surface of the shooting unit.
The distance measuring device 600 in the terminal provided by the third embodiment of the present invention, wherein the terminal is provided with a shooting unit and a voice coil motor, and the current value obtaining unit 601 is configured to obtain a current value for controlling the voice coil motor; the position information acquiring unit 602 is configured to acquire position information of the shooting unit according to the current value acquired by the current value acquiring unit 601, where the position information of the shooting unit is a distance between a mirror surface of the shooting unit and an image of a subject; the distance information acquiring unit 603 is configured to acquire distance information corresponding to the position information, based on the position information of the shooting unit acquired by the position information acquiring unit 602 and the correspondence between the position information and the distance information. By the device, the measurement data can be accurately obtained.
Optionally, in an embodiment of the present invention, as shown in fig. 7, the apparatus 600 further includes: a shooting attitude determination unit 604 for determining a shooting attitude of the terminal;
in this case, the location information obtaining unit 602 is specifically configured to: position information of the imaging unit is acquired from the current value acquired by the current value acquisition unit 601 and the imaging attitude determined by the imaging attitude determination unit 604.
Further, in an embodiment of the present invention, as shown in fig. 8, the apparatus 600 further includes: a first determining unit 605 for determining a correspondence relationship between position information of the photographing unit and a photographing posture of the terminal, and a current value for controlling the voice coil motor; a storage unit 606 for storing the correspondence between the position information of the shooting unit determined by the first determination unit 605 and the shooting attitude and current value of the terminal;
in this case, the location information obtaining unit 602 is specifically configured to: the position information of the shooting unit is obtained according to the correspondence between the current value obtained by the current value obtaining unit 601 and the shooting attitude determined by the shooting attitude determining unit 604, and the position information of the shooting unit stored in the storage unit 606, and the shooting attitude and the current value of the terminal.
Optionally, in an embodiment of the present invention, as shown in fig. 9, the apparatus 600 further includes: a second determination unit 607 for determining the correspondence relationship between the position information of the photographing unit and the current value;
in this case, the storage unit 606 is further configured to store the correspondence between the position information of the shooting unit determined by the second determination unit 607 and the current value;
the location information obtaining unit 602 is specifically configured to: the position information of the imaging unit is acquired based on the current value acquired by the current value acquisition unit 601 and the correspondence between the position information and the current value stored in the storage unit 606.
Optionally, in an embodiment of the present invention, as shown in fig. 10, the apparatus 600 further includes: a display unit 608 for displaying the distance information acquired by the distance information acquisition unit 603 on a display screen. .
It should be noted that for the specific functions of each structural unit of the distance measuring device 600 in the terminal according to the third embodiment of the present invention, please refer to the first embodiment of the foregoing method.
Example four
Corresponding to the second embodiment, a fourth embodiment of the present invention further provides a distance measuring device 110 in a terminal, where the terminal is provided with a shooting unit and a voice coil motor, as shown in fig. 11, and the device 110 includes:
a current value obtaining unit 111 for obtaining a current value for controlling the voice coil motor;
and a distance information obtaining unit 112, configured to obtain distance information corresponding to the current value according to the current value of the voice coil motor obtained by the current value obtaining unit 111 and the corresponding relationship between the current value and the distance information.
The distance measuring device 110 in the terminal according to the fourth embodiment of the present invention is provided, wherein the terminal is provided with a shooting unit and a voice coil motor. A current value obtaining unit 111 for obtaining a current value for controlling the voice coil motor; and a distance information obtaining unit 112, configured to obtain distance information corresponding to the current value according to the current value of the voice coil motor obtained by the current value obtaining unit 111 and the corresponding relationship between the current value and the distance information. With the distance measuring device 110, the distance information is directly obtained through the current value and the stored corresponding relationship, not only can the measurement data be accurately obtained, but also the distance measuring step can be simplified.
Optionally, in an embodiment of the present invention, as shown in fig. 12, the apparatus 110 further includes: a photographing posture determining unit 113 for determining a photographing posture of the terminal;
in this case, the distance information acquiring unit 112 is specifically configured to: and obtaining the distance information according to the obtained current value, the determined shooting posture and the corresponding relation between the current value, the shooting posture and the distance information.
Optionally, in an embodiment of the present invention, as shown in fig. 13, the apparatus 110 further includes: a determination unit 114 for determining a correspondence relationship between the current value and the distance information; a storage unit 115 for storing a correspondence relationship between the current value and the distance information;
in this case, the distance information acquiring unit 112 is specifically configured to acquire distance information corresponding to the current value according to the current value acquired by the current value acquiring unit 111 and the correspondence relationship stored in the storage unit 115.
Optionally, in an embodiment of the present invention, as shown in fig. 14, the apparatus 110 further includes: a display unit 116 for displaying the distance information acquired by the distance information acquisition unit 112 on a display screen.
It should be noted that, for the specific functions of each structural unit of the distance measuring device 110 in the terminal according to the fourth embodiment of the present invention, please refer to the second embodiment of the foregoing method.
EXAMPLE five
Fig. 15 shows another embodiment of the distance measuring device in the terminal according to the fifth embodiment of the present invention, and as shown in fig. 15, the distance measuring device 140 in the terminal according to the fifth embodiment of the present invention includes a processor 141, a memory 142, a lens module 146, and the lens module 146 includes a voice coil motor 145, a current source 147, a light sensor 148, and a mirror 149.
The processor 141, the memory 142, the lens module 146, etc. are connected by a bus to complete communication therebetween, and the current source 147 is connected to the voice coil motor 145 by a control line to transmit current. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one line is shown in FIG. 15, but it is not intended that there be only one bus or one type of bus.
The memory 142 is used to store executable program code, including computer operating instructions. Memory 142 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. In the embodiment of the present invention, the memory 142 is specifically configured to store the corresponding relationship between the position information of the lens module 146 and the current value for controlling the voice coil motor 145.
The processor 141 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 142, for:
acquiring a current value for controlling the voice coil motor 145;
acquiring position information of the lens module 146 according to the acquired current value, wherein the position information of the lens module 146 refers to a distance between the mirror surface 149 of the lens module 146 and an image of a shot object;
based on the acquired position information of the lens module 146 and the correspondence between the position information and the distance information, distance information corresponding to the position information is acquired, the distance information being a distance between the subject and the mirror surface 149 of the lens module 146.
The processor 141 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
It should be noted that the vcm 145 includes a magnet, a coil, a spring (not shown in the drawings), and the vcm 145 changes the position of the vcm 145 by converting the incoming electrical energy into mechanical energy, and it is understood that the position of the vcm 145 generally refers to the position of the vcm 145 determined after the spring is deformed.
The current value of the voice coil motor 145 is controlled by a driver circuit, which may optionally be part of the processor 141. When the lens module 146 captures an image, the processor 141 may control a current value of the voice coil motor 145 according to a focusing algorithm, thereby changing a deformation amount of a spring in the voice coil motor 145. Specifically, the processor 141 controls the current source 147 to make the current source 147 output different current values to the voice coil motor 145 according to different instructions of the processor 141, so that the voice coil motor 145 obtains different electric energy, and the voice coil motor 145 converts the different electric energy into corresponding mechanical energy, it can be understood that the different mechanical energy corresponds to different spring deformation, and as the current value changes, the voice coil motor 145 can traverse all shooting positions and determine the position with the highest image definition (i.e. sharpness). When the photographing position with the highest sharpness is determined, the processor 141 acquires a current value for controlling the voice coil motor 145 corresponding thereto at this time.
The position information of the lens module 146 corresponds to an image distance in optics. Wherein the distance value may be 2mm, 4mm, etc. Alternatively, the mirror surface 149 of the lens module 146 may be the center of a convex lens, and an image of a subject may be formed on the photosensor 148 such as a CCD or a CMOS, that is, the position information of the lens module 146 may be understood to refer to the distance between the mirror surface 149 of the lens module 146 and the photosensor 148. Optionally, the vcm 145 includes an inner cavity, the mirror 149 of the lens module 146 is located in the inner cavity of the vcm 145, and as the vcm 145 moves (i.e. the deformation of the spring), the position of the mirror 149 may move synchronously, that is: the distance between the mirror 149 and the photosensor 148 changes, so the moving distance of the voice coil motor 145 can be generally regarded as the position information of the lens module 146. In summary, the position information of the lens module 146 can be obtained according to the current value obtained for controlling the voice coil motor 145.
It should be noted that, besides the above functions, the processor 141 may also be configured to execute other processes in the first method embodiment, which is not described herein again.
It should be further noted that, the division of each functional unit in the processor 141 can be referred to the third embodiment of the distance measuring device 600, and is not described herein again.
Optionally, the device according to the fifth embodiment is utilized, wherein the processor 141 may be configured to execute other processes in the second embodiment of the method, and the division of each functional unit in the processor 141 may refer to the fourth embodiment of the distance measuring device 110, which is not described herein again.
The terminal 160 may be a mobile phone, a tablet computer, a personal digital assistant, or other types of terminals including a camera device, which is not limited in the present invention.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points.
It should be noted that the above-described device embodiments are merely illustrative, and units illustrated as separate components may or may not be physically separate, and components illustrated as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention may be implemented by software plus necessary general hardware, and may also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components and the like. Generally, functions performed by computer programs can be easily implemented by corresponding hardware, and specific hardware structures for implementing the same functions may be various, such as analog circuits, digital circuits, or dedicated circuits. However, the implementation of a software program is a more preferable embodiment for the present invention. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a readable storage medium, such as a floppy disk, a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk of a computer, and includes instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.