CN108429884A - A kind of focusing method, device, equipment and medium - Google Patents

A kind of focusing method, device, equipment and medium Download PDF

Info

Publication number
CN108429884A
CN108429884A CN201810570925.8A CN201810570925A CN108429884A CN 108429884 A CN108429884 A CN 108429884A CN 201810570925 A CN201810570925 A CN 201810570925A CN 108429884 A CN108429884 A CN 108429884A
Authority
CN
China
Prior art keywords
electric current
focusing
focusing electric
terminal
starting point
Prior art date
Application number
CN201810570925.8A
Other languages
Chinese (zh)
Inventor
彭磊
Original Assignee
昆山丘钛微电子科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 昆山丘钛微电子科技有限公司 filed Critical 昆山丘钛微电子科技有限公司
Priority to CN201810570925.8A priority Critical patent/CN108429884A/en
Publication of CN108429884A publication Critical patent/CN108429884A/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, TV cameras, video cameras, camcorders, webcams, camera modules for embedding in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/225Television cameras ; Cameras comprising an electronic image sensor, e.g. digital cameras, video cameras, camcorders, webcams, camera modules specially adapted for being embedded in other devices, e.g. mobile phones, computers or vehicles
    • H04N5/232Devices for controlling television cameras, e.g. remote control ; Control of cameras comprising an electronic image sensor
    • H04N5/23212Focusing based on image signals provided by the electronic image sensor

Abstract

The present invention discloses a kind of focusing method, device, equipment and medium, method:It determines starting point focusing electric current and terminal focusing electric current, and focusing electric current in midpoint is determined according to starting point focusing electric current and terminal focusing electric current;According to starting point clarity, terminal clarity and midpoint clarity, more ground zero focusing electric current and terminal focusing electric current;If updated starting point focusing electric current and terminal focusing electric current meet preset condition, best focusing electric current is determined according to updated starting point focusing electric current and terminal focusing electric current;It is executed since the step of determining midpoint focusing electric current conversely, then returning, until the updated starting point focusing electric current and terminal focusing electric current meet the preset condition.To solve detecting method in the prior art, existing technical problem computationally intensive, focusing speed is slow realizes the technique effect for reducing focusing calculation amount and improving focusing speed for method, apparatus, equipment and medium provided by the invention.

Description

A kind of focusing method, device, equipment and medium

Technical field

The present invention relates to camera technology field more particularly to a kind of focusing method, device, equipment and media.

Background technology

In order to meet the needs of users, most of picture pick-up device all has automatic focusing function.Auto-focusing is to pass through drive Camera lens is shifted onto corresponding distance by dynamic motor, so that the image-capturing resolution of picture pick-up device is optimal.Wherein, the master of motor It acts on and exactly camera lens is driven to move, and motor drives the distance of camera lens movement to be controlled often through the size of focusing electric current. Motor is set to make corresponding displacement, then by judging each focusing electric current to motor by the focusing electric current of the corresponding size of output The clarity of corresponding image makes camera lens be moved to obtain the corresponding best focusing in position of approximate most clear image to find Electric current, to focus.

Currently, it determines the corresponding focusing electric current of the highest imaging of clarity, generally requires the current steps by setting, gradually Movement motor, to obtain the auto-focusing curve of the characterization clarity shown in FIG. 1 variation of focusing electric current relatively (shown in Fig. 1 certainly The abscissa of dynamic focusing curve is focusing electric current, and ordinate is clarity).Then, it is clear then from auto-focusing curve to determine The corresponding focusing electric current of the approximate peak of degree, to complete to focus.However, current this focusing mode needs to measure clearly by step-length Clear to spend to obtain auto-focusing curve, calculation amount is larger, and focusing speed is also slow.

As it can be seen that focusing method in the prior art, there are the technical problems that computationally intensive, focusing speed are slow.

Invention content

In view of the above problems, it is proposed that the present invention overcoming the above problem in order to provide one kind or solves at least partly State focusing method, device, equipment and the medium of problem.

In a first aspect, the application provides a kind of focusing method, including:

Determine starting point focusing electric current and terminal focusing electric current, and according to starting point focusing electric current and terminal focusing electricity Stream determines that midpoint focusing electric current, the midpoint focusing electric current are equal to the sum of starting point focusing electric current and terminal focusing electric current The half of value;

According to the corresponding starting point clarity of starting point focusing electric current, the corresponding terminal clarity of terminal focusing electric current Midpoint clarity corresponding with midpoint focusing electric current updates the starting point focusing electric current and terminal focusing electric current;

If the updated starting point focusing electric current and terminal focusing electric current meet preset condition, according to update Starting point focusing electric current and terminal focusing electric current afterwards determines best focusing electric current;

If the updated starting point focusing electric current and terminal focusing electric current are unsatisfactory for the preset condition, return It returns and is executed since the step of electric current is focused at the determining midpoint, until the updated starting point focusing electric current and the terminal Focusing electric current meets the preset condition.

Optionally, the determining starting point focusing electric current and terminal focusing electric current, including:The focusing electricity supported with camera unit The minimum value of stream is as starting point focusing electric current, electric current of being focused using the maximum value of the focusing electric current of camera unit support as terminal; Alternatively, rule of thumb data determine starting point focusing electric current and terminal focusing electric current.

Optionally, it is focused the corresponding starting point clarity of electric current, terminal focusing electric current corresponding end according to the starting point Point clarity and the corresponding midpoint clarity of midpoint focusing electric current, update the starting point focusing electric current and terminal focusing Electric current, including:Compare the starting point clarity, the midpoint clarity and the terminal clarity;If the midpoint is clear Degree is more than the starting point clarity, and the midpoint clarity is less than the terminal clarity, then with midpoint focusing electric current As updated starting point focusing electric current, the terminal focusing electric current is constant;If the midpoint clarity is less than the starting point Clarity, and the midpoint clarity is more than the terminal clarity, then using midpoint focusing electric current as updated end Point focusing electric current, the starting point focusing electric current are constant.

Optionally, it after comparing the starting point clarity, the midpoint clarity and the terminal clarity, also wraps It includes:If the midpoint clarity is more than the starting point clarity, and the midpoint clarity is more than the terminal clarity, then Determine that stepping point focusing electric current, the stepping point focusing electric current are equal to midpoint focusing electric current according to midpoint focusing electric current With default step-length current value and value;It is clear according to the stepping point focusing corresponding stepping point clarity of electric current and the midpoint Degree updates the starting point focusing electric current and terminal focusing electric current.

It is optionally, described to be focused the corresponding stepping point clarity of electric current and the midpoint clarity according to the stepping point, The starting point focusing electric current and terminal focusing electric current are updated, including:It compares the stepping point clarity and the midpoint is clear Clear degree;If the stepping point clarity is more than the midpoint clarity, electric current is focused as after updating using the stepping point Starting point focus electric current, terminal focusing electric current is constant;If the stepping point clarity is less than the midpoint clarity, Electric current is focused as updated terminal focusing electric current using the stepping point, and the starting point focusing electric current is constant.

Optionally, the updated starting point focusing electric current and terminal focusing electric current meet preset condition, wrap It includes:Difference between the updated starting point focusing electric current and terminal focusing electric current is less than preset difference value.

Optionally, described that best focusing is determined according to the updated starting point focusing electric current and terminal focusing electric current Electric current, including:Made with updated starting point focusing electric current, updated terminal focusing electric current or updated midpoint focusing electric current For the best focusing electric current, the updated midpoint focusing electric current is equal to the updated starting point focusing electric current and described Updated terminal focusing electric current and value half.

Second aspect improves a kind of focusing mechanism, including:

Determining module, for determine starting point focusing electric current and terminal focus electric current, and according to the starting point focus electric current and The terminal focusing electric current determines that midpoint focusing electric current, the midpoint focusing electric current are equal to starting point focusing electric current and the end Point focusing electric current and value half;

Update module, for according to the corresponding starting point clarity of starting point focusing electric current, terminal focusing electric current pair The terminal clarity answered and the corresponding midpoint clarity of midpoint focusing electric current, update the starting point focusing electric current and the end Point focusing electric current;

Processing module presets item if met for the updated starting point focusing electric current and terminal focusing electric current Part then determines best focusing electric current according to the updated starting point focusing electric current and terminal focusing electric current;

Module is returned to, if be unsatisfactory for for the updated starting point focusing electric current and terminal focusing electric current described Preset condition is then returned and is executed since the step of electric current is focused at the determining midpoint, until the updated starting point focusing Electric current and terminal focusing electric current meet the preset condition.

The third aspect, provides a kind of electronic equipment, including memory, processor and storage on a memory and can handled The computer program run on device, the processor realize the method described in first aspect when executing described program.

Fourth aspect provides a kind of computer readable storage medium, is stored thereon with computer program, which is handled The method described in first aspect is realized when device executes.

The technical solution provided in the embodiment of the present invention, has at least the following technical effects or advantages:

Focusing method, device, equipment and medium provided in an embodiment of the present invention first determine starting point focusing electric current, terminal pair Burnt electric current and midpoint focus electric current, further according to the value of corresponding starting point clarity, terminal clarity and midpoint clarity Magnitude relationship, to update the starting point focusing electric current and terminal focusing electric current, and by judging that updated starting point is focused Whether electric current and terminal focusing electric current expire preset condition determines and more ground zero pair to determine that most preferably focusing electric current or cycle execute The step of burnt electric current and terminal focusing electric current, without gradually moving motor by step-length electric current, and clarity is measured to obtain Auto-focusing curve is obtained, the calculation amount for determining best focusing electric current is effectively reduced, improves focusing speed.

Above description is only the general introduction of technical solution of the present invention, in order to better understand the technical means of the present invention, And can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, below the special specific implementation mode for lifting the present invention.

Description of the drawings

By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are common for this field Technical staff will become clear.Attached drawing only for the purpose of illustrating preferred embodiments, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:

Fig. 1 is the schematic diagram of auto-focusing curve in background of invention;

The step of Fig. 2 is focusing method in the embodiment of the present invention is schemed;

Fig. 3 is the specific implementation step figure of focusing method in the embodiment of the present invention;

Fig. 4 is the structural schematic diagram of focusing mechanism in the embodiment of the present invention;

Fig. 5 is the structural schematic diagram of electronic equipment in the embodiment of the present invention;

Fig. 6 is the structural schematic diagram of storage medium in the embodiment of the present invention.

Specific implementation mode

The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.

Embodiment one

A kind of focusing method is present embodiments provided, as shown in Fig. 2, including:

