CN116437202A - Focusing method, focusing device, electronic equipment and readable storage medium - Google Patents

Focusing method, focusing device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116437202A
CN116437202A CN202111628955.8A CN202111628955A CN116437202A CN 116437202 A CN116437202 A CN 116437202A CN 202111628955 A CN202111628955 A CN 202111628955A CN 116437202 A CN116437202 A CN 116437202A
Authority
CN
China
Prior art keywords
focusing
area
focusing area
camera
amplified
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111628955.8A
Other languages
Chinese (zh)
Inventor
韩豪
姬向东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202111628955.8A priority Critical patent/CN116437202A/en
Publication of CN116437202A publication Critical patent/CN116437202A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Studio Devices (AREA)

Abstract

The disclosure provides a focusing method, a focusing device, an electronic device and a readable storage medium, wherein the focusing method comprises the following steps: acquiring a first focusing area based on a first preview image acquired by a camera; acquiring a second focusing area based on a second preview image of the camera, wherein the second preview image is a next frame image of the first preview image; amplifying the first focusing area to obtain an amplified first focusing area; and determining focusing parameters of the camera according to the amplified first focusing area and the amplified second focusing area. By adopting the method disclosed by the invention, the frame delay can be reduced in the focusing process, the better focusing effect can be achieved when the fast moving object is shot, the shooting quality is improved, and the user experience is improved.

Description

