CN113747070A - Focusing method and device of camera module, terminal equipment and medium - Google Patents

Focusing method and device of camera module, terminal equipment and medium Download PDF

Info

Publication number
CN113747070A
CN113747070A CN202111060591.8A CN202111060591A CN113747070A CN 113747070 A CN113747070 A CN 113747070A CN 202111060591 A CN202111060591 A CN 202111060591A CN 113747070 A CN113747070 A CN 113747070A
Authority
CN
China
Prior art keywords
focusing
camera module
phase difference
positions
different
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.)
Pending
Application number
CN202111060591.8A
Other languages
Chinese (zh)
Inventor
江舜凡
张生杰
黄志�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kunshan Q Technology Co Ltd
Original Assignee
Kunshan Q Technology Co Ltd
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 Kunshan Q Technology Co Ltd filed Critical Kunshan Q Technology Co Ltd
Priority to CN202111060591.8A priority Critical patent/CN113747070A/en
Publication of CN113747070A publication Critical patent/CN113747070A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • H04N23/672Focus control based on electronic image sensor signals based on the phase difference signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

The invention discloses a focusing method, a focusing device, terminal equipment and a medium of a camera module, wherein the method comprises the following steps: acquiring phase differences of the camera module at different focusing positions; determining an initial focusing position of which the phase difference meets a preset condition according to the obtained phase difference at the different focusing positions; carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module; and moving the lens of the camera module to the target focusing position, so as to realize the focusing of the camera module. The invention can solve the technical problems of low focusing precision and inaccurate focusing in phase focusing in the prior art.

Description

Focusing method and device of camera module, terminal equipment and medium
Technical Field
The invention relates to the technical field of terminals, in particular to a focusing method and device of a camera module, terminal equipment and a medium.
Background
With the rapid development and the gradual popularization of terminal devices, the terminal devices have become one of the indispensable tools in people's lives. Especially, terminal equipment with a camera module is more popular among users. In order to obtain better shooting experience, people have higher and higher requirements on the shooting function of the terminal equipment.
The phase focusing method is a commonly used focusing method for a camera module in the existing terminal equipment. In the conventional relative focusing method, focusing is performed through the phase of an image. The phase can be used to estimate the distance (also called the focusing position) between the current lens focusing plane and the image sensor CMOS in the camera module, and then phase focusing is completed according to the estimated focusing position. However, in practice, it is found that the phase focusing method is affected by the testing environment, such as the environmental temperature, humidity and testing voltage, and the focusing precision is not high and the focusing is not accurate.
Disclosure of Invention
The embodiment of the application provides a focusing method of a camera module, and solves the technical problems of low focusing precision and inaccurate focusing in the phase focusing in the prior art.
In one aspect, the present application provides a focusing method for a camera module according to an embodiment of the present application, where the method includes:
acquiring phase differences of the camera module at different focusing positions;
determining an initial focusing position of which the phase difference meets a preset condition according to the obtained phase difference at the different focusing positions;
carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module;
and moving the lens of the camera module to the target focusing position, so as to realize the focusing of the camera module.
Optionally, the obtaining the phase difference of the camera module at different focusing positions includes:
acquiring test images shot by the camera module at different focusing positions;
extracting corresponding phase coordinates from each test image shot at different focusing positions;
and performing phase difference calculation on the phase coordinates in each extracted test image to correspondingly obtain the phase difference of the camera module at different focusing positions.
Optionally, the phase coordinates appear in pairs, the phase coordinates include coordinates of left phase pixel points and coordinates of right phase pixel points, and the left phase pixel points and the right phase pixel points have the same phase value.
Optionally, the acquiring the test images shot by the camera module at different focusing positions includes:
and pushing a motor of the camera module to shoot corresponding test images at different focusing positions.
Optionally, the determining, according to the obtained phase difference at the different focusing positions, an initial focusing position at which the phase difference satisfies a preset condition includes:
and determining an initial focusing position with zero phase difference according to the obtained phase difference at the different focusing positions.
Optionally, the determining, according to the obtained phase difference at the different focusing positions, an initial focusing position at which the phase difference is zero includes:
performing linear function fitting on the phase differences at the different focusing positions to obtain a fitting phase difference curve;
and determining the initial focusing position with the phase difference being zero from the fitted phase difference curve.
Optionally, before performing a first-order function fitting on the phase differences at the different focusing positions to obtain a fitted phase difference curve, the method further includes:
judging whether the phase differences at different focusing positions can be successfully subjected to linear function fitting or not;
and if so, continuing to perform the step of performing linear function fitting on the phase differences at the different focusing positions to obtain a fitted phase difference curve.
Optionally, the performing a focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module includes:
performing curve fitting of a preset interval within a preset range of the initial focusing position by using a contrast focusing method to obtain a fitted focusing curve;
and determining the vertex focusing position in the fitting focusing curve as the clearest target focusing position of the camera module.
On the other hand, the present application provides a focusing device of a camera module according to an embodiment of the present application, the device includes: the device comprises an acquisition module, a determination module, a debugging module and a focusing module, wherein:
the acquisition module is used for acquiring phase differences of the camera module at different focusing positions;
the determining module is used for determining an initial focusing position of which the phase difference meets a preset condition according to the obtained phase difference at the different focusing positions;
the debugging module is used for carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module;
the focusing module is used for moving the lens of the camera module to the target focusing position, so that the focusing of the camera module is realized.
Optionally, the obtaining module is specifically configured to:
acquiring test images shot by the camera module at different focusing positions;
extracting corresponding phase coordinates from each test image shot at different focusing positions;
and performing phase difference calculation on the phase coordinates in each extracted test image to correspondingly obtain the phase difference of the camera module at different focusing positions.
Optionally, the determining module is specifically configured to:
and determining an initial focusing position with zero phase difference according to the obtained phase difference at the different focusing positions.
Optionally, the determining module is specifically configured to:
performing linear function fitting on the phase differences at the different focusing positions to obtain a fitting phase difference curve;
and determining the initial focusing position with the phase difference being zero from the fitted phase difference curve.
On the other hand, the present application provides a terminal device according to an embodiment of the present application, where the terminal device includes: a processor, a memory, a communication interface, and a bus; the processor, the memory and the communication interface are connected through the bus and complete mutual communication; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the focusing method of the camera module.
On the other hand, the present application provides a computer-readable storage medium, which stores a program that executes the above-mentioned focusing method for a camera module when the program runs on a terminal device, through an embodiment of the present application.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
this application is through acquireing the camera module and focusing the phase difference of position department at the difference, according to acquireing the phase difference of position department is focused to the difference, determines the initial position of focusing that the phase difference satisfies the default condition, and it is right to utilize the contrast method of focusing initial focus position is focused and is readjusted, obtains the target of camera module is focused the position, will at last the camera lens of camera module removes extremely target focus position department, thereby realizes focusing of camera module. Therefore, the initial focusing position is roughly determined through phase focusing, the initial focusing position is finely adjusted through a contrast focusing method to obtain the final target focusing position with the highest definition, and the focusing adjustment of the camera module is finally carried out according to the target focusing position, so that the rapid focusing of the camera module is accurately and efficiently realized, and the technical problems of low focusing precision and inaccurate focusing in the phase focusing in the prior art are solved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a focusing method of a camera module according to an embodiment of the present disclosure.
Fig. 2 is a schematic diagram of a fitted focusing curve provided in an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a focusing device of a camera module according to an embodiment of the present disclosure.
Fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a focusing method of a camera module, and solves the technical problems of low focusing precision and inaccurate focusing in the phase focusing in the prior art.
In order to solve the technical problems, the general idea of the embodiment of the application is as follows: acquiring phase differences of the camera module at different focusing positions; determining an initial focusing position with zero phase difference according to the obtained phase difference at the different focusing positions; carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module; and moving the lens of the camera module to the target focusing position, so as to realize the focusing of the camera module.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
First, it is stated that the term "and/or" appearing herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Please refer to fig. 1, which is a schematic flow chart of a focusing method of a camera module according to an embodiment of the present application, where the method shown in fig. 1 includes the following steps:
s101, phase differences of the camera module at different focusing positions are obtained.
In an embodiment, during the focusing test process, the camera module can be used to capture corresponding test images at different focusing positions, and specifically, the camera module can be pushed by a motor to capture corresponding test images at different focusing positions. Furthermore, at least one pair of phase coordinates can be extracted from each test image at different focusing positions, at least one pair of phase coordinates is correspondingly extracted from each test image, the phase coordinates appear in pairs and specifically comprise coordinates of a left phase pixel point and coordinates of a right phase pixel point, and the left phase pixel point and the right phase pixel point have the same phase value. Finally, the phase difference calculation can be carried out on the phase coordinates in each test image, so that the phase differences of the camera module at different focusing positions can be correspondingly obtained.
S102, according to the obtained phase differences at the different focusing positions, determining an initial focusing position of which the phase difference meets a preset condition.
In a specific embodiment, the focusing position where the phase difference meets the preset condition can be found out from the phase differences at different focusing positions, and the focusing position is used as the initial focusing position when the camera module is focused. The preset condition is a focusing condition set by a system in a self-defined way, for example, the phase difference is zero.
In another embodiment, the present application can perform a linear function fitting on the phase differences at different focusing positions to obtain corresponding fitted phase difference curves. And determining the initial focusing position with the phase difference being zero from the fitted phase difference curve.
In an alternative embodiment, before performing the first-order function fitting, the present application may further determine that the phase differences at the different positions can be fitted to a first-order function curve, that is, whether the first-order function fitting can be successfully performed on the phase differences at the different focusing positions is determined. If yes, continuing to execute the step of performing the first-order function fitting on the phase difference at different focusing positions, otherwise ending the process or executing the step of S101 again.
For example, please refer to table 1 below to show the phase difference at one possible different focus positions.
TABLE 1
Position of Phase difference Target phase
619 2.6082 0.00
548 0.2231 0.00
S103, carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module.
In one embodiment, the present application may utilize a contrast focusing method to perform curve fitting of a predetermined distance within a predetermined range of the initial focusing position to obtain a corresponding fitted focusing curve. And then determining a target focusing position of the camera module from the fitted focusing curve, and specifically determining a vertex focusing position in the fitted focusing curve as a clearest target focusing position of the camera module.
In another specific embodiment, each focusing position corresponds to a code value, and the code value refers to a driving signal input to a driving chip by a central processing unit CPU when the camera is focused, and is used for controlling a focusing motor to move a lens to the corresponding focusing position for focusing. One code value corresponds to one moving distance (i.e., one in-focus position). Correspondingly, according to the initial code value corresponding to the initial focusing position, parabolic fitting (namely curve fitting) of a preset interval is carried out in a preset range of the initial code value by adopting a contrast focusing method, so that a corresponding fitting focusing curve is obtained. And then, the vertex code value in the fitting focusing curve is used as a target code value corresponding to the target focusing position with the highest definition, and the target focusing position of the camera module with the clearest definition is further determined.
For example, please refer to fig. 2, which shows a schematic diagram of a fitting focus curve. As shown in fig. 2, a vertex 1 in the fitted focusing curve is the target focusing position, and a position point 2 on the fitted focusing curve is the initial focusing position. See also table 2 below for focus data involved in one possible contrast focus calculation.
TABLE 2
Position of Focusing value
511 1648.0000
531 2472.0000
548 3345.0000
571 2908.0000
619 1138.0000
As can be seen from the example in table 2 above, the focusing position in this application can be 548, which is the clearest target focusing position of the camera module.
And S104, moving the lens of the camera module to the target focusing position, so as to realize focusing of the camera module.
This application will through promoting camera module's motor will camera module's camera lens adjustment extremely target focusing position department to quick, accurate realization camera module's auto focus.
By implementing the method, the phase difference of the camera module at different focusing positions is obtained; determining an initial focusing position of which the phase difference meets a preset condition according to the obtained phase difference at the different focusing positions; carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module; and moving the lens of the camera module to the target focusing position, so as to realize the focusing of the camera module. Therefore, the initial focusing position of the camera module can be roughly found by using a phase focusing method, the initial focusing position is finely adjusted by using a contrast focusing method to obtain the final target focusing position with the highest definition, and the focusing adjustment of the camera module is finally carried out according to the target focusing position, so that the rapid focusing of the camera module is accurately and efficiently realized, and the technical problems of low focusing precision and inaccurate focusing existing in the phase focusing in the prior art are solved.
Based on the same inventive concept, another embodiment of the present application provides a device and a terminal device for implementing the focusing method of the camera module in the embodiment of the present application.
Please refer to fig. 3, which is a schematic structural diagram of a focusing device of a camera module according to an embodiment of the present disclosure. The apparatus shown in fig. 3 comprises: an obtaining module 301, a determining module 302, a debugging module 303 and a focusing module 304, wherein:
the obtaining module 301 is configured to obtain phase differences of the camera module at different focusing positions;
the determining module 302 is configured to determine, according to the obtained phase differences at the different focusing positions, an initial focusing position where the phase difference meets a preset condition;
the debugging module 303 is configured to perform focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module;
the focusing module 304 is configured to move the lens of the camera module to the target focusing position, so as to realize focusing of the camera module.
Optionally, the obtaining module 301 is specifically configured to:
acquiring test images shot by the camera module at different focusing positions;
extracting corresponding phase coordinates from each test image shot at different focusing positions;
and performing phase difference calculation on the phase coordinates in each extracted test image to correspondingly obtain the phase difference of the camera module at different focusing positions.
Optionally, the determining module 302 is specifically configured to:
and determining an initial focusing position with zero phase difference according to the obtained phase difference at the different focusing positions.
Optionally, the determining module 302 is specifically configured to:
performing linear function fitting on the phase differences at the different focusing positions to obtain a fitting phase difference curve;
and determining the initial focusing position with the phase difference being zero from the fitted phase difference curve.
Optionally, the apparatus further comprises a determining module 305, wherein:
the judging module 305 is configured to judge whether the linear function fitting can be successfully performed on the phase differences at the different focusing positions; if yes, the determining module 302 is notified to continue to perform the step of performing the first-order function fitting on the phase differences at the different focusing positions to obtain a fitted phase difference curve.
Optionally, the debugging module 303 is specifically configured to:
performing curve fitting of a preset interval within a preset range of the initial focusing position by using a contrast focusing method to obtain a fitted focusing curve;
and determining the vertex focusing position in the fitting focusing curve as the clearest target focusing position of the camera module.
Please refer to fig. 4, which is a schematic structural diagram of a terminal device according to an embodiment of the present application. The terminal device 40 shown in fig. 4 includes: at least one processor 401, a communication interface 402, a user interface 403 and a memory 404, wherein the processor 401, the communication interface 402, the user interface 403 and the memory 404 may be connected by a bus or other means, and the embodiment of the present invention is exemplified by being connected by a bus 405. Wherein,
processor 401 may be a general-purpose processor such as a Central Processing Unit (CPU).
The communication interface 402 may be a wired interface (e.g., an ethernet interface) or a wireless interface (e.g., a cellular network interface or using a wireless local area network interface) for communicating with other terminals or websites. In this embodiment of the present invention, the communication interface 402 is specifically configured to obtain a phase difference or a test image.
The user interface 403 may be a touch panel, including a touch screen and a touch screen, for detecting an operation instruction on the touch panel, and the user interface 403 may also be a physical button or a mouse. The user interface 403 may also be a display screen for outputting, displaying images or data.
The Memory 404 may include Volatile Memory (Volatile Memory), such as Random Access Memory (RAM); the Memory may also include a Non-Volatile Memory (Non-Volatile Memory), such as a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, HDD), or a Solid-State Drive (SSD); the memory 404 may also comprise a combination of memories of the kind described above. The memory 404 is used for storing a set of program codes, and the processor 401 is used for calling the program codes stored in the memory 404 and executing the following operations:
acquiring phase differences of the camera module at different focusing positions;
determining an initial focusing position of which the phase difference meets a preset condition according to the obtained phase difference at the different focusing positions;
carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module;
and moving the lens of the camera module to the target focusing position, so as to realize the focusing of the camera module.
Optionally, the obtaining the phase difference of the camera module at different focusing positions includes:
acquiring test images shot by the camera module at different focusing positions;
extracting corresponding phase coordinates from each test image shot at different focusing positions;
and performing phase difference calculation on the phase coordinates in each extracted test image to correspondingly obtain the phase difference of the camera module at different focusing positions.
Optionally, the phase coordinates appear in pairs, the phase coordinates include coordinates of left phase pixel points and coordinates of right phase pixel points, and the left phase pixel points and the right phase pixel points have the same phase value.
Optionally, the acquiring the test images shot by the camera module at different focusing positions includes:
and pushing a motor of the camera module to shoot corresponding test images at different focusing positions.
Optionally, the determining, according to the obtained phase difference at the different focusing positions, an initial focusing position at which the phase difference meets a preset condition includes:
and determining an initial focusing position with zero phase difference according to the obtained phase difference at the different focusing positions.
Optionally, the determining, according to the obtained phase difference at the different focusing positions, an initial focusing position at which the phase difference is zero includes:
performing linear function fitting on the phase differences at the different focusing positions to obtain a fitting phase difference curve;
and determining the initial focusing position with the phase difference being zero from the fitted phase difference curve.
Optionally, before performing a first-order function fitting on the phase differences at the different focusing positions to obtain a fitted phase difference curve, the processor 401 is further configured to:
judging whether the phase differences at different focusing positions can be successfully subjected to linear function fitting or not;
and if so, continuing to perform the step of performing linear function fitting on the phase differences at the different focusing positions to obtain a fitted phase difference curve.
Optionally, the performing a focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module includes:
performing curve fitting of a preset interval within a preset range of the initial focusing position by using a contrast focusing method to obtain a fitted focusing curve;
and determining the vertex focusing position in the fitting focusing curve as the clearest target focusing position of the camera module.
Since the terminal device described in this embodiment is a terminal device used for implementing the focusing method of the camera module in this embodiment, based on the focusing method of the camera module described in this embodiment, a person skilled in the art can understand the specific implementation manner of the terminal device of this embodiment and various variations thereof, and therefore, how to implement the method in this embodiment by the terminal device is not described in detail here. The terminal device used by a person skilled in the art to implement the method for processing information in the embodiment of the present application is within the scope of the protection intended by the present application.
The technical scheme in the embodiment of the application at least has the following technical effects or advantages: this application is through acquireing the camera module and focusing the phase difference of position department at the difference, according to acquireing the phase difference of position department is focused to the difference, determines the initial position of focusing that the phase difference satisfies the default condition, and it is right to utilize the contrast method of focusing initial focus position is focused and is readjusted, obtains the target of camera module is focused the position, will at last the camera lens of camera module removes extremely target focus position department, thereby realizes focusing of camera module. Therefore, the initial focusing position is roughly determined through phase focusing, the initial focusing position is finely adjusted through a contrast focusing method to obtain the final target focusing position with the highest definition, and the focusing adjustment of the camera module is finally carried out according to the target focusing position, so that the rapid focusing of the camera module is accurately and efficiently realized, and the technical problems of low focusing precision and inaccurate focusing in the phase focusing in the prior art are solved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. The focusing method of the camera module is characterized by comprising the following steps:
acquiring phase differences of the camera module at different focusing positions;
determining an initial focusing position of which the phase difference meets a preset condition according to the obtained phase difference at the different focusing positions;
carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module;
and moving the lens of the camera module to the target focusing position, so as to realize the focusing of the camera module.
2. The method for focusing a camera module according to claim 1, wherein the obtaining the phase difference of the camera module at different focusing positions comprises:
acquiring test images shot by the camera module at different focusing positions;
extracting corresponding phase coordinates from each test image shot at different focusing positions;
and performing phase difference calculation on the phase coordinates in each extracted test image to correspondingly obtain the phase difference of the camera module at different focusing positions.
3. The method for focusing the camera module according to claim 1, wherein the determining an initial focusing position where the phase difference satisfies a preset condition according to the obtained phase difference at the different focusing positions comprises:
and determining an initial focusing position with zero phase difference according to the obtained phase difference at the different focusing positions.
4. The method for focusing the camera module according to claim 3, wherein the determining an initial focusing position where the phase difference is zero according to the obtained phase differences at the different focusing positions comprises:
performing linear function fitting on the phase differences at the different focusing positions to obtain a fitting phase difference curve;
and determining the initial focusing position with the phase difference being zero from the fitted phase difference curve.
5. The method of claim 4, wherein before the performing a first-order function fitting on the phase differences at the different focusing positions to obtain a fitted phase difference curve, the method further comprises:
judging whether the phase differences at different focusing positions can be successfully subjected to linear function fitting or not;
and if so, continuing to perform the step of performing linear function fitting on the phase differences at the different focusing positions to obtain a fitted phase difference curve.
6. The method for focusing a camera module according to claim 1, wherein the performing a focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module comprises:
performing curve fitting of a preset interval within a preset range of the initial focusing position by using a contrast focusing method to obtain a fitted focusing curve;
and determining the vertex focusing position in the fitting focusing curve as the clearest target focusing position of the camera module.
7. The utility model provides a focusing device of camera module which characterized in that, focusing device of camera module includes: the device comprises an acquisition module, a determination module, a debugging module and a focusing module, wherein:
the acquisition module is used for acquiring phase differences of the camera module at different focusing positions;
the determining module is used for determining an initial focusing position of which the phase difference meets a preset condition according to the obtained phase difference at the different focusing positions;
the debugging module is used for carrying out focusing readjustment on the initial focusing position by using a contrast focusing method to obtain a target focusing position of the camera module;
the focusing module is used for moving the lens of the camera module to the target focusing position, so that the focusing of the camera module is realized.
8. The focusing device of a camera module according to claim 7, wherein the obtaining module is specifically configured to:
acquiring test images shot by the camera module at different focusing positions;
extracting corresponding phase coordinates from each test image shot at different focusing positions;
and performing phase difference calculation on the phase coordinates in each extracted test image to correspondingly obtain the phase difference of the camera module at different focusing positions.
9. A terminal device, characterized in that the terminal device comprises: a processor, a memory, a communication interface, and a bus; the processor, the memory and the communication interface are connected through the bus and complete mutual communication; the memory stores executable program code; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the focusing method of the camera module set as claimed in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a program that executes the focusing method of the camera module according to any one of claims 1 to 6 when the program is run on a terminal device.
CN202111060591.8A 2021-09-10 2021-09-10 Focusing method and device of camera module, terminal equipment and medium Pending CN113747070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111060591.8A CN113747070A (en) 2021-09-10 2021-09-10 Focusing method and device of camera module, terminal equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111060591.8A CN113747070A (en) 2021-09-10 2021-09-10 Focusing method and device of camera module, terminal equipment and medium