Step S201, determines starting point focusing electric current and terminal focusing electric current, and is focused electric current and described according to the starting point Terminal focusing electric current determines that midpoint focusing electric current, the midpoint focusing electric current are equal to starting point focusing electric current and the terminal pair Burnt electric current and value half;

Step S202, it is corresponding according to the corresponding starting point clarity of starting point focusing electric current, terminal focusing electric current Terminal clarity and the corresponding midpoint clarity of midpoint focusing electric current, update the starting point focusing electric current and the terminal pair Burnt electric current;

Step S203, if the updated starting point focusing electric current and terminal focusing electric current meet preset condition, Best focusing electric current is then determined according to the updated starting point focusing electric current and terminal focusing electric current;

Step S204, if the updated starting point focusing electric current and terminal focusing electric current are unsatisfactory for described preset Condition is then returned and is executed since the step of determining midpoint focusing electric current, until the updated starting point focusing electric current and institute It states terminal focusing electric current and meets the preset condition.

It should be noted that the focusing method can be applied to the electronics such as the mobile phone with camera unit, tablet, video camera Equipment can also be the electronic equipments such as the computer for being applied to communicate with camera unit, and this is not restricted.

The detailed implementation steps of focusing method provided in this embodiment are introduced with reference to Fig. 2:

First, execute step S201, determine starting point focusing electric current and terminal focusing electric current, and according to starting point focus electric current and Terminal focusing electric current determines that midpoint focusing electric current, the midpoint focus electric current equal to starting point focusing electric current and terminal focusing electric current And value half.

In the embodiment of the present application, determine starting point focusing electric current and terminal focusing electric current method can there are many, below It enumerates for two kinds:

The first, the minimum value for the focusing electric current supported using camera unit is as starting point focusing electric current, with camera unit branch The maximum value for the focusing electric current held is as terminal focusing electric current.

Specifically, capable of driving the focusing electric current that the motor of camera unit moves, often existence range, focusing electric current are too small It may cause motor cannot be driven to move, focusing electric current is excessive may to cause motor or camera unit to damage.Therefore it can be can protect Demonstrate,prove the minimum value of the rated range of the focusing electric current of camera unit normal work as starting point focusing electric current, most with rated range Big value is as terminal focusing electric current.

As an example it is assumed that the rated range for the focusing electric current that camera unit is supported is 165mA~237mA, it is determined that rise Point focusing electric current is 165mA, and terminal focuses electric current as 237mA.

Second, rule of thumb data determine starting point focusing electric current and terminal focusing electric current.

Specifically, technical staff tends to the model for summing up best focusing electric current in related research and development experience for many years It encloses.Therefore can rule of thumb data, fixed starting point focusing electric current and terminal focusing electric current are pre-set, as long as can meet can reach Best focusing electric current to optimal imaging effect is located between starting point focusing electric current and terminal focusing electric current.

Certainly, in specific implementation process, determine starting point focusing electric current and terminal focusing electric current method be not limited to it is above-mentioned Two kinds, in specific implementation process, can also according to user select photographed scene pattern, in conjunction with preset scene mode with The relation information for current range of focusing, to determine corresponding starting point focusing electric current and terminal focusing electric current, this is not restricted.

After starting point focusing electric current and terminal focusing electric current is determined, midpoint focusing electric current, the midpoint pair can be determined Burnt electric current is equal to starting point focusing electric current and terminal focusing electric current and value half.

Then, step S202 is executed, it is corresponding according to the corresponding starting point clarity of starting point focusing electric current, terminal focusing electric current Terminal clarity and the corresponding midpoint clarity of midpoint focusing electric current, update starting point focusing electric current and terminal focusing electric current.

It should be noted that the acquisition of starting point clarity, terminal clarity and midpoint clarity, is defeated by controlling respectively Go out after being starting point focusing electric current, terminal focusing electric current and midpoint focusing electric current to the focusing current value of motor, obtains camera unit Image-forming information, and calculate acquisition.Specifically, by taking the focusing method is applied to the electronic equipment with camera unit as an example, Can export starting point by the focusing chip of electronic equipment to focus electric current to motor, so that motor is made corresponding displacement, then will Imaging data under current starting point focusing electric current inputs computing chip, and the clear of the imaging data is determined by computing chip Degree is used as starting point clarity.Existing arbitrary sharpness computation algorithm may be used in specific sharpness computation method, herein It is not restricted.The computational methods of terminal clarity and midpoint clarity are similar to the computational methods of starting point clarity, in order to illustrate Book it is succinct, be not repeated herein.

After starting point clarity, terminal clarity and midpoint clarity is determined, according to the magnitude relationship of its value, update Point focusing electric current and terminal focusing electric current.

In specific implementation process, more ground zero focus electric current and terminal focusing electric current method can there are many, below It enumerates for two kinds.

The first update method:

First comparison starting point clarity, midpoint clarity and terminal clarity;

If terminal clarity>Midpoint clarity>Starting point clarity, then using current midpoint focusing electric current as update Starting point focusing electric current afterwards, terminal focusing electric current are constant;

If starting point clarity>Midpoint clarity>Terminal clarity, then using current midpoint focusing electric current as update Terminal focusing electric current afterwards, starting point focusing electric current are constant.

Specifically, in the case of in view of interference is not considered, clarity is often unimodal with the change curve of focusing electric current Curve, therefore by executing above-mentioned steps, not only reduce the electricity between updated starting point focusing electric current and terminal focusing electric current Flow range, it is ensured that the size of the best focusing current value of clarity approximation peak is still located on starting point focusing electric current and end Between point focusing electric current, convenient for subsequently continuing to determine best focusing current value.

