CN114666490A - Focusing method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN114666490A
CN114666490A CN202011540490.6A CN202011540490A CN114666490A CN 114666490 A CN114666490 A CN 114666490A CN 202011540490 A CN202011540490 A CN 202011540490A CN 114666490 A CN114666490 A CN 114666490A
Authority
CN
China
Prior art keywords
focusing
area
preview image
mode
default
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011540490.6A
Other languages
Chinese (zh)
Other versions
CN114666490B (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.)
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 CN202011540490.6A priority Critical patent/CN114666490B/en
Publication of CN114666490A publication Critical patent/CN114666490A/en
Application granted granted Critical
Publication of CN114666490B publication Critical patent/CN114666490B/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/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • 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
    • H04N23/675Focus control based on electronic image sensor signals comprising setting of focusing regions

Abstract

The disclosure relates to a focusing method, a focusing device, an electronic device and a storage medium, wherein the focusing method is applied to a terminal device and comprises the following steps: acquiring a focusing area of a first preview image in a viewing frame of a preset application, wherein the first preview image is a preview image which completes non-default mode focusing, and a shooting object corresponding to the focusing area is a target object; generating a second preview image in the view frame according to a zooming instruction based on the first preview image, and determining a target area of the second preview image, wherein a shooting object corresponding to the target area is the target object; and in response to the target area meeting a preset condition, focusing the second preview image in a default mode.

Description

