CN107124547B - Double-camera shooting method and device - Google Patents

Double-camera shooting method and device Download PDF

Info

Publication number
CN107124547B
CN107124547B CN201710258756.XA CN201710258756A CN107124547B CN 107124547 B CN107124547 B CN 107124547B CN 201710258756 A CN201710258756 A CN 201710258756A CN 107124547 B CN107124547 B CN 107124547B
Authority
CN
China
Prior art keywords
camera
focusing
light
determining
focus position
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
CN201710258756.XA
Other languages
Chinese (zh)
Other versions
CN107124547A (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.)
Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Original Assignee
Yulong Computer Telecommunication Scientific Shenzhen 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 Yulong Computer Telecommunication Scientific Shenzhen Co Ltd filed Critical Yulong Computer Telecommunication Scientific Shenzhen Co Ltd
Priority to CN201710258756.XA priority Critical patent/CN107124547B/en
Publication of CN107124547A publication Critical patent/CN107124547A/en
Application granted granted Critical
Publication of CN107124547B publication Critical patent/CN107124547B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene
    • H04N23/71Circuitry for evaluating the brightness variation

Abstract

A double-camera photographing method is applied to electronic equipment and comprises the following steps: acquiring a shooting target; controlling a first camera and a second camera to focus simultaneously, and determining an initial focusing position of the first camera and a second focusing position of the second camera; determining the first focus position based on the initial focus position when the initial focus position is within a proximity range of the second focus position; when the initial focusing position is not within the adjacent range of the second focusing position, driving a first focusing lens of the first camera to move from the initial focusing position to a reference position within the adjacent range, and determining the first focusing position based on the reference position; and shooting the shooting target based on the first focus position and the second focus position. The invention also provides a double-camera photographing device. The invention can improve the focusing speed and accuracy in dark environment.

Description

Double-camera shooting method and device
Technical Field
The invention relates to the technical field of photographing, in particular to a double-camera photographing method and device.
Background
In order to improve the photographing effect of the terminal, more and more electronic devices adopt two cameras, a color camera and a black and white camera. However, the two cameras need to be focused by adopting the two cameras, so that the two cameras can be focused. If the focusing is not successful, the shot object cannot be imaged clearly. The current focusing method is that the color camera firstly focuses, and the black-and-white camera focuses according to the focus position of the color camera. Therefore, the light inlet quantity of the color sensor of the color camera in a low-light environment is not as high as that of a black-white sensor of a black-white camera, so that the problems of inaccurate focusing and low focusing speed are easily caused in the low-light environment.
Disclosure of Invention
In view of the above, it is desirable to provide a method and an apparatus for taking a picture with two cameras, which can improve the focusing speed and accuracy in a dark environment.
A double-camera photographing method is applied to electronic equipment, the electronic equipment comprises a first camera and a second camera, the first camera is a color camera, the second camera is a black and white camera, and the method comprises the following steps:
acquiring a shooting target;
when the current light is detected to be dim light, controlling the first camera and the second camera to focus simultaneously, and determining an initial focusing position of the first camera and a second focusing position of the second camera;
determining the first focus position based on the initial focus position when the initial focus position is within a proximity range of the second focus position;
when the initial focusing position is not within the adjacent range of the second focusing position, driving a first focusing lens of the first camera to move from the initial focusing position to a reference position within the adjacent range, and determining the first focusing position based on the reference position;
and shooting the shooting target based on the first focus position and the second focus position.
According to a preferred embodiment of the invention, the method further comprises:
sensing a current light value by using a light sensor of the electronic equipment, and determining a light interval range in which the current light value is located;
when the current light value is within the range of the light interval of the dim light, determining that the current light is the dim light; or
And when the current light value is within the light interval range of the normal light or within the light interval range of the strong light, determining that the current light is not the dark light.
According to a preferred embodiment of the present invention, the determining the first focus position based on the initial focus position includes:
from the initial focusing position, gradually reducing a searching range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing searching algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a first position meeting a preset condition as the first focusing position, wherein the searching step size is gradually reduced along with the increase of the searching times.
According to a preferred embodiment of the present invention, the determining the first focus position based on the reference position comprises:
from the reference position, gradually reducing the search range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing search algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a second position satisfying a preset condition as the first focusing position, wherein the search step size is gradually reduced with the increase of the number of searches.
According to a preferred embodiment of the present invention, the preset conditions include one or more of the following: the searching times are more than or equal to the preset times, and the searching step length is less than or equal to the preset step length.
The utility model provides a device is shot to two cameras, moves in electronic equipment, electronic equipment includes first camera and second camera, first camera is color camera, the second camera is black and white camera, the device includes:
the acquisition module is used for acquiring a shooting target;
the determining module is used for controlling the first camera and the second camera to focus simultaneously when the current light is detected to be dim light, and determining an initial focusing position of the first camera and a second focusing position of the second camera;
the determination module is further configured to determine the first focus position based on the initial focus position when the initial focus position is within a proximity of the second focus position;
the determination module is further used for driving a first focusing lens of the first camera to move from the initial focusing position to a reference position in the adjacent range when the initial focusing position is not in the adjacent range of the second focusing position, and determining the first focusing position based on the reference position;
and the shooting module is used for shooting the shooting target based on the first focusing position and the second focusing position.
According to a preferred embodiment of the present invention, the determining module is further configured to sense a current light value by using a light sensor of the electronic device, and determine a light interval range in which the current light value is located;
the determining module is further configured to determine that the current light is dim light when the current light value is within the range of the light interval of the dim light;
the determining module is further used for determining that the current light is not the dark light when the current light value is within the light interval range of the normal light or within the light interval range of the strong light.
According to a preferred embodiment of the present invention, the determining module for determining the first focus position based on the initial focus position comprises:
from the initial focusing position, gradually reducing a searching range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing searching algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a first position meeting a preset condition as the first focusing position, wherein the searching step size is gradually reduced along with the increase of the searching times.
According to a preferred embodiment of the present invention, the determining module for determining the first focus position based on the reference position comprises:
from the reference position, gradually reducing the search range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing search algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a second position satisfying a preset condition as the first focusing position, wherein the search step size is gradually reduced with the increase of the number of searches.
According to a preferred embodiment of the present invention, the preset conditions include one or more of the following: the searching times are more than or equal to the preset times, and the searching step length is less than or equal to the preset step length.
According to the technical scheme, the method obtains the shooting target; when the current light is determined to be dim light, focusing a first camera and a second camera by adopting a first focusing method, and determining a first focusing position of the first camera and a second focusing position of the second camera; shooting the shooting target based on the first focus position and the second focus position; when the current light is determined not to be dim light, focusing the first camera and the second camera by adopting a second focusing method, and determining a third focusing position of the first camera and a fourth focusing position of the second camera; and shooting the shooting target based on the third focusing position and the fourth focusing position. The invention also provides a double-camera photographing device. The invention can automatically select focusing corresponding to the light according to the light of the photographing environment, thereby improving the focusing speed and accuracy.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a dual-camera photographing method according to a preferred embodiment of the present invention.
Fig. 2 is a schematic diagram of searching for an optimal focusing position by using a hill-climbing search method according to the present invention.
Fig. 3 is a functional block diagram of a dual-camera photographing apparatus according to a preferred embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention.
Description of the main elements
Figure BDA0001274158360000051
Figure BDA0001274158360000061
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Preferably, the dual-camera photographing method of the present invention can be applied to one or more of the electronic devices. The electronic device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device includes, but is not limited to, any electronic product that can interact with a user through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), an interactive web television (IPTV), a smart wearable device, a Digital camera, and the like. The electronic equipment comprises two cameras, wherein the first camera is a color camera, and the second camera is a black-and-white camera.
It should be simply stated that the structure of the camera generally consists of a lens, a sensor and a peripheral circuit, the sensor cannot work independently, and the optical signal can be converted into an electrical signal only by the support of the peripheral circuit; the light is reflected by the shooting target and reaches the photosensitive element of the sensor through the lens, so that the light signal is converted into an electric signal, the converted electric signal is transmitted to the image signal processor for analysis and processing, the focusing lens is adjusted, and the clearest point of the image is searched, namely the process of automatic focusing. In the embodiment of the invention, after the focusing position is determined, the focusing position is represented by the distance from the focusing lens of the camera to the photosensitive element of the camera. For example, when the distance from the focusing lens of the camera to the photosensitive element of the camera is 3mm, the focusing position is located at the position with the distance of 3mm from the photosensitive element of the camera.
The first camera includes, but is not limited to, a first focus lens, a first sensor, a first light sensing element, a distance measuring device, and the like. The second camera includes a second focus lens, a second sensor, a second light sensing element, and so on. The distance measuring device is used for measuring the distance between a shooting target and the first camera. Such as a laser rangefinder or the like. Through the configuration of the first camera and the second camera, the second camera is responsible for outlining a shooting target, and the first camera is responsible for restoring the color of the shooting target.
Fig. 1 is a flowchart of a dual-camera photographing method according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
And S10, the electronic equipment acquires a shooting target.
In at least one embodiment of the present invention, the acquiring of the shooting target may specifically be a process in which a user aims a camera of the electronic device at an object to be shot.
Further, before the acquiring the shooting target, the method further includes:
receiving a starting instruction of a camera;
specifically, the action of clicking the application icon of the camera on the electronic device by the user triggers the start instruction of the camera, and the electronic device can receive the start instruction of the camera.
And S11, when the current light is detected to be dim light, the electronic equipment controls the first camera and the second camera to focus simultaneously, and determines the initial focusing position of the first camera and the second focusing position of the second camera.
In at least one embodiment of the present invention, the electronic device includes a light sensor. The memory of the electronic device stores a plurality of light ray interval ranges, and comprises: normal light ray interval range, dim light ray interval range, strong light ray interval range, and the like. And training and determining the ranges of the light ray intervals according to the large sample data by utilizing a machine learning algorithm, so that the data accuracy can be better ensured.
The electronic equipment senses the current light value by using the light sensor and determines the range of the light interval where the current light value is located. And when the current light value is within the range of the light interval of the dim light, the electronic equipment determines that the current light is the dim light. When the current light value is within the light interval range of the normal light or within the light interval range of the strong light, the electronic equipment determines that the current light is not the dark light. In other embodiments, whether the current light is a dim light may also be determined in other manners, which is not limited in the present invention.
In at least one embodiment of the present invention, the electronic device controls the first camera and the second camera to focus simultaneously by using a passive auto-focusing method to determine the second focusing position and the initial focusing position. And in the process of focusing by using the passive automatic focusing method, when the second focusing position is determined, the process of focusing by using the passive automatic focusing method is terminated, and the initial focusing position is recorded. That is, when the second camera is focused by the passive automatic focusing method, the first camera does not complete focusing or the first camera has a poor focusing effect.
Preferably, the passive auto-focusing method includes: phase focus and/or contrast focus. Phase focusing and contrast focusing are prior art and the present invention will not be described in detail.
S12, the electronic device determines whether the initial focus position is within a proximity range of the second focus position.
In the electronic device, the second camera is a black-and-white camera, the first camera is a color camera, the second camera is provided with the second sensor, the first camera is provided with the first sensor and used for completing the collection and conversion of optical signals, and the light inlet quantity of the second sensor is far greater than that of the first sensor, so that the focusing speed and the focusing effect of the second sensor are obviously superior to those of the first sensor in a dark light environment. Meanwhile, the initial focusing position of the first camera is adjusted based on the first focusing position of the second camera, so that focusing can be completed more quickly and accurately in a dark environment, and the final shooting effect is better.
When the initial focus position is within the proximity of the second focus position, S13 is performed. When the initial in-focus position is not within the proximity of the second in-focus position, S14 is performed.
For example, the initial focus position is represented by 2mm, i.e. the distance from the first focus lens to the first photosensitive element is 2mm, and the second focus position is represented by 4mm, i.e. the distance from the first focus lens to the first photosensitive element is 4 mm. The adjacent range of the second focusing position is [3mm,5mm ], and the distance corresponding to the initial focusing position is not in the adjacent range.
S13, the electronic equipment determines the first focusing position based on the initial focusing position.
In at least one embodiment of the present invention, the electronic device gradually reduces a search range including a maximum value of the focus evaluation function value using a hill-climbing search algorithm from the initial focus position until a preset condition is reached through a plurality of searches, and determines a first position satisfying the preset condition as the first focus position. The preset conditions include, but are not limited to, the number of searches being greater than or equal to a preset number of times, and the search step length being less than or equal to a preset step length. The search step size is gradually reduced as the number of searches increases. During a search, the first focusing lens is moved in the same search step. For example, during a first search, 0.3mm movement, and during a second search, 0.2mm movement. There are many focus evaluation functions, such as gray-scale gradient based functions, informatics functions, frequency domain functions, statistical functions, etc., and the present invention is not limited thereto.
Preferably, as shown in fig. 2, in the first search process, starting from the initial focusing position a point, the first focusing lens is driven to move in a direction away from the first photosensitive element or in a direction close to the first photosensitive element by a first step length, a current focusing evaluation function value is calculated every step, and a larger focusing evaluation function value and a focusing position corresponding to the larger focusing evaluation function value are recorded compared with the focusing evaluation function value obtained in the previous step, that is, the following focusing positions are recorded: B. c, D, E, F, G, determining the scope of the second search as searching between D and F. In the second search, a search is performed at a second step size, the second step size being smaller than the first step size. The electronic device drives the first focusing lens to start at D and end at F, and the following focusing positions are recorded: D. h, I, J, K, L, M, N, F, determining the range of the third search between J and L, and repeating the search until reaching the preset condition. And the electronic equipment determines the focusing position corresponding to the maximum value of the focusing evaluation function in the last searching process as the first position.
In other embodiments, to reduce the amount of calculation, the electronic device drives the first focus lens to move away from or close to the first photosensitive element by a first step length in a preset step length from the initial focus position. And each step is taken, the electronic equipment calculates the current focusing evaluation function value until the focusing evaluation function value is reduced. And when the focusing evaluation function value begins to decline, the electronic equipment drives the first focusing lens to retreat by a preset distance, and the position retreated by the preset distance is determined as the first position.
S14, the electronic device drives the first focus lens, moves from the initial focusing position to a reference position in the adjacent range, and determines the first focusing position based on the reference position.
In at least one embodiment of the present invention, the reference position may be any position within the proximity range.
In at least one embodiment of the present invention, the electronic device gradually reduces a search range including a maximum value of the focus evaluation function value using a hill-climbing search algorithm from the reference position until a preset condition is reached through a plurality of searches, and determines a first position satisfying the preset condition as the first focus position. The preset conditions include, but are not limited to, the number of searches being greater than or equal to a preset number of times, and the search step length being less than or equal to a preset step length. The search step size is gradually reduced as the number of searches increases. During a search, the first focusing lens is moved in the same search step. The specific search process is similar to that of fig. 3 and is not described again.
In other embodiments, to reduce the amount of calculation, the electronic device drives the first focus lens to move by a first step length in a direction away from or close to the first photosensitive element, starting from the reference position, by a preset step length. And each step is taken, the electronic equipment calculates the current focusing evaluation function value until the focusing evaluation function value is reduced. And when the focusing evaluation function value begins to decline, the electronic equipment drives the first focusing lens to retreat by a preset distance, and the position retreated by the preset distance is determined as the second position.
And S15, the electronic equipment shoots the shooting target based on the first focus position and the second focus position.
As shown in fig. 3, a functional block diagram of a dual-camera photographing apparatus according to a preferred embodiment of the present invention is shown. The double-camera photographing device 11 comprises an acquisition module 100, a determination module 101, a judgment module 102 and a photographing module 103. The module referred to in the present invention refers to a series of computer program segments capable of being executed by the processor 13 and performing a fixed function, which are stored in the memory 12. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
The acquisition module 100 acquires a photographic target.
In at least one embodiment of the present invention, the acquiring of the shooting target may specifically be a process in which a user aims a camera of the electronic device at an object to be shot.
Further, before the obtaining module 100 obtains the shooting target, the method further includes:
receiving a starting instruction of a camera;
specifically, the action of clicking the application icon of the camera on the electronic device by the user triggers the start instruction of the camera, and the electronic device can receive the start instruction of the camera.
When the current light is detected to be dim light, the determining module 101 controls the first camera and the second camera to focus simultaneously, and determines an initial focusing position of the first camera and a second focusing position of the second camera.
In at least one embodiment of the present invention, the electronic device includes a light sensor. The memory of the electronic device stores a plurality of light ray interval ranges, and comprises: normal light ray interval range, dim light ray interval range, strong light ray interval range, and the like. And training and determining the ranges of the light ray intervals according to the large sample data by utilizing a machine learning algorithm, so that the data accuracy can be better ensured.
The determining module 101 senses a current light value by using the light sensor, and determines a light interval range in which the current light value is located. When the current light value is within the range of the light interval of the dim light, the determining module 101 determines that the current light is the dim light. When the current light value is within the light interval range of the normal light or within the light interval range of the strong light, the determining module 101 determines that the current light is not the dark light. In other embodiments, whether the current light is a dim light may also be determined in other manners, which is not limited in the present invention.
In at least one embodiment of the present invention, the determining module 101 utilizes a passive auto-focusing method to control the first camera and the second camera to focus simultaneously to determine the second focusing position and the initial focusing position. And in the process of focusing by using the passive automatic focusing method, when the second focusing position is determined, the process of focusing by using the passive automatic focusing method is terminated, and the initial focusing position is recorded. That is, when the second camera is focused by the passive automatic focusing method, the first camera does not complete focusing or the first camera has a poor focusing effect.
Preferably, the passive auto-focusing method includes: phase focus and/or contrast focus. Phase focusing and contrast focusing are prior art and the present invention will not be described in detail.
The determining module 102 determines whether the initial focusing position is within a proximity range of the second focusing position.
In the electronic device, the second camera is a black-and-white camera, the first camera is a color camera, the second camera is provided with the second sensor, the first camera is provided with the first sensor and used for completing the collection and conversion of optical signals, and the light inlet quantity of the second sensor is far greater than that of the first sensor, so that the focusing speed and the focusing effect of the second sensor are obviously superior to those of the first sensor in a dark light environment. Meanwhile, the initial focusing position of the first camera is adjusted based on the first focusing position of the second camera, so that focusing can be completed more quickly and accurately in a dark environment, and the final shooting effect is better.
For example, the initial focus position is represented by 2mm, i.e. the distance from the first focus lens to the first photosensitive element is 2mm, and the second focus position is represented by 4mm, i.e. the distance from the first focus lens to the first photosensitive element is 4 mm. The adjacent range of the second focusing position is [3mm,5mm ], and the distance corresponding to the initial focusing position is not in the adjacent range.
When the initial in-focus position is within the proximity of the second in-focus position, the determination module 101 determines the first in-focus position based on the initial in-focus position.
In at least one embodiment of the present invention, the determining module 101 gradually reduces a search range including a maximum value of the focus evaluation function values by using a hill-climbing search algorithm from the initial focus position until a preset condition is reached, and determines a first position satisfying the preset condition as the first focus position. The preset conditions include, but are not limited to, the number of searches being greater than or equal to a preset number of times, and the search step length being less than or equal to a preset step length. The search step size is gradually reduced as the number of searches increases. During a search, the first focusing lens is moved in the same search step. For example, during a first search, 0.3mm movement, and during a second search, 0.2mm movement. There are many focus evaluation functions, such as gray-scale gradient based functions, informatics functions, frequency domain functions, statistical functions, etc., and the present invention is not limited thereto.
Preferably, as shown in fig. 2, in the first search process, starting from the initial focusing position a point, the first focusing lens is driven to move in a direction away from the first photosensitive element or in a direction close to the first photosensitive element by a first step length, a current focusing evaluation function value is calculated every step, and a larger focusing evaluation function value and a focusing position corresponding to the larger focusing evaluation function value are recorded compared with the focusing evaluation function value obtained in the previous step, that is, the following focusing positions are recorded: B. c, D, E, F, G, determining the scope of the second search as searching between D and F. In the second search, a search is performed at a second step size, the second step size being smaller than the first step size. The electronic device drives the first focusing lens to start at D and end at F, and the following focusing positions are recorded: D. h, I, J, K, L, M, N, F, determining the range of the third search between J and L, and repeating the search until reaching the preset condition. And the electronic equipment determines the focusing position corresponding to the maximum value of the focusing evaluation function in the last searching process as the first position.
In other embodiments, to reduce the amount of calculation, the determining module 101 drives the first focusing lens to move away from the first photosensitive element or close to the first photosensitive element by a first step length from the initial focusing position. And each step is taken, the electronic equipment calculates the current focusing evaluation function value until the focusing evaluation function value is reduced. When the focusing evaluation function value starts to decrease, the determining module 101 drives the first focusing lens to retreat by a preset distance, and determines the position retreated by the preset distance as the first position.
When the initial focus position is not within the proximity range of the second focus position, the determination module 101 drives the first focus lens, moves from the initial focus position to a reference position within the proximity range, and determines the first focus position based on the reference position.
In at least one embodiment of the present invention, the reference position may be any position within the proximity range.
In at least one embodiment of the present invention, the determining module 101 gradually reduces a search range including a maximum value of the focus evaluation function values by using a hill-climbing search algorithm from the reference position until a preset condition is reached, and determines a first position satisfying the preset condition as the first focus position. The preset conditions include, but are not limited to, the number of searches being greater than or equal to a preset number of times, and the search step length being less than or equal to a preset step length. The search step size is gradually reduced as the number of searches increases. During a search, the first focusing lens is moved in the same search step. The specific search process is similar to that of fig. 3 and is not described again.
In other embodiments, to reduce the amount of calculation, the determining module 101 drives the first focusing lens to move away from or close to the first photosensitive element by a first step length in a preset step length from the reference position. Each step, the determining module 101 calculates the current focus evaluation function value until the focus evaluation function value decreases. When the focusing evaluation function value starts to decrease, the determining module 101 drives the first focusing lens to retreat by a preset distance, and determines the position retreated by the preset distance as the second position.
The shooting module 103 shoots the shooting target based on the first focus position and the second focus position.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention.
As shown in fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing a dual-camera photographing method. The electronic device 1 comprises a memory 12, a processor 13, a first camera 14, and a second camera 15.
The electronic device 1 may also include, but is not limited to, any electronic product that can interact with a user through a keyboard, a mouse, a remote controller, a touch panel, or a voice control device, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an Internet Protocol Television (IPTV), an intelligent wearable device, and the like. The Network where the electronic device 1 is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
The memory 12 is used for storing a program and various data of a double-camera photographing method and realizing high-speed and automatic access of the program or the data in the operation process of the electronic device 1. The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the Memory 12 may be a circuit having a Memory function without any physical form in the integrated circuit, such as a RAM (Random-Access Memory), a FIFO (First in First Out), and the like. Alternatively, the memory 12 may be a memory in a physical form, such as a memory stick, a TF Card (Trans-flash Card), or the like.
The processor 13 is also called a Central Processing Unit (CPU), and is an ultra-large scale integrated circuit, which is an operation Core (Core) and a Control Core (Control Unit) of the electronic device 1. The processor 13 may execute an operating system of the electronic device 1 and various installed application programs, program codes, and the like, such as the dual-camera photographing device 11.
The first camera 14 includes a first sensor 141, a first photosensitive element 142, and a first focusing lens 143. The second camera 15 includes a second sensor 151, a second photosensitive element 152, and a second focusing lens 153. In the embodiment of the present invention, the first camera 14 is a color camera, and the second camera 15 is a black-and-white camera. By configuring the first camera 14 and the second camera 15, the second camera 15 is responsible for outlining the shooting target, and the first camera 14 is responsible for restoring the color of the shooting target.
Referring to fig. 1, the memory 12 in the electronic device 1 stores a plurality of instructions to implement a dual-camera photographing method, and the processor 13 can execute the plurality of instructions to implement: acquiring a shooting target; when the current light is detected to be dim light, controlling the first camera and the second camera to focus simultaneously, and determining an initial focusing position of the first camera and a second focusing position of the second camera; determining the first focus position based on the initial focus position when the initial focus position is within a proximity range of the second focus position; when the initial focusing position is not within the adjacent range of the second focusing position, driving a first focusing lens of the first camera to move from the initial focusing position to a reference position within the adjacent range, and determining the first focusing position based on the reference position; and shooting the shooting target based on the first focus position and the second focus position.
According to a preferred embodiment of the present invention, the plurality of instructions executed by the processor 13 further includes:
sensing a current light value by using a light sensor of the electronic equipment, and determining a light interval range in which the current light value is located;
when the current light value is within the range of the light interval of the dim light, determining that the current light is the dim light; or
And when the current light value is within the light interval range of the normal light or within the light interval range of the strong light, determining that the current light is not the dark light.
According to a preferred embodiment of the present invention, the determining the first focus position based on the initial focus position includes:
from the initial focusing position, gradually reducing a searching range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing searching algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a first position meeting a preset condition as the first focusing position, wherein the searching step size is gradually reduced along with the increase of the searching times.
According to a preferred embodiment of the present invention, the determining the first focus position based on the reference position comprises:
from the reference position, gradually reducing the search range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing search algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a second position satisfying a preset condition as the first focusing position, wherein the search step size is gradually reduced with the increase of the number of searches.
According to a preferred embodiment of the present invention, the preset conditions include one or more of the following: the searching times are more than or equal to the preset times, the searching step length is less than or equal to the preset step length
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. The utility model provides a two camera methods of shooing, is applied to in the electronic equipment, the electronic equipment includes first camera and second camera, first camera is the color camera, the second camera is the black and white camera, first camera includes first focus lens, a photosensitive element, its characterized in that, the method includes:
acquiring a shooting target;
when the current light is detected to be dim light, controlling the first camera and the second camera to focus simultaneously, and determining an initial focusing position of the first camera and a second focusing position of the second camera;
determining a first focus position based on the initial focus position when the initial focus position is within a proximity range of the second focus position, comprising: starting from the initial focusing position, driving the first focusing lens to move in a direction away from the first photosensitive element or in a direction close to the first photosensitive element by a preset step length, calculating a current focusing evaluation function value every step until the focusing evaluation function value is reduced, driving the first focusing lens to retreat by a preset distance, and determining the position retreated by the preset distance as the first focusing position;
driving a first focus lens of the first camera to move from the initial focus position to a reference position within a proximity range of the second focus position when the initial focus position is not within the proximity range, and determining the first focus position based on the reference position, including: driving the first focusing lens to move in a direction away from the first photosensitive element or in a direction close to the first photosensitive element by the preset step length from the reference position, calculating a current focusing evaluation function value every step until the focusing evaluation function value is reduced, driving the first focusing lens to retreat by the preset distance, and determining a position retreated by the preset distance as the first focusing position;
and shooting the shooting target based on the first focus position and the second focus position.
2. The dual-camera photographing method of claim 1, wherein the method further comprises:
sensing a current light value by using a light sensor of the electronic equipment, and determining a light interval range in which the current light value is positioned, wherein a plurality of light interval ranges are determined by using a machine learning algorithm and training according to large sample data;
when the current light value is within the range of the light interval of the dim light, determining that the current light is the dim light; or
And when the current light value is in the range of the light interval of the normal light or the range of the light interval of the strong light, determining that the current light is not the dark light.
3. The dual-camera photographing method according to claim 1, wherein the determining the first focus position based on the initial focus position includes:
from the initial focusing position, gradually reducing a searching range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing searching algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a first position meeting a preset condition as the first focusing position, wherein the searching step size is gradually reduced along with the increase of the searching times.
4. The dual-camera photographing method according to claim 1, wherein the determining the first focus position based on the reference position includes:
from the reference position, gradually reducing the search range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing search algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a second position satisfying a preset condition as the first focusing position, wherein the search step size is gradually reduced with the increase of the number of searches.
5. The dual-camera photographing method according to any one of claims 3 or 4, wherein the preset condition includes one or more of: the searching times are more than or equal to the preset times, and the searching step length is less than or equal to the preset step length.
6. The utility model provides a device is shot to two cameras, moves in electronic equipment, electronic equipment includes first camera and second camera, first camera is color camera, the second camera is black and white camera, first camera includes first focusing lens, a photosensitive element, its characterized in that, the device includes:
the acquisition module is used for acquiring a shooting target;
the determining module is used for controlling the first camera and the second camera to focus simultaneously when the current light is detected to be dim light, and determining an initial focusing position of the first camera and a second focusing position of the second camera;
the determining module is further configured to determine a first focus position based on the initial focus position when the initial focus position is within a proximity of the second focus position, including: starting from the initial focusing position, driving the first focusing lens to move in a direction away from the first photosensitive element or in a direction close to the first photosensitive element by a preset step length, calculating a current focusing evaluation function value every step until the focusing evaluation function value is reduced, driving the first focusing lens to retreat by a preset distance, and determining the position retreated by the preset distance as the first focusing position;
the determining module is further configured to drive a first focus lens of the first camera when the initial focus position is not within a proximity range of the second focus position, move from the initial focus position to a reference position within the proximity range, and determine the first focus position based on the reference position, including: driving the first focusing lens to move in a direction away from the first photosensitive element or in a direction close to the first photosensitive element by the preset step length from the reference position, calculating a current focusing evaluation function value every step until the focusing evaluation function value is reduced, driving the first focusing lens to retreat by the preset distance, and determining a position retreated by the preset distance as the first focusing position;
and the shooting module is used for shooting the shooting target based on the first focusing position and the second focusing position.
7. The dual-camera photographing device according to claim 6, wherein the determining module is further configured to sense a current light value by using a light sensor of the electronic device and determine a light interval range in which the current light value is located, wherein a plurality of light interval ranges are determined by using a machine learning algorithm according to large sample data training;
the determining module is further configured to determine that the current light is dim light when the current light value is within the range of the light interval of the dim light;
the determining module is further used for determining that the current light is not dim light when the current light value is within the range of the light interval of the normal light or within the range of the light interval of the strong light.
8. The dual-camera photographing device of claim 6, wherein the determining module for determining the first focus position based on the initial focus position comprises:
from the initial focusing position, gradually reducing a searching range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing searching algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a first position meeting a preset condition as the first focusing position, wherein the searching step size is gradually reduced along with the increase of the searching times.
9. The dual-camera photographing device of claim 6, wherein the determining module for determining the first focus position based on the reference position comprises:
from the reference position, gradually reducing the search range containing the maximum value of the focusing evaluation function value by utilizing a hill climbing search algorithm, and searching for a plurality of times until a preset condition is reached;
and determining a second position satisfying a preset condition as the first focusing position, wherein the search step size is gradually reduced with the increase of the number of searches.
10. The dual-camera photographing device according to any one of claims 8 or 9, wherein the preset condition includes one or more of: the searching times are more than or equal to the preset times, and the searching step length is less than or equal to the preset step length.
CN201710258756.XA 2017-04-19 2017-04-19 Double-camera shooting method and device Active CN107124547B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710258756.XA CN107124547B (en) 2017-04-19 2017-04-19 Double-camera shooting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710258756.XA CN107124547B (en) 2017-04-19 2017-04-19 Double-camera shooting method and device