In the first update method, there is also terminal clarity<Midpoint clarity>The case where starting point clarity, this When, two kinds of following A, B renewal models may be used:

If A, terminal clarity<Midpoint clarity>Starting point clarity then determines stepping point according to midpoint focusing electric current It focuses electric current, stepping point is focused electric current is equal to midpoint focusing electric current and default step-length current value and value;Further according to stepping point pair The corresponding stepping point clarity of burnt electric current and midpoint clarity, more ground zero focuses electric current and terminal is focused electric current.

Specifically, it when the focusing electric current that stepping point clarity inputs motor in order to control is stepping point focusing electric current, calculates The definition values gone out.Default step-length current value be preset empirical value, for example, can be arranged default step-length current value be 1mA, 2mA, 3mA, 4mA or 5mA etc., this is not restricted.

Default step-length current value is smaller, and focusing precision is higher, but speed is slower.It is studied according to inventor and finds the default step of setting When long electrical wave value is 4mA, focusing speed can be improved while ensureing to focus precision.

In the embodiment of the present application, according to stepping point clarity and midpoint clarity, more ground zero is focused electric current and terminal The method of focusing electric current, Ke Yishi:First compare stepping point clarity and midpoint clarity;If stepping point clarity is more than midpoint Clarity then focuses electric current as updated starting point focusing electric current using stepping point, and terminal focusing electric current is constant;If stepping point Clarity is less than midpoint clarity, then electric current of being focused using stepping point focusing electric current as updated terminal, starting point focusing electric current It is constant.Can also be:If stepping point clarity is more than midpoint clarity, using midpoint focusing electric current as updated starting point Focusing electric current, terminal focusing electric current are constant;If stepping point clarity be less than midpoint clarity, using midpoint focus electric current as Updated terminal focusing electric current, starting point focusing electric current are constant.This is not restricted.

If B, terminal clarity<Midpoint clarity>Starting point clarity, then with current starting point focusing electric current plus pre- If current value and value focus electric current as updated starting point, preset current value is subtracted with current terminal focusing electric current Difference as updated terminal focus electric current.

Second of update method:

First comparison starting point clarity, midpoint clarity and terminal clarity;

If terminal clarity>Midpoint clarity>Starting point clarity, then with current starting point focusing electric current plus default Current value and value as updated starting point focus electric current, terminal focus electric current it is constant;

If starting point clarity>Midpoint clarity>Terminal clarity is then subtracted with current terminal focusing electric current default Current value difference as updated terminal focus electric current, starting point focus electric current it is constant.

If terminal clarity<Midpoint clarity>Starting point clarity, then with current starting point focusing electric current plus default Current value and value focus electric current as updated starting point, preset current value is subtracted with current terminal focusing electric current Difference is as updated terminal focusing electric current.

In the first above-mentioned update method and second of update method, it is also possible to which there are midpoint clarity=starting point is clear The case where degree or terminal clarity=midpoint clarity, at this time:

When terminal clarity<When midpoint clarity=starting point clarity, the electric current that can be focused with current midpoint substitutes eventually Point focusing electric current, or the difference of preset current value is subtracted using current terminal focusing electric current and is focused electricity as updated terminal Stream.

When starting point clarity<When midpoint clarity=terminal clarity, the electric current that can be focused with current midpoint substitutes Point focusing electric current, or using current starting point focusing electric current plus preset current value and value it is electric as the focusing of updated starting point Stream.

Certainly, in specific implementation process, according to starting point clarity, terminal clarity and midpoint clarity, more ground zero The method of focusing electric current and terminal focusing electric current is not limited to above two, and this is not restricted, also will not enumerate.

After focus by step S202 more ground zeros electric current and terminal focusing electric current, need to judge updated starting point pair Whether burnt electric current and terminal focusing electric current meet preset condition.

In the embodiment of the present application, judge whether updated starting point focusing electric current and terminal focusing electric current meet default item Part, Ke Yishi judge whether updated starting point focusing electric current and the difference of terminal focusing electric current are less than preset difference value;It can also It is to judge whether are the corresponding starting point clarity of updated starting point focusing electric current and the corresponding terminal clarity of terminal focusing electric current Default definition values are all higher than, this is not restricted.

Specifically, by judging it is default whether the difference of updated starting point focusing electric current and terminal focusing electric current is less than Difference is to determine whether meet preset condition, due to that need not go to calculate updated starting point focusing electric current and terminal focusing electricity again Corresponding definition values are flowed, calculation amount can be further reduced, improve focusing speed.

If meeting preset condition, S203 is thened follow the steps, according to the updated starting point focusing electric current and the end Point focusing electric current determines best focusing electric current.

In the embodiment of the present application, determine that best focusing is electric according to updated starting point focusing electric current and terminal focusing electric current The method of stream is more, and the electric current that can be focused using updated starting point, can also be with updated terminal as best focusing electric current Electric current of focusing is used as best focusing electric current, can also be using updated midpoint focusing electric current as best electric current of focusing, the update Afterwards midpoint focusing electric current be equal to updated starting point focusing electric current and updated terminal focusing electric current and value half.

If being unsatisfactory for preset condition, S204 is thened follow the steps, returns and is held since the step of determining midpoint focusing electric current Row, until updated starting point focusing electric current and terminal focusing electric current meet the preset condition.

I.e. in the case where being unsatisfactory for preset condition, return to step S201 is needed, is executed according to starting point focusing electric current and end Point focusing electric current determines the step of midpoint focusing electric current, and starting point focusing electric current and terminal focusing electric current are preceding primary execution step Updated electric current when S202.And step S202 is executed again, starting point focusing electric current and terminal focusing electric current are carried out again more Newly, and according to newer starting point focusing electric current again and terminal focusing electric current judge to execute step S203 or step S204, if Judging result has not been met preset condition, then also needs to return to cycle until when time newer starting point focusing electric current and terminal focusing electricity Stream meets the preset condition.

For the ease of understanding focusing method provided in this embodiment on the whole, it is real in detail to provide one with reference to Fig. 3 Apply scheme:

First, execute step S301, determine starting point focusing electric current and terminal focusing electric current, and according to starting point focus electric current and Terminal focusing electric current determines midpoint focusing electric current;

Step S302 is executed again, during the corresponding starting point clarity of comparison starting point focusing electric current, midpoint focusing electric current are corresponding Point clarity and the corresponding terminal clarity of terminal focusing electric current;

If terminal clarity>Midpoint clarity>Starting point clarity, thens follow the steps S303, is focused with current midpoint For electric current as updated starting point focusing electric current, terminal focusing electric current is constant;

If starting point clarity>Midpoint clarity>Terminal clarity, thens follow the steps S304, is focused with current midpoint For electric current as updated terminal focusing electric current, starting point focusing electric current is constant;

If terminal clarity<Midpoint clarity>Starting point clarity, thens follow the steps S305, according to midpoint focusing electric current Determine that stepping point is focused electric current, stepping point is focused electric current is equal to midpoint focusing electric current and default step-length current value and value, then right Than stepping point clarity and midpoint clarity;If stepping point clarity is more than midpoint clarity, S306 is thened follow the steps, with step Into focusing electric current as updated starting point focusing electric current, terminal focusing electric current is constant;During if stepping point clarity is less than Point clarity, thens follow the steps S307, electric current of being focused using stepping point focusing electric current as updated terminal, starting point focusing electric current It is constant.

Then, judge whether updated starting point focusing electric current and terminal focusing electric current meet preset condition, to select Execute step S308 and step S309:

Step S308, if the difference of updated starting point focusing electric current and terminal focusing electric current is poor less than or equal to default Value then focuses electric current and terminal focusing electric current corresponding midpoint focusing electric current as electric current of most preferably focusing using updated starting point;

Step S309, if the difference of updated starting point focusing electric current and terminal focusing electric current is more than preset difference value, Return to step S301.

According to inventor's verification experimental verification, using focusing method provided in this embodiment can in the case where ensureing to focus precision, Improve focusing speed, test result as described below:

Table 1

Table 1 is the focusing method using the embodiment of the present application, and it is 1mA's and 4mA that default step-length current value, which is respectively set, Test result data, SensodD are camera unit number;Code is best focusing electric current;FV is that best focusing electric current is corresponding Clarity;CodeDiff is the deviation using the best focusing electric current of different step size computations;FVDiff is to use different step-length meters The deviation for the corresponding clarity of best focusing electric current calculated.As it can be seen that calculated best using different default step-length current values The maximum deviation CodeDiff of focusing electric current is only 6mA, that is, it is higher to use the accuracy of the focusing method of the embodiment of the present application 's.

Table 2 is the focusing computational chart focused using the focusing method of the embodiment of the present application, and table 3 is using the prior art The focusing computational chart focused of focusing method, SensorID is camera unit number;NearPos is to be exported in focus process The focusing electric current crossed, FocusValue are the corresponding definition values of calculated focusing electric current.Using pair of the embodiment of the present application The best focusing electric current that burnt method determines is 247mA, and corresponding clarity is 3972552, true using the focusing method of the prior art Fixed best focusing electric current is 253mA, and corresponding clarity is 3975201.As it can be seen that the calculated best focusing of two kinds of focusing methods The deviation of electric current is only 6mA, that is, it is higher to use the accuracy of the focusing method of the embodiment of the present application.And using the application The focusing method of embodiment only needs to carry out 12 sharpness computations, and 26 clarity need to be carried out using the focusing method of the prior art It calculates, it is seen then that the calculation amount using the focusing method of the embodiment of the present application is much smaller, and speed is also faster.

Inventor uses the focusing method of the embodiment of the present application and the focusing method contrast test of the prior art 30pcs to take the photograph As unit, wherein have 1pcs of the best focusing current deviation more than 5mA, deviation are equal to the 1pcs of 5mA, other are respectively less than 5mA.

To sum up, it is seen that focusing method provided in this embodiment can be reduced calculation amount, carried on the basis of ensureing to focus precision High focusing speed.

Specifically, first determine that starting point focusing electric current, terminal focusing electric current and midpoint are focused electric current, further according to corresponding to respectively Starting point clarity, the magnitude relationship of the value of terminal clarity and midpoint clarity, to update the starting point focusing electric current and institute Terminal focusing electric current is stated, and by judging whether updated starting point focusing electric current and terminal focusing electric current expire preset condition come really Fixed most preferably focusing electric current or cycle execute the step of determining with more ground zero focusing electric current and terminal focusing electric current, without Motor is gradually moved by step-length electric current, and measures clarity to obtain auto-focusing curve, effectively reduces and determines best focusing The calculation amount of electric current, improves focusing speed.

Based on same inventive concept, the embodiment of the present invention additionally provides one corresponding device embodiment of embodiment, refers to reality Apply example two.

Embodiment two

As shown in figure 4, the present embodiment provides a kind of focusing mechanisms, including:

Determining module 401, for determining starting point focusing electric current and terminal focusing electric current, and according to starting point focusing electric current Determine that midpoint is focused electric current with terminal focusing electric current, midpoint focusing electric current is equal to starting point focusing electric current and described Terminal focusing electric current and value half;

Update module 402, for according to the corresponding starting point clarity of starting point focusing electric current, terminal focusing electric current Corresponding terminal clarity and the corresponding midpoint clarity of midpoint focusing electric current update the starting point focusing electric current and described Terminal focusing electric current;

Processing module 403, if met for the updated starting point focusing electric current and terminal focusing electric current pre- If condition, then best focusing electric current is determined according to the updated starting point focusing electric current and terminal focusing electric current;

Module 404 is returned to, if be unsatisfactory for for the updated starting point focusing electric current and terminal focusing electric current The preset condition is then returned and is executed since the step of electric current is focused at the determining midpoint, until the updated starting point Focusing electric current and terminal focusing electric current meet the preset condition.

By the device that the embodiment of the present invention two is introduced, filled used by the method to implement the embodiment of the present invention one It sets, so based on the method that the embodiment of the present invention one is introduced, the affiliated personnel in this field can understand the concrete structure of the device And deformation, so details are not described herein.Device used by the method for every embodiment of the present invention one belongs to the present invention and is intended to The range of protection.

Based on same inventive concept, the embodiment of the present invention additionally provides the corresponding electronic equipment of method in embodiment one, in detail See embodiment three.

Embodiment three

As shown in figure 5, the present embodiment provides a kind of electronic equipment, including memory 510, processor 520 and it is stored in On reservoir 510 and the computer program 511 that can be run on processor 520, the processor 520 execute the computer program Following steps are realized when 511:

Determine starting point focusing electric current and terminal focusing electric current, and according to starting point focusing electric current and terminal focusing electricity Stream determines that midpoint focusing electric current, the midpoint focusing electric current are equal to the sum of starting point focusing electric current and terminal focusing electric current The half of value;

According to the corresponding starting point clarity of starting point focusing electric current, the corresponding terminal clarity of terminal focusing electric current Midpoint clarity corresponding with midpoint focusing electric current updates the starting point focusing electric current and terminal focusing electric current;

If the updated starting point focusing electric current and terminal focusing electric current meet preset condition, according to update Starting point focusing electric current and terminal focusing electric current afterwards determines best focusing electric current;

If the updated starting point focusing electric current and terminal focusing electric current are unsatisfactory for the preset condition, return It returns and is executed since the step of electric current is focused at the determining midpoint, until the updated starting point focusing electric current and the terminal Focusing electric current meets the preset condition.

The processor 520 realizes any embodiment in the embodiment of the present invention one when executing the computer program 511.

By the electronic equipment that the embodiment of the present invention three is introduced, adopted to implement any one of embodiment of the present invention one Equipment, so based on the method described in the embodiment of the present invention one, the affiliated personnel in this field can understand the equipment Concrete structure and deformation, so details are not described herein.Equipment all belongs to used by any one of every embodiment of the present invention one In the range of the invention to be protected.

Based on same inventive concept, the embodiment of the present invention additionally provides the corresponding storage medium of method in embodiment one, in detail See example IV.

Example IV

As shown in fig. 6, the present embodiment provides a kind of computer readable storage medium 600, it is stored thereon with computer program 611, which realizes following steps when being executed by processor:

Determine starting point focusing electric current and terminal focusing electric current, and according to starting point focusing electric current and terminal focusing electricity Stream determines that midpoint focusing electric current, the midpoint focusing electric current are equal to the sum of starting point focusing electric current and terminal focusing electric current The half of value;

According to the corresponding starting point clarity of starting point focusing electric current, the corresponding terminal clarity of terminal focusing electric current Midpoint clarity corresponding with midpoint focusing electric current updates the starting point focusing electric current and terminal focusing electric current;

If the updated starting point focusing electric current and terminal focusing electric current meet preset condition, according to update Starting point focusing electric current and terminal focusing electric current afterwards determines best focusing electric current;

If the updated starting point focusing electric current and terminal focusing electric current are unsatisfactory for the preset condition, return It returns and is executed since the step of electric current is focused at the determining midpoint, until the updated starting point focusing electric current and the terminal Focusing electric current meets the preset condition.

Any embodiment in the embodiment of the present invention one is realized when the computer program 611 is executed by processor.

The technical solution provided in the embodiment of the present invention, has at least the following technical effects or advantages:

Focusing method, device, equipment and medium provided in an embodiment of the present invention first determine starting point focusing electric current, terminal pair Burnt electric current and midpoint focus electric current, further according to the value of corresponding starting point clarity, terminal clarity and midpoint clarity Magnitude relationship, to update the starting point focusing electric current and terminal focusing electric current, and by judging that updated starting point is focused Whether electric current and terminal focusing electric current expire preset condition determines and more ground zero pair to determine that most preferably focusing electric current or cycle execute The step of burnt electric current and terminal focusing electric current, without gradually moving motor by step-length electric current, and clarity is measured to obtain Auto-focusing curve is obtained, the calculation amount for determining best focusing electric current is effectively reduced, improves focusing speed.

Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.