Focusing method, focusing device, electronic equipment and readable storage medium
Technical Field
The disclosure relates to the field of imaging technologies, and in particular, to a focusing method, a focusing device, an electronic device and a readable storage medium.
Background
When a photographing apparatus having an auto-focus function performs a photographing operation, it is necessary to determine which focus Region (ROI) or focus is to be auto-focused. In order to obtain a focus area and a Phase Difference (PD) of the focus area, the photographing apparatus needs to use the first two frames of data of the current frame. In a complete focusing process, due to hardware limitation, a camera in shooting equipment needs to firstly acquire a focusing area of a first frame in the first two frames, and calculate relevant parameters of the acquired focusing area through time of a second frame to obtain a phase difference, and obtain phase difference data of the focusing area acquired by the first frame in a current frame to control the camera to focus. It can be seen that during each focusing process, there is a frame delay of at least two frames from the acquisition of the focusing region to the acquisition of the phase difference data, resulting in a probabilistic focus loss. Moreover, when the shooting device needs to perform focus tracking shooting on a fast moving object, the focus tracking blur problem caused by frame delay is more serious, the shooting quality is reduced, and the user experience is affected.
Disclosure of Invention
In view of the above, the present disclosure provides a focusing method, a focusing device, an electronic device, and a readable storage medium, so as to implement a focusing method when a shooting device performs focus tracking shooting on a fast moving object, shorten a frame delay required for focusing, improve shooting quality, and improve user experience.
According to a first aspect of the present disclosure, there is provided a focusing method, the method comprising:
acquiring a first focusing area based on a first preview image acquired by a camera;
acquiring a second focusing area based on a second preview image of the camera, wherein the second preview image is a next frame image of the first preview image;
amplifying the first focusing area to obtain an amplified first focusing area;
and determining focusing parameters of the camera according to the amplified first focusing area and the amplified second focusing area.
In combination with any one of the embodiments provided in the present disclosure, the determining, according to the amplified first focusing area and the second focusing area, a focusing parameter of the camera includes:
acquiring a phase difference of the amplified first focusing region in the second focusing region under the condition that the amplified first focusing region covers the second focusing region;
And determining focusing parameters of the camera according to the phase difference.
In combination with any one of the embodiments provided in the present disclosure, the determining, according to the amplified first focusing area and the second focusing area, a focusing parameter of the camera includes:
acquiring an overlapping region under the condition that the amplified first focusing region is partially overlapped with the second focusing region;
acquiring the phase difference of the amplified first focusing area in the overlapping area;
and determining focusing parameters of the camera according to the phase difference.
In combination with any one of the embodiments provided in the present disclosure, the determining, according to the amplified first focusing area and the second focusing area, a focusing parameter of the camera includes:
and determining focusing parameters of the camera for focusing the next frame of image of the second preview image according to the amplified first focusing area and the second focusing area.
In connection with any one of the embodiments provided by the present disclosure, the method includes:
acquiring an initial focusing area based on the previous frame image of the first preview image;
and acquiring an amplification factor of the first focusing area according to the position relation between the initial focusing area and the first focusing area.
In combination with any one of the embodiments provided in the present disclosure, the amplifying the first focusing area to obtain an amplified first focusing area includes:
and amplifying the first focusing area according to the amplification factor of the first focusing area to obtain an amplified first focusing area.
In combination with any one of the embodiments provided in the present disclosure, after determining the focusing parameters of the camera, the method includes:
controlling a motor to drive a lens in the camera to move according to focusing parameters of the camera;
the lens is controlled to focus at the moved position.
According to a second aspect of the present disclosure, there is provided a focusing device, the device comprising:
the first focusing area acquisition module: the method comprises the steps of acquiring a first focusing area based on a first preview image acquired by a camera;
the second focusing area acquisition module: the camera is used for acquiring a first focusing area based on a first preview image of the camera, wherein the first preview image is a frame image of the first preview image;
a first focusing area amplifying module: the method comprises the steps of amplifying the first focusing area to obtain an amplified first focusing area;
And a parameter determining module: and determining the focusing parameters of the camera according to the amplified first focusing area and the amplified second focusing area.
In combination with any one of the embodiments provided in the present disclosure, the parameter determining module is configured to determine, according to the amplified first focusing area and the second focusing area, a focusing parameter of the camera, and specifically is configured to:
acquiring a phase difference of the amplified first focusing region in the second focusing region under the condition that the amplified first focusing region covers the second focusing region;
and determining focusing parameters of the camera according to the phase difference.
In combination with any one of the embodiments provided in the present disclosure, the parameter determining module is configured to determine, according to the amplified first focusing area and the second focusing area, a focusing parameter of the camera, and specifically is configured to:
acquiring an overlapping region under the condition that the amplified first focusing region is partially overlapped with the second focusing region;
acquiring the phase difference of the amplified first focusing area in the overlapping area;
and determining focusing parameters of the camera according to the phase difference.
In combination with any one of the embodiments provided in the present disclosure, the Jiao Canshu determining module is configured to determine a focusing parameter of the camera according to the amplified first focusing area and the second focusing area, and is specifically configured to:
and determining focusing parameters of the camera for focusing the next frame of image of the second preview image according to the amplified first focusing area and the second focusing area.
In connection with any of the embodiments provided herein, the apparatus includes:
an initial focusing area acquisition module: the method comprises the steps of acquiring an initial focusing area based on a previous frame image of the first preview image;
the amplification factor acquisition module: and the amplifying coefficient of the first focusing area is obtained according to the position relation between the initial focusing area and the first focusing area.
In combination with any one of the embodiments provided in the present disclosure, the first focusing area amplifying module is configured to amplify the first focusing area to obtain an amplified first focusing area, and is specifically configured to:
and amplifying the first focusing area according to the amplification factor of the first focusing area to obtain an amplified first focusing area.
In combination with any one of the embodiments provided in the present disclosure, after determining the focusing parameters of the camera, the apparatus includes:
a motor control module: the lens driving device is used for controlling a motor to drive lenses in the camera to move according to focusing parameters of the camera;
the lens adjusting module: for controlling the lens to focus at the moved-to position.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
a memory for storing processor-executable instructions;
a processor configured to execute executable instructions in the memory to implement the steps of the method of any of the embodiments of the first aspect described above.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method according to any of the embodiments of the first aspect described above.
According to a fifth aspect of the present disclosure, there is provided a photographing apparatus including the above-described electronic apparatus.
The technical scheme provided by the disclosure can comprise the following beneficial effects:
the first preview image and the second preview image acquired by the camera are used for obtaining a first focusing area and a second focusing area, amplifying the first focusing area, determining focusing parameters of the camera according to the amplified first focusing area and the amplified second focusing area, enabling the final focusing area to be closer to a specific position of an object relative to the whole image in a current frame, reducing frame delay in a focusing process, achieving a better focusing effect when shooting the object which moves rapidly, improving shooting quality and improving user experience.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments consistent with the disclosure and together with the disclosure, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of a focusing method according to an exemplary embodiment of the present disclosure.
Fig. 2 is a flow chart of another focusing method illustrated by the present disclosure according to an exemplary embodiment.
Fig. 3 is an enlarged schematic view of a focus area shown in accordance with an exemplary embodiment of the present disclosure.
Fig. 4 is a flowchart of another focusing method illustrated by the present disclosure according to an exemplary embodiment.
Fig. 5 is a schematic view of a focusing apparatus according to an exemplary embodiment of the present disclosure.
Fig. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
In the present disclosure, the execution subject involved may include: the shooting device, such as miniature single-lens shooting device, digital shooting device and the like with the motion focus tracking function, can also be mobile phone device, tablet personal computer and wearable device with the shooting function, such as smart watch, smart bracelet and the like.
Fig. 1 illustrates a flowchart of a focusing method according to an exemplary embodiment of the present disclosure.
In step S101, a first focusing area is acquired based on a first preview image acquired by a camera.
Under the condition that the shooting equipment normally operates, the camera is in a state of continuously collecting preview images, and the first preview image is used as a first preview image of a focusing process and can comprise any one of the preview images continuously collected by the camera. The focus region may also be referred to as a region of interest (ROI) in the image. In one example, in a case where the camera needs to perform focus-following shooting on a fast-moving object, the position of the object may be set as the focus area. The acquisition of the focus area from the preview image may be performed by using an existing method, which is not described in detail herein.
In step S102, a second focusing area is acquired based on a second preview image of the camera, the second preview image being a next frame image of the first preview image.
And after the first focusing area is acquired, acquiring a second focusing area in the next frame of preview image continuously acquired by the camera. In the process of performing focus tracking shooting on a fast moving object, a large deviation may occur between the position of the object in the first preview image and the position in the second preview image, so that for other preview images after the second preview image, the second focusing area is closer to the true position of the object relative to the whole image in the current frame relative to the first focusing area.
In step S103, the first focusing area is enlarged, so as to obtain an enlarged first focusing area.
During the process of tracking and shooting the fast moving object, a larger deviation may be generated in the second focusing area relative to the first focusing area, and the second focusing area is closer to the real position of the object relative to the full image in the second frame. However, for hardware reasons, the process of setting parameters of the focusing area needs at least one frame time, so that the relevant parameters of the second focusing area cannot be used as focusing parameters. Therefore, the first focusing area is enlarged, so that the enlarged first focusing area covers the second focusing area as much as possible, and related parameter setting is performed on the overlapping part of the two areas in the subsequent step. The amplifying of the first focusing area can be realized by setting an amplifying coefficient according to parameters such as the moving speed, the moving direction, the moving track and the like of the object.
In step S104, a focusing parameter of the camera is determined according to the amplified first focusing area and the second focusing area.
Because the focusing method disclosed by the disclosure is based on the enlarged first focusing area to perform parameter setting, compared with the focusing parameter calculation based on the second focusing area, more enough processing time can be reserved on a hardware level, and because the focusing parameters are determined according to the enlarged first focusing area and the second focusing area, compared with the focusing parameters determined based on the first focusing area, the method disclosed by the disclosure can capture the real position of the object, which is closer to the full image, in the fast moving process.
According to the method, the first focusing area and the second focusing area are obtained through the first preview image and the second preview image acquired by the camera, the first focusing area is amplified, the focusing parameters of the camera are determined according to the amplified first focusing area and the amplified second focusing area, frame delay can be reduced in the focusing process, a better focusing effect can be achieved when a fast moving object is shot, shooting quality is improved, and user experience is improved.
In an optional embodiment, the determining the focusing parameter of the camera according to the amplified first focusing area and the second focusing area includes: and under the condition that the amplified first focusing area covers the second focusing area, acquiring the phase difference of the amplified first focusing area in the second focusing area.
After the first focusing region is enlarged, in an ideal case, the enlarged first focusing region can completely cover the second focusing region, and at this time, a phase difference of the enlarged first focusing region in the second focusing region is acquired. The phase difference may be acquired by a CMOS sensor in the photographing apparatus. In the process that the camera acquires a preview image of one frame, a metal cover is added at the upper half position of the CMOS, so that pixels covered by the left half can only receive a left light source, and similarly, pixels covered by the right half can only receive a right light source, and in the CMOS, the pixels covered by the left and the right are in pairs at adjacent positions. Based on the above principle, the left-blocked pixel and the right-blocked pixel are axisymmetric, and the phase difference may be obtained by obtaining a relationship between the two images by autocorrelation, and in one example, the phase difference may be calculated during the time of the second frame. And determining focusing parameters of the camera according to the phase difference.
The relative setting of the electronic devices in the camera can be determined according to the phase difference, and the moving direction and the moving distance of the motor in the camera can be generally obtained, so that the lens is driven to perform angle adjustment and position adjustment, and the overlapping area is focused.
According to the method, the phase difference of the amplified first focusing area is acquired in the second focusing area, so that the electronic devices in the camera are subjected to relevant setting, the frame delay can be reduced in the focusing process, a better focusing effect can be achieved when a fast moving object is shot, the shooting quality is improved, and the user experience is improved.
In an optional embodiment, the determining the focusing parameter of the camera according to the amplified first focusing area and the second focusing area includes: and under the condition that the amplified first focusing area is partially overlapped with the second focusing area, acquiring an overlapped area, and acquiring a phase difference of the amplified first focusing area in the overlapped area.
In some cases, when the moving speed of the object that needs to perform focus tracking by the camera is too high, the enlarged first focusing area and the second focusing area may only partially overlap, and the overlapping area needs to be acquired at this time, and then the phase difference of the enlarged first focusing area is acquired in the overlapping area, so that the camera can focus the overlapping area that is biased to the second focusing area as much as possible.
And determining focusing parameters of the camera according to the phase difference.
According to the method, the phase difference of the amplified first focusing area in the overlapping area is obtained through obtaining the overlapping area, and then the electronic devices in the camera are arranged in a correlated mode, so that frame delay can be reduced in each focusing process, a better continuous focusing effect can be achieved when a fast moving object is shot, shooting quality is improved, and user experience is improved.
In an optional embodiment, the determining the focusing parameter of the camera according to the amplified first focusing area and the second focusing area includes: and determining focusing parameters of the camera for focusing the next frame of image of the second preview image according to the amplified first focusing area and the second focusing area.
In a complete focusing process, at least one frame of time is required in the process of setting parameters of the focusing area due to hardware, so that after phase difference calculation and acquisition of focusing parameters are performed on the overlapping area, the camera has completed the acquisition work of the next frame image of the second preview image, namely the third preview image. Therefore, the focusing parameter obtained by the method is used as a parameter image of the third preview image and is used for setting electronic devices such as a motor in the camera.
According to the method, the focusing parameters of the camera for focusing the next frame image of the second preview image are determined according to the amplified first focusing area and the amplified second focusing area, so that frame delay can be reduced in each focusing process, a better continuous focusing effect can be achieved when a fast moving object is shot, shooting quality is improved, and user experience is improved.
Fig. 2 illustrates a flow chart of another focusing method illustrated by the present disclosure according to an exemplary embodiment.
In step S105, an initial focus area is acquired based on the previous frame image of the first preview image.
In order to more accurately amplify the first focusing area so as to achieve the aim of overlapping with the second focusing area as much as possible, the method can be realized by setting an amplification factor according to parameters such as the moving speed, the moving direction, the moving track and the like of the object. In order to acquire the parameter, an initial focusing area needs to be acquired based on the previous frame of image of the first preview image. According to the position change of the object in the initial focusing area and the first focusing area, the motion state of the object can be estimated, and then the first focusing area is amplified.
In step S106, according to the positional relationship between the initial focusing area and the first focusing area, the magnification factor of the first focusing area is obtained.
Fig. 3 illustrates an enlarged schematic view of a focus area shown in accordance with an exemplary embodiment of the present disclosure.
As shown in fig. 3, after the initial focusing area and the first focusing area are acquired, the first focusing area may be enlarged according to the positional relationship of the areas. The enlarged first focusing area can completely cover the initial focusing area and the first focusing area. In general, the area of the enlarged first focusing area is equal to or smaller than a full-width area.
In one example, the magnification factor of the first focus area may be determined by the end point coordinates of the above-described area.
As shown in fig. 3, the above-mentioned region end point coordinates may be calculated by the formula:
ratioX=(endX1-starX0)/(endX0-starX0);
ratioY=(endY0-starY1)/(endY0-starX0);
wherein, ratio is the magnification factor of the first focusing area in the X axis, and ratio is the magnification factor of the first focusing area in the Y axis. In the case that the focusing areas are rectangular, the starX1 and the starY1 are the abscissa and the ordinate of the upper left end point of the first focusing area; the endX1 and the endY1 are the abscissa and the ordinate of the lower right end point of the first focusing region. The starX0 and the starY0 are the abscissa and the ordinate of the upper left end point of the initial focusing region; the endX0 and the endY0 are the abscissa and the ordinate of the lower right end point of the initial focus area.
Based on the above formula, the enlarged first focusing area that can completely cover the initial focusing area and the first focusing area can be obtained.
According to the method, the amplification factor of the first focusing area is obtained according to the position relation between the initial focusing area and the first focusing area, the first focusing area is amplified, the focusing parameters of the camera are determined, the frame delay can be reduced in each focusing process, a better continuous focusing effect can be achieved when a fast moving object is shot, the shooting quality is improved, and the user experience is improved.
In an optional embodiment, the amplifying the first focusing area to obtain an amplified first focusing area includes: and amplifying the first focusing area according to the amplification factor of the first focusing area to obtain an amplified first focusing area.
Amplifying the first focusing region based on the amplification factor ratio of the first focusing region in the X axis and the amplification factor ratio of the first focusing region in the Y axis, which are obtained in the above steps, to obtain the amplified first focusing region capable of completely covering the initial focusing region and the first focusing region, and obtaining the focusing parameters based on the overlapping region of the above regions and the second focusing region in the subsequent steps.
According to the method, the amplification factor of the first focusing area is obtained according to the position relation between the initial focusing area and the first focusing area, the first focusing area is amplified, the focusing parameters of the camera are determined, the frame delay can be reduced in each focusing process, a better continuous focusing effect can be achieved when a fast moving object is shot, the shooting quality is improved, and the user experience is improved.
In an alternative embodiment, after determining the focusing parameters of the camera, the method includes: and controlling the lens to focus at the moved position according to the focusing parameters of the camera.
After the related settings of the electronic devices in the camera determined by the phase difference are obtained, the movement information of the motor in the camera, namely the movement direction and the movement distance, can be obtained. In the focusing process, the movement of the motor drives the lens in the camera to move, so that the lens focuses on the overlapping area to complete shooting.
According to the method, the first focusing area and the second focusing area are obtained through the first preview image and the second preview image acquired by the camera, the first focusing area is amplified, focusing parameters of the camera are determined, the motor is controlled to drive the lens in the camera to move according to the focusing parameters of the camera, the lens is controlled to focus at the position moved to, frame delay can be reduced in each focusing process, a better continuous focusing effect can be achieved when a fast moving object is shot, shooting quality is improved, and user experience is improved.
Fig. 4 illustrates a flowchart of another focusing method illustrated by the present disclosure according to an exemplary embodiment.
Under the condition that the shooting equipment is in normal operation, the camera is in a state of continuously acquiring preview images, as shown in fig. 4, in step 401, the preview images are continuously acquired based on the camera; in step 402, in the case where the preview image is a first preview image; in step 403, a first focusing area is acquired based on the first preview image; in step 404, according to the positional relationship between the initial focusing area and the first focusing area, an amplification factor of the first focusing area is obtained; in step 401, the acquisition of preview images based on the camera is continued; in step 405, in the case where the preview image is a second preview image; in step 406, a second focus area is acquired; in step 407, amplifying the first focusing area according to the amplification factor of the first focusing area to obtain an amplified first focusing area and calculating a phase difference; in step 401, the acquisition of preview images based on the camera is continued; in step 405, in the case that the preview image is not the first preview image and the second preview image; in step 408, a phase difference of the amplified first focusing region is obtained in a superposition region of the amplified first focusing region and the second focusing region; in step 409, the camera is controlled to execute focusing according to the focusing parameters; in step 401, after the focusing method is performed, the next focusing process may be performed in a loop by continuously acquiring the preview image based on the camera. For example, the first focus area acquired by the first preview image may be taken as an initial focus area in the next cycle and focus may be continued.
For the present embodiment, since it basically corresponds to the above-described method embodiment, the relevant point is only required to refer to the partial explanation of the above-described method embodiment.
According to the method, the first focusing area and the second focusing area are obtained through the first preview image and the second preview image which are continuously collected by the camera, the first focusing area is amplified, the focusing parameters of the camera are determined according to the amplified first focusing area and the amplified second focusing area, frame delay can be reduced in the focusing process, a better focus tracking effect can be achieved when a continuously and rapidly moving object is shot, shooting quality is improved, and user experience is improved.
For the foregoing method embodiments, for simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will appreciate that the present disclosure is not limited by the order of acts described, as some steps may occur in other orders or concurrently in accordance with the disclosure.
Further, those skilled in the art will also appreciate that the embodiments described in the specification are all alternative embodiments, and that the acts and modules referred to are not necessarily required by the present disclosure.
Corresponding to the foregoing embodiment of the application function implementation method, the present disclosure provides an embodiment of an application function implementation device and a corresponding terminal.
Fig. 5 shows a schematic view of a focusing apparatus according to an exemplary embodiment of the present disclosure, which may include:
the first focusing area acquisition module 501: the method comprises the steps of acquiring a first focusing area based on a first preview image acquired by a camera;
the second focusing area acquisition module 502: the camera is used for acquiring a first focusing area based on a first preview image of the camera, wherein the first preview image is a frame image of the first preview image;
the first focusing area enlarging module 503: the method comprises the steps of amplifying the first focusing area to obtain an amplified first focusing area;
parameter determination module 504: and determining the focusing parameters of the camera according to the amplified first focusing area and the amplified second focusing area.
In combination with any one of the embodiments provided in the present disclosure, the parameter determining module is configured to determine, according to the amplified first focusing area and the second focusing area, a focusing parameter of the camera, and specifically is configured to:
acquiring a phase difference of the amplified first focusing region in the second focusing region under the condition that the amplified first focusing region covers the second focusing region;
And determining focusing parameters of the camera according to the phase difference.
In combination with any one of the embodiments provided in the present disclosure, the parameter determining module is configured to determine, according to the amplified first focusing area and the second focusing area, a focusing parameter of the camera, and specifically is configured to:
acquiring an overlapping region under the condition that the amplified first focusing region is partially overlapped with the second focusing region;
acquiring the phase difference of the amplified first focusing area in the overlapping area;
and determining focusing parameters of the camera according to the phase difference.
In combination with any one of the embodiments provided in the present disclosure, the Jiao Canshu determining module is configured to determine a focusing parameter of the camera according to the amplified first focusing area and the second focusing area, and is specifically configured to:
and determining focusing parameters of the camera for focusing the next frame of image of the second preview image according to the amplified first focusing area and the second focusing area.
In connection with any of the embodiments provided herein, the apparatus includes:
an initial focusing area acquisition module: the method comprises the steps of acquiring an initial focusing area based on a previous frame image of the first preview image;
The amplification factor acquisition module: and the amplifying coefficient of the first focusing area is obtained according to the position relation between the initial focusing area and the first focusing area.
In combination with any one of the embodiments provided in the present disclosure, the first focusing area amplifying module is configured to amplify the first focusing area to obtain an amplified first focusing area, and is specifically configured to:
and amplifying the first focusing area according to the amplification factor of the first focusing area to obtain an amplified first focusing area.
In combination with any one of the embodiments provided in the present disclosure, after determining the focusing parameters of the camera, the apparatus includes:
a motor control module: the lens driving device is used for controlling a motor to drive lenses in the camera to move according to focusing parameters of the camera;
the lens adjusting module: for controlling the lens to focus at the moved-to position.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements described above as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the objectives of the disclosed solution. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Fig. 6 illustrates a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Referring to fig. 6, a block diagram of an electronic device is shown. For example, apparatus 600 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 6, apparatus 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input/output (I/O) interface 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the apparatus 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the device 600. Examples of such data include instructions for any application or method operating on the apparatus 600, contact data, phonebook data, messages, pictures, videos, and the like. The memory 604 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power component 606 provides power to the various components of the device 600. The power components 606 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 600.
The multimedia component 608 includes a screen between the device 600 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 600 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor assembly 614 may detect the on/off state of the device 600, the relative positioning of the assemblies, such as the display and keypad of the device 600, the sensor assembly 614 may detect a change in position of the device 600 or one of the assemblies of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration/deceleration of the device 600, and a change in temperature of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 614 may include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communication between the apparatus 600 and other devices in a wired or wireless manner. The device 600 may access a wireless network based on a communication standard, such as WiFi,2G or 3G,4G or 5G, or a combination thereof. In one exemplary embodiment, the communication part 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 616 includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for performing the power supply methods of electronic devices described above.
In a sixth aspect, the present disclosure provides, in an exemplary embodiment, a non-transitory computer-readable storage medium, such as memory 604, comprising instructions executable by processor 620 of apparatus 600 to perform the method of powering an electronic device described above. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (17)

1. A focusing method, the method comprising:
acquiring a first focusing area based on a first preview image acquired by a camera;
acquiring a second focusing area based on a second preview image acquired by the camera, wherein the second preview image is the next frame image of the first preview image;
amplifying the first focusing area to obtain an amplified first focusing area;
And determining focusing parameters of the camera according to the amplified first focusing area and the amplified second focusing area.
2. The method of claim 1, wherein determining the focus parameter of the camera from the enlarged first focus area and the second focus area comprises:
acquiring a phase difference of the amplified first focusing region in the second focusing region under the condition that the amplified first focusing region covers the second focusing region;
and determining focusing parameters of the camera according to the phase difference.
3. The method of claim 1, wherein determining the focus parameter of the camera from the enlarged first focus area and the second focus area comprises:
acquiring an overlapping region under the condition that the amplified first focusing region is partially overlapped with the second focusing region;
acquiring the phase difference of the amplified first focusing area in the overlapping area;
and determining focusing parameters of the camera according to the phase difference.
4. A method according to any one of claims 1 to 3, wherein said determining a focus parameter of the camera from the enlarged first and second focus areas comprises:
And determining focusing parameters of the camera for focusing the next frame of image of the second preview image according to the amplified first focusing area and the second focusing area.
5. A method according to any one of claims 1 to 3, characterized in that the method comprises:
acquiring an initial focusing area based on a previous frame image of the first pre-image acquired by a camera;
and acquiring an amplification factor of the first focusing area according to the position relation between the initial focusing area and the first focusing area.
6. The method of claim 5, wherein the magnifying the first focus area to obtain a magnified first focus area comprises:
and amplifying the first focusing area according to the amplification factor of the first focusing area to obtain an amplified first focusing area.
7. A method according to any one of claims 1 to 3, wherein after determining the focus parameters of the camera, the method comprises:
and controlling the lens to focus at the moved position according to the focusing parameters of the camera.
8. A focusing device, the device comprising:
The first focusing area acquisition module: the method comprises the steps of acquiring a first focusing area based on a first preview image acquired by a camera;
the second focusing area acquisition module: the camera is used for acquiring a first focusing area based on a first preview image of the camera, wherein the first preview image is a frame image of the first preview image;
a first focusing area amplifying module: the method comprises the steps of amplifying the first focusing area to obtain an amplified first focusing area;
and a parameter determining module: and determining the focusing parameters of the camera according to the amplified first focusing area and the amplified second focusing area.
9. The apparatus according to claim 8, wherein the parameter determining module is configured to determine a focusing parameter of the camera according to the amplified first focusing area and the second focusing area, specifically configured to:
acquiring a phase difference of the amplified first focusing region in the second focusing region under the condition that the amplified first focusing region covers the second focusing region;
and determining focusing parameters of the camera according to the phase difference.
10. The apparatus according to claim 8, wherein the parameter determining module is configured to determine a focusing parameter of the camera according to the amplified first focusing area and the second focusing area, specifically configured to:
Acquiring an overlapping region under the condition that the amplified first focusing region is partially overlapped with the second focusing region;
acquiring the phase difference of the amplified first focusing area in the overlapping area;
and determining focusing parameters of the camera according to the phase difference.
11. The apparatus according to any one of claims 8 to 10, wherein the Jiao Canshu determining module is configured to determine a focusing parameter of the camera according to the enlarged first focusing area and the second focusing area, in particular for:
and determining focusing parameters of the camera for focusing the next frame of image of the second preview image according to the amplified first focusing area and the second focusing area.
12. The apparatus according to any one of claims 8 to 10, characterized in that the apparatus comprises:
an initial focusing area acquisition module: the method comprises the steps of acquiring an initial focusing area based on a previous frame image of the first preview image;
the amplification factor acquisition module: and the amplifying coefficient of the first focusing area is obtained according to the position relation between the initial focusing area and the first focusing area.
13. The apparatus of claim 12, wherein the first focusing area amplifying module is configured to amplify the first focusing area to obtain an amplified first focusing area, and is specifically configured to:
and amplifying the first focusing area according to the amplification factor of the first focusing area to obtain an amplified first focusing area.
14. The apparatus according to any one of claims 8 to 10, characterized in that after determining the focus parameters of the camera, the apparatus comprises:
a motor control module: the lens driving device is used for controlling a motor to drive lenses in the camera to move according to focusing parameters of the camera;
the lens adjusting module: for controlling the lens to focus at the moved-to position.
15. An electronic device, the electronic device comprising:
a memory for storing processor-executable instructions;
a processor configured to execute executable instructions in the memory to implement the steps of the method of any one of claims 1 to 7.
16. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
17. A photographing apparatus comprising the electronic apparatus of claim 15.
CN202111628955.8A 2021-12-28 2021-12-28 Focusing method, focusing device, electronic equipment and readable storage medium Pending CN116437202A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111628955.8A CN116437202A (en) 2021-12-28 2021-12-28 Focusing method, focusing device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111628955.8A CN116437202A (en) 2021-12-28 2021-12-28 Focusing method, focusing device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN116437202A true CN116437202A (en) 2023-07-14