Focusing method, focusing device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of image acquisition, and in particular, to a focusing method, an apparatus, an electronic device, and a storage medium.
Background
With the progress of scientific technology, the shooting performance of the terminal equipment is higher and higher, for example, the zoom magnification is larger, the zoom process is smooth, the focusing mode is various, and the like. When the terminal equipment is used for shooting images or videos, users often frequently zoom and focus, but in the related technology, the zoom and focus matching effect of a camera is not ideal, and the shooting effect and the use experience are affected.
Disclosure of Invention
To overcome the problems in the related art, embodiments of the present disclosure provide a focusing method, apparatus, electronic device and storage medium to solve the defects in the related art.
According to a first aspect of the embodiments of the present disclosure, there is provided a focusing method applied to a terminal device, including:
acquiring a focusing area of a first preview image in a viewing frame of a preset application, wherein the first preview image is a preview image which completes non-default mode focusing, and a shooting object corresponding to the focusing area is a target object;
generating a second preview image in the view frame according to a zooming instruction based on the first preview image, and determining a target area of the second preview image, wherein a shooting object corresponding to the target area is the target object;
and in response to the target area meeting a preset condition, focusing the second preview image in a default mode.
In one embodiment, the target area satisfies a predetermined condition, including:
and the proportion of the target area in the second preview image is smaller than a first proportion threshold value.
In one embodiment, the target area satisfies a predetermined condition, including:
a zoom ratio of the target area and the focus area is greater than the zoom ratio threshold, wherein the zoom ratio threshold is determined according to the first preview image and the focus area.
In one embodiment, the zoom ratio threshold is determined based on a ratio of the focusing area to the first preview image and a distance of the focusing area from a center of the first preview image.
In one embodiment, the target region comprises a focused sub-region and an unfocused sub-region;
the target area satisfies a predetermined condition, including:
the proportion of the non-in-focus sub-area in the target area is larger than a second proportion threshold value.
In one embodiment, the non-default manner focusing is triggered by a non-default focusing instruction;
the acquiring a focusing area of a first preview image in a viewing frame of a preset application includes:
determining that a shooting object for which the non-default focusing instruction is directed is the target object;
and determining the area in the target frame corresponding to the target object as the focusing area.
In one embodiment, the non-default focus instruction comprises: determining a focusing instruction according to the touch operation;
the shooting object aimed by the non-default focusing instruction comprises: and the touch operation aims at the shooting object.
In one embodiment, the preset application has a plurality of modes; the default mode comprises the following steps: and determining a focusing mode according to the preset application current running mode.
In one embodiment, the preset application has at least one of an image capture mode, a video recording mode, and a preset object mode;
the default mode when the preset application runs the image acquisition mode and the video recording mode comprises the following steps: focusing mode with image center as focusing point;
the default mode of the preset application when running the preset object mode comprises the following steps: and taking a preset object as a focusing mode of focusing.
According to a second aspect of the embodiments of the present disclosure, there is provided a focusing apparatus applied to a terminal device, including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a focusing area of a first preview image in a viewing frame of a preset application, the first preview image is a preview image which completes non-default mode focusing, and a shooting object corresponding to the focusing area is a target object;
the second acquisition module is used for generating a second preview image in the view frame according to a zoom instruction based on the first preview image and determining a target area of the second preview image, wherein a shooting object corresponding to the target area is the target object;
and the focusing module is used for focusing the second preview image in a default mode in response to the target area meeting a preset condition.
In one embodiment, the target area satisfies a predetermined condition, including:
and the proportion of the target area in the second preview image is smaller than a first proportion threshold value.
In one embodiment, the target area satisfies a predetermined condition, including:
and the zoom ratio of the target area and the focusing area is greater than the zoom ratio threshold, wherein the zoom ratio threshold is determined according to the first preview image and the focusing area.
In one embodiment, the zoom ratio threshold is determined based on a ratio of the focusing area to the first preview image and a distance of the focusing area from a center of the first preview image.
In one embodiment, the target region comprises a focused sub-region and an unfocused sub-region;
the target area satisfies a predetermined condition, including:
the proportion of the non-in-focus sub-area to the target area is larger than a second proportion threshold value.
In one embodiment, the non-default manner focusing is triggered by a non-default focusing instruction;
the first obtaining module is specifically configured to:
determining that a shooting object for which the non-default focusing instruction is directed is the target object;
and determining the area in the target frame corresponding to the target object as the focusing area.
In one embodiment, the non-default focus instruction comprises: determining a focusing instruction according to the touch operation;
the shooting object aimed by the non-default focusing instruction comprises: and the touch operation aims at the shooting object.
In one embodiment, the preset application has a plurality of modes; the default mode comprises the following steps: and determining a focusing mode according to the preset application current running mode.
In one embodiment, the preset application has at least one of an image capture mode, a video recording mode, and a preset object mode;
the default mode when the preset application runs the image acquisition mode and the video recording mode comprises the following steps: focusing mode with the image center as focusing point;
the default mode of the preset application when running the preset object mode comprises the following steps: and taking a preset object as a focusing mode of focusing.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device comprising a memory for storing computer instructions executable on a processor, the processor for performing the focusing method according to the first aspect when executing the computer instructions.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the method comprises the steps of firstly obtaining a first preview image which is focused in a non-default mode in a preset application view-finding frame, obtaining a focusing area from the first preview image, further generating a second preview image in the view-finding frame according to a zooming instruction, then obtaining a target area in the second preview image, enabling shooting objects corresponding to the target area and the focusing area to be target objects, and finally carrying out default mode focusing on the second preview image when the target area meets a preset condition. The method comprises the steps of obtaining an area corresponding to a target object all the time in the zooming process, setting a preset condition for the default mode focusing of a second preview image, and selectively starting the default mode focusing according to the target area and the preset condition in the zooming result, so that the default mode focusing can be accurately started, the phenomenon that the redundant default mode focusing damages the focusing result of the non-default mode focusing is avoided, the focusing effect is improved, the focusing energy consumption is saved, the matching effect of zooming and focusing is improved, and the shooting effect and the user experience are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow chart illustrating a focusing method according to an exemplary embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating a comparison of preview images before and after zooming in accordance with an exemplary embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating a comparison of preview images before and after zooming in accordance with another exemplary embodiment of the present disclosure;
FIG. 4 is a diagram illustrating a relationship between a target object and a target box according to an exemplary embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of a focusing device according to an exemplary embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended 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 also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such 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 "when … …" or "in response to a determination," depending on the context.
With the progress of scientific technology, the shooting performance of the terminal equipment is higher and higher, for example, the zoom magnification is larger, the zoom process is smooth, the focusing mode is various, and the like. When the terminal equipment is used for shooting images or videos, users often zoom and focus frequently, but in the related technology, the zoom and focus matching effect of a camera is not ideal, and the shooting effect and the use experience are influenced.
Based on this, in a first aspect, at least one embodiment of the present disclosure provides a focusing method applied to a terminal device, please refer to fig. 1, which shows a flow of the focusing method, including steps S101 to S103.
The terminal device may be a smart phone, a tablet computer, a desktop/laptop/handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR)/Virtual Reality (VR) device, and the like, and embodiments of the present disclosure are not intended to limit a specific form of the terminal device.
The terminal device may have an image capturing component, such as a camera. When the terminal device starts an application such as a camera using the image acquisition assembly, the image acquisition assembly acquires a preview image of a space within an acquisition range in real time, and the preview image can be zoomed or focused, and the zooming or focusing operation can be performed automatically or according to an operation input by a user. In step S101, a focusing area of a first preview image in a view frame of a preset application is obtained, where the first preview image is a preview image that completes focusing in a non-default manner, and a shooting object corresponding to the focusing area is a target object.
The preset application may be an application using an image capturing component, such as a camera, and in the running process of the preset application, an image captured by the image capturing component forms a preview image.
The non-default focusing mode refers to a focusing mode which can be executed only by requiring user intervention. The non-default mode focusing is triggered by a non-default focusing instruction, the non-default focusing instruction can be input by a user based on a preview image, and an area targeted by the non-default focusing instruction is a focusing area. Optionally, the non-default focusing instruction may be a focusing instruction determined according to the touch operation, so that the area to which the non-default focusing instruction is directed may be a shooting area to which the touch operation is directed, for example, a user may click one area (such as an area corresponding to a certain person, an object, and the like) in the preview image to generate a focusing instruction with the area as a focusing area, and the preview image after the focusing is performed may be the first preview image.
The preview image is a result of the image acquisition component acquiring space within an acquisition range in real time, and is therefore a continuous multi-frame image, and the first preview image may be a frame image or a multi-frame image. Optionally, the first preview image is not zoomed or refocused, that is, the first preview image may be always used as the first preview image.
In step S102, a second preview image is generated in the finder frame according to a zoom instruction based on the first preview image, and a target area of the second preview image is determined, where a shooting object corresponding to the target area is the target object.
The zoom instruction can be automatically generated or generated according to the operation input by the user; the zoom form may be a smooth zoom (SAT). Optionally, the user may make a movement of moving two fingers away from or closer to the display screen of the terminal device, so as to generate a zoom instruction for increasing the focal length or decreasing the focal length, that is, the preview image is enlarged or reduced with the movement of the fingers, the fingers stop moving, and the preview image freezes the picture at the time point. The zoom command may include a zoom ratio or not, and when the zoom ratio is not included, the zoom ratio may be determined according to the focusing area and the target area.
The subject (i.e., the target subject) corresponding to the focusing area is enlarged or reduced along with the preview image during zooming, and the size of the view frame is fixed, so that the subject (i.e., the target subject) can be completely retained in the view frame, i.e., the subject corresponding to the target area is a complete target subject, the subject (i.e., the target subject) can be partially retained in the view frame, i.e., the subject corresponding to the target area is a part of the target subject, and the subject (i.e., the target subject) can be separated from the view frame, i.e., the target area corresponding to the target subject does not exist in the second preview image. Referring to fig. 2, a small turtle 202 is provided in the first preview image 201, the small turtle 202 is a target object, the area where the small turtle 202 is located is a focus area, and after the first preview image 201 zooms to generate the second preview image 203, the space corresponding to the second preview image 203 is a part of the space corresponding to the first preview image 201, and the small turtle 202 is not in the space corresponding to the second preview image 203, so that the small turtle 202 is separated from the view frame, and the second preview image does not have the target area corresponding to the small turtle 202. Referring to fig. 3, a small turtle 302 is provided in the first preview image 301, the small turtle 202 is a target object, the area where the small turtle 302 is located is a focus area, and after the first preview image 301 zooms to generate the second preview image 303, the space corresponding to the second preview image 303 is a portion of the space corresponding to the first preview image 301, and the small turtle 302 is still left in the space corresponding to the second preview image 303, so that the small turtles 302 are all kept in the finder frame, and the target area in the second preview image 303 corresponds to the complete small turtle 302.
In step S103, in response to the target area satisfying a predetermined condition, focusing the second preview image in a default manner.
Wherein the predetermined condition may be set in advance, and a plurality of predetermined conditions may be set. Therefore, whether the target area meets each preset condition can be sequentially judged, if any one of the judgment conditions is met, the default mode focusing is carried out, and if the judgment conditions are not met, the default mode focusing is not carried out, namely, the focusing result of the non-default mode focusing is kept.
The default mode focusing means a focusing mode that can be performed without user intervention.
In the embodiment of the disclosure, a first preview image in which focusing in a non-default manner is completed in a preset application view-finding frame is obtained, a focusing area is obtained from the first preview image, a second preview image is further generated in the view-finding frame according to a zoom instruction, a target area in the second preview image is obtained, a shooting object corresponding to the target area and the focusing area is also a target object, and finally, when the target area meets a preset condition, focusing in the default manner is performed on the second preview image. The method comprises the steps of obtaining an area corresponding to a target object all the time in the zooming process, setting a preset condition for the default mode focusing of a second preview image, and selectively starting the default mode focusing according to the target area and the preset condition in the zooming result, so that the default mode focusing can be accurately started, the phenomenon that the redundant default mode focusing damages the focusing result of the non-default mode focusing is avoided, the focusing effect is improved, the focusing energy consumption is saved, the matching effect of zooming and focusing is improved, and the shooting effect and the user experience are improved.
In some embodiments of the present disclosure, the target area satisfying the predetermined condition may be: and the proportion of the target area in the second preview image is smaller than a first proportion threshold value.
The preset condition is to judge whether refocusing is needed according to an intersection of the target area and the second preview image, and the intersection of the target area and the second preview image is an area where focusing is completed, so that the definition of the second preview image can be represented by taking the intersection as the judgment condition, that is, the larger the area where focusing is completed is, the clearer the second preview image is, and the smaller the area where focusing is completed is, the more blurred the second preview image is.
The first proportional threshold value can be automatically generated by a system or can be customized by a user. For example, the first ratio threshold may be 50%, when the ratio of the target area to the second preview image is less than 50% (for example, the ratio of the target area to the second preview image is 20%, or the ratio of the target area to the second preview image is 0, that is, there is no target area corresponding to the target object in the second preview image), the second preview image is focused in the default manner, and when the ratio of the target area to the second preview image is greater than or equal to 50% (for example, the ratio of the target area to the second preview image is 70%), the second preview image is not focused in the default manner, that is, the result of focusing in the non-default manner is maintained.
In some embodiments of the present disclosure, the target area satisfying the predetermined condition may be: a zoom ratio of the target area and the focus area is greater than the zoom ratio threshold, wherein the zoom ratio threshold is determined according to the first preview image and the focus area.
The zoom ratio is a size ratio of a photographic object in the second preview image to a corresponding photographic object in the first preview image, and may be obtained according to a zoom instruction or by comparing a target area with a focus area.
The zoom ratio threshold represents a critical value of a magnification factor with which the first preview image can maintain sharpness, that is, if the magnification factor is lower than the critical value, the magnified result is still a sharp image, that is, an image which does not need to be focused, and if the magnification factor is higher than or equal to the critical value, the magnified result is a blurred image, that is, an image which needs to be focused. Since the focusing area in the first preview image is the area where focusing is completed, the ratio of the focusing areas has a certain influence on the resolution, and the threshold value, i.e. the zoom ratio threshold value, can be determined according to the ratio of the first preview image to the focusing areas. In addition, during zooming, the shooting object corresponding to the preview image in the view frame can be enlarged or reduced by taking the image center as a base point, so that the proportion of the shooting object (namely, the target object) corresponding to the focusing area remaining in the view frame during zooming is also related to the distance between the shooting object and the center of the first preview image, therefore, the zoom ratio threshold value can be further determined according to the proportion of the focusing area in the first preview image and the distance between the focusing area and the center of the first preview image, and the accuracy of the zoom ratio threshold value can be further improved.
In the embodiment of the disclosure, the zoom ratio is used as a condition for judging whether to perform focusing in a default mode, and the zoom ratio threshold is determined according to the focusing area, so that the definition of the zoomed second preview image can be determined very accurately, and whether to perform refocusing is further determined.
In some embodiments of the present disclosure, the target region comprises a focused sub-region and a non-focused sub-region; based on this, the target area satisfying the predetermined condition may be: the proportion of the non-in-focus sub-area in the target area is larger than a second proportion threshold value.
The focusing sub-area is an area where focusing is completed, the non-focusing sub-area is an area where focusing is not completed, that is, the definition of the focusing sub-area is high, and the definition of the non-focusing sub-area is low. Therefore, the proportion of the non-focusing sub-area to the target area can represent the focusing result holding effect of the focusing area, that is, the lower the proportion is, the better the focusing result holding effect of the focusing area is, and the higher the proportion is, the worse the focusing result holding effect of the focusing area is; therefore, the proportion is very accurate as a condition for judging the definition of the second preview image, and whether the second preview image needs to be refocused or not can be accurately determined.
In some embodiments of the present disclosure, the focus area of the first preview image may be obtained as follows: firstly, determining a shooting object for which the non-default focusing instruction is directed as a target object; and then, determining an area in a target frame corresponding to the target object as the focusing area.
The non-default focusing instruction may be a focusing instruction determined according to the touch operation, and therefore the shooting object targeted by the non-default focusing instruction may be the shooting object targeted by the touch operation, for example, a user may click one shooting object (such as a person, an object, and the like) in the preview image, so as to generate a focusing instruction targeting the shooting object.
In this embodiment, the boundary of each object in the image may be determined by the pixel value of each pixel of the first preview image, so that each object may be identified, and then the photographed object to which the non-default focusing instruction is directed is determined as the target object in the plurality of objects; the target frame may be a minimum frame capable of framing the target object, for example, a rectangular frame, and refer to fig. 4, which shows a relationship between the target object and the target frame, wherein the turtle 402 in the first preview image 401 is the target object, and the target frame 403 is the minimum rectangular frame capable of framing the turtle 402. The area in the target frame for framing the target object is used as the focusing area, so that convenience can be provided for judging the preset condition related to the focusing area, and the accuracy of judgment can be improved.
In some embodiments of the present disclosure, the preset application has a plurality of modes; the default mode may be: and determining a focusing mode according to the preset application current running mode.
The preset application does not only have one default focusing mode, but also has different focusing modes in different modes, so that focusing can be performed in a targeted manner, and the focusing effect of the default mode is improved, for example, the definition of an image focused by the default mode is improved.
Optionally, the preset application is a camera, and the camera has at least one of an image capture mode, a video recording mode and a preset object mode; furthermore, the default mode when the preset application runs the image acquisition mode and the video recording mode may be: focusing mode with image center as focusing point; the default mode of the preset application when running the preset object mode may be: and taking a preset object as a focusing mode of focusing. The preset object mode can be combined with an image acquisition mode, namely applied to a photographing scene, and can also be combined with a video recording mode, namely applied to a video recording scene; for example, the portrait mode of the camera is a form of the preset object mode, and the default focusing mode in the portrait mode is portrait focusing, that is, a focusing mode with the portrait as a focusing center; for another example, the two-dimensional code scanning mode is also a form of a preset object mode, and the default focusing mode in the two-dimensional code scanning mode is two-dimensional code focusing, that is, a focusing mode using the two-dimensional code as a focusing center.
Referring to fig. 5, according to a second aspect of the embodiment of the present disclosure, there is provided a focusing apparatus applied to a terminal device, including:
a first obtaining module 501, configured to obtain a focusing area of a first preview image in a preset application view-finding frame, where the first preview image is a preview image that is focused in a non-default manner, and a shooting object corresponding to the focusing area is a target object;
a second obtaining module 502, configured to generate a second preview image in the view frame according to a zoom instruction based on the first preview image, and determine a target area of the second preview image, where a shooting object corresponding to the target area is the target object;
a focusing module 503, configured to perform default mode focusing on the second preview image in response to that the target area satisfies a predetermined condition.
In some embodiments of the present disclosure, the target region satisfies a predetermined condition, including:
and the proportion of the target area in the second preview image is smaller than a first proportion threshold value.
In some embodiments of the present disclosure, the target region satisfies a predetermined condition, including:
a zoom ratio of the target area and the focus area is less than the zoom ratio threshold, wherein the zoom ratio threshold is determined according to the first preview image and the focus area.
In some embodiments of the present disclosure, the zoom ratio threshold is determined according to a ratio of the focusing area to the first preview image and a distance of the focusing area from a center of the first preview image.
In some embodiments of the present disclosure, the target region includes an in-focus sub-region and an out-of-focus sub-region;
the target area satisfies a predetermined condition, including:
the proportion of the non-in-focus sub-area in the target area is larger than a second proportion threshold value.
In some embodiments of the present disclosure, the non-default manner focusing is triggered by a non-default focusing instruction;
the first obtaining module is specifically configured to:
determining that a shooting object for which the non-default focusing instruction is directed is the target object;
and determining the area in the target frame corresponding to the target object as the focusing area.
In some embodiments of the present disclosure, the non-default focus instruction comprises: determining a focusing instruction according to the touch operation;
the shooting object aimed by the non-default focusing instruction comprises: and the touch operation aims at the shooting object.
In some embodiments of the present disclosure, the preset application has a plurality of modes; the default mode comprises the following steps: and determining a focusing mode according to the preset application current running mode.
In some embodiments of the present disclosure, the preset application has at least one of an image capture mode, a video recording mode, and a preset object mode;
the default mode when the preset application runs the image acquisition mode and the video recording mode comprises the following steps: focusing mode with image center as focusing point;
the default mode of the preset application when running the preset object mode comprises the following steps: and taking a preset object as a focusing mode of focusing.
With regard to the apparatus in the above-mentioned embodiments, the specific manner in which each module performs the operation has been described in detail in the first aspect with respect to the embodiment of the method, and will not be elaborated here.
According to a fifth aspect of the disclosed embodiment, please refer to fig. 6, which schematically illustrates a block diagram of an electronic device. For example, the apparatus 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, apparatus 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 616.
The processing component 602 generally controls overall operation of the device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 602 may include one or more processors 620 to execute instructions to perform all or a portion 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 can 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 operation at the device 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile 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 disks.
Power component 606 provides power to the various components of device 600. 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 device 600.
The multimedia component 608 includes a screen that provides an output interface between the device 600 and a user. 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 an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 600 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, audio component 610 includes a Microphone (MIC) configured to receive external audio signals when apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further 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 keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor component 614 may detect an open/closed state of the device 600, the relative positioning of components, such as a display and keypad of the device 600, the sensor component 614 may also detect a change in position of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, orientation or acceleration/deceleration of the device 600, and a change in temperature of the device 600. The sensor assembly 614 may also include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also 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 also include an acceleration sensor, a gyroscope 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 apparatus 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 an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further 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, micro-controllers, microprocessors or other electronic components for performing the power supply method of the electronic devices.
The sixth aspect of the present disclosure also provides, in an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as the memory 604 including instructions, executable by the processor 620 of the apparatus 600 to perform the method for powering the electronic device. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
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 variations, 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (20)

