CN110913134B - Focusing method and device, camera, storage medium and electronic equipment - Google Patents
Focusing method and device, camera, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN110913134B CN110913134B CN201911175037.7A CN201911175037A CN110913134B CN 110913134 B CN110913134 B CN 110913134B CN 201911175037 A CN201911175037 A CN 201911175037A CN 110913134 B CN110913134 B CN 110913134B
- Authority
- CN
- China
- Prior art keywords
- object distance
- current
- lens
- current object
- bit number
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000004590 computer program Methods 0.000 claims description 12
- 238000001514 detection method Methods 0.000 claims description 4
- 238000006243 chemical reaction Methods 0.000 claims 1
- 230000008569 process Effects 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000003384 imaging method Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
- H04N23/671—Focus control based on electronic image sensor signals in combination with active ranging signals, e.g. using light or sound signals emitted toward objects
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Lens Barrels (AREA)
- Studio Devices (AREA)
Abstract
The invention discloses a focusing method, a focusing device, a camera, electronic equipment and a storage medium. The method comprises the following steps: detecting the current object distance of the lens; determining the bit number corresponding to the current object distance; controlling a motor driving chip to output current to a VCM (Voice coil Motor) so as to drive the VCM to push the lens to focus; the bit number of the DAC code value corresponding to the output current of the motor driving chip is the bit number corresponding to the current object distance; and the bit number corresponding to the current object distance is reduced along with the increase of the current object distance.
Description
Technical Field
The present invention relates to the field of photographing technologies, and in particular, to a focusing method and apparatus, a camera, a storage medium, and an electronic device.
Background
In the related art, when a lens of Auto Focus (AF) performs macro photography, a scene of the lens is shallow and easily out of Focus, which causes a blur of a photographed picture.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a focusing method, a focusing apparatus, a camera, a storage medium, and an electronic device, so as to at least solve the problem in the related art that an AF lens is prone to being out of focus when performing macro photography.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a focusing method, which comprises the following steps:
detecting the current object distance of the lens;
determining the bit number corresponding to the current object distance;
controlling a motor driving chip to output current to a VCM (Voice coil Motor) so as to drive the VCM to push the lens to focus; wherein,
the bit number of the DAC code value corresponding to the output current of the motor driving chip is the bit number corresponding to the current object distance; and the bit number corresponding to the current object distance is reduced along with the increase of the current object distance.
In the foregoing scheme, the determining the number of bits corresponding to the current object distance includes:
determining a numerical interval in which the current object distance is located in at least two numerical intervals; the numerical interval of the current object distance is a first numerical interval; the at least two numerical value intervals are obtained by dividing the object distance range of the lens; the lens can realize focusing in the object distance range;
and determining the bit number corresponding to the first numerical value interval as the bit number corresponding to the current object distance.
In the foregoing aspect, the controlling the motor driver chip to output the current to the VCM includes:
and sending a driving instruction to the motor driving chip, wherein the driving instruction carries an identifier corresponding to the bit number corresponding to the current object distance, so that the motor driving chip outputs a current corresponding to the DAC value of the bit number corresponding to the current object distance to the VCM according to the identifier.
In the foregoing solution, the sending a driving instruction to the motor driving chip includes:
determining an identifier corresponding to the bit number corresponding to the current object distance; the identification is represented by a binary number;
generating a driving instruction carrying the identifier;
and sending the driving instruction to the motor driving chip.
In the foregoing solution, the sending a driving instruction to the motor driving chip includes:
and sending the driving instruction of the IIC protocol to the motor driving chip.
In the above scheme, the detecting a current object distance of the lens includes:
detecting the current DAC value of the motor driving chip;
and determining the current object distance of the lens according to the current DAC code value.
An embodiment of the present invention further provides a focusing apparatus, including:
the detection unit is used for detecting the current object distance of the lens;
a determining unit, configured to determine a number of bits corresponding to a current object distance corresponding to the current object distance;
the focusing unit is used for controlling a motor driving chip to output current to the VCM so as to drive the VCM to push the lens to focus; wherein,
the bit number of the DAC code value corresponding to the output current of the motor driving chip is the bit number corresponding to the current object distance; and the bit number corresponding to the current object distance is reduced along with the increase of the current object distance.
An embodiment of the present invention further provides a camera, including: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is configured to perform the steps of any of the above methods when running the computer program.
An embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the above methods.
The embodiment of the invention also provides electronic equipment comprising the camera.
In the embodiment of the invention, the bit number of the DAC value of the motor driving chip is determined according to the object distance of the lens, so that the DAC values with different bit numbers are correspondingly used for controlling the current output to the VCM by the motor driving chip on different object distances, and the bit number of the DAC value is reduced along with the increase of the object distance, thereby dynamically adjusting the focusing precision of the lens. Based on this, for the condition of macro shooting, a focusing mode with higher precision can be adopted, the out-of-focus condition caused by shallow depth of field is avoided, and the imaging quality is improved.
Drawings
Fig. 1 is a schematic flow chart illustrating an implementation of a focusing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating an implementation of a focusing method according to another embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating an implementation of a focusing method according to another embodiment of the present invention;
FIG. 4 is a schematic view of a focusing principle provided by an embodiment of the present invention;
FIG. 5 is a schematic flow chart illustrating an implementation of a focusing method according to another embodiment of the present invention;
fig. 6 is a schematic flow chart illustrating an implementation of sending a driving command by a focusing method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an internal circuit of a motor driving chip according to an embodiment of the present invention
FIG. 8 is a schematic structural diagram of a focusing device according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware composition structure of a camera according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The technical means described in the embodiments of the present invention may be arbitrarily combined without conflict.
In addition, in the present examples, "first", "second", and the like are used for distinguishing similar objects, and are not necessarily used for describing a particular order or sequence.
In the focusing process of the AF lens, a Motor driving chip in the lens outputs current to a Voice Coil Motor (VCM), and after the current is supplied to the VCM, a Coil in the VCM generates a magnetic field to generate a force for pushing the lens, so that the VCM is driven to move by controlling the magnitude and direction of the output current to further push the lens, thereby completing focusing. The magnitude of the output current is determined by a Digital-to-Analog converter (DAC) code value of the motor driving chip, and the moving step of the VCM during focusing of the lens is determined by a bit number of the DAC code value.
The closer the object distance of the lens, the shallower the depth of field of the lens, the more likely the out-of-focus, i.e., the out-of-focus, occurs. In the related art, no matter how long the object distance of the lens is, the motor driving chip outputs current by using DAC code values with the same bit number, so that the situation of defocusing inevitably occurs in the macro shooting process, and the shot picture is blurred. Here, scenes with an object distance of less than 3cm are generally referred to as macro shots.
In view of the above-mentioned disadvantage that the AF lens in the related art is prone to out-of-focus when performing macro photography, in various embodiments of the present invention, the number of bits of the DAC code value of the motor driver chip is determined according to the object distance of the lens, so that the DAC code values with different numbers of bits are correspondingly used for controlling the output current of the motor driver chip to the VCM at different object distances, and the number of bits of the DAC code value is reduced as the object distance increases, thereby dynamically adjusting the focusing accuracy of the lens. Based on this, for the condition of macro shooting, a focusing mode with higher precision can be adopted, the out-of-focus condition caused by shallow depth of field is avoided, and the imaging quality is improved.
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 shows an implementation flow of a focusing method provided in an embodiment of the present invention, where an execution subject of the method may be a camera, and the method includes:
s101: and detecting the current object distance of the lens.
Here, the lens is an AF lens, and further, may be a standard lens, a telephoto lens, a wide-angle lens, or the like of AF. When shooting is carried out by using the camera, the current object distance of the lens is detected, wherein the object distance refers to the distance from the surface of the first lens, which is closest to the object, of the lens to the object.
In one embodiment, as shown in fig. 2, the detecting the current object distance of the lens includes:
s1011: and detecting the current DAC value of the motor driving chip.
S1012: and determining the current object distance of the lens according to the current DAC code value.
Here, the DAC code value is a binary value with a set number of bits for controlling the magnitude of the output current of the motor driver chip. For example, the DAC code value corresponding to the motor driver chip has a bit number of 10 bits and a maximum output current of 100mA, and then the motor driver chip may output a current of 100mA to the VCM when the DAC code value is 1111111111 (corresponding to 1024 decimal), and may output a current of 50mA to the VCM when the DAC code value is 0111111111 (corresponding to 512 decimal). Since the output current is supplied to the VCM, a magnetic field is generated in the VCM, and a force for pushing the lens is generated, it can be said that the distance of lens movement is determined by the DAC code value corresponding to the output current, and the lens movement brings about a change in the object distance when the subject position is fixed. The larger the DAC code value is, the closer the object distance of the lens is, the smaller the DAC code value is, and the farther the object distance of the lens is.
And S102, determining the bit number corresponding to the current object distance.
Aiming at the condition that the depth of field is shallower when the object distance is smaller, so that the defocusing phenomenon is easy to generate during macro shooting, the step length of VCM movement is changed by adjusting the bit number of DAC code values, so that the focusing precision of the lens is changed. The number of bits of the DAC code value is determined by the object distance of the lens, and the number of bits corresponding to the current object distance decreases with the increase of the current object distance, that is, the larger the object distance of the lens, the smaller the number of bits of the DAC code value, the smaller the object distance of the lens, and the larger the number of bits of the DAC code value.
Here, the moving step of VCM is the ratio of the maximum output current of the motor driver chip to the DAC code value, for example, in the case of the maximum output current of 100mA, D of 10bitThe minimum moving step of the AC code value corresponding to the VCM can reach 100mA/210And the minimum movement step of the DAC code value of 12 bits corresponding to the VCM can reach 100mA/212Therefore, it can be understood that, under the condition that the maximum output current of the motor driver chip is not changed, the bit number of the DAC code value determines the moving step of the VCM, the larger the bit number of the DAC code value is, the smaller the moving step of the VCM is, and accordingly, the smaller the distance that the VCM pushes the lens to move every time the VCM moves by one moving step is, so that focusing with higher precision can be performed; on the contrary, the smaller the bit number of the DAC code value is, the larger the moving step of the VCM is, and accordingly, the larger the distance of the lens moved by moving the VCM by one moving step is, so that focusing with lower precision can be performed.
In one embodiment, as shown in fig. 3, the determining the number of bits corresponding to the current object distance includes:
s1021: determining a numerical interval in which the current object distance is located in at least two numerical intervals; the numerical interval of the current object distance is a first numerical interval; the at least two numerical value intervals are obtained by dividing the object distance range of the lens; the lens can realize focusing in the object distance range.
S1022: and determining the bit number corresponding to the first numerical value interval as the bit number corresponding to the current object distance.
The object distance range refers to an object distance range in which the lens can perform focusing. Generally, each lens has a corresponding focal distance range, and when taking a picture, the focal distance of the lens needs to be within the corresponding focal distance range, so that the subject can clearly form an image. The focusing distance refers to the sum of the distance from the lens to the object and the distance from the lens to the photosensitive element, and the distance from the lens to the object is also the object distance, so that the lens also has a corresponding object distance range, and when photographing, the object distance of the lens needs to be within the object distance range, and the object can be clearly imaged.
The method includes dividing an object distance range in which a lens can focus to obtain at least two value regions, wherein each value region corresponds to one bit number, determining a first value region in which a current object distance is located, and determining the bit number corresponding to the first value region as the bit number corresponding to the current object distance, so that the determination of the bit number corresponding to the current object distance is completed.
In practical application, the number of bits corresponding to 12 bits can be set for an object distance smaller than 3cm, and the number of bits corresponding to 10 bits can be set for an object distance larger than 3cm, so that focusing with higher precision can be realized for macro shooting. Further, the object distance range can be divided more finely, for example, for an object distance of more than 5m, a bit number of 8bit is correspondingly set, so that the object distance range is divided into three sections, and when the lens is 5m away from the shot object, coarse focusing is performed with lower precision, so that the lens is pushed to move to a focusing position more quickly, and the shooting efficiency is improved.
In the embodiment shown in fig. 3, the object distance range of the lens is divided into different numerical value intervals, and the bit number of the DAC value of the motor driving chip is determined according to the numerical value interval where the current object distance is located, so that the moving step length of the lens can be adjusted, the requirement of fast focusing during shooting at a long object distance and the requirement of accurate focusing during shooting at a micro distance and an ultra-micro distance are met, and the imaging effect of an image is better.
S103: controlling a motor driving chip to output current to a VCM (Voice coil Motor) so as to drive the VCM to push the lens to focus; and the bit number of the DAC code value corresponding to the output current of the motor driving chip is the bit number corresponding to the current object distance.
In actual focusing, as shown in fig. 4, the CPU sends the number of bits corresponding to the current object distance to the motor driver chip, the motor driver chip is controlled to output a corresponding current to the VCM, the VCM moves under the action of the current to push the lens to move, a subject is imaged on a complementary metal oxide semiconductor Image Sensor (CIS, CMOS Image Sensor), an imaged picture is transmitted to the CPU, the CPU analyzes the sharpness of the Image to determine whether the Image is clear, when the Image is not clear, the CPU controls the motor driver chip to continue outputting the current to the VCM, and the above process is repeated until the CPU determines that the Image is clear, and the focusing process is completed.
In the focusing process, the CPU determines the bit number corresponding to the current object distance according to the current object distance of the lens so as to control the motor driving chip to output current to the VCM with corresponding precision, thereby dynamically realizing the adjustment of the focusing precision.
As an embodiment of the present invention, as shown in fig. 5, the controlling the motor driving chip to output a current to the VCM includes:
s1031: and sending a driving instruction to the motor driving chip, wherein the driving instruction carries an identifier corresponding to the bit number corresponding to the current object distance, so that the motor driving chip outputs a current corresponding to the DAC value of the bit number corresponding to the current object distance to the VCM according to the identifier.
In actual application, different identifiers are set for different bit numbers, the identifier corresponding to the bit number corresponding to the current object distance is obtained, the identifier is carried in a driving instruction sent to the motor driving chip, when the motor driving chip receives the driving instruction, the motor driving chip can determine the corresponding bit number corresponding to the current object distance according to the identifier in the driving instruction, and therefore current can be output to the VCM through the DAC code value of the bit number corresponding to the current object distance.
In one embodiment, as shown in fig. 6, the sending a driving command to the motor driving chip includes:
s601, determining an identifier corresponding to the bit number corresponding to the current object distance; the identification is represented by a binary number.
In order to meet the requirements of practical application, different object distances are divided into different value intervals, one value interval corresponds to one bit number, and the bit numbers corresponding to the value intervals are different. Each bit number is identified to better distinguish, and specifically, all the bit numbers can be binary numbered to obtain the identifications of binary numbers corresponding to different bit numbers. For example, the object distance corresponding to the numerical interval is 3cm-5m, and the corresponding bit number is 10; and carrying out binary numbering on the bit numbers of the two value intervals, wherein 00 is an identifier of 10bit numbers, and 01 is an identifier of 12bit numbers, and the object distance corresponding to the other value interval is less than 3cm, and the corresponding bit number is 12. If the current object distance is 2m, the corresponding bit number of the current object distance is 10, and the corresponding identifier of the bit number of the current object distance is 00.
S602: and generating a driving instruction carrying the identification.
The driving instruction is used for indicating the bit number corresponding to the current object distance, so that the driving instruction contains an identifier corresponding to the bit number corresponding to the current object distance. Therefore, the motor driving chip can receive the driving command and can identify the mark in the driving command, and finally, the motor driving chip can be instructed to output current to the VCM at the DAC value of the bit number corresponding to the current object distance.
S603: and sending the driving instruction to the motor driving chip.
In one embodiment, the sending a driving instruction to the motor driving chip includes:
transmitting the driving instruction of an Inter-Integrated Circuit Bus (IIC) protocol to the motor driving chip.
Fig. 7 is a schematic diagram of an internal circuit of the motor driver chip, and it can be seen that the CPU sends a driving instruction of the IIC protocol to the motor driver chip through the IIC bus, and the motor driver chip reads a corresponding identifier from the driving instruction, so as to output a current to the VCM by using a DAC code value having a bit number corresponding to the identifier.
In the embodiment of the invention, the bit number of the DAC value of the motor driving chip is determined according to the object distance of the lens, so that the DAC values with different bit numbers are correspondingly used for controlling the current output to the VCM by the motor driving chip on different object distances, and the bit number of the DAC value is reduced along with the increase of the object distance, thereby dynamically adjusting the focusing precision of the lens. Based on this, for the condition of macro shooting, a focusing mode with higher precision can be adopted, the out-of-focus condition caused by shallow depth of field is avoided, and the imaging quality is improved.
In order to implement the focusing method according to the embodiment of the present invention, an embodiment of the present invention further provides a focusing device disposed in the camera, and as shown in fig. 8, the focusing device includes:
a detection unit 801 for detecting the current object distance of the lens;
a determining unit 802, configured to determine a bit number corresponding to a current object distance corresponding to the current object distance;
a focusing unit 803, configured to control a motor driving chip to output a current to a VCM, so as to drive the VCM to push the lens to focus; wherein,
the bit number of the DAC code value corresponding to the output current of the motor driving chip is the bit number corresponding to the current object distance; and the bit number corresponding to the current object distance is reduced along with the increase of the current object distance.
In an embodiment, the determining unit 802 is configured to:
determining a numerical interval in which the current object distance is located in at least two numerical intervals; the numerical interval of the current object distance is a first numerical interval; the at least two numerical value intervals are obtained by dividing the object distance range of the lens; the lens can realize focusing in the object distance range;
and determining the bit number corresponding to the first numerical value interval as the bit number corresponding to the current object distance.
In an embodiment, the focusing unit 803 is configured to:
and sending a driving instruction to the motor driving chip, wherein the driving instruction carries an identifier corresponding to the bit number corresponding to the current object distance, so that the motor driving chip outputs a current corresponding to the DAC value of the bit number corresponding to the current object distance to the VCM according to the identifier.
In an embodiment, when the focusing unit 803 sends a driving instruction to the motor driving chip, it is configured to:
determining an identifier corresponding to the bit number corresponding to the current object distance; the identification is represented by a binary number;
generating a driving instruction carrying the identifier;
and sending the driving instruction to the motor driving chip.
In an embodiment, when the focusing unit 803 sends a driving instruction to the motor driving chip, it is configured to:
and sending the driving instruction of the IIC protocol to the motor driving chip.
In an embodiment, the detection unit 801 is configured to:
detecting the current DAC value of the motor driving chip;
and determining the current object distance of the lens according to the current DAC code value.
In practical applications, the detecting unit 801, the determining unit 802 and the focusing unit 803 may be implemented by a processor in a focusing apparatus. Of course, the processor needs to run the program stored in the memory to realize the functions of the above-described program modules.
It should be noted that, when the focusing device provided in the embodiment of fig. 8 performs focusing, only the division of the program modules is illustrated, and in practical applications, the above processing may be distributed to different program modules according to needs, that is, the internal structure of the device may be divided into different program modules to complete all or part of the above-described processing. In addition, the focusing device and the focusing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments and are not described herein again.
Based on the hardware implementation of the program module, in order to implement the method of the embodiment of the present invention, the embodiment of the present invention further provides a camera. Fig. 9 is a schematic diagram of a hardware composition structure of a camera according to an embodiment of the present invention, and as shown in fig. 9, the camera includes:
a communication interface 1 capable of information interaction with other devices such as network devices and the like;
and the processor 2 is connected with the communication interface 1 to realize information interaction with other equipment, and is used for executing the method provided by one or more technical schemes when running a computer program. And the computer program is stored on the memory 3.
In practice, of course, the various components in the camera are coupled together by a bus system 4. It will be appreciated that the bus system 4 is used to enable connection communication between these components. The bus system 14 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For the sake of clarity, however, the various buses are labeled as bus system 4 in fig. 9.
The memory 3 in the embodiment of the present invention is used to store various types of data to support operations in the camera. Examples of such data include: any computer program for operating on a camera head.
It will be appreciated that the memory 3 may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 3 described in the embodiments of the present invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed by the above embodiment of the present invention can be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 2. The processor 2 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 2 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 3, and the processor 2 reads the program in the memory 3 and in combination with its hardware performs the steps of the aforementioned method.
When the processor 2 executes the program, the corresponding processes in the methods according to the embodiments of the present invention are realized, and for brevity, are not described herein again.
An embodiment of the present invention further provides an electronic device, including the camera shown in fig. 9, where the electronic device may be a mobile phone, a tablet, a camera, and the like.
In an exemplary embodiment, the present invention further provides a storage medium, i.e., a computer storage medium, specifically a computer readable storage medium, for example, including a memory storing a computer program, which is executable by a processor to perform the steps of the foregoing method. The computer readable storage medium may be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, terminal and method may be implemented in other manners. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling an electronic device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
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 all 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 appended claims.
Claims (9)
1. A focusing method, the method comprising:
detecting the current object distance of the lens;
determining the bit number corresponding to the current object distance; the determining the number of bits corresponding to the current object distance includes: determining a numerical interval in which the current object distance is located in at least two numerical intervals; the numerical interval of the current object distance is a first numerical interval; the at least two numerical value intervals are obtained by dividing the object distance range of the lens; the lens can realize focusing in the object distance range; determining the bit number corresponding to the first numerical value interval as the bit number corresponding to the current object distance; the object distance range represents an object distance range in which the lens can focus;
controlling a motor driving chip to output current to a Voice Coil Motor (VCM) so as to drive the VCM to push the lens to focus;
wherein,
the bit number of the digital-to-analog conversion DAC code value corresponding to the output current of the motor driving chip is the bit number corresponding to the current object distance; and the bit number corresponding to the current object distance is reduced along with the increase of the current object distance.
2. The method of claim 1, wherein controlling the motor driver chip to output current to the VCM comprises:
and sending a driving instruction to the motor driving chip, wherein the driving instruction carries an identifier corresponding to the bit number corresponding to the current object distance, so that the motor driving chip outputs a current corresponding to the DAC value of the bit number corresponding to the current object distance to the VCM according to the identifier.
3. The method of claim 2, wherein said sending drive instructions to said motor drive chip comprises:
determining an identifier corresponding to the bit number corresponding to the current object distance; the identification is represented by a binary number;
generating a driving instruction carrying the identifier;
and sending the driving instruction to the motor driving chip.
4. The method of claim 2, wherein said sending drive instructions to said motor drive chip comprises:
and sending the driving instruction of the IIC protocol to the motor driving chip.
5. The method of claim 1, wherein detecting the current object distance of the lens comprises:
detecting the current DAC value of the motor driving chip;
and determining the current object distance of the lens according to the current DAC code value.
6. A focusing apparatus, comprising:
the detection unit is used for detecting the current object distance of the lens;
a determining unit, configured to determine a number of bits corresponding to a current object distance corresponding to the current object distance; the determining the number of bits corresponding to the current object distance includes: determining a numerical interval in which the current object distance is located in at least two numerical intervals; the numerical interval of the current object distance is a first numerical interval; the at least two numerical value intervals are obtained by dividing the object distance range of the lens; the lens can realize focusing in the object distance range; determining the bit number corresponding to the first numerical value interval as the bit number corresponding to the current object distance; the object distance range represents an object distance range in which the lens can focus;
the focusing unit is used for controlling a motor driving chip to output current to the VCM so as to drive the VCM to push the lens to focus; wherein,
the bit number of the DAC code value corresponding to the output current of the motor driving chip is the bit number corresponding to the current object distance; and the bit number corresponding to the current object distance is reduced along with the increase of the current object distance.
7. A camera, comprising: a processor and a memory for storing a computer program capable of running on the processor,
wherein the processor is adapted to perform the steps of the method of any one of claims 1 to 5 when running the computer program.
8. A storage medium having a computer program stored thereon, the computer program, when being executed by a processor, implementing the steps of the method of any one of claims 1 to 5.
9. An electronic device characterized by comprising the camera according to claim 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911175037.7A CN110913134B (en) | 2019-11-26 | 2019-11-26 | Focusing method and device, camera, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911175037.7A CN110913134B (en) | 2019-11-26 | 2019-11-26 | Focusing method and device, camera, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110913134A CN110913134A (en) | 2020-03-24 |
CN110913134B true CN110913134B (en) | 2021-08-20 |
Family
ID=69819662
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911175037.7A Active CN110913134B (en) | 2019-11-26 | 2019-11-26 | Focusing method and device, camera, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110913134B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116095473A (en) * | 2021-11-01 | 2023-05-09 | 中兴终端有限公司 | Lens automatic focusing method, device, electronic equipment and computer storage medium |
CN117674652A (en) * | 2022-08-24 | 2024-03-08 | 华为技术有限公司 | Motor power supply method and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103837129A (en) * | 2014-02-27 | 2014-06-04 | 华为终端有限公司 | Distance measuring method and device in terminals and terminal |
CN104469168A (en) * | 2014-12-29 | 2015-03-25 | 信利光电股份有限公司 | Shooting module and automatic focusing method thereof |
CN104883502A (en) * | 2015-05-19 | 2015-09-02 | 广东欧珀移动通信有限公司 | Focusing method and apparatus for mobile terminal |
CN105100617A (en) * | 2015-07-28 | 2015-11-25 | 深圳市万普拉斯科技有限公司 | Focusing control method for imaging equipment, and imaging device |
CN109068066A (en) * | 2018-10-10 | 2018-12-21 | Oppo广东移动通信有限公司 | Camera focusing bearing calibration, relevant device and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170318273A1 (en) * | 2016-04-28 | 2017-11-02 | Qualcomm Incorporated | Shift-and-match fusion of color and mono images |
-
2019
- 2019-11-26 CN CN201911175037.7A patent/CN110913134B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103837129A (en) * | 2014-02-27 | 2014-06-04 | 华为终端有限公司 | Distance measuring method and device in terminals and terminal |
CN104469168A (en) * | 2014-12-29 | 2015-03-25 | 信利光电股份有限公司 | Shooting module and automatic focusing method thereof |
CN104883502A (en) * | 2015-05-19 | 2015-09-02 | 广东欧珀移动通信有限公司 | Focusing method and apparatus for mobile terminal |
CN105100617A (en) * | 2015-07-28 | 2015-11-25 | 深圳市万普拉斯科技有限公司 | Focusing control method for imaging equipment, and imaging device |
CN109068066A (en) * | 2018-10-10 | 2018-12-21 | Oppo广东移动通信有限公司 | Camera focusing bearing calibration, relevant device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110913134A (en) | 2020-03-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108989791B (en) | Motor linearity detection method and device and computer readable storage medium | |
CN100517044C (en) | Image capturing apparatus | |
CN101600050B (en) | System amd method for effectively optimizing zoom settings in a digital camera | |
CN106412437B (en) | Focusing method, device and the terminal of terminal | |
US10237491B2 (en) | Electronic apparatus, method of controlling the same, for capturing, storing, and reproducing multifocal images | |
CN103369227A (en) | Photographing method of moving object and electronic equipment | |
JP2011259285A (en) | Imaging apparatus | |
CN110913134B (en) | Focusing method and device, camera, storage medium and electronic equipment | |
US10516819B2 (en) | Electronic device with multiple lenses and lens switching method | |
JP5497698B2 (en) | Projection apparatus having autofocus function and autofocus method thereof | |
CN101788743B (en) | Image sensing apparatus and control method thereof | |
JP2014106274A (en) | Camera module, camera, camera control method and control program | |
CN109151328B (en) | Lens focusing method and device and zoom lens | |
CN105629428A (en) | Optical instrument and control method for lens | |
JP6040422B2 (en) | Imaging device | |
US9591201B2 (en) | AF controller, lens apparatus including the AF controller and image pickup apparatus | |
CN110830726B (en) | Automatic focusing method, device, equipment and storage medium | |
CN112153271B (en) | Control method and control device for optical lens of electronic equipment and storage medium | |
JP2002122776A (en) | Autofocus controller, digital still camera and digital video camera equipped with the same, autofocus control method and recording medium having autofocus control program recorded thereon | |
JP2021047296A (en) | Lens device, imaging apparatus, method for controlling lens device, and program | |
JP6145822B2 (en) | Imaging device | |
KR102350926B1 (en) | Method to control Auto Focus | |
US11829000B2 (en) | Optical apparatus, its control method, and storage medium | |
JP2013130683A (en) | Imaging device, control method of the same and program | |
CN114245002B (en) | Curve determination method, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |