CN111131696B - Focusing method, device, terminal and storage medium - Google Patents

Focusing method, device, terminal and storage medium Download PDF

Info

Publication number
CN111131696B
CN111131696B CN201911309516.3A CN201911309516A CN111131696B CN 111131696 B CN111131696 B CN 111131696B CN 201911309516 A CN201911309516 A CN 201911309516A CN 111131696 B CN111131696 B CN 111131696B
Authority
CN
China
Prior art keywords
focusing
time length
period
camera
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911309516.3A
Other languages
Chinese (zh)
Other versions
CN111131696A (en
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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201911309516.3A priority Critical patent/CN111131696B/en
Publication of CN111131696A publication Critical patent/CN111131696A/en
Application granted granted Critical
Publication of CN111131696B publication Critical patent/CN111131696B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The embodiment of the invention relates to the technical field of cameras, and discloses a focusing method, which comprises the following steps: acquiring focusing time length of the latest focusing in historical focusing actions of a camera, wherein the focusing time length is a difference value between focusing starting time and corresponding focusing success time; determining a focusing period according to a preset factor and the focusing duration; and calling an automatic focusing mode according to the focusing period to focus the target focusing object. The embodiment of the invention also provides a focusing device, a terminal and a storage medium. The focusing method, the focusing device, the focusing terminal and the storage medium provided by the embodiment of the invention can improve the code scanning efficiency.

Description

Focusing method, device, terminal and storage medium
Technical Field
The present invention relates to the field of camera technologies, and in particular, to a focusing method, an apparatus, a terminal, and a storage medium.
Background
With the development of network science and technology, people can conveniently scan codes through mobile phones for consumption. The camera of the android system does not have a function of directly scanning codes, in order to realize the function of scanning the two-dimensional codes, the APP of the android system integrates zxing, zbar and other third-party decoding toolkits, the camera of the android system is circularly called to acquire preview frame data, and the third-party decoding toolkit is called to decode according to the preview frame data.
However, when scanning a two-dimensional code, especially when scanning some two-dimensional codes with smaller sizes, a camera often fails to focus, which results in that the two-dimensional code cannot be decoded correctly for a long time, and the code scanning efficiency is low.
Disclosure of Invention
The embodiment of the invention aims to provide a focusing method, a focusing device, a focusing terminal and a storage medium, so that the code scanning efficiency is improved.
To solve the above technical problem, an embodiment of the present invention provides a focusing method, including: acquiring focusing time length of the latest focusing in historical focusing actions of a camera, wherein the focusing time length is a difference value between focusing starting time and corresponding focusing success time; determining a focusing period according to a preset factor and the focusing duration; and calling an automatic focusing mode according to the focusing period to focus the target focusing object.
An embodiment of the present invention further provides a focusing apparatus, including: the time length obtaining module is used for obtaining the focusing time length of the latest focusing in the historical focusing action of the camera, and the focusing time length is the difference value between the focusing starting time and the corresponding focusing success time; the period determining module is used for determining a focusing period according to a preset factor and the focusing duration; and the object focusing module is used for calling an automatic focusing mode according to the focusing period to focus the target focusing object.
An embodiment of the present invention further provides a terminal, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described focusing method.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which when executed by a processor implements the above-described focusing method.
Compared with the prior art, the method and the device have the advantages that the focusing time length of the latest focusing in the historical focusing action of the camera is obtained, the focusing period is determined according to the preset factor and the focusing time length, and then the automatic focusing mode is called according to the focusing period to focus the target focusing object. Because the decoding is realized by acquiring the effective preview frame of the two-dimensional code in the code scanning process, the performance of the camera of each terminal is different, if a fixed focusing period is set for focusing, and if the set focusing period is too long, the number of the acquired clear preview frames in unit time is less, the probability of the existence of the effective preview frames is lower, and the decoding efficiency is lower; if the set focusing period is too short, the camera may not be focused within the focusing period. According to the focusing method provided by the embodiment of the invention, a dynamic focusing period is obtained through the last focusing time and the preset factor, so that the focusing period is more consistent with the actual condition of the camera, the number of the clear preview frames obtained in unit time is more, and the effective preview frames are more easily obtained, so that the effective preview frames are more easily obtained in the code scanning process of the camera, and the code scanning decoding efficiency is improved.
In addition, before the focusing time length of the last focusing in the historical focusing action of the camera, the method further comprises the following steps: starting an asynchronous thread; the calling of an automatic focusing mode according to the focusing period to focus the target focusing object comprises: calling back the asynchronous thread according to the focusing cycle; and the asynchronous thread calls an automatic focusing mode and focuses the target focusing object according to the focusing period. By setting the asynchronous thread, the asynchronous thread can be called back after the focusing period is determined, and then the asynchronous thread calls the automatic focusing mode of the camera to focus the target focusing object, so that the automatic calling of the automatic focusing mode can be realized, and the implementation efficiency of the focusing method provided by the embodiment of the invention is improved.
In addition, the determining a focusing period according to a preset factor and the focusing duration includes: if the focusing time length is greater than or equal to a time length threshold value, taking the time length threshold value as a focusing period; and if the focusing time length is smaller than the time length threshold, adding a preset factor to the focusing time length to obtain the focusing period. Comparing the focusing time length with a time length threshold, and if the focusing time length is greater than or equal to the time length threshold, taking the time length threshold as a focusing period, so that the focusing period determined each time is in a reasonable range, and the stability of each focusing is improved; if the focusing time length is less than the time length threshold value, a preset factor is added to the focusing time length to obtain a focusing period, because if the focusing time length is less than the time length threshold value, the focusing environment is favorable, the focusing process is smooth, the focusing time length is added with the preset factor to determine the focusing period, so that the using environment of each time can be balanced, the focusing period is more consistent with the using environment of the terminal, and the focusing stability is improved.
In addition, before the invoking of the automatic focusing mode according to the focusing cycle to focus the target focusing object, the method further includes: setting the preview multiple of the preview frame of the camera to be one N of the maximum supported magnification of the camera, wherein N is a positive integer. The preview multiple of the preview frame of the camera is amplified, so that the details of the two-dimensional code can be more easily obtained to a certain extent, and the decoding is convenient. Therefore, the preview multiple of the preview frame of the camera is set to be one N of the maximum supported magnification of the camera, so that the effective preview frame can be obtained more easily during decoding, and the decoding efficiency is improved.
In addition, after the automatic focusing mode is called according to the focusing period to focus the target focusing object, the method further comprises the following steps: acquiring a posture change value of the camera by adopting a sensor; and if the attitude change value is larger than or equal to a preset threshold value, focusing again. Because in the process of scanning the code, the gesture changes such as shaking or deviation of the camera are easy to occur, the decoding efficiency is influenced, and the refocusing is carried out when the gesture change value is greater than or equal to the preset threshold value, so that the camera can be rapidly refocused, the focusing time is shortened, and the decoding efficiency is improved.
In addition, the sensors include a three-axis gyroscope, an acceleration sensor, a vibration sensor and/or a control protocol dome machine.
In addition, before obtaining the focusing time length of the last focusing in the historical focusing action of the camera, the method further comprises the following steps: and starting the first focusing according to the initial focusing period.
Drawings
One or more embodiments are illustrated by the corresponding figures in the drawings, which are not meant to be limiting.
FIG. 1 is a flowchart illustrating a focusing method according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a detailed process of the focusing method S102 according to the first embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating a focusing method according to a first embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a focusing device according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the invention relates to a focusing method, which comprises the steps of obtaining the focusing time length of the latest focusing in the historical focusing action of a camera, wherein the focusing time length is the difference value between the focusing starting time and the corresponding focusing success time, determining the focusing period according to the preset factor and the focusing time length, and calling an automatic focusing mode according to the focusing period to focus a target focusing object. Because the effective preview frame of the two-dimensional code needs to be acquired for decoding in the code scanning process, the more the number of the clear preview frames acquired by the camera in the code scanning process is, the easier the effective preview frame is acquired, and the easier the decoding is successful. However, there is a difference between cameras of each terminal, and if the focus period of the camera is set to a fixed period, this results in the following: firstly, the set focusing period is too long, so that the camera can repeat the process of sharpness-fuzziness in the focusing process, the number of obtained sharpness preview frames in unit time is small, the probability of existence of effective preview frames is low, and the decoding probability is low; if the time of the set focusing period is too short, the camera cannot be successfully focused in the focusing period, and a phenomenon of continuous flicker is easily caused. The focusing period is determined according to the latest focusing time length and the preset factor, so that the focusing period can better accord with the actual condition of each terminal, the focusing is easier to succeed, and the code scanning efficiency can be improved.
It should be noted that the focusing method provided by the embodiment of the present invention is applied to a process of scanning a code, and may also be applied to other similar processes, which is not specifically limited, and the following description takes a process of scanning a code as an example, where an object of scanning a code may be a two-dimensional code or a barcode. In addition, the execution subject of the focusing method provided by the embodiment of the present invention may be a program or a chip of a mobile terminal, which is not particularly limited, and the following description will take the chip as an example.
The specific flow of the focusing method provided by the embodiment of the invention is shown in fig. 1, and specifically comprises the following steps:
s101: and acquiring the focusing time length of the latest focusing in the historical focusing action of the camera, wherein the focusing time length is the difference value between the focusing starting time and the corresponding focusing success time.
The camera is a camera of the terminal, the terminal may be but is not limited to a mobile terminal, and the historical focusing action and the focusing duration of the camera may be obtained by a program or a chip of the mobile terminal and stored in a storage space of the mobile terminal.
Specifically, when a camera is turned on for focusing, the focusing start time is recorded; when focusing is completed, for example, when decoding is successful, a focusing success time is recorded. And subtracting the focusing initial time from the focusing success time to obtain a difference value, wherein the difference value is the focusing duration. The focusing success time may also be the time when the camera starts to shoot, and the focusing success time may also be obtained according to a user-defined standard, which is not specifically limited by the embodiment of the present invention.
In a specific example, before S101, the method further includes: and starting the first focusing according to the initial focusing period.
The initial focusing period may be randomly set, or may be a focusing period initially set by the system, which is not limited herein. Alternatively, other focusing periods of the same or similar models may be acquired as the initial focusing period through the network.
S102: and determining a focusing period according to a preset factor and the focusing time length.
The preset factor may be set according to actual needs, and is not specifically limited herein.
Alternatively, the focusing duration may be multiplied by a preset factor to obtain the focusing period. For example, the focusing time is 500ms, the preset factor is 120%, and the focusing period is 500 × 120% — 600 ms.
In a specific example, as shown in fig. 2, S102 may specifically include the following steps:
s1021: and if the focusing time length is greater than or equal to the time length threshold, taking the time length threshold as a focusing period.
S1022: and if the focusing time length is less than the time length threshold value, adding a preset factor to the focusing time length to obtain a focusing period.
The duration threshold may be set according to actual needs, which is not specifically limited herein, and may be, for example, 1 s.
Specifically, the chip compares the focusing time length with a time length threshold, and if the focusing time length is greater than or equal to the time length threshold, the time length threshold is used as a focusing period. For example, if the time threshold is 1s and the actual focusing time is 5s, 1s is taken as the focusing period. And if the focusing time length is less than the time length threshold value, adding a preset factor to the focusing time length to obtain a focusing period. For example, if the time threshold is 1s, the actual focusing time is 500ms, and the preset factor is 100ms, the focusing period is 500+100 to 600 ms. Optionally, if the result of adding the preset factor to the focusing time length is greater than or equal to the time length threshold, the time length threshold may be used as the focusing period, or the result may be used as the focusing period, which is not limited herein.
Comparing the focusing time length with a time length threshold, and if the focusing time length is greater than or equal to the time length threshold, taking the time length threshold as a focusing period, so that the focusing period determined each time is in a reasonable range, and the stability of each focusing is improved; if the focusing time length is less than the time length threshold value, a preset factor is added to the focusing time length to obtain a focusing period, because if the focusing time length is less than the time length threshold value, the focusing environment is favorable, the focusing process is smooth, the focusing time length is added with the preset factor to determine the focusing period, so that the using environment of each time can be balanced, the focusing period is more consistent with the using environment of the terminal, and the focusing stability is improved.
S103: and calling an automatic focusing mode according to the focusing period to focus the target focusing object.
Specifically, the chip calls an automatic focusing mode of the camera according to the determined focusing period, and focuses the target focusing object according to the focusing period. It should be understood that, when focusing on a target focusing object is successful, for example, when decoding a two-dimensional code is successful, a focusing time duration corresponding to the focusing can be obtained, and then a focusing period of a next focusing process is determined according to the focusing time duration, that is, the focusing method provided by the embodiment of the present invention is a continuous cycle process.
Compared with the prior art, the focusing method provided by the embodiment of the invention has the advantages that the focusing time length of the latest focusing in the historical focusing action of the camera is obtained, the focusing period is determined according to the preset factor and the focusing time length, and then the automatic focusing mode is called according to the focusing period to focus the target focusing object. In the code scanning process, decoding is realized by acquiring effective preview frames of the two-dimensional code, the performance of a camera of each terminal is different, if a fixed focusing period is set for focusing, and if the set focusing period is too long, the number of the acquired clear preview frames in unit time is less, the probability of the existence of the effective preview frames is lower, and the decoding efficiency is lower; if the set focusing period is too short, the camera may not be focused within the focusing period. The focusing method of the embodiment of the invention obtains a dynamic focusing period through the last focusing time length and the preset factor, so that the determined focusing period is more in line with the actual condition of the camera, and more clear preview frames are obtained in unit time, thereby the camera can more easily obtain effective preview frames in the code scanning process, and the code scanning decoding efficiency is improved.
In a specific example, as shown in fig. 3, another schematic flow chart of the focusing method according to the embodiment of the present invention specifically includes the following steps:
s201: an asynchronous thread is started.
S202: and acquiring the focusing time length of the latest focusing in the historical focusing action of the camera, wherein the focusing time length is the difference value between the focusing starting time and the corresponding focusing success time.
S203: and determining a focusing period according to a preset factor and the focusing time length.
S204: and calling back the asynchronous thread according to the focusing cycle.
S205: and the asynchronous thread calls an automatic focusing mode and focuses the target focusing object according to the focusing period.
S202 and S203 are the same as S101 and S102 described above, and are not described again here.
In S201, the asynchronous thread is a self-defined asynchronous thread, which is used to call an auto-focus mode of the system camera for auto-focus after the system background waits for a certain time. It will be appreciated that the asynchronous thread is to call the auto focus mode auto focus of the system camera after waiting for the focus period to be determined.
In S204, when the focusing period is obtained, the chip calls back the asynchronous thread. A callback refers to a specific task or method being called when some event occurs. Here, when the focus period is determined, the asynchronous thread is invoked.
In S205, when the asynchronous thread is recalled, the asynchronous thread invokes an auto focus mode of the camera, and focuses the target focused object according to the determined focus period.
By setting the asynchronous thread, the asynchronous thread can be called back after the focusing period is determined, and then the asynchronous thread calls the automatic focusing mode of the camera to focus the target focusing object, so that the automatic calling of the automatic focusing mode can be realized, and the implementation efficiency of the focusing method provided by the embodiment of the invention is improved.
In a specific example, before S103, that is, before the automatic focusing mode is invoked to focus the target focusing object according to the focusing cycle, the method further includes: and setting the preview multiple of the preview frame of the camera to be one N of the maximum supported magnification of the camera, wherein N is a positive integer.
It is understood that in the process of decoding the two-dimensional code, the preview frame is acquired for decoding. The preview multiple of the preview frame of the camera is amplified, so that the details of the two-dimensional code can be more easily obtained to a certain extent, and the decoding is convenient. Therefore, the preview multiple of the preview frame of the camera is set to be one N of the maximum supported magnification of the camera, so that the effective preview frame can be obtained more easily during decoding, and the decoding efficiency is improved. N may be set according to practical situations, and is for example 2, 3 or 4, and is not limited herein.
Optionally, the focusing durations before and after setting the N to different values may be compared, respectively, and the value with the shortest focusing duration may be selected as the value finally set by N.
In a specific example, after S103, that is, after the automatic focusing mode is invoked to focus the target focused object according to the focusing cycle, the method further includes: and acquiring the attitude change value of the camera by adopting a sensor, and re-focusing if the attitude change value is greater than or equal to a preset threshold value.
The specific sensor may be selected according to the configuration of the terminal, and is not limited herein. Optionally, the sensors may include a three-axis gyroscope, an acceleration sensor, a shock sensor, and/or a servo control protocol dome machine.
The attitude change value may include a change amount of angular velocity, a change amount of acceleration, a change amount of displacement, and/or the like. The preset threshold may be set according to actual needs, and is not particularly limited herein.
Specifically, the chip acquires a posture change value of the camera acquired by a sensor of the terminal, compares the posture change value with a preset threshold value, and performs focusing again if the posture change value is greater than or equal to the preset threshold value.
And acquiring the attitude change value of the camera through the sensor, comparing the attitude change value with a preset threshold value, and re-focusing if the attitude change value is greater than or equal to the preset threshold value. Because in the process of scanning the code, the gesture changes such as shaking or deviation of the camera are easy to occur, the decoding efficiency is influenced, and the refocusing is carried out when the gesture change value is greater than or equal to the preset threshold value, so that the camera can be rapidly refocused, the focusing time is shortened, and the decoding efficiency is improved.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the steps contain the same logical relationship, which is within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A second embodiment of the present invention relates to a focusing device, as shown in fig. 4, including: a duration acquisition module 301, a period determination module 302, and an object focus module 303.
A time length obtaining module 301, configured to obtain a focusing time length of the latest focusing in a historical focusing action of the camera, where the focusing time length is a difference between a focusing start time and a corresponding focusing success time;
a period determining module 302, configured to determine a focusing period according to a preset factor and a focusing duration;
and an object focusing module 303, configured to invoke an automatic focusing mode according to the focusing period to focus the target focusing object.
Further, the focusing apparatus further comprises a thread calling module, wherein the thread calling module is configured to: starting an asynchronous thread; the object focusing module 303 is further configured to: calling back an asynchronous thread according to the focusing period; and the asynchronous thread calls an automatic focusing mode and focuses the target focusing object according to the focusing period.
Further, the period determination module 302 is further configured to:
if the focusing time length is greater than or equal to the time length threshold value, taking the time length threshold value as a focusing period;
and if the focusing time length is less than the time length threshold value, adding a preset factor to the focusing time length to obtain a focusing period.
Further, focusing device still includes preview multiple setting module, and wherein, predetermine multiple setting module and be used for:
and setting the preview multiple of the preview frame of the camera to be one N of the maximum supported magnification of the camera, wherein N is a positive integer.
Further, the focusing apparatus further comprises a refocusing module, wherein the refocusing module is configured to:
acquiring a posture change value of a camera by adopting a sensor;
and if the attitude change value is greater than or equal to the preset threshold value, focusing again.
Optionally, the sensor comprises a three-axis gyroscope, an acceleration sensor, a shock sensor, and/or a control protocol dome machine.
Further, the focusing device further comprises a primary focusing module, wherein the primary focusing module is used for:
and starting the first focusing according to the initial focusing period.
It should be understood that this embodiment is an example of the apparatus corresponding to the first embodiment, and may be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
A third embodiment of the invention is directed to a terminal, as shown in fig. 5, comprising at least one processor 401; and a memory 402 communicatively coupled to the at least one processor 401; the memory 402 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401, so that the at least one processor 401 can execute the above-mentioned focusing method.
Where the memory 402 and the processor 401 are coupled by a bus, which may include any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 401 and the memory 402 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 401 may be transmitted over a wireless medium via an antenna, which may receive the data and transmit the data to the processor 401.
The processor 401 is responsible for managing the bus and general processing and may provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 402 may be used to store data used by processor 401 in performing operations.
A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, those skilled in the art can understand that all or part of the steps in the method of the foregoing embodiments may be implemented by a program to instruct related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (9)

1. A focusing method, comprising:
acquiring focusing time length of the latest focusing in historical focusing actions of a camera, wherein the focusing time length is a difference value between focusing starting time and corresponding focusing success time;
if the focusing time length is greater than or equal to a time length threshold value, taking the time length threshold value as a focusing period; if the focusing time length is smaller than the time length threshold, adding a preset factor to the focusing time length to obtain the focusing period;
and calling an automatic focusing mode according to the focusing period to focus the target focusing object.
2. The focusing method according to claim 1, further comprising, before a focusing time length of a last focusing in the acquisition history focusing action of the camera:
starting an asynchronous thread;
the calling of an automatic focusing mode according to the focusing period to focus the target focusing object comprises:
calling back the asynchronous thread according to the focusing cycle;
and the asynchronous thread calls an automatic focusing mode and focuses the target focusing object according to the focusing period.
3. The focusing method according to claim 1, further comprising, before the invoking of the auto-focusing mode according to the focusing period to focus the target focusing object:
setting the preview multiple of the preview frame of the camera to be one N of the maximum supported magnification of the camera, wherein N is a positive integer.
4. The focusing method according to claim 1, further comprising, after the invoking of the auto-focusing mode according to the focusing period to focus the target focusing object:
acquiring a posture change value of the camera by adopting a sensor;
and if the attitude change value is larger than or equal to a preset threshold value, focusing again.
5. The focusing method according to claim 4, wherein the sensor comprises a three-axis gyroscope, an acceleration sensor, a vibration sensor and/or a servo control protocol dome machine.
6. The focusing method according to any one of claims 1 to 5, further comprising, before the focusing time length of the last focusing in the historical focusing action of the capturing camera:
and starting the first focusing according to the initial focusing period.
7. A focusing apparatus, comprising:
the time length obtaining module is used for obtaining the focusing time length of the latest focusing in the historical focusing action of the camera, and the focusing time length is the difference value between the focusing starting time and the corresponding focusing success time;
the period determining module is used for taking the time length threshold as a focusing period if the focusing time length is greater than or equal to the time length threshold; if the focusing time length is smaller than the time length threshold, adding a preset factor to the focusing time length to obtain the focusing period;
and the object focusing module is used for calling an automatic focusing mode according to the focusing period to focus the target focusing object.
8. A terminal, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a focusing method as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the focusing method according to any one of claims 1 to 6.
CN201911309516.3A 2019-12-18 2019-12-18 Focusing method, device, terminal and storage medium Active CN111131696B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911309516.3A CN111131696B (en) 2019-12-18 2019-12-18 Focusing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911309516.3A CN111131696B (en) 2019-12-18 2019-12-18 Focusing method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111131696A CN111131696A (en) 2020-05-08
CN111131696B true CN111131696B (en) 2021-08-17

Family

ID=70499626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911309516.3A Active CN111131696B (en) 2019-12-18 2019-12-18 Focusing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111131696B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112556855A (en) * 2020-11-10 2021-03-26 四川省东宇信息技术有限责任公司 Thermal imager system capable of automatic calibration and calibration method
CN112637504B (en) * 2020-12-23 2022-05-03 维沃移动通信有限公司 Focusing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1335589A1 (en) * 2002-02-07 2003-08-13 Ricoh Company, Ltd. Imaging apparatus
CN105763795A (en) * 2016-03-01 2016-07-13 苏州科达科技股份有限公司 Focusing method and apparatus, cameras and camera system
CN107659770A (en) * 2014-07-25 2018-02-02 广东欧珀移动通信有限公司 The method, apparatus and mobile device of a kind of rapid focus
CN109145667A (en) * 2018-08-30 2019-01-04 深圳大势智能科技有限公司 Quick identification bar code method, system, equipment and storage medium based on code reader
CN109670362A (en) * 2017-10-16 2019-04-23 上海商米科技有限公司 Bar code scanning method and device
CN110059518A (en) * 2019-04-22 2019-07-26 广东小天才科技有限公司 A kind of barcode scanning method, device and mobile terminal
CN110336951A (en) * 2019-08-26 2019-10-15 厦门美图之家科技有限公司 Contrast formula focusing method, device and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018087859A (en) * 2016-11-28 2018-06-07 オリンパス株式会社 Focus adjustment device and focus adjustment method
CN110460771A (en) * 2019-07-25 2019-11-15 南京诺源医疗器械有限公司 Focusing method, device and focus apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1335589A1 (en) * 2002-02-07 2003-08-13 Ricoh Company, Ltd. Imaging apparatus
CN107659770A (en) * 2014-07-25 2018-02-02 广东欧珀移动通信有限公司 The method, apparatus and mobile device of a kind of rapid focus
CN105763795A (en) * 2016-03-01 2016-07-13 苏州科达科技股份有限公司 Focusing method and apparatus, cameras and camera system
CN109670362A (en) * 2017-10-16 2019-04-23 上海商米科技有限公司 Bar code scanning method and device
CN109145667A (en) * 2018-08-30 2019-01-04 深圳大势智能科技有限公司 Quick identification bar code method, system, equipment and storage medium based on code reader
CN110059518A (en) * 2019-04-22 2019-07-26 广东小天才科技有限公司 A kind of barcode scanning method, device and mobile terminal
CN110336951A (en) * 2019-08-26 2019-10-15 厦门美图之家科技有限公司 Contrast formula focusing method, device and electronic equipment

Also Published As

Publication number Publication date
CN111131696A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111131696B (en) Focusing method, device, terminal and storage medium
CN109428773B (en) Communication method and device
US20140104444A1 (en) Photographing processing method and terminal device
CN111796885A (en) Display method and device of cloud application program and electronic equipment
CN110557417B (en) Image processing method and device and storage medium
US10143033B2 (en) Communications apparatus, control method, and storage medium
CN103701867A (en) Method, system and central server for processing call requests
CN110336592B (en) Data transmission method suitable for Bluetooth card reader, electronic equipment and storage medium
EP3226513A1 (en) Network-based file transfer method and system
CN105657244A (en) Anti-shake photographing method and apparatus, and mobile terminal
EP3907897A2 (en) System and method for managing collisions in multiple-transmission-and-reception-points communications
CN104935709A (en) Method and device for achieving lens compatibility
CN115243202B (en) Resource sharing method and device and electronic equipment
CN108170493B (en) System module loading method, system and device
CN108616567B (en) Picture transmission method, system, server, client and user equipment
CN111381978A (en) Method for accessing application program, storage medium and smart television
CN105306829A (en) Shooting method and apparatus
CA2775421C (en) Apparatus and method for controlling a camera in an electronic device
US20150103231A1 (en) Focusing Method
CN112637121B (en) Data port updating method and device, electronic equipment and readable storage medium
CN116113011A (en) Network connection method and device and electronic equipment
CN110418333B (en) Method and device for USIM to acquire image through terminal
KR102457007B1 (en) electronic device and method for controlling video sharing with the rich communication suite service
CN109150951B (en) Method and device for starting Activity of Android system
CN110708467B (en) Focusing method, focusing device and camera

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant