CN112653835A - Method and device for judging focusing state and storage medium - Google Patents

Method and device for judging focusing state and storage medium Download PDF

Info

Publication number
CN112653835A
CN112653835A CN202011468773.4A CN202011468773A CN112653835A CN 112653835 A CN112653835 A CN 112653835A CN 202011468773 A CN202011468773 A CN 202011468773A CN 112653835 A CN112653835 A CN 112653835A
Authority
CN
China
Prior art keywords
size
lens
difference
determining
target object
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.)
Granted
Application number
CN202011468773.4A
Other languages
Chinese (zh)
Other versions
CN112653835B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202011468773.4A priority Critical patent/CN112653835B/en
Publication of CN112653835A publication Critical patent/CN112653835A/en
Application granted granted Critical
Publication of CN112653835B publication Critical patent/CN112653835B/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

Landscapes

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

Abstract

The embodiment of the invention provides a method and a device for judging a focusing state and a storage medium. The method comprises the following steps: under the condition that a target object appears in a first path of image shot by a first lens and a second path of image shot by a second lens, determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under the initial focal length; controlling the second lens to zoom to a target magnification; before the second lens starts focusing or in the focusing process, determining that the third size of the target object in the second path of image under the current focal length is fit to the second size difference between the fourth size and the first size under the initial focal length; and under the condition that the difference between the second size difference and the first size difference is smaller than a preset threshold value, determining that the focusing state of the second lens meets the definition requirement.

Description

Method and device for judging focusing state and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image acquisition, in particular to a method and a device for judging a focusing state and a storage medium.
Background
With the development of camera technology, more and more devices are used for linking the movement, and intelligent ball machines such as gun-ball linkage, fixed-focus zooming forms and the like play an important role under intelligent waves.
However, since some services such as face snapshot have high requirements on the snapshot rate, a quick response mechanism is often lacking in determining whether the focus is clear at present, and the problem of low snapshot rate due to long focusing time easily occurs in the current devices in the industry in such applications.
Disclosure of Invention
The embodiment of the invention provides a method and a device for judging a focusing state and a storage medium, which are used for at least solving the problem of long focusing time caused by lack of a quick response mechanism for judging whether the focusing is clear at present in the related technology.
According to an embodiment of the present invention, there is provided a method of determining a focusing state, applied to an apparatus including one or more lens groups each including at least a first lens and a second lens in movement linkage, the method including: under the condition that a target object appears in a first path of image shot by the first lens and a second path of image shot by the second lens, determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under an initial focal length; controlling the second lens to zoom to a target magnification; before or during the focusing of the second lens, determining that a third size of the target object in the second path of image under the current focal length fits back to a second size difference value between a fourth size under the initial focal length and the first size; and under the condition that the difference between the second size difference and the first size difference is smaller than a preset threshold value, determining that the focusing state of the second lens meets the definition requirement.
In at least one exemplary embodiment, determining a first size difference between a first size of the target object in the first pass image and a second size of the target object in the second pass image at the initial focus distance comprises: determining that the target object is at the initial focus distanceThe first size S in the first image1And said second dimension S in said second image2(ii) a According to the first size S1And said second dimension S2Calculating said first size difference Δ 1 ═ S2-S1
In at least one exemplary embodiment, determining that the third size of the target object in the second pass image at the current focus fits back to the second size difference between the fourth size at the initial focus and the first size comprises: determining the third dimension S of the target object in the second path of image at the current focal distance3And determining the fourth dimension S of the third dimension fit back to the initial focus4=S3K, wherein k is the current focal length/the initial focal length; according to the first size S1And said fourth dimension S4Calculating said second size difference Δ 2 ═ S4-S1
In at least one exemplary embodiment, the preset threshold is determined by one of: calculating the allowable depth of field under the initial focal length, determining the allowable step number of an F motor based on a lens curve according to the allowable depth of field, and calculating the allowable area difference according to the allowable step number to serve as the preset threshold; and adjusting the step number of the F motor until the current area difference is read as the preset threshold when the focusing state of the second lens meets the definition requirement.
In at least one exemplary embodiment, in a case that a difference between the second size difference and the first size difference is not smaller than a preset threshold, the second lens is controlled to continue focusing, and an operation of determining that a third size of the target object in the second path image at the current focal length fits back to a second size difference between a fourth size at the initial focal length and the first size is performed.
In at least one exemplary embodiment, in a case that a difference between the second size difference and the first size difference is smaller than a preset threshold, at least one of the following is further included: notifying the focus state of the second lens that the sharpness requirement is met; and controlling the second lens to shoot the target object at the current focal length.
According to another embodiment of the present invention, there is provided a device for determining a focusing state, which is connected to or provided in an apparatus including one or more lens groups each including at least a first lens and a second lens in movement linkage, the device for determining a focusing state including: the first determining module is used for determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under the initial focal length under the condition that the target object appears in the first path of image shot by the first lens and the second path of image shot by the second lens; the zooming control module is used for controlling the second lens to zoom to a target magnification; a second determining module, configured to determine, before or during a focusing operation of the second lens, that a third size of the target object in the second path of image at the current focal length fits back to a second size difference between a fourth size and the first size at the initial focal length; and the focusing state judging module is used for determining that the focusing state of the second lens meets the definition requirement under the condition that the difference between the second size difference and the first size difference is smaller than a preset threshold value.
In at least one example embodiment, the first determination module is configured to: determining the first size S of the target object in the first path image at the initial focal length1And said second dimension S in said second image2(ii) a According to the first size S1And said second dimension S2Calculating said first size difference Δ 1 ═ S2-S1
In at least one example embodiment, the second determination module is configured to: determining the third dimension S of the target object in the second path of image at the current focal distance3And determining the fourth ruler of the third dimension fit back to the initial focal lengthCun S4=S3K, wherein k is the current focal length/the initial focal length; according to the first size S1And said fourth dimension S4Calculating said second size difference Δ 2 ═ S4-S1
In at least one exemplary embodiment, the focus state determination module is further configured to: and under the condition that the difference between the second size difference and the first size difference is not smaller than a preset threshold, controlling the second lens to continue focusing, and calling the second determining module to perform an operation of determining that the third size of the target object in the second path of image under the current focal length is fitted back to the second size difference between the fourth size under the initial focal length and the first size.
In at least one exemplary embodiment, the focusing state determining module is further configured to, when a difference between the second size difference and the first size difference is smaller than a preset threshold, perform at least one of the following operations: notifying the focus state of the second lens that the sharpness requirement is met; and controlling the second lens to shoot the target object at the current focal length.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, after the target object is found and the zooming operation of the second lens is completed, the fitting comparison is carried out between the size (for example, imaging area) difference value of the target object on the two paths of images in the initial stage and the size (for example, imaging area) difference value of the target object in the two paths of images in the current state in real time before the second lens starts focusing or in the focusing process, so that whether the current focusing state is in the range of the snapshot quality permission is judged, therefore, the problem that the focusing time is long due to lack of a quick response mechanism for judging whether the current focusing is clear or not in the related art can be solved, the real-time judgment of the focusing state before the focusing starts or in the focusing process is realized, and most time is saved for intelligent services.
Drawings
Fig. 1 is a flowchart of a method for determining a focus state according to an embodiment of the present invention;
fig. 2 is a block diagram of a configuration of a focus state determination apparatus according to an embodiment of the present invention;
fig. 3 is an overall block relationship diagram of a system relating to a method of determining a focus state of a movable core according to an embodiment of the present invention;
fig. 4 is a detailed algorithm flow of a method for judging a focusing state of a movable core according to an embodiment of the present invention.
Detailed Description
In the related art, when an intelligent service takes a snapshot of a target object such as a human face through equipment of a linked movement, the snapshot is generally performed after focusing is finished, so that the intelligent service is realized, the judgment on a focusing state does not exist before focusing is started or in a focusing process, and the snapshot is performed only after the focusing is finished completely.
In order to solve the problem, a large part of time in the focusing process meets the requirement of definition, even the requirement of definition is met without focusing at all, so the embodiment of the invention provides a method, a device and a storage medium for judging the focusing state.
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be applied to a device (e.g., a movement-linked monitoring device) including one or more lens groups, where each lens group includes at least a first lens and a second lens linked by a movement. The first lens can be a fixed focus lens or a shallow zoom lens and is generally used for range search; the second lens may be a zoom lens (for example, may be a deep zoom lens) generally used for performing tracking shooting of a target object.
Fig. 1 is a flowchart of a method for determining a focus state according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
step S102, under the condition that a target object appears in a first path of image shot by a first lens and a second path of image shot by a second lens, determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under an initial focal length;
step S104, controlling the second lens to zoom to a target magnification;
step S106, before the second lens starts focusing or in the process of focusing, determining that a third size of the target object in the second path of image under the current focal length is fitted back to a second size difference value between a fourth size under the initial focal length and the first size;
step S108, determining that the focusing state of the second lens meets the definition requirement under the condition that the difference between the second size difference and the first size difference is smaller than a preset threshold value.
Through the steps, after the target object is found and the zooming operation of the second lens is completed, the fitting comparison is carried out between the size (for example, the imaging area) difference value of the target object on the two paths of images in the initial stage and the size (for example, the imaging area) difference value of the target object in the two paths of images in the current state in real time before the second lens starts focusing or in the focusing process, so that whether the current focusing state is in the range of the snapshot quality permission is judged, therefore, the problem that the focusing time is long due to lack of a quick response mechanism for judging whether the current focusing state is clear or not in the related art can be solved, the real-time judgment of the focusing state before the focusing starts or in the focusing process is realized, and most time is saved for intelligent services.
The executing body of the above steps may be a device including one or more lens groups, or may be a server connected to a device including one or more lens groups, but is not limited thereto.
In at least one exemplary embodiment, step S102 may include:
step S1021, determining the first size S of the target object in the first path image under the initial focal length1And said second dimension S in said second image2
Step S1022, according to the first size S1And said second dimension S2Calculating said first size difference Δ 1 ═ S2-S1
In at least one exemplary embodiment, step S106 may include:
step S1061, determining the third dimension S of the target object in the second image at the current focal length3And determining the fourth dimension S of the third dimension fit back to the initial focus4=S3K, wherein k is the current focal length/the initial focal length;
step S1062, according to the first size S1And said fourth dimension S4Calculating said second size difference Δ 2 ═ S4-S1
In at least one exemplary embodiment, the preset threshold may be determined by one of:
(1) calculating the allowable depth of field under the initial focal length, determining the allowable step number of an F motor based on a lens curve according to the allowable depth of field, and calculating the allowable area difference according to the allowable step number to serve as the preset threshold;
(2) and adjusting the step number of the F motor until the current area difference is read as the preset threshold when the focusing state of the second lens meets the definition requirement.
In at least one exemplary embodiment, in a case that a difference between the second size difference and the first size difference is not smaller than a preset threshold, the second lens is controlled to continue focusing, and an operation of determining that a third size of the target object in the second path image at the current focal length fits back to a second size difference between a fourth size at the initial focal length and the first size is performed. By the method, under the condition that the current focal length is determined not to meet the definition requirement, the second lens continues to be focused, and whether the difference between the second size difference and the first size difference is smaller than a preset threshold value under the condition of the current focal length is continuously judged.
In at least one exemplary embodiment, in a case that a difference between the second size difference and the first size difference is smaller than a preset threshold, the method may further include at least one of:
step S110-1, informing the focusing state of the second lens to meet the definition requirement;
and step S110-2, controlling the second lens to shoot the target object under the current focal length.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a device for determining a focusing state is further provided, and the device is connected to or disposed in a device including one or more lens groups, where each lens group includes at least a first lens and a second lens linked by a movement, so as to implement the above embodiments and preferred embodiments, which have been already described and are not repeated. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 2 is a block diagram showing a configuration of a focus state determination apparatus according to an embodiment of the present invention, as shown in fig. 2, the focus state determination apparatus including:
a first determining module 22, configured to determine, when it is monitored that a target object appears in a first path of image captured by the first lens and a second path of image captured by the second lens, a first size difference between a first size of the target object in the first path of image and a second size of the target object in the second path of image at an initial focal length;
the zooming control module 24 is used for controlling the second lens to zoom to a target magnification;
a second determining module 26, configured to determine, before or during the second lens starts focusing, that a third size of the target object in the second path of image at the current focal length fits back to a second size difference between a fourth size at the initial focal length and the first size;
and a focusing state determining module 28, configured to determine that the focusing state of the second lens meets a requirement for sharpness when a difference between the second size difference and the first size difference is smaller than a preset threshold.
By the device, after a target object is found and the zooming operation of the second lens is completed, the fitting comparison is carried out between the size (for example, imaging area) difference value of the target object on the two paths of images in the initial stage and the size (for example, imaging area) difference value of the target object in the two paths of images in the current state in real time before the second lens starts focusing or in the focusing process, so that whether the current focusing state is in the range of the snapshot quality permission is judged, therefore, the problem that the focusing time is long due to lack of a quick response mechanism for judging whether the current focusing is clear or not in the related art can be solved, the real-time judgment of the focusing state before the focusing starts or in the focusing process is realized, and most time is saved for intelligent services.
In at least one exemplary embodiment, the first determining module 22 is configured to:
determining the first size S of the target object in the first path image at the initial focal length1And said second dimension S in said second image2
According to the first size S1And said second dimension S2Calculating said first size difference Δ 1 ═ S2-S1
In at least one exemplary embodiment, the second determination module 26 is configured to:
determining the third dimension S of the target object in the second path of image at the current focal distance3And determining the fourth dimension S of the third dimension fit back to the initial focus4=S3K, wherein k is the current focal length/the initial focal length;
according to the first size S1And said fourth dimension S4Calculating said second size difference Δ 2 ═ S4-S1
In at least one exemplary embodiment, the focus state determination module 28 is further configured to:
and under the condition that the difference between the second size difference and the first size difference is not smaller than a preset threshold, controlling the second lens to continue focusing, and calling the second determining module 26 to perform an operation of determining that the third size of the target object in the second path of image under the current focal length is fitted back to the second size difference between the fourth size under the initial focal length and the first size.
In at least one exemplary embodiment, the focus state determination module 28 is further configured to, when a difference between the second size difference and the first size difference is smaller than a preset threshold, perform at least one of the following operations:
notifying the focus state of the second lens that the sharpness requirement is met;
and controlling the second lens to shoot the target object at the current focal length.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
In the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
step S1, under the condition that a target object appears in a first path of image shot by the first lens and a second path of image shot by the second lens, determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under an initial focal length;
step S2, controlling the second lens to zoom to a target magnification;
step S3, before or during the second lens starts focusing, determining that a third size of the target object in the second path of image at the current focal length fits back to a second size difference between a fourth size at the initial focal length and the first size;
step S4, determining that the focusing state of the second lens meets the sharpness requirement when a difference between the second size difference and the first size difference is smaller than a preset threshold.
The computer readable storage medium is further arranged to store a computer program for performing the steps of:
step S5, notifying the focusing status of the second lens to meet the sharpness requirement;
and step S6, controlling the target object to be photographed through the second lens at the current focal length.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
In an exemplary embodiment, the processor may be configured to execute the following steps by a computer program:
step S1, under the condition that a target object appears in a first path of image shot by the first lens and a second path of image shot by the second lens, determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under an initial focal length;
step S2, controlling the second lens to zoom to a target magnification;
step S3, before or during the second lens starts focusing, determining that a third size of the target object in the second path of image at the current focal length fits back to a second size difference between a fourth size at the initial focal length and the first size;
step S4, determining that the focusing state of the second lens meets the sharpness requirement when a difference between the second size difference and the first size difference is smaller than a preset threshold.
In an exemplary embodiment, the processor may be further configured to execute the following steps by the computer program:
step S5, notifying the focusing status of the second lens to meet the sharpness requirement;
and step S6, controlling the target object to be photographed through the second lens at the current focal length.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
The following describes a detailed processing procedure of the method for determining the focus state of the linked movement, taking as an example the application of the above-described method for determining the focus state to a monitoring device of the linked movement.
The method is very useful for the shape of a lens device which is provided with one or more groups of double lenses and at least one lens device with a zooming function, and judges whether the shape is in the range of the snapshot quality permission or not by fitting and comparing the difference value of the imaging areas of the target object on the two paths of images with the difference value of the areas of the two paths of images after the zooming motor finishes the snapshot in the initial stage.
Fig. 3 is a relationship diagram of overall modules of a system related to a method for determining a focus state of a mobile device core according to an embodiment of the present invention, and as shown in fig. 3, the system includes a lens 1 (which takes one image corresponding to a number 1), a lens 2 (which takes one image corresponding to a number 2), an intelligent module capable of acquiring two images of the lens 1 and the lens 2, and a focus state determining module for determining a focus state.
When the intelligent module is started, the states of the lens 1 and the lens 2 are generally clear states, and the triggering of the intelligent service is waited.
When the target object is intelligently detected, the size difference of the target object in the lens 1 and the lens 2 is acquired firstly when the system is started.
Then, the intelligent module usually performs zooming and focusing on the zoom lens according to the information of the target, and performs capturing and other actions after the zooming is finished.
And the focusing state judgment module zooms the size of the target object in the current path in real time according to the ratio of the focal length to the initial focal length to obtain the size difference value of the target object in the corresponding initial lens 1 and the lens 2, compares the size difference value with the starting difference value to confirm whether the focal depth of the starting focal length contains the difference value, and finally obtains the confirmation of the focusing state.
Fig. 4 is a detailed algorithm flow of a method for judging a focusing state of a movable core according to an embodiment of the present invention, as shown in fig. 4, the method includes the steps of:
step S401, after the intelligent module is started, monitoring the first path of image and the second path of image, waiting for the intelligent target to appear, and if the intelligent target does not appear, circularly waiting all the time, and assuming that the first path of image is a fixed-focus detection path image.
Step S402, the size of the target in the initial state of target appearance and acquisition is S1The size of the zoom path image is S2Wherein the difference (S)2-S1) Is denoted as Δ 1.
In step S403, the intelligence enables the startup zoom to follow to the target magnification.
Step S404, when the zoom following is finished, before the focusing is started, according to the size S of the current target3And the size of the target when the positions of the Z motor and the F motor are fitted back to the initial focal length by the method of the current size S3K (coefficient), the size of k is determined by the focal length, k is the current focal length/initial focal length, and the current bit is obtained therebyFitting the target object size S back to the initial position4For and S1A comparison is made.
Step S405, by S4And S1Calculating Δ 2 (S) which is a difference between the size of the target object after the zoom is finished and the size of the target object in the fixed-focus path image when the size of the target object is fit back to the initial position4-S1) Therefore, if the difference between Δ 1 and Δ 2 is not large (for example, smaller than a preset threshold (i.e., the allowable area difference Thrd), which may be specifically determined according to the allowable range of depth of field), the corresponding image is within the allowable range of depth of field, and the intelligent definition is notified that the services such as capturing can be performed. The depth of field is converted into an allowable area difference Thrd from the measured step number, and the next step is carried out if the depth of field is not within the allowable range.
The allowable area difference calculation is classified into an equation method and an actual measurement method, and each of them will be described in detail below.
(1) The formulation may calculate the exact allowable depth of field by the depth of field formula:
Figure BDA0002835406590000131
where f is the actual focal length, r is the aperture, D is the distance from the center of the aperture to the sensor, and D is the blur circle diameter, where D is an empirical value that would typically be between 3mm and 5 mm.
The method comprises the steps of obtaining an object distance value through the formula, wherein the depth of field is one unit of the object distance, correcting an object distance curve of a lens when the lens leaves a factory to represent the object distance, actually combining a plurality of groups of Z motors and F motors, reading the allowable step number of the F motor under the change of the depth of field of the lens curve under the current object distance under the formula, wherein the allowable step number of the F motor corresponds to the lens parameter and is the focal length, and the ratio of the front focal length to the rear focal length is the amplification factor, so that the amplification factor of an object actually in the depth of field can be calculated through the relation of the focal lengths of the motors. On the basis of the calculated allowable amplification factor, the intelligent module can calculate the target area according to the coordinates of the current target frame, so that the target area can be converted into an allowable area difference, that is, the intelligent module can calculate the allowable area difference of the snapshot target frame according to the amplification factor.
(2) The actual measurement rule can directly adjust the F steps in a one-way mode until a user considers the F steps to be an acceptable limit, then the amplification factor of an object in the depth of field is calculated through the relation of the focal length of the motor, and finally the area difference of the snapshot target frame at the moment is read from the intelligent module to serve as an allowable value threshold.
Step S406, starting focusing and fitting the size of the target back to the size of the initial focal segment before each step of the focusing process is determined, according to the size of the current target and the positions of the Z motor and the F motor, as shown in steps S404 and S405, if the current target and the Z motor and the F motor reach the corresponding positions in the focusing process, notifying the intelligent module until the focusing is finished.
According to the scheme of the embodiment of the invention, the real-time judgment of the focusing state is realized through respectively decomposing the process, judging the zooming end and the focusing process, and during the specific judgment, the judgment of the focusing state is realized through fitting the size of the target object in the initial and target position images back to the initial focal length, so that the real-time judgment of the focusing state in service can be realized under intelligent double-shot (one or more groups of double-shot) equipment, and the problem that the running effect of an intelligent module is influenced by redundant waiting in many times in the current scheme is solved.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method for judging a focusing state is applied to a device comprising one or more lens groups, wherein each lens group at least comprises a first lens and a second lens linked by a movement, and the method comprises the following steps:
under the condition that a target object appears in a first path of image shot by the first lens and a second path of image shot by the second lens, determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under an initial focal length;
controlling the second lens to zoom to a target magnification;
before or during the focusing of the second lens, determining that a third size of the target object in the second path of image under the current focal length fits back to a second size difference value between a fourth size under the initial focal length and the first size;
and under the condition that the difference between the second size difference and the first size difference is smaller than a preset threshold value, determining that the focusing state of the second lens meets the definition requirement.
2. The method of claim 1, wherein determining a first size difference between a first size of the target object in the first pass image and a second size of the target object in the second pass image at an initial focus distance comprises:
determining the first size S of the target object in the first path image at the initial focal length1And said second dimension S in said second image2
According to the first size S1And said second dimension S2Calculating said first size difference Δ 1 ═ S2-S1
3. The method of claim 1, wherein determining that a third size of the target object in the second path image at the current focus fits back to a second size difference between a fourth size at the initial focus and the first size comprises:
determining the third dimension S of the target object in the second path of image at the current focal distance3And determining the fourth dimension S of the third dimension fit back to the initial focus4=S3K, wherein k is the current focal length/the initial focal length;
according to the first size S1And said fourth dimension S4Calculating said second size difference Δ 2 ═ S4-S1
4. The method of claim 1, wherein the preset threshold is determined by one of:
calculating the allowable depth of field under the initial focal length, determining the allowable step number of an F motor based on a lens curve according to the allowable depth of field, and calculating the allowable area difference according to the allowable step number to serve as the preset threshold;
and adjusting the step number of the F motor until the current area difference is read as the preset threshold when the focusing state of the second lens meets the definition requirement.
5. The method according to claim 1, wherein in a case that a difference between the second size difference and the first size difference is not less than a preset threshold, the second lens is controlled to continue focusing, and the operation of determining that a third size of the target object in the second path image at the current focal length fits back to a second size difference between a fourth size at the initial focal length and the first size is performed.
6. The method according to any one of claims 1-5, further comprising, in the event that the difference between the second size difference and the first size difference is less than a preset threshold, at least one of:
notifying the focus state of the second lens that the sharpness requirement is met;
and controlling the second lens to shoot the target object at the current focal length.
7. A device for determining a focusing state, which is connected to or provided in an apparatus including one or more lens groups, wherein each lens group includes at least a first lens and a second lens linked by a movement, the device for determining a focusing state comprising:
the first determining module is used for determining a first size difference value between a first size of the target object in the first path of image and a second size of the target object in the second path of image under the initial focal length under the condition that the target object appears in the first path of image shot by the first lens and the second path of image shot by the second lens;
the zooming control module is used for controlling the second lens to zoom to a target magnification;
a second determining module, configured to determine, before or during a focusing operation of the second lens, that a third size of the target object in the second path of image at the current focal length fits back to a second size difference between a fourth size and the first size at the initial focal length;
and the focusing state judging module is used for determining that the focusing state of the second lens meets the definition requirement under the condition that the difference between the second size difference and the first size difference is smaller than a preset threshold value.
8. The apparatus of claim 7, wherein the first determining module is configured to:
determining the first size S of the target object in the first path image at the initial focal length1And said second dimension S in said second image2
According to the first size S1And said second dimension S2Calculating said first size difference Δ 1 ═ S2-S1
9. The apparatus of claim 7, wherein the second determining module is configured to:
determining the third dimension S of the target object in the second path of image at the current focal distance3And determining the fourth dimension S of the third dimension fit back to the initial focus4=S3K, wherein k is the current focal length/the initial focal length;
according to the first size S1And said fourth dimension S4Calculating said second size difference Δ 2 ═ S4-S1
10. The apparatus of claim 7, wherein the focus state determining module is further configured to:
and under the condition that the difference between the second size difference and the first size difference is not smaller than a preset threshold, controlling the second lens to continue focusing, and calling the second determining module to perform an operation of determining that the third size of the target object in the second path of image under the current focal length is fitted back to the second size difference between the fourth size under the initial focal length and the first size.
11. The apparatus according to any one of claims 7-10, wherein the focus state determining module is further configured to, if a difference between the second size difference and the first size difference is smaller than a preset threshold, perform at least one of the following operations:
notifying the focus state of the second lens that the sharpness requirement is met;
and controlling the second lens to shoot the target object at the current focal length.
12. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when executed.
CN202011468773.4A 2020-12-14 2020-12-14 Method and device for judging focusing state and storage medium Active CN112653835B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011468773.4A CN112653835B (en) 2020-12-14 2020-12-14 Method and device for judging focusing state and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011468773.4A CN112653835B (en) 2020-12-14 2020-12-14 Method and device for judging focusing state and storage medium