Publications (1)

Publication Number Publication Date
CN113747070A true CN113747070A (en) 2021-12-03

Family

ID=78737902

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111060591.8A Pending CN113747070A (en) 2021-09-10 2021-09-10 Focusing method and device of camera module, terminal equipment and medium

Country Status (1)

Country Link
CN (1) CN113747070A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105007425A (en) * 2015-07-23 2015-10-28 广东欧珀移动通信有限公司 Contrast type focusing method and mobile terminal
CN106464807A (en) * 2014-06-13 2017-02-22 英特尔公司 Reliability measurements for phase based autofocus
CN107124555A (en) * 2017-05-31 2017-09-01 广东欧珀移动通信有限公司 Control method, device, computer equipment and the computer-readable recording medium of focusing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106464807A (en) * 2014-06-13 2017-02-22 英特尔公司 Reliability measurements for phase based autofocus
CN105007425A (en) * 2015-07-23 2015-10-28 广东欧珀移动通信有限公司 Contrast type focusing method and mobile terminal
CN107124555A (en) * 2017-05-31 2017-09-01 广东欧珀移动通信有限公司 Control method, device, computer equipment and the computer-readable recording medium of focusing

Similar Documents

Publication Publication Date Title
CN109166156B (en) Camera calibration image generation method, mobile terminal and storage medium
CN106657988B (en) It is automatically positioned Camera Test method and apparatus, the computer equipment of test pattern
KR20160048140A (en) Method and apparatus for generating an all-in-focus image
CN103235397B (en) A kind of Atomatic focusing method and equipment
CN104215216B (en) A kind of range unit and terminal
CN109712193B (en) Method and device for determining field angle of dome camera
CN110784659B (en) Exposure control method and device and storage medium
US9838594B2 (en) Irregular-region based automatic image correction
CN109658346B (en) Image restoration method and device, computer-readable storage medium and electronic equipment
CN105091847B (en) The method and electronic equipment of a kind of measurement distance
CN109102026B (en) Vehicle image detection method, device and system
CN104811608A (en) Image capturing apparatus and image defect correction method thereof
US20170212327A1 (en) Focus hunting prevention for phase detection auto focus (af)
CN109996005B (en) Focus correction method and device
CN111654637B (en) Focusing method, focusing device and terminal equipment
CN104215215B (en) A kind of distance-finding method
US9091821B2 (en) Device and method of focusing on points of objects
CN110858814B (en) Control method and device for intelligent household equipment
CN113920083A (en) Image-based size measurement method and device, electronic equipment and storage medium
CN109788199B (en) Focusing method suitable for terminal with double cameras
CN112153271B (en) Control method and control device for optical lens of electronic equipment and storage medium
CN113747070A (en) Focusing method and device of camera module, terminal equipment and medium
CN106161951B (en) A kind of focusing method, device and mobile terminal
CN115797267A (en) Image quality evaluation method, system, electronic device, and storage medium
US20210160420A1 (en) Determination device, control device, photographing device, determination method, and program

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20211203