CN106161952B - A kind of focusing method, device and mobile terminal - Google Patents
A kind of focusing method, device and mobile terminal Download PDFInfo
- Publication number
- CN106161952B CN106161952B CN201610645728.9A CN201610645728A CN106161952B CN 106161952 B CN106161952 B CN 106161952B CN 201610645728 A CN201610645728 A CN 201610645728A CN 106161952 B CN106161952 B CN 106161952B
- Authority
- CN
- China
- Prior art keywords
- phase detection
- data
- detection data
- linked list
- focusing
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000001514 detection method Methods 0.000 claims abstract description 195
- 230000007613 environmental effect Effects 0.000 claims description 29
- 238000004364 calculation method Methods 0.000 claims description 10
- 230000002708 enhancing effect Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000001960 triggered effect Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/67—Focus control based on electronic image sensor signals
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
The embodiment of the invention discloses a kind of focusing method, device and mobile terminals, wherein instructs this method comprises: receiving to the focusing of shooting image;The focusing instruction is responded, the phase-detection data of the corresponding frame image of the shooting image are obtained;When the number of the phase-detection data of the frame image of acquisition reaches preset quantity threshold, the average value for reaching the phase-detection data of the quantity threshold is calculated;It is focused based on the average value to the shooting image.Implement the embodiment of the present invention, the reliability for the phase-detection data that can be obtained by enhancing, to promote focusing accuracy.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a focusing method and apparatus, and a mobile terminal.
Background
With the continuous development of terminal technology and image processing technology, the photographing function of a terminal such as a mobile phone is used more and more frequently, and convenience is brought to a user for recording life. At present, the focusing modes of a mobile phone are many, such as phase focusing (PDAF for short), and the principle is to reserve some shielding pixel points on a photosensitive element for phase detection, and determine a focusing offset value by detecting the distance between pixels and the change thereof, so as to implement accurate focusing.
In an actual focusing process, since the phase data of the pixels are collected and affected by noise points, external light and other factors, the phase detection data output is unstable, as shown in fig. 1, the obtained phase detection data is not smooth, so that the focusing performed according to the phase detection data is unreliable, and the focusing accuracy is low.
Disclosure of Invention
The embodiment of the invention provides a focusing method, a focusing device and a mobile terminal, which can improve the focusing accuracy by enhancing the reliability of acquired phase detection data.
In a first aspect, an embodiment of the present invention discloses a focusing method, including:
receiving a focusing instruction for a shot image;
responding to the focusing instruction, and acquiring phase detection data of a frame image corresponding to the shot image;
when the number of the phase detection data of the acquired frame image reaches a preset number threshold, calculating the average value of the phase detection data reaching the number threshold;
focusing the shot image based on the average value.
Optionally, the method further includes:
creating a data linked list for storing the phase detection data, wherein the maximum number of phase detection data stored by the data linked list is the same as the number threshold;
when the number of the phase detection data of the acquired frame image reaches a preset number threshold, calculating an average value of the phase detection data reaching the number threshold, including:
and when the data linked list is stored to the maximum number of phase detection data, calculating the average value of the phase detection data in the data linked list.
Optionally, when the data linked list stores the maximum number of phase detection data, calculating an average value of the phase detection data in the data linked list, including:
when the data linked list is stored to the maximum number of phase detection data, phase detection data of a new frame image are obtained;
updating the data linked list according to the new phase detection data, wherein the updating comprises adding the new phase detection data into the data linked list and deleting the phase detection data with the longest storage time in the data linked list;
and calculating the average value of the phase detection data in the updated data linked list.
Optionally, the number of the phase detection data added to the data link table is the same as the number of the phase detection data deleted in the data link table.
Optionally, the method further includes:
acquiring an environment parameter corresponding to a current environment, wherein the environment parameter comprises a noise point parameter and/or an environment light brightness parameter;
setting the number threshold according to the environmental parameter.
In a second aspect, an embodiment of the present invention further discloses a focusing apparatus, including:
the instruction receiving module is used for receiving a focusing instruction of the shot image;
the first acquisition module is used for responding to the focusing instruction and acquiring phase detection data of a frame image corresponding to the shot image;
the calculating module is used for calculating the average value of the phase detection data reaching the number threshold when the number of the phase detection data of the frame image acquired by the first acquiring module reaches the preset number threshold;
and the focusing module is used for focusing the shot image based on the average value.
Optionally, the apparatus further comprises:
a creating module, configured to create a data linked list used for storing the phase detection data, where a maximum number of phase detection data stored in the data linked list is the same as the number threshold;
the calculation module is specifically configured to:
and when the data linked list is stored to the maximum number of phase detection data, calculating the average value of the phase detection data in the data linked list.
Optionally, the calculation module is specifically configured to:
when the data linked list is stored to the maximum number of phase detection data, phase detection data of a new frame image are obtained;
updating the data linked list according to the new phase detection data, wherein the updating comprises adding the new phase detection data into the data linked list and deleting the phase detection data with the longest storage time in the data linked list;
and calculating the average value of the phase detection data in the updated data linked list.
Optionally, the number of the phase detection data added to the data link table is the same as the number of the phase detection data deleted in the data link table.
Optionally, the apparatus further comprises:
the second acquisition module is used for acquiring environmental parameters corresponding to the current environment, wherein the environmental parameters comprise noise parameters and/or environmental light brightness parameters;
and the setting module is used for setting the number threshold according to the environment parameters acquired by the second acquisition module.
In a third aspect, an embodiment of the present invention further discloses a mobile terminal, including an input device, a memory, and a processor, where the processor is connected to the input device and the memory respectively; wherein,
the memory is used for storing an application program;
the processor is used for calling the application program stored in the memory to execute:
receiving a focusing instruction for a shot image through the input device;
responding to the focusing instruction, and acquiring phase detection data of a frame image corresponding to the shot image;
when the number of the phase detection data of the acquired frame image reaches a preset number threshold, calculating the average value of the phase detection data reaching the number threshold;
focusing the shot image based on the average value.
Optionally, the processor may call an application program stored in the memory to perform part or all of the steps of the focusing method of the first aspect.
The embodiment of the invention has the following beneficial effects:
in the embodiment of the present invention, when a focusing instruction for a captured image is received, phase detection data of a frame image corresponding to the captured image may be obtained, and when the number of the obtained phase detection data of the frame image reaches a preset number threshold, an average value of the obtained phase detection data may be calculated, so as to focus the captured image based on the calculated average value, thereby improving reliability of the obtained phase detection data, and further improving focusing accuracy when focusing is performed based on the phase detection data.
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 embodiments will be briefly described 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 that other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a diagram of the output of a phase detection data in the prior art;
FIG. 2 is a flowchart illustrating a focusing method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another focusing method according to an embodiment of the present invention;
FIG. 4 is a diagram of an output of phase detection data provided by an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a focusing device according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of another focusing device provided in the embodiments of the present invention;
fig. 7 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "comprises" and "comprising," and any variations thereof, in the description and claims of this invention and the above-described drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the listed steps or modules but may alternatively include other steps or modules not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
It should be understood that the technical solution of the embodiment of the present invention may be specifically applied to Mobile phones (e.g., Android phones, iOS phones, etc.), tablet computers, Mobile Internet Devices (Mobile Internet Devices, abbreviated as "MID"), Personal Digital assistants (Personal Digital assistants, abbreviated as "PDA"), cameras, and other Mobile terminals (Terminal) having a shooting function. The Mobile terminal may also be referred to as User Equipment (UE), a terminal, a wireless terminal or a Mobile Station (MS), and the like, which are not limited in the embodiments of the present invention.
The embodiment of the invention discloses a focusing method, a focusing device and a mobile terminal, which can improve the focusing accuracy by enhancing the reliability of acquired phase detection data. The details are described below.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a focusing method according to an embodiment of the invention. Specifically, the method according to the embodiment of the present invention may be specifically applied to the mobile terminal described above. As shown in fig. 2, the focusing method according to the embodiment of the present invention may include the following steps:
101. and receiving a focusing instruction of the shot image.
102. And responding to the focusing instruction, and acquiring phase detection data of the frame image corresponding to the shot image.
In a specific embodiment, when the terminal needs to execute a shooting function and receives a focusing instruction for a shot image, phase detection data of each frame image corresponding to the shot image, which is obtained by a moving motor, can be obtained, the phase detection data is stored, and the number of the phase data of the obtained frame image can be counted. Optionally, the focusing instruction may be triggered automatically after a shooting application of the terminal is opened, or triggered by a user clicking a terminal screen, and the like, which is not limited in the embodiment of the present invention.
103. When the number of the phase detection data of the acquired frame image reaches a preset number threshold, calculating an average value of the phase detection data reaching the number threshold.
In a specific embodiment, the average value calculation may be performed once every time the threshold number of sets of phase detection data are obtained, and the calculated average value may be stored to perform focusing based on the average value. Alternatively, the phase detection data of the two adjacent calculated averages may partially overlap.
The average value includes any one of an arithmetic average value, a geometric average value, a square average value, a harmonic average value, and a weighted average value, which is not limited in the embodiments of the present invention.
Optionally, the terminal may further obtain an environmental parameter corresponding to a current environment in which the captured image is located, where the environmental parameter may include a noise parameter and/or an environmental light brightness parameter, and the like, and thus the number threshold may be set according to the obtained environmental parameter, so as to improve accuracy of phase detection data used for performing focusing calculation.
104. Focusing the shot image based on the average value.
In an embodiment, after obtaining the average value of the phase detection data, the focusing operation may be performed based on the average value. The obtained phase detection data are averaged, which is equivalent to one-time small filtering, so that the phase detection data become smoother, the influence of environmental parameters is reduced, and the accuracy of phase focusing is effectively improved.
In the embodiment of the present invention, when a focusing instruction for a captured image is received, phase detection data of a frame image corresponding to the captured image may be acquired, and when the number of the acquired phase detection data of the frame image reaches a preset number threshold, an average value of the acquired phase detection data may be calculated, so as to focus the captured image based on the calculated average value, thereby improving reliability of the acquired phase detection data, and thus improving focusing accuracy when focusing is performed based on the phase detection data.
Further, please refer to fig. 3, fig. 3 is a flowchart illustrating another focusing method according to an embodiment of the present invention. Specifically, as shown in fig. 3, the focusing method according to the embodiment of the present invention may include the following steps:
201. a data link table is created for storing phase detection data.
Specifically, the maximum number of phase detection data (hereinafter referred to as "PD data") that can be stored in the data link table is the same as the number threshold. That is, the data linked list can only store PD data of the number of threshold sets, and when the data linked list is full (that is, PD data of the number of threshold sets has already been stored), and new PD data is acquired and stored, part of data in the data linked list needs to be deleted to update the data linked list. Optionally, the PD data in the data link list may be stored in a first-in first-out manner.
202. And receiving a focusing instruction of the shot image.
203. And responding to the focusing instruction, acquiring the phase detection data of the frame image corresponding to the shot image, and storing the phase detection data to the data linked list.
204. And when the data linked list is stored to the maximum number of phase detection data, calculating the average value of the phase detection data in the data linked list.
Optionally, the terminal may further obtain an environmental parameter corresponding to the current shooting environment of the terminal, where the environmental parameter may include a noise parameter and/or an environmental light brightness parameter, and the like, and thus the maximum number of data that can be stored in the data linked list may be set according to the obtained environmental parameter, that is, the size of the data linked list is set. For example, when the current environmental parameters have a large influence on PD data, a large number threshold may be set for the data linked list, that is, a large data linked list is set; on the contrary, when the influence of the current environment parameters on the PD data is small, a small data linked list may be set to improve the accuracy of the phase detection data for performing the focusing calculation.
205. Phase detection data of a new frame image is acquired.
206. And updating the data linked list according to the new phase detection data.
And updating the PD data, wherein the updating comprises adding the new PD data into the data linked list and deleting the PD data with the longest storage time in the data linked list. Further, the number of the PD data added to the data link list is the same as the number of the PD data deleted in the data link list.
207. And calculating the average value of the phase detection data in the updated data linked list.
208. Focusing the shot image based on the obtained average value.
For example, assuming that the data link list can store 10 frames of PD data, when the data link list is fully loaded, a total of 10 frames of PD data in the data link list are averaged from 1 to 10. When 11 frames of PD data are acquired, the 11 frames of PD data are added to the data link list, and the 1 st frame of PD data stored in the data link list is deleted, when 12 frames of PD data are acquired, the 12 th frame of PD data are added to the data link list, the 2 nd frame of PD data in the data link list, that is, "first in first out," is deleted, 10 frames of data in the link list are maintained, and 10 frames of data in the link list are averaged, so that the PD data are smoother, as shown in fig. 4. The abscissa may be a focus position (or a motor moving distance), and the ordinate is a defocus value (e.g., a displacement between an out-of-focus position and an in-focus position after moving the motor). Therefore, the influence of noise, ambient light and other external environments on PD data is reduced, and rapid and accurate focusing is realized.
In the embodiment of the invention, the data linked list can be created, so that when a focusing instruction for the shot image is received, the PD data of the frame image corresponding to the shot image can be acquired and stored in a first-in first-out mode through the data linked list, and the shot image is focused by calculating the average value of the PD data in the data linked list and based on the calculated average value, so as to improve the accuracy of phase focusing. According to the embodiment of the invention, the acquired PD data are averaged, which is equivalent to one-time small filtering, so that the PD data become smooth, and the focusing is performed on the shot image based on the calculated average value, so that the problem of inaccurate focusing caused by unstable PD data output due to the fact that each frame of PD data is influenced by environmental factors such as noise, ambient light and the like is effectively solved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a focusing device according to an embodiment of the present invention. Specifically, the apparatus according to the embodiment of the present invention may be disposed in the mobile terminal. As shown in fig. 5, the focusing apparatus according to the embodiment of the present invention may include an instruction receiving module 11, a first obtaining module 12, a calculating module 13, and a focusing module 14. Wherein,
the instruction receiving module 11 is configured to receive a focusing instruction for a captured image.
The first obtaining module 12 is configured to respond to the focusing instruction to obtain phase detection data of a frame image corresponding to the captured image.
Specifically, when the shooting function needs to be executed, and the command receiving module 11 receives a focusing command for a shot image, the first obtaining module 12 may be triggered to obtain the phase detection data of each frame of image corresponding to the shot image obtained by the moving motor, store the phase detection data, and count the number of the phase data of the obtained frame of image. Optionally, the focusing instruction may be triggered automatically after a shooting application of the terminal is opened, or triggered by a user clicking a terminal screen, and the like, which is not limited in the embodiment of the present invention.
The calculating module 13 is configured to calculate an average value of the phase detection data reaching a preset number threshold when the number of the phase detection data of the frame image acquired by the first acquiring module 12 reaches the preset number threshold.
The focusing module 14 is configured to focus the shot image based on the average value.
In an embodiment, the calculating module 13 may perform an average value calculation once when the threshold number group of phase detection data is obtained, and store the calculated average value, so that the focusing module 14 may perform focusing based on the average value to improve the focusing accuracy. Alternatively, the phase detection data of the two adjacent calculated averages may partially overlap.
The average value includes any one of an arithmetic average value, a geometric average value, a square average value, a harmonic average value, and a weighted average value, which is not limited in the embodiments of the present invention.
In the embodiment of the present invention, when a focusing instruction for a captured image is received, phase detection data of a frame image corresponding to the captured image may be acquired, and when the number of the acquired phase detection data of the frame image reaches a preset number threshold, an average value of the acquired phase detection data may be calculated, so as to focus the captured image based on the calculated average value, thereby improving the reliability of the acquired phase detection data and the focusing accuracy when focusing is performed based on the phase detection data.
Further, please refer to fig. 6, fig. 6 is a schematic structural diagram of another focusing device according to an embodiment of the present invention. Specifically, the apparatus according to the embodiment of the present invention may include the instruction receiving module 11, the first obtaining module 12, the calculating module 13, and the focusing module 14 of the focusing apparatus according to the embodiment of the present invention shown in fig. 5. Further, in the embodiment of the present invention, the apparatus further includes:
a creating module 15, configured to create a data linked list for storing the phase detection data;
the calculation module 13 may be specifically configured to:
and when the data linked list is stored to the maximum number of phase detection data, calculating the average value of the phase detection data in the data linked list.
Further, in the embodiment of the present invention, the calculating module 13 may specifically be configured to:
when the data linked list is stored to the maximum number of phase detection data, phase detection data of a new frame image are obtained;
updating the data linked list according to the new phase detection data;
and calculating the average value of the phase detection data in the updated data linked list.
And updating the phase detection data, wherein the updating comprises adding the new phase detection data into the data chain table and deleting the phase detection data with the longest storage time in the data chain table. Further, the number of the phase detection data added to the data link list is the same as the number of the phase detection data deleted from the data link list, that is, the phase detection data in the data link list may be stored in a first-in first-out manner.
Specifically, the maximum number of phase detection data that can be stored in the data link table is the same as the number threshold. That is, the data linked list can only store the phase detection data of the number of threshold value sets, and when the data linked list is full (i.e. the phase detection data of the number of threshold value sets are already stored), and new phase detection data is obtained and stored, the calculating module 13 may delete the phase detection data with the longest storage time in the data linked list, i.e. "first in first out", to update the data linked list and keep the full state. So that the focusing module 14 can focus based on the average value.
Further optionally, in an embodiment of the present invention, the apparatus may further include:
a second obtaining module 16, configured to obtain an environmental parameter corresponding to a current environment, where the environmental parameter includes a noise parameter and/or an environmental light brightness parameter;
a setting module 17, configured to set the number threshold according to the environment parameter acquired by the second acquiring module 16.
Specifically, the terminal may further obtain, through the second obtaining module 16, an environmental parameter corresponding to a current environment where the captured image is located, where the environmental parameter may include a noise parameter and/or an environmental light brightness parameter, and the setting module 17 may set the number threshold, that is, set the size of the data linked list, according to the obtained environmental parameter. For example, when the current environmental parameter has a large influence on the phase detection data, the setting module 17 may set a large number threshold for the data linked list, that is, a large data linked list; on the contrary, when the influence of the current environment parameter on the phase detection data is small, the setting module 17 may set a small data linked list to improve the accuracy of the phase detection data for performing the focusing calculation.
In the embodiment of the invention, the data linked list can be created, so that when a focusing instruction for the shot image is received, the phase detection data of the frame image corresponding to the shot image can be obtained and stored in a first-in first-out mode through the data linked list, and therefore, the accuracy of phase focusing is improved by calculating the average value of the phase detection data in the data linked list and focusing the shot image based on the calculated average value. According to the embodiment of the invention, the obtained phase detection data are averaged, which is equivalent to one-time small filtering, so that the phase detection data become smooth, and the shot image is focused based on the calculated average value, so that the problem of inaccurate focusing caused by unstable phase detection data output due to the influence of environmental factors such as noise, ambient light and the like on each frame of phase detection data is effectively solved.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention, configured to execute the above focusing method. Specifically, as shown in fig. 7, the mobile terminal (abbreviated as "terminal") according to the embodiment of the present invention may include: at least one processor 100, at least one input device 200, at least one output device 300, memory 500, etc. Wherein the components are communicatively coupled via one or more buses 400. Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 7 is not intended to limit embodiments of the present invention, and may be a bus configuration, a star configuration, a combination of more or fewer components than those shown, or a different arrangement of components. Wherein:
the processor 100 is a control center of the terminal, connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing programs and/or modules stored in the memory 500 and calling data stored in the memory 500, such as the phase detection data described above. The processor 100 may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 100 may include only a Central Processing Unit (CPU), or may be a combination of a CPU, a Digital Signal Processor (DSP), a Graphics Processing Unit (GPU), and various control chips. In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
The input device 200 may include a standard touch screen, keyboard, camera, etc., and may also include a wired interface, wireless interface, etc.
The output device 300 may include a display screen, a speaker, etc., and may also include a wired interface, a wireless interface, etc.
The memory 500 may be used to store software programs and modules, and the processor 100, the input device 200, and the output device 300 execute various functional applications of the terminal and implement data processing by calling the software programs and modules stored in the memory 500. The memory 500 mainly includes a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the data storage area may store data created according to the use of the terminal, and the like. In the embodiment of the present invention, the operating system may be an Android system, an iOS system, a Windows operating system, or the like.
Specifically, the processor 100 calls an application program stored in the memory 500 to execute the following steps:
receiving a focusing instruction for a shot image;
responding to the focusing instruction, and acquiring phase detection data of a frame image corresponding to the shot image;
when the number of the phase detection data of the acquired frame image reaches a preset number threshold, calculating the average value of the phase detection data reaching the number threshold;
focusing the shot image based on the average value.
Optionally, the processor 100 calls an application program stored in the memory 500, and is further configured to perform the following steps:
creating a data linked list for storing the phase detection data, wherein the maximum number of phase detection data stored by the data linked list is the same as the number threshold;
the processor 100 calls an application program stored in the memory 500 to perform the following steps of calculating an average value of the phase detection data reaching a preset number threshold when the number of the phase detection data of the acquired frame image reaches the preset number threshold:
and when the data linked list is stored to the maximum number of phase detection data, calculating the average value of the phase detection data in the data linked list.
Further optionally, the processor 100 invokes an application program stored in the memory 500 to perform the calculating an average value of the phase detection data in the data chain table when the data chain table stores up to the maximum number of phase detection data, including:
when the data linked list is stored to the maximum number of phase detection data, phase detection data of a new frame image are obtained;
updating the data linked list according to the new phase detection data, wherein the updating comprises adding the new phase detection data into the data linked list and deleting the phase detection data with the longest storage time in the data linked list;
and calculating the average value of the phase detection data in the updated data linked list.
Optionally, the number of the phase detection data added to the data link table is the same as the number of the phase detection data deleted in the data link table.
Further optionally, the processor 100 calls an application program stored in the memory 500, and is further configured to perform the following steps:
acquiring an environment parameter corresponding to a current environment, wherein the environment parameter comprises a noise point parameter and/or an environment light brightness parameter;
setting the number threshold according to the environmental parameter.
In the embodiment of the present invention, when a focusing instruction for a captured image is received, phase detection data of a frame image corresponding to the captured image may be acquired, and when the number of the acquired phase detection data of the frame image reaches a preset number threshold, an average value of the acquired phase detection data may be calculated, so as to focus the captured image based on the calculated average value, thereby improving the reliability of the acquired phase detection data and the focusing accuracy when focusing is performed based on the phase detection data.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware form, and can also be realized in a form of hardware and a software functional module.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (11)
1. A focusing method, comprising:
creating a data linked list for storing phase detection data, wherein the maximum number of the phase detection data stored in the data linked list is the same as the number threshold;
receiving a focusing instruction for a shot image;
responding to the focusing instruction, and acquiring phase detection data of a frame image corresponding to the shot image;
the data linked list stores the phase detection data of the number threshold, the phase detection data in the data linked list is stored in a first-in first-out mode, and when the data linked list stores the phase detection data of the number threshold and obtains and stores new data, the phase detection data stored in the data linked list firstly is deleted;
calculating an average value of phase detection data reaching a preset number threshold value and storing the average value whenever the number of phase detection data of the acquired frame image reaches the number threshold value;
focusing the photographed image based on a plurality of the average values.
2. The method of claim 1, further comprising:
when the number of the phase detection data of the acquired frame image reaches a preset number threshold, calculating an average value of the phase detection data reaching the number threshold, including:
and when the data linked list is stored to the maximum number of phase detection data, calculating the average value of the phase detection data in the data linked list.
3. The method of claim 2, wherein calculating the average of the phase detection data in the data link list when the data link list stores up to a maximum number of phase detection data comprises:
when the data linked list is stored to the maximum number of phase detection data, phase detection data of a new frame image are obtained;
updating the data linked list according to the new phase detection data, wherein the updating comprises adding the new phase detection data into the data linked list and deleting the phase detection data with the longest storage time in the data linked list;
and calculating the average value of the phase detection data in the updated data linked list.
4. The method of claim 3, wherein the number of phase detection data added to the data linked list is the same as the number of phase detection data deleted in the data linked list.
5. The method according to any one of claims 1-4, further comprising:
acquiring an environment parameter corresponding to a current environment, wherein the environment parameter comprises a noise point parameter and/or an environment light brightness parameter;
setting the number threshold according to the environmental parameter.
6. A focusing apparatus, comprising:
the creating module is used for creating a data linked list used for storing the phase detection data, wherein the maximum number of the phase detection data stored in the data linked list is the same as the number threshold;
the instruction receiving module is used for receiving a focusing instruction of the shot image;
the first acquisition module is used for responding to the focusing instruction and acquiring phase detection data of a frame image corresponding to the shot image;
the data linked list stores the phase detection data of the number threshold, the phase detection data in the data linked list is stored in a first-in first-out mode, and when the data linked list stores the phase detection data of the number threshold and obtains and stores new data, the phase detection data stored in the data linked list firstly is deleted;
a calculation module configured to calculate an average value of the phase detection data reaching a preset number threshold every time the number of the phase detection data of the frame image acquired by the first acquisition module reaches the number threshold and store the average value;
and the focusing module is used for focusing the shot image based on the plurality of average values.
7. The apparatus of claim 6, further comprising:
the calculation module is specifically configured to:
and when the data linked list is stored to the maximum number of phase detection data, calculating the average value of the phase detection data in the data linked list.
8. The apparatus of claim 7, wherein the computing module is specifically configured to:
when the data linked list is stored to the maximum number of phase detection data, phase detection data of a new frame image are obtained;
updating the data linked list according to the new phase detection data, wherein the updating comprises adding the new phase detection data into the data linked list and deleting the phase detection data with the longest storage time in the data linked list;
and calculating the average value of the phase detection data in the updated data linked list.
9. The apparatus of claim 8, wherein the number of phase detection data added to the data link list is the same as the number of phase detection data deleted in the data link list.
10. The apparatus according to any one of claims 6-9, further comprising:
the second acquisition module is used for acquiring environmental parameters corresponding to the current environment, wherein the environmental parameters comprise noise parameters and/or environmental light brightness parameters;
and the setting module is used for setting the number threshold according to the environment parameters acquired by the second acquisition module.
11. A mobile terminal, comprising: the device comprises an input device, a memory and a processor, wherein the processor is respectively connected with the input device and the memory; wherein,
the memory is used for storing an application program and a data linked list for storing the phase detection data, and the maximum number of the phase detection data stored in the data linked list is the same as the number threshold;
the processor is used for calling the application program stored in the memory to execute:
receiving a focusing instruction for a shot image through the input device;
responding to the focusing instruction, and acquiring phase detection data of a frame image corresponding to the shot image;
the data linked list stores the phase detection data of the number threshold, the phase detection data in the data linked list is stored in a first-in first-out mode, and when the data linked list stores the phase detection data of the number threshold and obtains and stores new data, the phase detection data stored in the data linked list firstly is deleted;
calculating an average value of phase detection data reaching a preset number threshold value and storing the average value whenever the number of phase detection data of the acquired frame image reaches the number threshold value;
focusing the photographed image based on a plurality of the average values.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610645728.9A CN106161952B (en) | 2016-08-08 | 2016-08-08 | A kind of focusing method, device and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610645728.9A CN106161952B (en) | 2016-08-08 | 2016-08-08 | A kind of focusing method, device and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106161952A CN106161952A (en) | 2016-11-23 |
CN106161952B true CN106161952B (en) | 2019-06-11 |
Family
ID=57329047
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610645728.9A Expired - Fee Related CN106161952B (en) | 2016-08-08 | 2016-08-08 | A kind of focusing method, device and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106161952B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107179596B (en) * | 2017-05-24 | 2019-09-17 | Oppo广东移动通信有限公司 | Focusing method and Related product |
CN109580490B (en) * | 2018-11-06 | 2020-01-10 | 珠海格力电器股份有限公司 | Air quality detection method, system, detection device and readable storage medium |
CN117135449A (en) * | 2023-01-13 | 2023-11-28 | 荣耀终端有限公司 | Automatic focusing method and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1609824A (en) * | 2003-10-23 | 2005-04-27 | 英特尔公司 | Cache memory management |
CN103460105A (en) * | 2011-03-30 | 2013-12-18 | 富士胶片株式会社 | Image pickup device and autofocus control method therefor |
CN103874952A (en) * | 2011-09-29 | 2014-06-18 | 富士胶片株式会社 | Solid state image capture element, image capture device, and focus control method |
JP2016114785A (en) * | 2014-12-15 | 2016-06-23 | 富士通株式会社 | Imaging device, imaging method and imaging program |
-
2016
- 2016-08-08 CN CN201610645728.9A patent/CN106161952B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1609824A (en) * | 2003-10-23 | 2005-04-27 | 英特尔公司 | Cache memory management |
CN103460105A (en) * | 2011-03-30 | 2013-12-18 | 富士胶片株式会社 | Image pickup device and autofocus control method therefor |
CN103874952A (en) * | 2011-09-29 | 2014-06-18 | 富士胶片株式会社 | Solid state image capture element, image capture device, and focus control method |
JP2016114785A (en) * | 2014-12-15 | 2016-06-23 | 富士通株式会社 | Imaging device, imaging method and imaging program |
Also Published As
Publication number | Publication date |
---|---|
CN106161952A (en) | 2016-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110248110B (en) | Shooting parameter setting method, setting device, terminal equipment and readable storage medium | |
US9451173B2 (en) | Electronic device and control method of the same | |
KR102010712B1 (en) | Distortion Correction Method and Terminal | |
JP6924901B2 (en) | Photography method and electronic equipment | |
CN108134903B (en) | Shooting method and related product | |
US9204027B2 (en) | Method for photographing processing and terminal device | |
CN109040523B (en) | Artifact eliminating method and device, storage medium and terminal | |
CN109040603A (en) | High-dynamic-range image acquisition method, device and mobile terminal | |
CN107909569B (en) | Screen-patterned detection method, screen-patterned detection device and electronic equipment | |
EP3110134A1 (en) | Electronic device and method for processing image | |
EP3163423A1 (en) | Method and device for setting background of ui control and terminal | |
CN106161952B (en) | A kind of focusing method, device and mobile terminal | |
CN107454344B (en) | A kind of acquisition parameters setting method and user terminal | |
CN108234880A (en) | A kind of image enchancing method and device | |
CN111970437B (en) | Text shooting method, wearable device and storage medium | |
CN111654637B (en) | Focusing method, focusing device and terminal equipment | |
CN106357978B (en) | Image output method, device and terminal | |
US20200090309A1 (en) | Method and device for denoising processing, storage medium, and terminal | |
CN107360361B (en) | Method and device for shooting people in backlight mode | |
CN111597009A (en) | Application program display method and device and terminal equipment | |
US20230164446A1 (en) | Imaging exposure control method and apparatus, device and storage medium | |
CN103826061B (en) | Information processing method and electronic device | |
CN109547703A (en) | A kind of image pickup method of picture pick-up device, device, electronic equipment and medium | |
CN105072349A (en) | Method and system for improving experience of user in photographing of intelligent terminal | |
CN104978566A (en) | Picture processing method and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20190611 |