1. A focusing method is applied to a terminal device and comprises the following steps:
acquiring a focusing area of a first preview image in a viewing frame of a preset application, wherein the first preview image is a preview image which completes non-default mode focusing, and a shooting object corresponding to the focusing area is a target object;
generating a second preview image in the view frame according to a zooming instruction based on the first preview image, and determining a target area of the second preview image, wherein a shooting object corresponding to the target area is the target object;
and in response to the target area meeting a preset condition, focusing the second preview image in a default mode.
2. The focusing method according to claim 1, wherein the target area satisfies a predetermined condition, including:
and the proportion of the target area in the second preview image is smaller than a first proportion threshold value.
3. The focusing method according to claim 1, wherein the target area satisfies a predetermined condition, including:
a zoom ratio of the target area and the focus area is greater than the zoom ratio threshold, wherein the zoom ratio threshold is determined according to the first preview image and the focus area.
4. The focusing method according to claim 3, wherein the zoom ratio threshold is determined according to a ratio of the focusing area to the first preview image and a distance between the focusing area and a center of the first preview image.
5. The focusing method of claim 1, wherein the target area comprises a focused sub-area and a non-focused sub-area;
the target area satisfies a predetermined condition, including:
the proportion of the non-in-focus sub-area in the target area is larger than a second proportion threshold value.
6. The focusing method according to any one of claims 1 to 5, wherein the non-default mode focusing is triggered by a non-default focusing instruction;
the acquiring of the focusing area of the first preview image in the view frame of the preset application includes:
determining that a shooting object for which the non-default focusing instruction is directed is the target object;
and determining the area in the target frame corresponding to the target object as the focusing area.
7. The focusing method of claim 6, wherein the non-default focusing instruction comprises: determining a focusing instruction according to touch operation;
the shooting object aimed by the non-default focusing instruction comprises: and the touch operation aims at the shooting object.
8. The focusing method according to any one of claims 1 to 5, wherein the preset application has a plurality of modes; the default mode comprises the following steps: and determining a focusing mode according to the preset application current running mode.
9. The focusing method according to claim 8, wherein the preset application has at least one of an image capture mode, a video recording mode and a preset object mode;
the default mode when the preset application runs the image acquisition mode and the video recording mode comprises the following steps: focusing mode with image center as focusing point;
the default mode of the preset application when running the preset object mode comprises the following steps: and taking a preset object as a focusing mode of focusing.
10. A focusing device is applied to a terminal device and comprises:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a focusing area of a first preview image in a viewing frame of a preset application, the first preview image is a preview image which completes non-default mode focusing, and a shooting object corresponding to the focusing area is a target object;
the second acquisition module is used for generating a second preview image in the view frame according to a zoom instruction based on the first preview image and determining a target area of the second preview image, wherein a shooting object corresponding to the target area is the target object;
and the focusing module is used for focusing the second preview image in a default mode in response to the target area meeting a preset condition.
11. The focusing device of claim 10, wherein the target area satisfies a predetermined condition, comprising:
and the proportion of the target area in the second preview image is smaller than a first proportion threshold value.
12. The focusing device of claim 10, wherein the target area satisfies a predetermined condition, comprising:
a zoom ratio of the target area and the focus area is greater than the zoom ratio threshold, wherein the zoom ratio threshold is determined according to the first preview image and the focus area.
13. The focusing device of claim 12, wherein the zoom ratio threshold is determined according to a ratio of the focusing area to the first preview image and a distance of the focusing area from a center of the first preview image.
14. The focusing device of claim 10, wherein the target region comprises a focused sub-region and a non-focused sub-region;
the target area satisfies a predetermined condition, including:
the proportion of the non-in-focus sub-area in the target area is larger than a second proportion threshold value.
15. The focusing device according to any one of claims 10 to 14, wherein the non-default focusing is triggered by a non-default focusing instruction;
the first obtaining module is specifically configured to:
determining that a shooting object for which the non-default focusing instruction is directed is the target object;
and determining the area in the target frame corresponding to the target object as the focusing area.
16. The focusing device of claim 15, wherein the non-default focusing instruction comprises: determining a focusing instruction according to touch operation;
the shooting object aimed by the non-default focusing instruction comprises: and the touch operation aims at the shooting object.
17. The focusing device of any one of claims 10 to 14, wherein the preset application has a plurality of modes; the default mode comprises the following steps: and determining a focusing mode according to the preset application current running mode.
18. The focusing device of claim 17, wherein the preset application has at least one of an image capture mode, a video recording mode, and a portrait mode;
the default mode when the preset application runs the image acquisition mode and the video recording mode comprises the following steps: focusing mode with image center as focusing point;
the default mode of the preset application when running the preset object mode comprises the following steps: and taking a preset object as a focusing mode of focusing.
19. An electronic device, characterized in that the electronic device comprises a memory for storing computer instructions executable on a processor, the processor being configured to base the focusing method of any one of claims 1 to 9 when executing the computer instructions.
20. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method of any one of claims 1 to 9.
CN202011540490.6A 2020-12-23 2020-12-23 Focusing method, focusing device, electronic equipment and storage medium Active CN114666490B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011540490.6A CN114666490B (en) 2020-12-23 2020-12-23 Focusing method, focusing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011540490.6A CN114666490B (en) 2020-12-23 2020-12-23 Focusing method, focusing device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114666490A true CN114666490A (en) 2022-06-24
CN114666490B CN114666490B (en) 2024-02-09

Family

ID=82024812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011540490.6A Active CN114666490B (en) 2020-12-23 2020-12-23 Focusing method, focusing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114666490B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095477A (en) * 2022-08-16 2023-05-09 荣耀终端有限公司 Focusing processing system, method, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660913A (en) * 2015-03-18 2015-05-27 努比亚技术有限公司 Focus length adjusting method and device
CN106375595A (en) * 2016-10-17 2017-02-01 努比亚技术有限公司 Auxiliary focusing apparatus and method
CN107071273A (en) * 2017-03-01 2017-08-18 北京橙鑫数据科技有限公司 A kind of photographing instruction sending method and device
CN109495681A (en) * 2017-09-12 2019-03-19 天津三星通信技术研究有限公司 The method and apparatus for obtaining image
CN109618102A (en) * 2019-01-28 2019-04-12 Oppo广东移动通信有限公司 Focusing process method, apparatus, electronic equipment and storage medium
CN111050073A (en) * 2019-12-26 2020-04-21 维沃移动通信有限公司 Focusing method and electronic equipment
CN111277753A (en) * 2020-02-10 2020-06-12 Oppo广东移动通信有限公司 Focusing method and device, terminal equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104660913A (en) * 2015-03-18 2015-05-27 努比亚技术有限公司 Focus length adjusting method and device
CN106375595A (en) * 2016-10-17 2017-02-01 努比亚技术有限公司 Auxiliary focusing apparatus and method
CN107071273A (en) * 2017-03-01 2017-08-18 北京橙鑫数据科技有限公司 A kind of photographing instruction sending method and device
CN109495681A (en) * 2017-09-12 2019-03-19 天津三星通信技术研究有限公司 The method and apparatus for obtaining image
CN109618102A (en) * 2019-01-28 2019-04-12 Oppo广东移动通信有限公司 Focusing process method, apparatus, electronic equipment and storage medium
CN111050073A (en) * 2019-12-26 2020-04-21 维沃移动通信有限公司 Focusing method and electronic equipment
CN111277753A (en) * 2020-02-10 2020-06-12 Oppo广东移动通信有限公司 Focusing method and device, terminal equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116095477A (en) * 2022-08-16 2023-05-09 荣耀终端有限公司 Focusing processing system, method, equipment and storage medium
CN116095477B (en) * 2022-08-16 2023-10-20 荣耀终端有限公司 Focusing processing system, method, equipment and storage medium

Also Published As

Publication number Publication date
CN114666490B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
CN108419016B (en) Shooting method and device and terminal
CN110557547B (en) Lens position adjusting method and device
EP3945494A1 (en) Video processing method, apparatus and storage medium
CN114666490B (en) Focusing method, focusing device, electronic equipment and storage medium
CN112188096A (en) Photographing method and device, terminal and storage medium
US11252341B2 (en) Method and device for shooting image, and storage medium
CN114422687B (en) Preview image switching method and device, electronic equipment and storage medium
CN114339019B (en) Focusing method, focusing device and storage medium
CN114430457B (en) Shooting method, shooting device, electronic equipment and storage medium
CN112866555B (en) Shooting method, shooting device, shooting equipment and storage medium
CN111461950B (en) Image processing method and device
CN108366237B (en) Projection image adjusting method and device and computer readable storage medium
CN111698414B (en) Image signal processing method and device, electronic device and readable storage medium
CN107682623B (en) Photographing method and device
CN114071004A (en) Moon image acquisition method and device, electronic equipment and storage medium
CN107707819B (en) Image shooting method, device and storage medium
CN114339018B (en) Method and device for switching lenses and storage medium
CN113766115B (en) Image acquisition method, mobile terminal, device and storage medium
CN114339017B (en) Distant view focusing method, device and storage medium
CN109447929B (en) Image synthesis method and device
CN109862252B (en) Image shooting method and device
CN117499776A (en) Shooting method, shooting device, electronic equipment and storage medium
CN106713748B (en) Method and device for sending pictures
CN117412168A (en) Focusing method, device, equipment and storage medium
CN117546071A (en) Zoom method, zoom device, electronic apparatus, and storage medium

Legal Events

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