Publications (2)

Publication Number Publication Date
CN107124547A CN107124547A (en) 2017-09-01
CN107124547B true CN107124547B (en) 2020-10-16

Family

ID=59724732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710258756.XA Active CN107124547B (en) 2017-04-19 2017-04-19 Double-camera shooting method and device

Country Status (1)

Country Link
CN (1) CN107124547B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020210168A1 (en) 2019-04-08 2020-10-15 Activ Surgical, Inc. Systems and methods for medical imaging
CN110769162B (en) 2019-11-28 2021-07-13 维沃移动通信有限公司 Electronic equipment and focusing method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3338322B2 (en) * 1997-02-25 2002-10-28 三洋電機株式会社 Auto focus camera
CN105578029A (en) * 2015-09-01 2016-05-11 闽南师范大学 Multi-scale variable-step autofocusing searching algorithm data transmission device and method
CN105578048A (en) * 2015-12-23 2016-05-11 北京奇虎科技有限公司 Quick focusing method, quick focusing apparatus and mobile terminal
CN106226976A (en) * 2016-09-22 2016-12-14 宇龙计算机通信科技(深圳)有限公司 A kind of dual camera image pickup method, system and terminal
CN106254682A (en) * 2016-09-22 2016-12-21 维沃移动通信有限公司 A kind of photographic method and mobile terminal
CN106506939A (en) * 2016-10-12 2017-03-15 成都西纬科技有限公司 A kind of image collecting device and acquisition method
CN106534696A (en) * 2016-11-29 2017-03-22 努比亚技术有限公司 Focusing apparatus and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5404376B2 (en) * 2009-12-24 2014-01-29 株式会社東芝 Camera module and image processing apparatus
CN105657251B (en) * 2015-12-24 2018-06-29 广东欧珀移动通信有限公司 Camera control method, photographing control device and camera system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3338322B2 (en) * 1997-02-25 2002-10-28 三洋電機株式会社 Auto focus camera
CN105578029A (en) * 2015-09-01 2016-05-11 闽南师范大学 Multi-scale variable-step autofocusing searching algorithm data transmission device and method
CN105578048A (en) * 2015-12-23 2016-05-11 北京奇虎科技有限公司 Quick focusing method, quick focusing apparatus and mobile terminal
CN106226976A (en) * 2016-09-22 2016-12-14 宇龙计算机通信科技(深圳)有限公司 A kind of dual camera image pickup method, system and terminal
CN106254682A (en) * 2016-09-22 2016-12-21 维沃移动通信有限公司 A kind of photographic method and mobile terminal
CN106506939A (en) * 2016-10-12 2017-03-15 成都西纬科技有限公司 A kind of image collecting device and acquisition method
CN106534696A (en) * 2016-11-29 2017-03-22 努比亚技术有限公司 Focusing apparatus and method

Also Published As

Publication number Publication date
CN107124547A (en) 2017-09-01

Similar Documents

Publication Publication Date Title
CN107026979B (en) Double-camera shooting method and device
WO2021052487A1 (en) Method and apparatus for obtaining extended depth of field image, and electronic device
JP5368723B2 (en) Imaging apparatus and control method thereof
US9456141B2 (en) Light-field based autofocus
CN108668086B (en) Automatic focusing method and device, storage medium and terminal
CN106101540B (en) Focus point determines method and device
CN106226976A (en) A kind of dual camera image pickup method, system and terminal
CN108200335A (en) Photographic method, terminal and computer readable storage medium based on dual camera
CN105163034A (en) Photographing method and mobile terminal
CN112738397A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN112333379A (en) Image focusing method and device and image acquisition equipment
CN107124547B (en) Double-camera shooting method and device
US9912858B2 (en) Image capturing apparatus and control method thereof
CN108769538B (en) Automatic focusing method and device, storage medium and terminal
CN109698902B (en) Synchronous focusing method and device
CN113866782A (en) Image processing method and device and electronic equipment
CN106154688A (en) A kind of method and device of auto-focusing
CN105120153A (en) Image photographing method and device
CN106878621B (en) Double-camera shooting method and device
JP2016057463A (en) Focus adjustment device and control method of the same
CN107124535B (en) Double-camera shooting method and device
US20230164446A1 (en) Imaging exposure control method and apparatus, device and storage medium
CN114500837B (en) Shooting method and device and electronic equipment
CN114286011B (en) Focusing method and device
CN114125226A (en) Image shooting method and device, electronic equipment and readable 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