In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.

Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific implementation mode are expressly incorporated in the specific implementation mode, wherein each claim itself All as a separate embodiment of the present invention.

Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment Change and they are arranged in the one or more equipment different from the embodiment.It can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation It replaces.

In addition, it will be appreciated by those of skill in the art that although some embodiments in this include institute in other embodiments Including certain features rather than other feature, but the combination of the feature of different embodiment means to be in the scope of the present invention Within and form different embodiments.For example, in the following claims, embodiment claimed it is arbitrary it One mode can use in any combination.

The all parts embodiment of the present invention can be with hardware realization, or to run on one or more processors Software module realize, or realized with combination thereof.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) are some or all in the device of the embodiment of the present invention, equipment to realize The some or all functions of component.The present invention be also implemented as a part for executing method as described herein or Whole equipment or program of device (for example, computer program and computer program product).Such journey for realizing the present invention Sequence can may be stored on the computer-readable medium, or can be with the form of one or more signal.Such signal can It is obtained with being downloaded from internet website, either provided on carrier signal or provided in any other forms.

It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference mark between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Component or step listed in the claims.Word "a" or "an" before component does not exclude the presence of multiple such Component.The present invention can be by means of including the hardware of several different components and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be by the same hardware branch To embody.The use of word first, second, and third does not indicate that any sequence.These words can be explained and be run after fame Claim.

Claims (10)

1. a kind of focusing method, which is characterized in that including:
Determine starting point focusing electric current and terminal focusing electric current, and true according to starting point focusing electric current and terminal focusing electric current Fix midway point focusing electric current, the midpoint focusing electric current are focused electric current and value equal to starting point focusing electric current and the terminal Half;
According to the corresponding starting point clarity of starting point focusing electric current, the corresponding terminal clarity of terminal focusing electric current and institute The corresponding midpoint clarity of midpoint focusing electric current is stated, the starting point focusing electric current and terminal focusing electric current are updated;
If the updated starting point focusing electric current and terminal focusing electric current meet preset condition, according to updated The starting point focusing electric current and terminal focusing electric current determine best focusing electric current;
If updated starting point focusing electric current and terminal focusing electric current are unsatisfactory for the preset condition, return from The step of determining midpoint focusing electric current starts to execute, the electric current until the updated starting point focusing electric current and the terminal are focused Meet the preset condition.
2. the method as described in claim 1, which is characterized in that the determining starting point focusing electric current and terminal focusing electric current, packet It includes:
The minimum value for the focusing electric current supported using camera unit is as starting point focusing electric current, the focusing electric current supported with camera unit Maximum value as terminal focus electric current;Alternatively,
Rule of thumb data determine starting point focusing electric current and terminal focusing electric current.
3. the method as described in claim 1, which is characterized in that according to the starting point focus the corresponding starting point clarity of electric current, The terminal focusing corresponding terminal clarity of electric current and the corresponding midpoint clarity of midpoint focusing electric current, update is described to be risen Point focusing electric current and terminal focusing electric current, including:
Compare the starting point clarity, the midpoint clarity and the terminal clarity;
If the midpoint clarity is more than the starting point clarity, and the midpoint clarity is less than the terminal clarity, Electric current is then focused as updated starting point focusing electric current using the midpoint, the terminal focusing electric current is constant;
If the midpoint clarity is less than the starting point clarity, and the midpoint clarity is more than the terminal clarity, Electric current is then focused as updated terminal focusing electric current using the midpoint, the starting point focusing electric current is constant.
4. method as claimed in claim 3, which is characterized in that compare the starting point clarity, the midpoint clarity and After the terminal clarity, further include:
If the midpoint clarity is more than the starting point clarity, and the midpoint clarity is more than the terminal clarity, Stepping point focusing electric current is then determined according to midpoint focusing electric current, it is electric that the stepping point focusing electric current is equal to midpoint focusing Flow with default step-length current value and value;
According to the stepping point focusing corresponding stepping point clarity of electric current and the midpoint clarity, the starting point focusing is updated Electric current and terminal focusing electric current.
5. method as claimed in claim 4, which is characterized in that described according to the corresponding stepping point of stepping point focusing electric current Clarity and the midpoint clarity update the starting point focusing electric current and terminal focusing electric current, including:
Compare the stepping point clarity and the midpoint clarity;
If the stepping point clarity is more than the midpoint clarity, electric current is focused as updated using the stepping point Starting point focusing electric current, the terminal focusing electric current are constant;
If the stepping point clarity is less than the midpoint clarity, electric current is focused as updated using the stepping point Terminal focusing electric current, the starting point focusing electric current are constant.
6. the method as described in claim 1, which is characterized in that the updated starting point focusing electric current and the terminal Focusing electric current meets preset condition, including:
Difference between the updated starting point focusing electric current and terminal focusing electric current is less than preset difference value.
7. the method as described in claim 1, which is characterized in that described according to the updated starting point focusing electric current and described Terminal focusing electric current determines best focusing electric current, including:
Electric current is focused described in using updated starting point focusing electric current, updated terminal focusing electric current or updated midpoint Best focusing electric current, after the updated midpoint focusing electric current is equal to the updated starting point focusing electric current and the update Terminal focusing electric current and value half.
8. a kind of focusing mechanism, which is characterized in that including:
Determining module is focused electric current and described for determining that starting point focusing electric current and terminal are focused electric current, and according to the starting point Terminal focusing electric current determines that midpoint focusing electric current, the midpoint focusing electric current are equal to starting point focusing electric current and the terminal pair Burnt electric current and value half;
Update module, for corresponding according to the corresponding starting point clarity of starting point focusing electric current, terminal focusing electric current Terminal clarity and the corresponding midpoint clarity of midpoint focusing electric current, update the starting point focusing electric current and the terminal pair Burnt electric current;
Processing module, if meeting preset condition for the updated starting point focusing electric current and terminal focusing electric current, Best focusing electric current is then determined according to the updated starting point focusing electric current and terminal focusing electric current;
Module is returned to, if be unsatisfactory for for the updated starting point focusing electric current and terminal focusing electric current described default Condition is then returned and is executed since the step of electric current is focused at the determining midpoint, the electric current until the updated starting point is focused Meet the preset condition with terminal focusing electric current.
9. a kind of electronic equipment, including memory, processor and storage are on a memory and the calculating that can run on a processor Machine program, which is characterized in that the processor realizes claim 1-7 any methods when executing described program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor Claim 1-7 any methods are realized when execution.
CN201810570925.8A 2018-06-05 2018-06-05 A kind of focusing method, device, equipment and medium CN108429884A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810570925.8A CN108429884A (en) 2018-06-05 2018-06-05 A kind of focusing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810570925.8A CN108429884A (en) 2018-06-05 2018-06-05 A kind of focusing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN108429884A true CN108429884A (en) 2018-08-21

Family

ID=63164571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810570925.8A CN108429884A (en) 2018-06-05 2018-06-05 A kind of focusing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN108429884A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101918892A (en) * 2008-02-13 2010-12-15 高通股份有限公司 Auto-focus calibration for image capture device
WO2013172566A1 (en) * 2012-05-17 2013-11-21 Lg Innotek Co., Ltd. Camera module and method for auto focusing the same
CN103472658A (en) * 2012-06-06 2013-12-25 鸿富锦精密工业(深圳)有限公司 Auto-focusing method
CN103513396A (en) * 2012-06-20 2014-01-15 鸿富锦精密工业(深圳)有限公司 Focusing position search method
CN103838058A (en) * 2012-11-23 2014-06-04 鸿富锦精密工业(深圳)有限公司 Automatic focusing method
CN105700106A (en) * 2016-03-28 2016-06-22 华为技术有限公司 Automatic focusing method and automatic focusing device
CN105827944A (en) * 2015-11-25 2016-08-03 维沃移动通信有限公司 Focusing method and mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101918892A (en) * 2008-02-13 2010-12-15 高通股份有限公司 Auto-focus calibration for image capture device
WO2013172566A1 (en) * 2012-05-17 2013-11-21 Lg Innotek Co., Ltd. Camera module and method for auto focusing the same
CN103472658A (en) * 2012-06-06 2013-12-25 鸿富锦精密工业(深圳)有限公司 Auto-focusing method
CN103513396A (en) * 2012-06-20 2014-01-15 鸿富锦精密工业(深圳)有限公司 Focusing position search method
CN103838058A (en) * 2012-11-23 2014-06-04 鸿富锦精密工业(深圳)有限公司 Automatic focusing method
CN105827944A (en) * 2015-11-25 2016-08-03 维沃移动通信有限公司 Focusing method and mobile terminal
CN105700106A (en) * 2016-03-28 2016-06-22 华为技术有限公司 Automatic focusing method and automatic focusing device

Similar Documents

Publication Publication Date Title
US10192162B2 (en) Vector computation unit in a neural network processor
CN103942078B (en) The method and embedded device of a kind of load driver program
RU2724460C2 (en) Device, system and method of determining one or more optical parameters of a lens
EP2575346A1 (en) Device orientation dependent autofocus operations
EP3075993A1 (en) Method and device for setting an accelerator response
CN103294047B (en) For diagnosing the method and system of vehicle
US20110271182A1 (en) Eletronic apparatus and control method thereof
CN104516783B (en) Authority control method and device
WO2018196549A1 (en) Dual-core focusing image sensor, focusing control method for the same, and electronic device
KR20180109619A (en) Convolutional neural network processing method and apparatus
CN102905079B (en) For the method for pan-shot, device and mobile terminal
JP2011508268A (en) Method and apparatus with depth map generation
CN103136094A (en) Page testing method and device
CN104539844A (en) Terminal
CN105847665B (en) Dual camera capture apparatus and dual camera optical axis means for correcting
CN104995911A (en) Image processing device, image capture device, filter generating device, image restoration method, and program
US20090051310A1 (en) Closed Loop Stepper Motor Control
CN105677327B (en) A kind of method and system that page info preloads
CN105827944B (en) A kind of focusing method and mobile terminal
CN105955748B (en) The return scene process method and device of application program
US20150331569A1 (en) Device for controlling user interface, and method of controlling user interface thereof
US10027899B2 (en) Optical module with variable light-transmission area and electronic apparatus using the optical module
JP5338781B2 (en) Imaging device
US20110145308A1 (en) System to improve numereical conversions and associated methods
CN104133844A (en) Method and device for loading webpage

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