Publications (2)

Publication Number Publication Date
CN112653835A true CN112653835A (en) 2021-04-13
CN112653835B CN112653835B (en) 2022-02-08

Family

ID=75355435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011468773.4A Active CN112653835B (en) 2020-12-14 2020-12-14 Method and device for judging focusing state and storage medium

Country Status (1)

Country Link
CN (1) CN112653835B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709367A (en) * 2021-08-24 2021-11-26 浙江大华技术股份有限公司 Method and device for controlling focusing and electronic equipment
CN114088628A (en) * 2021-11-19 2022-02-25 中导光电设备股份有限公司 Microscope measuring method
CN114374800A (en) * 2022-01-14 2022-04-19 浙江大华技术股份有限公司 Focusing processing method and device, storage medium and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090073304A1 (en) * 2007-09-14 2009-03-19 Sony Corporation Imaging apparatus, imaging apparatus control method, and computer program
US20100208091A1 (en) * 2009-02-19 2010-08-19 Apple Inc. Auto focus speed enhancement using object recognition and resolution
US20110229052A1 (en) * 2010-03-22 2011-09-22 Sony Corporation Blur function modeling for depth of field rendering
CN106303205A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 Focusing area method of adjustment and device
CN106448546A (en) * 2016-11-16 2017-02-22 西安诺瓦电子科技有限公司 Method for automatically adjusting imaging area and method for correcting LED brightness and chrominance
CN106899800A (en) * 2016-06-28 2017-06-27 阿里巴巴集团控股有限公司 Method, device and mobile terminal device that camera is focused
CN108024065A (en) * 2017-12-28 2018-05-11 努比亚技术有限公司 A kind of method of terminal taking, terminal and computer-readable recording medium
CN108076278A (en) * 2016-11-10 2018-05-25 阿里巴巴集团控股有限公司 A kind of Atomatic focusing method, device and electronic equipment
CN110971810A (en) * 2018-09-29 2020-04-07 浙江宇视科技有限公司 Movement lens return path difference processing method and device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090073304A1 (en) * 2007-09-14 2009-03-19 Sony Corporation Imaging apparatus, imaging apparatus control method, and computer program
US20100208091A1 (en) * 2009-02-19 2010-08-19 Apple Inc. Auto focus speed enhancement using object recognition and resolution
US20110229052A1 (en) * 2010-03-22 2011-09-22 Sony Corporation Blur function modeling for depth of field rendering
CN106303205A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 Focusing area method of adjustment and device
CN106899800A (en) * 2016-06-28 2017-06-27 阿里巴巴集团控股有限公司 Method, device and mobile terminal device that camera is focused
CN108076278A (en) * 2016-11-10 2018-05-25 阿里巴巴集团控股有限公司 A kind of Atomatic focusing method, device and electronic equipment
CN106448546A (en) * 2016-11-16 2017-02-22 西安诺瓦电子科技有限公司 Method for automatically adjusting imaging area and method for correcting LED brightness and chrominance
CN108024065A (en) * 2017-12-28 2018-05-11 努比亚技术有限公司 A kind of method of terminal taking, terminal and computer-readable recording medium
CN110971810A (en) * 2018-09-29 2020-04-07 浙江宇视科技有限公司 Movement lens return path difference processing method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709367A (en) * 2021-08-24 2021-11-26 浙江大华技术股份有限公司 Method and device for controlling focusing and electronic equipment
CN114088628A (en) * 2021-11-19 2022-02-25 中导光电设备股份有限公司 Microscope measuring method
CN114088628B (en) * 2021-11-19 2024-04-26 中导光电设备股份有限公司 Microscope measuring method
CN114374800A (en) * 2022-01-14 2022-04-19 浙江大华技术股份有限公司 Focusing processing method and device, storage medium and electronic device
CN114374800B (en) * 2022-01-14 2023-07-14 浙江大华技术股份有限公司 Focusing processing method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN112653835B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
CN112653835B (en) Method and device for judging focusing state and storage medium
US9998650B2 (en) Image processing apparatus and image pickup apparatus for adding blur in an image according to depth map
US20230059657A1 (en) Multi-camera zoom control method and apparatus, and electronic system and storage medium
US10061182B2 (en) Systems and methods for autofocus trigger
US9501834B2 (en) Image capture for later refocusing or focus-manipulation
CN111726521B (en) Photographing method and photographing device of terminal and terminal
CN110913129B (en) Focusing method, device, terminal and storage device based on BP neural network
CN113141448B (en) Image pickup apparatus
CN106161910B (en) Imaging control method and device and imaging equipment
CN109996005B (en) Focus correction method and device
CN111917941B (en) Camera picture processing method and camera
JP5968379B2 (en) Image processing apparatus and control method thereof
US20140327743A1 (en) Auto focus method and auto focus apparatus
CN111131717B (en) Focusing method, device, equipment and computer readable storage medium
CN111028296B (en) Method, device, equipment and storage device for estimating focal length value of spherical camera
CN116567412A (en) Zoom tracking curve determination method, apparatus, computer device and storage medium
CN112672045B (en) Shooting mode setting method and device and electronic equipment
CN115379201A (en) Test method and device, electronic equipment and readable storage medium
CN110839126B (en) Zoom tracking method and device and zoom camera
JP6486453B2 (en) Image processing apparatus, image processing method, and program
WO2024032125A1 (en) Camera monitoring method and apparatus
CN111641782B (en) Control method and device for image pickup apparatus, storage medium, and electronic device
JP2021132295A (en) Image processing device, imaging device, image processing method, and program
CN116761071A (en) Exposure control method, system, equipment, medium and chip for camera switching
CN116456189A (en) Shooting method, mobile terminal and storage medium

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