Family

ID=87085937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111628955.8A Pending CN116437202A (en) 2021-12-28 2021-12-28 Focusing method, focusing device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116437202A (en)

Similar Documents

Publication Publication Date Title
CN110557547B (en) Lens position adjusting method and device
EP3905203A1 (en) Method and apparatus for processing video, and storage medium
CN110769147B (en) Shooting method and electronic equipment
EP3945494A1 (en) Video processing method, apparatus and storage medium
EP3945718A2 (en) Control method and apparatus, electronic device, and storage medium
CN112738397A (en) Shooting method, shooting device, electronic equipment and readable storage medium
CN111294511B (en) Focusing method and device of camera module and storage medium
CN115134505B (en) Preview picture generation method and device, electronic equipment and storage medium
CN107241535B (en) Flash lamp adjusting device and terminal equipment
US11792518B2 (en) Method and apparatus for processing image
CN116188343B (en) Image fusion method and device, electronic equipment, chip and medium
CN114666490B (en) Focusing method, focusing device, electronic equipment and storage medium
CN114430457B (en) Shooting method, shooting device, electronic equipment and storage medium
CN116437202A (en) Focusing method, focusing device, electronic equipment and readable storage medium
CN113315903B (en) Image acquisition method and device, electronic equipment and storage medium
CN107295229B (en) The photographic method and device of mobile terminal
CN113766115B (en) Image acquisition method, mobile terminal, device and storage medium
CN114339018B (en) Method and device for switching lenses and storage medium
US11838655B2 (en) Image acquiring method and apparatus, electronic device, and storage medium
CN113079310B (en) Automatic focusing method, automatic focusing device, electronic equipment and computer readable storage medium
CN112000250B (en) Information processing method, device, electronic equipment and storage medium
CN109447929B (en) Image synthesis method and device
CN115134512A (en) Shooting method and device
CN117499776A (en) Shooting method, shooting device, electronic equipment and storage medium
CN116419069A (en) Image preview method, device, terminal 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