Nothing Special   »   [go: up one dir, main page]

WO2024169363A1 - 追焦方法、对焦方法、拍摄方法和电子设备 - Google Patents

追焦方法、对焦方法、拍摄方法和电子设备 Download PDF

Info

Publication number
WO2024169363A1
WO2024169363A1 PCT/CN2023/138113 CN2023138113W WO2024169363A1 WO 2024169363 A1 WO2024169363 A1 WO 2024169363A1 CN 2023138113 W CN2023138113 W CN 2023138113W WO 2024169363 A1 WO2024169363 A1 WO 2024169363A1
Authority
WO
WIPO (PCT)
Prior art keywords
focus
tracking
objects
frame
target
Prior art date
Application number
PCT/CN2023/138113
Other languages
English (en)
French (fr)
Inventor
宋红颖
Original Assignee
荣耀终端有限公司
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
Priority claimed from CN202310153939.0A external-priority patent/CN118524284A/zh
Priority claimed from CN202310162723.0A external-priority patent/CN118524286A/zh
Priority claimed from CN202310227257.XA external-priority patent/CN118555478A/zh
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2024169363A1 publication Critical patent/WO2024169363A1/zh

Links

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

Definitions

  • the present application relates to the field of image processing technology, and in particular, to a tracking method, a focusing method, a shooting method and an electronic device.
  • terminal devices such as smartphones
  • the functions of terminal devices such as smartphones are becoming more and more complete.
  • users can take photos through smartphones.
  • many shooting scenes in order to make the image clear, it is necessary to focus on the subject to meet users' higher shooting needs.
  • the focus is usually performed on the central area of the camera preview interface, or on an area manually selected by the user.
  • these focusing methods cannot adaptively adjust the focus object according to the actual shooting scene, resulting in not only poor focusing effect, but also poor flexibility and ease of use, which affects the user's shooting experience.
  • the embodiments of the present application provide a focus tracking method, apparatus, terminal device and computer-readable storage medium, which can solve the problem that focusing methods such as focusing on the central area of the camera preview interface as the focus area, or focusing on an area manually selected by a user cannot adaptively adjust the focus object according to the actual shooting scene, thereby not only having a poor focusing effect, but also having poor flexibility and ease of use, affecting the user's shooting experience.
  • an embodiment of the present application provides a focus tracking method, including: displaying a camera preview interface in response to a first operation of a user; performing identification processing on each object displayed in the camera preview interface to determine the object type of each object; determining the focus tracking frame type of each object according to the object type of each object; determining the first focus tracking priority of each object according to the object type of each object and a preset priority strategy, wherein the preset priority strategy is set according to the user's attention level to each object type; generating a focus tracking frame corresponding to each object according to the focus tracking frame type of each object, and displaying the focus tracking frame corresponding to each object in the camera preview interface according to the coordinates of each object; determining any object with the highest first focus tracking priority as a target focus tracking object according to the first focus tracking priority of each object, and performing focus tracking processing on the target focus tracking object.
  • the object type includes the following types: portraits ranked in the top N in the gallery, portraits ranked in the top N in the non-gallery, and non-face objects of a preset type, where N is a positive integer greater than or equal to 1;
  • the focus frame type of the portraits ranked in the top N in the gallery is the first focus frame type or the second focus frame type.
  • the focus frame type of the portraits ranked in the top N in the non-image library and the focus frame type of the non-face objects of the preset type are the third focus frame type, wherein the first focus frame type, the second focus frame type and the third focus frame type are all different;
  • the above-mentioned preset priority strategy is: the first focus tracking priority of the portraits ranked in the top N in the gallery is higher than the first focus tracking priority of the portraits ranked in the top N outside the gallery, and the first focus tracking priority of the portraits ranked in the top N outside the gallery is higher than the first focus priority of non-face objects of the preset type.
  • generating a tracking frame corresponding to each object according to the tracking frame type of each object, and displaying the tracking frame corresponding to each object in the camera preview interface according to the coordinates of each object includes:
  • the objects include a first object whose object type is a portrait ranked in the top N in the gallery, generating a first tracking focus frame corresponding to the first object according to the second tracking focus frame type, and displaying the first tracking focus frame corresponding to the first object in the camera preview interface according to the coordinates of the first object;
  • the objects include a first object whose object type is a portrait ranked in the top N in the gallery and at least one second object
  • a first tracking frame corresponding to the first object is generated according to the first tracking frame type
  • a second tracking frame corresponding to each second object is generated according to the second tracking frame type
  • the first tracking frame corresponding to the first object and the second tracking frame corresponding to each second object are displayed in the camera preview interface according to the coordinates of the first object and each second object, wherein the size of the first object is larger than the size of each second object.
  • the method further includes:
  • any second object is determined as a new first object, and the first object is determined as a new second object, and the focus frame corresponding to the new first object is changed from the second focus frame to the first focus frame, and the focus frame corresponding to the new second object is changed from the first focus frame to the second focus frame.
  • the method further includes:
  • the object type of the object is not a portrait ranked in the top N in the gallery or a non-face object of a preset type, determining a display time length of a focus tracking frame corresponding to the object;
  • the focus tracking frame corresponding to the object stops being displayed.
  • determining, according to the first focus tracking priorities of the objects, any object with the highest first focus tracking priority as the target focus tracking object includes:
  • the first object is determined as the object with the highest first priority, and any first object is determined as the target focus tracking object;
  • the first object is not included in the objects, determining whether the objects include a second object whose object type is not a portrait ranked in the top N in the image library;
  • the second object is determined as the object with the highest first priority. and determining any second object as a target focus tracking object;
  • the second object is not included in the objects, determining whether the objects include a third object whose object type is a non-face object of a preset type;
  • the objects include at least one third object, the third object is determined as the object with the highest first priority, and any third object is determined as the target focus tracking object;
  • center focus processing is performed in the preview interface.
  • the method further includes:
  • the designated focus object is the target focus object, the designated focus object is continuously focused until a user clicks on any object;
  • the focus processing on the target focus object is suspended, and the focus processing on the designated focus object is continued until a user click operation on any object is obtained.
  • the method further includes:
  • the designated focus object is the target focus object, and the object type of the designated focus object is a portrait ranked in the top N in the gallery, the focus frame type of the designated focus object remains unchanged, the focus frame of the designated focus object continues to be displayed, and the focus frames of all objects except the designated focus object are temporarily displayed;
  • the focus frame type of the designated focus object is changed to the first focus frame type, and a first focus frame corresponding to the designated focus object is generated and continuously displayed according to the first focus frame type, and the focus frames of all objects except the designated focus object are temporarily displayed;
  • the focus frame type of the specified focus object will be changed to the fourth focus frame type, and the fourth focus frame corresponding to the specified focus object will be generated and continuously displayed according to the fourth focus frame type, and the focus frames of all objects except the specified focus object will be temporarily displayed.
  • the method further includes:
  • the focus processing on the designated focus object is paused, and based on the first focus priority of each object, any object with the highest first focus priority is determined as the target focus object, and the focus processing is performed on the target focus object.
  • the objects include multiple objects with the highest first focus tracking priority; accordingly, the step of determining, according to the first focus tracking priorities of the objects, any object with the highest first focus tracking priority as the target focus tracking object includes:
  • the object with the second highest focus tracking priority is determined as the target focus tracking object.
  • determining the second focus priority of each object having the highest first focus priority includes:
  • the second focus tracking priority of each object is determined according to the size of each object.
  • an embodiment of the present application provides a focus tracking device, comprising: a first display module, for displaying a camera preview interface in response to a first operation of a user; a first determination module, for identifying and processing each object displayed in the camera preview interface to determine the object type of each object; a second determination module, for determining the focus tracking frame type of each object according to the object type of each object; a third determination module, for determining the first focus tracking priority of each object according to the object type of each object and a preset priority strategy, wherein the preset priority strategy is set according to the user's attention level to each object type; the second display module, for generating a focus tracking frame corresponding to each object according to the focus tracking frame type of each object, and displaying the focus tracking frame corresponding to each object in the camera preview interface according to the coordinates of each object; the first focus tracking module, for determining any object with the highest first focus tracking priority as a target focus tracking object according to the first focus tracking priority of each object, and performing focus tracking processing on the
  • the object type includes the following types: portraits ranked in the top N in the gallery, portraits ranked in the top N in the non-gallery, and non-face objects of a preset type, where N is a positive integer greater than or equal to 1;
  • the focus frame type of the portraits ranked in the top N in the gallery is the first focus frame type or the second focus frame type
  • the focus frame type of the portraits ranked in the top N in the non-gallery and the focus frame type of the non-face objects of the preset type is the third focus frame type, wherein the first focus frame type, the second focus frame type and the third focus frame type are all different;
  • the preset priority strategy is: the first focus tracking priority of the top N portraits in the gallery is higher than the first focus tracking priority of the top N portraits outside the gallery, and the first focus tracking priority of the top N portraits outside the gallery is higher than the first focus priority of non-face objects of a preset type.
  • the second display module includes:
  • a first display unit is used to generate a first tracking focus frame corresponding to the first object according to the second tracking focus frame type when the object includes a first object whose object type is a portrait ranked in the top N in the gallery, and display the first tracking focus frame corresponding to the first object in the camera preview interface according to the coordinates of the first object;
  • the second display unit is used to generate a first tracking frame corresponding to the first object according to the first tracking frame type, and generate second tracking frames corresponding to each second object according to the second tracking frame type, when the objects include a first object whose object type is a portrait ranked in the top N in the gallery and at least one second object, and display the first tracking frame corresponding to the first object and the second tracking frames corresponding to each second object in the camera preview interface according to the coordinates of the first object and each second object, wherein the size of the first object is larger than the size of each second object.
  • the second display module further includes:
  • the first changing unit is used to determine any second object as a new first object if it is determined that the size of any second object is larger than the size of the first object, and to determine the first object as a new second object, and to change the focus frame corresponding to the new first object from the second focus frame to the first focus frame, and to change the focus frame corresponding to the new second object from the first focus frame to the second focus frame.
  • the apparatus further includes:
  • a fourth determination module configured to determine a display duration of a focus tracking frame corresponding to the object when the object type is a non-human face object that is ranked in the top N in the image library or a preset type;
  • the first display stopping module is used to stop displaying the focus tracking frame corresponding to the object when the display time of the focus tracking frame corresponding to the object reaches a time threshold.
  • the first focus tracking module includes:
  • a first judging unit used to judge whether the objects include a first object whose object type is a portrait ranked in the top N in the gallery;
  • a first determining unit configured to determine the first object as an object with the highest first priority if the objects include at least one first object, and to determine any first object as a target focus tracking object;
  • a second judgment unit is used to judge whether the objects contain a second object whose object type is not a portrait ranked in the top N in the image library if the objects do not contain the first object;
  • a second determining unit configured to determine the second object as the object with the highest first priority if the object includes at least one second object, and determine any second object as a target focus tracking object;
  • a third judgment unit configured to judge whether the object contains a third object whose object type is a non-face object of a preset type if the object does not contain the second object;
  • a third determination unit configured to determine the third object as the object with the highest first priority if the objects include at least one third object, and determine any third object as a target focus tracking object;
  • the first focusing unit is used to perform center focusing processing in the preview interface if the objects do not include the third object.
  • the apparatus further includes:
  • a fifth determining module configured to determine any object as a designated focus tracking object in response to a user's click operation on any object
  • a second focus tracking module is used for, if the designated focus tracking object is the target focus tracking object, continuously performing focus tracking processing on the designated focus tracking object until a user clicks on any object;
  • the third focus tracking module is used to suspend the focus tracking process on the target focus tracking object if the designated focus tracking object is not the target focus tracking object, and continue the focus tracking process on the designated focus tracking object until a user click operation on any object is obtained.
  • the apparatus further includes:
  • a third display module is used for maintaining the focus frame type of the specified focus object unchanged and continuously displaying the focus frame of the specified focus object, and pausing displaying the focus frames of objects other than the specified focus object, if the specified focus object is the target focus object and the object type of the specified focus object is a portrait ranked in the top N in the gallery;
  • a fourth display module configured to change the focus frame type of the specified focus object to a first focus frame type if the specified focus object is not the target focus object and the object type of the specified focus object is a portrait ranked in the top N in the gallery, and to generate and continuously display a first focus frame corresponding to the specified focus object according to the first focus frame type, and to pause displaying focus frames of objects other than the specified focus object;
  • the fifth display module is used to change the focus frame type of the specified focus object to a fourth focus frame type if the object type of the specified focus object is not a portrait ranked in the top N in the gallery, and to generate and continuously display a fourth focus frame corresponding to the specified focus object according to the fourth focus frame type, and to pause displaying the focus frames of each object except the specified focus object.
  • the apparatus further includes:
  • the fourth focus tracking module is used to respond to the user's click operation on the designated focus tracking object, pause the focus tracking process on the designated focus tracking object, and determine any object with the highest first focus tracking priority as the target focus tracking object according to the first focus tracking priority of each object, and perform focus tracking on the target focus tracking object.
  • the objects include multiple objects with the highest first focus tracking priority; accordingly, the first focus tracking module includes:
  • a fourth determining unit configured to determine a second focus tracking priority for each object having the highest first focus tracking priority
  • the fifth determining unit is used to determine the object with the highest second focus tracking priority as the target focus tracking object.
  • the fourth determining unit is specifically configured to:
  • the second focus tracking priority of each object is determined according to the size of each object.
  • an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the focus tracking method as described above when executing the computer program.
  • an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the focus tracking method as described above.
  • an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the focus tracking method as described above.
  • the embodiments of the present application have the following beneficial effects: during the preview process, the object that the user is most concerned about in the current shooting scene is selected according to the object type of each object in the camera preview interface as the highest priority focus tracking object, so that the object that the user is currently most concerned about is tracked, and different focus tracking frames are used for displaying different types of objects. Therefore, not only can the focus tracking object be adaptively adjusted according to the real-time shooting scene, thereby improving the shooting effect of the object that the user is most concerned about, but also the user does not need to perform manual operation, thereby improving the flexibility and ease of use of focus tracking and improving the user's shooting experience.
  • the present application provides a focusing method and a focusing device, which can avoid out-of-focus and improve focusing accuracy.
  • a focusing method comprising: obtaining a focus position selected by a user; focusing according to a target detection result of the focus position, the target detection result being used to indicate whether there is a target at the focus position.
  • the occurrence of false focus can be avoided by mainly detecting whether there is a target at the focus position and focusing in a targeted manner according to the target detection result.
  • a target that is, a person, animal, plant or object
  • a corresponding focusing strategy is adopted to avoid the occurrence of false focus.
  • focusing is performed according to a target detection result at a focus position, including:
  • the target which may be a person, animal, plant or object; or,
  • different focus frames can be set to distinguish them, so that the user can distinguish which focus strategy is used by the difference in the focus frames.
  • the color and/or shape of the focus frame can be different.
  • the color can include at least one of the line color and the background color of the focus frame.
  • the shape can include at least one of the line thickness and the shape of the focus frame.
  • the color of the focus frame of the continuous focus is different from the color of the focus frame of the single focus, and/or the shape of the focus frame of the continuous focus is different from the shape of the focus frame of the single focus.
  • the color of the focus frame for continuous focus is yellow; the color of the focus frame for single focus is white.
  • the method further includes:
  • a successful focus tracking corresponds to the existence of a target
  • a failed focus tracking corresponds to the non-existence of a target. That is, there is a one-to-one correspondence between the target detection result and the SOT focus tracking result.
  • the focus tracking When the focus tracking is successful, it means that there is a target that can be focused at the focus position. At this time, if you use continuous focus to track and focus on this target, you can always focus on this target. If you use the traditional conventional focus solution, the target will deviate from the focus position, resulting in out-of-focus problems.
  • the focus tracking fails, it means that there is no focusable target at the focus position.
  • the focus will fail and become defocused, because according to the traditional solution, when the system detects that it cannot focus on the focus position selected by the user, it is defocused.
  • the solution of the embodiment of the present application directly changes to a single focus strategy in this case, so it is possible to avoid defocus.
  • the traditional solution will fail to focus because there is no focusable target at the focus position, resulting in defocus.
  • the solution in the present application changes to a single focus when there is no focusable target at the focus position and it cannot focus, so defocus can be avoided.
  • performing single-object tracking focus on a focus position may include:
  • the focus tracking result is determined to be a successful focus tracking result
  • the focus tracking result is determined to be a focus tracking failure.
  • This example can be performed based on an existing feature matching solution, such as the SOT algorithm in the cyberfocus unit in the camera framework layer.
  • performing single-object tracking focus on a focus position may include:
  • the focus tracking result is considered to be successful; or,
  • the focus tracking result is deemed to be a focus tracking failure.
  • the steps of performing single object tracking on the focus position and obtaining the tracking result include:
  • the neural network model is used to process the image feature vector to obtain the target detection result.
  • the training data set of the neural network model may include an image sample with at least one focus position and a target detection result label corresponding to each focus position.
  • the label of a focus position in a certain image sample is that a target exists, and the label of another focus position is that a target does not exist, etc., without limitation.
  • continuously focusing on the target when there is a target at the focus position, continuously focusing on the target includes:
  • the position coordinates of the focus position in the camera coordinate system are converted to obtain the position coordinates of the focus position in the SOT coordinate system;
  • the target is continuously tracked and focused.
  • the focus when there is a trackable target at the focus position, the focus can be performed according to the coordinate position in the SOT coordinate system converted from the focus position, which can make tracking and focusing on the target faster and more accurate.
  • single focusing when there is no target at the focus position, single focusing is performed, including: performing single focusing according to the position coordinates of the focus position in the camera coordinate system. That is, when there is no target that can be tracked at the focus position, there is no need to perform coordinate conversion, and focusing can be performed directly according to the position coordinates of the focus position in the camera coordinate system, which can save the calculation of coordinate conversion, improve processing efficiency, and enable faster execution of focusing.
  • the focus position when the focus position does not include the target, single focus is performed, including: focusing on the current shooting scene without considering the focus position. That is, if the focus position already knows that there is no target that can be focused, then there is no need to consider this position, and the entire shooting scene can be refocused as if this position does not exist, which saves the processing of confirming and sending coordinates, and can also enable the focus to be on a more suitable target, such as focusing on a person or animal in the shooting scene, which can further improve the focus accuracy.
  • the method before obtaining the focus position selected by the user, the method further includes: enabling the all-object tracking function. It can also be understood that the solution of the embodiment of the present application is provided with a startup interface, and the method is used for focusing only when the all-object tracking function is enabled, and when it is not enabled, the original traditional focusing solution can be used, giving the user room for independent selection.
  • a focusing device which includes a unit composed of software and/or hardware for executing any one of the methods in the sixth aspect.
  • an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the methods in the sixth aspect can be implemented.
  • a chip comprising a processor, the processor being configured to read and execute a program stored in a storage device.
  • a computer program in a device when the computer program is executed by a processor, can implement any one of the methods of the sixth aspect.
  • the chip also includes a memory, and the memory is electrically connected to the processor.
  • the chip may also include a communication interface.
  • a computer-readable storage medium which stores a computer program, and when the computer program is executed by a processor, any one of the methods in the sixth aspect can be implemented.
  • a computer program product which includes a computer program, and when the computer program is executed by a processor, it can implement any one of the methods in the sixth aspect.
  • the present application provides a shooting method and an electronic device that can achieve intelligent focus tracking, helping to improve the user's shooting experience.
  • an image processing method which is applied to an electronic device, and the method includes: displaying a first interface of a camera application (a setting interface of a "main character tracking focus” function) in a camera application, wherein the first interface includes a first control (an opening control of the "main character tracking focus” function); in response to a user's operation on the first control, obtaining N registered facial features corresponding to N faces in a gallery application, where N is an integer greater than 0; after operating the first control, displaying a second interface of the camera application (a photo preview interface), wherein the second interface includes a first image frame captured by a camera, and when a first object is photographed, the first image frame includes the first object; thereafter, it is necessary to determine whether the facial features of the first object match one of the N registered facial features; when the facial features of the first object match one of the N registered facial features, displaying a first tracking focus frame (which may be a highlighted double frame) on the first object, and starting to automatically track the focus
  • a first selection box (which can be a single white box) is displayed on the first object, and the first focus frame is different from the first selection box; when the first object does not match any of the N registered facial features, if the user wishes to manually set the first object as the focus object, the first selection box can be clicked.
  • the first object is focused, and a second focus frame (which can be a single white box) is displayed on the first object, and the second focus frame is different from the first focus frame. This achieves automatic priority focus, and the priority focus subject is displayed separately.
  • the clustered faces are generated by clustering face feature data through face feature extraction and clustering algorithms, and the face feature data is stored in the gallery application. After determining that there are clustered faces in the gallery application, the first N clustered face features in the gallery application are obtained as N registered face features. In this way, the faces that users often take pictures of can be obtained as the subjects of priority focus.
  • the camera application in order to determine whether there are clustered faces in the gallery application, the camera application needs to first perform a first query operation, and the first query operation is used to query the storage status of the clustered faces.
  • the gallery application stores clustered faces, it will write tag 1 to the database; when the gallery application does not have facial feature data, the gallery application writes tag 2 to the database. Therefore, the camera application can determine whether there are clustered faces in the gallery application based on the tags obtained by querying the database.
  • the camera application obtains the first tag, it determines that clustered faces are stored. In this way, it can avoid the camera from frequently searching for faces in the gallery application, reducing power consumption.
  • the gallery application in order to obtain N registered facial features corresponding to N faces in the gallery application, the gallery application needs to query the on state of the first shooting mode (the "main character tracking focus” shooting mode). There is a flag in the database.
  • the "main character tracking focus” mode state flag initially stored in the database is OFF, which means “main character tracking focus” mode is on. "Other focus tracking” mode is turned off, and "ON” represents that the "main character focus tracking” mode is turned on. Therefore, when the gallery application obtains the second mark (ON mark), it is determined that the first shooting mode is turned on. Therefore, the main character focus tracking will only be performed when the "main character focus tracking" shooting mode is turned on, avoiding the increase of power consumption.
  • the target recognition algorithm before determining whether the facial features of the first object match one of the N registered facial features, it is necessary to send the first image (obtained by callback of the photo preview interface) to the target recognition algorithm to identify the facial features of the subject therein, and respectively identify the facial features of different objects in the image, such as identifying the first facial features of the first object. In this way, the subject information in the photo preview image can be automatically obtained.
  • the autofocus algorithm when the first facial feature matches one of the N registered facial features, the autofocus algorithm first sets the first object as the focus of the first image and focuses on it, then acquires the next frame (the second image), sets the first object as the focus of the second image and focuses on it. Not only is the autofocus algorithm used to focus on the first object, but a first focus tracking frame is also drawn on the first object based on the first facial feature. This achieves automatic priority focus, and displays the priority focus subject differently from other subjects.
  • the first image frame also includes other second objects that match the registered facial features; when the facial features of the second object match one of the N registered facial features, compare the areas occupied by the first object and the second object in the second interface; when the area occupied by the first object in the second interface is larger than the area occupied by the second object in the second interface; the second object is considered to be a registered face but not the object with the highest priority for focus tracking, and a second focus tracking frame is displayed on the second object, and the second focus tracking frame is displayed as different from the first focus tracking frame.
  • automatic priority focusing can be achieved on the registered face with the highest priority, while distinguishing and marking other registered faces for user selection.
  • the first image frame when the first image frame also includes a third object; when the facial features of the third object do not match the N registered facial features, a fourth focus tracking frame is displayed on the third object. This can achieve automatic priority focusing on the registered face with the highest priority, while distinguishing and marking other non-registered faces or subjects for user selection.
  • the first object tracking is stopped, thereby automatically focusing on the registered face with the highest priority and then stopping the focusing.
  • an electronic device comprising a unit for executing any one of the methods in the twelfth aspect.
  • the electronic device may be a terminal or a chip in a terminal.
  • the electronic device comprises an input unit, a display unit and a processing unit.
  • the processing unit may be a processor
  • the input unit may be a communication interface
  • the display unit may be a graphics processing module and a screen
  • the terminal may also include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the terminal executes any one of the methods in aspect 12.
  • the processing unit may be a logic processing unit inside the chip, the input unit may be an input interface, a pin or a circuit, etc., and the display unit may be a graphics processing unit inside the chip;
  • the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods of the twelfth aspect.
  • a computer-readable storage medium stores Computer program code, when the computer program code is executed by an electronic device, causes the electronic device to execute any one of the methods in the twelfth aspect.
  • a computer program product comprising: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes any one of the methods in the twelfth aspect.
  • a chip including a processor, and when the processor executes instructions, the processor executes any one of the methods in the twelfth aspect.
  • FIG1 is a schematic diagram of a flow chart of a focus tracking method provided in an embodiment of the present application.
  • FIG2 is a schematic diagram of a main interface of a terminal device provided by an embodiment of the present application.
  • FIG3 is a schematic diagram of a camera preview interface of a terminal device provided by an embodiment of the present application.
  • FIG4 is a schematic diagram of a camera preview interface of another terminal device provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a recording interface of a terminal device provided in an embodiment of the present application.
  • 6-10 are schematic diagrams of a camera preview interface of a group of terminal devices provided in an embodiment of the present application.
  • FIG11 is a schematic flow chart of a focus tracking method provided in another embodiment of the present application.
  • FIGS. 12-14 are schematic diagrams of camera preview interfaces of another group of terminal devices provided in one embodiment of the present application.
  • FIG15 is a software architecture diagram of a focus tracking method provided in an embodiment of the present application.
  • FIG16 is a timing diagram of a focus tracking method provided in an embodiment of the present application.
  • FIG17 is a schematic diagram of the structure of a focus tracking device provided in an embodiment of the present application.
  • FIG18 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application.
  • FIG19 is a schematic diagram of an applicable focusing scene according to an embodiment of the present application.
  • FIG20 is a comparison diagram of shooting results of different focusing schemes
  • FIG21 is a schematic diagram of another applicable focusing scene according to an embodiment of the present application.
  • FIG22 is a schematic flow chart of a focusing method according to an embodiment of the present application.
  • FIG23 is a schematic diagram of a logical architecture of a camera function according to an embodiment of the present application.
  • FIG24 is a schematic diagram of an execution process of a focusing method according to an embodiment of the present application.
  • FIG25 is a schematic diagram of an execution process of a focusing method according to an embodiment of the present application.
  • FIG26 is a schematic diagram of another execution process of the focusing method according to an embodiment of the present application.
  • FIG27 is a schematic diagram of a focusing device according to an embodiment of the present application.
  • FIG28 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
  • FIG29 is a schematic diagram of the hardware structure of another electronic device according to an embodiment of the present application.
  • FIG30 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG31 is a hardware structure diagram of an electronic device provided in an embodiment of the present application.
  • FIG32 is a software architecture diagram of an electronic device provided in an embodiment of the present application.
  • FIG33 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG34 is a schematic diagram of a module interaction provided in an embodiment of the present application.
  • FIG35 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG36 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG37 is a schematic diagram of a module interaction provided in an embodiment of the present application.
  • FIG38 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG39 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG40 is a schematic diagram of a module interaction provided in an embodiment of the present application.
  • FIG41 is a schematic diagram of an interface provided in an embodiment of the present application.
  • FIG42 is a schematic diagram of an interface provided in an embodiment of the present application.
  • Figure 43 is a schematic diagram of an interface provided in an embodiment of the present application.
  • the term “if” can be interpreted as “when” or “uponce” or “in response to determining” or “in response to detecting”, depending on the context.
  • the phrase “if it is determined” or “if [described condition or event] is detected” can be interpreted as meaning “uponce it is determined” or “in response to determining” or “uponce [described condition or event] is detected” or “in response to detecting [described condition or event]", depending on the context.
  • references to "one embodiment” or “some embodiments” etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements “in one embodiment”, “in some embodiments”, “in some other embodiments”, “in some other embodiments”, etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean “one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
  • the terms “including”, “comprising”, “having” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized in other ways.
  • FIG1 shows a schematic flow chart of a focus tracking method provided in an embodiment of the present application.
  • Step 101 In response to a first operation of a user, a camera preview interface is displayed.
  • the focus tracking method of the embodiment of the present application can be executed by the focus tracking device of the embodiment of the present application.
  • the focus tracking device of the embodiment of the present application can be configured in any terminal device to execute the focus tracking method of the embodiment of the present application.
  • the focus tracking device of the embodiment of the present application can be configured in a terminal device such as a mobile phone, a computer, a wearable device, etc. to realize the automatic focus tracking function of the user during the shooting process.
  • the first operation may be any operation input by the user in the terminal device that can trigger the opening of the camera preview interface.
  • the first operation may be triggering the camera application icon in the main interface of the terminal device, triggering the shutter control in the camera operation interface, triggering the end recording control during the camera recording process, triggering the pause recording control during the camera recording process, etc.
  • the main interface 200 of the terminal device displays a page with application icons, which may include multiple application icons (for example, weather application icon, calendar application icon, album application icon, note application icon, email application icon, application store application icon, setting application icon, etc.).
  • a page indicator may also be displayed below the above multiple application icons to indicate the positional relationship between the currently displayed page and other pages.
  • There are multiple application icons for example, camera application icon 201, browser application icon, information application icon, dial application icon) below the page indicator. These application icons remain displayed when the page is switched.
  • the camera application icon 201 is an icon of a camera application (i.e., a camera application).
  • the camera application icon 201 can be used to trigger the launch of the camera application.
  • the terminal device can detect the trigger operation acting on the camera application icon 201, and in response to the trigger operation, the electronic device can display the camera preview interface 300 as shown in Figure 3.
  • the camera preview interface 300 is the shooting interface of the default shooting mode of the camera application, and the user can preview the image and complete the shooting on this interface.
  • the camera preview interface 300 may include a preview window 301 , a camera mode option 302 , an album shortcut control 303 , a shutter control 304 , and a camera flip control.
  • the preview window 301 can be used to display a preview image.
  • the preview image displayed in the preview window 301 is an original image captured by the camera of the terminal device based on the viewing range.
  • One or more shooting mode options may be displayed in the camera mode option 302.
  • the one or more shooting mode options may include: a night scene mode option, a smart portrait mode option, a photo mode option, a video mode option 3021, and more options. It is understandable that the camera mode option 302 may also include more or fewer shooting mode options.
  • the album quick control 303 can be used to open the album application. After the user triggers the electronic device to open the album application through the album quick control 303, the captured images and videos can be viewed. In addition, the album quick control 303 can also display thumbnails of the captured images or videos.
  • the shutter control 304 can be used to trigger the camera to collect images and complete the photo operation.
  • the terminal device can automatically return to and display the camera preview interface 300 after obtaining the user's trigger operation on the shutter control 304 and completing the photo.
  • triggering the recording mode option 3021 can enter the recording mode and display the camera preview interface 400 (recording preview interface) as shown in FIG. 4.
  • the controls included in the camera preview interface 400 are substantially the same as the controls included in the camera preview interface 300, except that the camera preview interface 400 can also include a recording start control 401.
  • the recording start control 402 is used to trigger the electronic device to start recording.
  • the terminal device can display a recording interface 50 as shown in FIG. 5.
  • the recording interface 50 includes an end recording control 51 and a pause recording control 52.
  • the end recording control can be used to end recording, and the pause recording control 52 can be used to pause recording.
  • the terminal device can obtain the user's end recording control.
  • the recording control 51 is triggered, the recording is ended and the camera preview interface 400 shown in FIG. 4 is displayed; the recording can also be stopped and the camera preview interface is displayed after the user triggers the pause recording control 52 .
  • trigger operations mentioned in the embodiments of the present application may include but are not limited to touch (for example, click, etc.), voice control, gesture and other operations, and the present application does not limit this.
  • the types of the first operation listed above and the methods of triggering the display of the camera preview interface are only exemplary and cannot be regarded as limitations of the present application.
  • the type of the first operation that triggers the display of the camera preview interface may be related to the functions of the terminal device and the camera application, and the embodiments of the present application do not limit this.
  • Step 102 performing recognition processing on each object displayed in the camera preview interface to determine the object type of each object.
  • the object type may include portraits ranked in the top N in the gallery, portraits ranked in the top N in the non-gallery, and non-face objects of preset types, where N is a positive integer greater than or equal to 1.
  • the gallery application in the terminal device can perform clustering processing based on the images that the user has collected and stored in the gallery database, so as to classify the images that the user has collected according to the objects contained in each image, thereby generating personal albums corresponding to each collected object, and sorting each personal album according to parameters such as the number of images contained in the personal album and whether the personal album has been named, so that the portraits corresponding to the personal albums ranked in the top N in the gallery can be determined as the portraits ranked in the top N in the gallery, and the facial features of the portraits ranked in the top N in the gallery are sent to the camera application, so that the camera application can determine whether the object in the preview interface is the portrait ranked in the top N in the gallery according to the sent facial features during the preview stage.
  • the portrait ranked in the top N in the gallery is referred to as the protagonist portrait, that is, the portrait ranked in the top N in the gallery mentioned in the present application is the same type of portrait as the protagonist portrait.
  • the specific value of N can be determined according to actual needs and specific application scenarios, and the embodiment of the present application does not limit this.
  • N can be 5.
  • the portraits ranked high in the gallery are usually portraits that appear frequently in the user's gallery, or portraits named by the user, the portraits ranked in the top N in the gallery can usually be considered as objects of high user attention.
  • the portraits ranked in the top N in the non-image library may be portraits included in the image library but not ranked in the top N, or portraits not included in the image library.
  • the portraits ranked in the top N in the non-image library are referred to as ordinary portraits, that is, the portraits ranked in the top N in the non-image library mentioned in the present application are the same type of portraits as the ordinary portraits.
  • the preset type of non-face object can be any type of entity object other than a face image.
  • the preset type of non-face object can include pets such as cats and dogs, vehicles, etc., and the present embodiment of the application does not limit this.
  • the types of non-face objects included in the preset type can be set according to the actual needs of the user, and the present embodiment of the application does not limit this.
  • the preset type of non-face object can be a cat or a dog.
  • the camera after opening the camera application and displaying the camera preview interface, the camera can capture images of the framing range at a certain frame rate and store the captured image frames in a frame buffer. Therefore, after displaying the camera preview interface, the preview frames that the camera has captured can be obtained frame by frame from the frame buffer, and the objects in each preview frame can be identified and processed using the all-object tracking algorithm and the face feature algorithm in the semantic engine to determine the object type of each object in each preview frame.
  • Step 103 Determine the focus frame type of each object according to the object type of each object.
  • the focus frame of each object can be displayed in the camera preview interface to facilitate the camera to The process of tracking focus on each object in the preview interface is visible to the user.
  • different types of tracking focus frames can be used for tracking focus on different types of objects, so that users can know the type of each object based on the tracking focus frame corresponding to each object, and then whether each object in the camera preview interface is the object of their attention, so that users can adjust their shooting strategies according to their own shooting needs.
  • the correspondence between object types and focus frame types can be pre-set. After the object type of each object in the camera preview interface is determined, the focus frame type corresponding to the object type of each object can be determined as the focus frame type of each object according to the preset correspondence between the object type and the focus frame type.
  • the focus frame type of the portraits ranked in the top N in the gallery can be the first focus frame type or the second focus frame type
  • the focus frame type of the portraits ranked in the top N in the non-gallery and the focus frame type of the non-face objects of the preset type can be the third focus frame type, wherein the first focus frame type, the second focus frame type, and the third focus frame type are all different.
  • the focus frame type of the protagonist portrait can be a double-layer yellow frame or a double-layer white frame, that is, the first focus frame type can be a double-layer yellow frame, and the second focus frame type can be a double-layer white frame;
  • the focus frame type of ordinary portraits and preset types of non-face objects can be a single-layer white frame, that is, the third focus frame type can be a single-layer white frame.
  • Step 104 Determine the first focus tracking priority of each object according to the object type and the preset priority strategy of each object.
  • the preset priority strategy may be set according to the user's attention level to each object type.
  • the priority strategy can be pre-set according to the user's attention to each object type. That is, in the preset priority strategy, the higher the user's attention to the object type, the higher the corresponding first focus tracking priority, so that the object with the highest current attention of the user can be focused during the shooting process, thereby achieving the purpose of taking the clearest picture of the object with the highest attention of the user.
  • the preset priority strategy can be: the first focus tracking priority of portraits ranked in the top N in the gallery (protagonist portraits) is higher than the first focus tracking priority of portraits ranked in the top N in the non-gallery (ordinary portraits), and the first focus tracking priority of portraits ranked in the top N in the non-gallery (ordinary portraits) is higher than the first focus priority of non-face objects of a preset type.
  • the first focus priority of the protagonist portrait can be set to the highest, so that when the protagonist portrait exists in the camera preview interface, the protagonist portrait is given priority to focus tracking; in addition to the protagonist portrait, when taking pictures, compared with other types of physical objects, users usually pay more attention to facial objects.
  • the first focus priority of ordinary portraits can be set to be lower than the protagonist portrait and higher than the preset type of non-face objects, so that when the protagonist portrait is not included in the camera preview interface, ordinary faces are given priority to focus tracking; since the preset type of non-face objects is an object type that the user pays more attention to besides facial objects according to the user's usage needs, the first focus priority of the preset type of non-face objects can be set to be lower than the first focus priority of ordinary faces, so that when there is no protagonist face and ordinary faces in the camera preview interface. When tracking faces, priority will be given to non-face objects of preset types.
  • the first focus tracking priority of the protagonist portrait can be determined as the highest priority
  • the first focus tracking priority of ordinary portraits can be determined as the second highest priority
  • the first focus tracking priority of the preset type of non-face objects can be determined as the lowest priority
  • the first focus tracking priority of ordinary portraits can be determined as the highest priority
  • the first focus tracking priority of the preset type of non-face objects can be determined as the second highest priority
  • the first focus tracking priority of the protagonist portrait can be determined as the highest priority
  • the first focus tracking priority of the preset type of non-face objects can be determined as the second highest priority
  • the first focus tracking priority of the protagonist portrait can be determined as the highest priority
  • the first focus tracking priority of the preset type of non-face objects can be determined as the second highest priority
  • Step 105 generating a focus frame corresponding to each object according to the focus frame type of each object, and displaying the focus frame corresponding to each object in the camera preview interface according to the coordinates of each object.
  • the coordinates and focus frame type of each object can be sent to the everything focus tracking plug-in in the camera application, so that the everything focus tracking plug-in can draw the corresponding type of focus frame according to the focus frame type of each object, and display the drawn focus frame in the camera preview interface according to the coordinates of each object, so that the focus frame corresponding to each object in the camera preview interface follows the real-time position of the corresponding object.
  • the coordinates of the object may include the center point coordinates of the object and the corresponding area size (height, width) of the object in the camera preview interface.
  • the center point coordinates of the object may be the center point coordinates of the object's head area
  • the corresponding area size in the camera preview interface may be the size corresponding to the object's head area.
  • the area size of the object in the camera preview interface may be used as the size of the corresponding focus frame to draw the focus frame
  • the center point coordinates of the object may be used as the center point coordinates of the corresponding focus frame to display the focus frame, so that the display position of the focus frame is consistent with the display position of the corresponding object.
  • the first focus frame type corresponding to the protagonist portrait is a double-layer yellow frame
  • the second focus frame type is a double-layer white frame
  • the third focus frame type corresponding to ordinary portraits and preset types of non-face objects is a single-layer white frame
  • a single-layer white frame 602 can be drawn and displayed in the display area corresponding to the cat
  • a single-layer white frame 7011 can be drawn and displayed in the display area corresponding to the cat
  • single-layer white frames 7021, 7031, and 7041 can be displayed in the head areas corresponding to the ordinary portraits 702, 703, and 704, respectively
  • the focus frame of the first focus frame type can be used to represent the portrait of the protagonist that is locked in focus. Therefore, when the camera preview interface includes multiple portraits of the protagonist, the focus frame of one of the portraits of the protagonist can be determined as the first focus frame type, and the focus frames of the remaining portraits of the protagonist can be determined as the second focus frame type. That is, in a possible implementation of the embodiment of the present application, the above step 105 can include:
  • the object includes a first portrait (portrait of the protagonist) whose object type is ranked in the top N in the image library.
  • a first tracking focus frame corresponding to the first object is generated according to the second tracking focus frame type, and the first tracking focus frame corresponding to the first object is displayed in the camera preview interface according to the coordinates of the first object;
  • the objects include a first object whose object type is a portrait (protagonist portrait) ranked in the top N in the gallery and at least one second object
  • a first tracking frame corresponding to the first object is generated according to the first tracking frame type
  • a second tracking frame corresponding to each second object is generated according to the second tracking frame type
  • the first tracking frame corresponding to the first object and the second tracking frame corresponding to each second object are displayed in the camera preview interface according to the coordinates of the first object and each second object, wherein the size of the first object is larger than the size of each second object.
  • the focus frame type of the first portrait can be directly determined as the first focus frame type, and a first focus frame of the first focus frame type can be drawn and displayed in the head area of the first object;
  • the camera preview interface includes multiple portraits of protagonists, the protagonist portrait with the largest size can be determined as the first object according to the size of each protagonist object, and the other protagonist portraits can be determined as the second objects, and then the focus frame type of the first object can be determined as the first focus frame type, and the focus frame type of the second object can be determined as the second focus frame type, and then the first focus frame of the first focus frame type can be drawn and displayed in the head area of the first object, and the second focus frame of the second focus frame type can be drawn and displayed in the head area of the second object.
  • the camera preview interface 800 includes ordinary portraits 801, 802 and a protagonist portrait 803, then the protagonist portrait 803 can be determined as the first object, and a double-layer yellow frame 8031 can be drawn and displayed in the head area of the protagonist portrait 803, and single-layer white frames 8011 and 8021 can be drawn and displayed in the head areas of the ordinary portraits 801 and 802, respectively.
  • the camera preview interface 900 includes ordinary portraits 901, 902 and protagonist portraits 903, 904, and the size of protagonist portrait 904 is larger than the size of protagonist portrait 903.
  • protagonist portrait 904 can be determined as the first object
  • protagonist portrait 903 can be determined as the second object.
  • a double-layer yellow frame 9041 is drawn and displayed in the head area of protagonist portrait 904
  • a double-layer white frame 9031 is drawn and displayed in the head area of protagonist portrait 903
  • single-layer white frames 9011 and 9021 are drawn and displayed in the head areas of ordinary portraits 901 and 902, respectively.
  • the focus frame of each of the portraits of the main characters can be redrawn according to the size change of each of the portraits of the main characters, so as to further improve the accuracy and flexibility of the focus tracking. That is, in a possible implementation of the embodiment of the present application, after the first focus frame corresponding to the first object is generated according to the first focus frame type, and the second focus frame corresponding to each of the second objects is generated according to the second focus frame type, and the first focus frame corresponding to the first object and the second focus frame corresponding to each of the second objects are displayed in the camera preview interface according to the coordinates of the first object and the second objects, it can also include:
  • any second object is determined as a new first object, and the first object is determined as a new second object, and the focus frame corresponding to the new first object is changed from the second focus frame to the first focus frame, and the focus frame corresponding to the new second object is changed from the first focus frame to the second focus frame.
  • the focus frame type of each portrait of the protagonist can be switched in real time according to the position change of each portrait of the protagonist.
  • the second object can be switched.
  • the first object is determined as a new first object, and the focus frame of the new first object is changed from the second focus frame to the first focus frame; the first object is determined as a new second object, and the focus frame of the new second object is changed from the first focus frame to the second focus frame.
  • the focus frame of the protagonist portrait 1003 can be switched from the double-layer white frame 9031 to the double-layer yellow frame 10031, and the focus frame of the protagonist portrait 1004 can be switched from the double-layer yellow frame 9041 to the double-layer white frame 10041.
  • the focus frame corresponding to each protagonist portrait can be continuously displayed.
  • the focus tracking frame of a normal portrait and a preset type of non-face object such as a cat or dog can automatically stop displaying after a period of time. That is, in a possible implementation of the embodiment of the present application, after the above step 105, the following may also be included:
  • the object type of the object is a portrait (ordinary portrait) that is not in the top N in the image library or a non-face object of a preset type, determine the display time length of the focus tracking frame corresponding to the object;
  • the focus tracking frame corresponding to the object stops being displayed.
  • the focus tracking frames corresponding to these objects can be stopped from being displayed in the camera preview interface when the display time of the focus tracking frames corresponding to these objects in the camera preview interface reaches a time threshold.
  • the focus tracking frames corresponding to ordinary portraits and preset types of non-face objects are only displayed in the camera preview interface for a short time to prevent too many focus tracking frames from being displayed for a long time when there are many objects in the camera preview interface, resulting in a cluttered display of the camera preview interface and affecting the user's visual experience when shooting.
  • the specific value of the time threshold can be set according to actual needs and specific application scenarios, and the embodiment of the present application does not limit this.
  • the time threshold can be 3 seconds, 5 seconds, 10 seconds, and so on.
  • Step 106 According to the first focus tracking priority of each object, any object with the highest first focus tracking priority is determined as a target focus tracking object, and a focus tracking process is performed on the target focus tracking object.
  • the object with the highest first focus priority can be determined as the target focus object, so that the target focus object can be focused during the preview process and after the user triggers shooting. It should be noted that when there are multiple objects with the highest first focus priority, any object with the highest first focus priority can be determined as the target focus object, or an object that meets the preset rules can be selected from the objects with the highest first focus priority according to the preset rules as the target focus object, and the embodiment of the present application does not limit this.
  • an autofocus region of interest command can be generated according to the coordinates of the target focusing object, and the autofocus region of interest command can be sent to the autofocus algorithm to perform focusing processing on the target focusing object through the autofocus algorithm.
  • the focus frame type of the target focus tracking object can be determined as the first focus frame type (such as a double-layer yellow frame), and when there is no interaction in the camera preview interface, the first focus frame (double-layer yellow frame) corresponding to the target focus tracking object is continuously displayed in the camera preview interface; if the target focus tracking object finally determined is an ordinary portrait or a preset type of non-face object, the focus frame display strategy of the target focus tracking object is the same as the aforementioned steps, that is, the focus frame type of the target focus tracking object is determined to be the third focus frame type (such as a single-layer white frame), and when there is no interaction in the camera preview interface, the display time of the focus frame of the target focus tracking object reaches the first focus frame type (such as a double-layer yellow frame), and when there is no interaction in the camera preview interface, the display time of the focus frame of the target focus tracking object reaches the first focus frame type (such as a double-layer yellow frame), and when there is no interaction in the camera preview interface, the display time of the focus frame
  • the target focus tracking object can be determined in the following manner:
  • the first object is determined as the object with the highest first priority, and any first object is determined as the target focus tracking object;
  • the first object is not included in the objects, determining whether the objects include a second object whose object type is not a portrait ranked in the top N in the image library;
  • the second object is determined as the object with the highest first priority, and any second object is determined as the target focus tracking object;
  • the second object is not included in the objects, determining whether the objects include a third object whose object type is a non-face object of a preset type;
  • the objects include at least one third object, the third object is determined as the object with the highest first priority, and any third object is determined as the target focus tracking object;
  • center focus processing is performed in the preview interface.
  • any object when the camera preview interface includes a portrait of a protagonist, any object can be selected from the portraits of the protagonist as the target focus tracking object; when the camera preview interface does not include a portrait of a protagonist and includes ordinary portraits, any object can be selected from the ordinary portraits as the target focus tracking object; when the camera preview interface only includes non-face objects of preset types, any object can be selected from non-face objects of preset types as the target focus tracking object.
  • the focus tracking priorities of each object with the highest first focus tracking priority may be re-sorted to ensure that the object of automatic focus tracking is the object that the user is currently most concerned about, further improving the accuracy of automatic focus tracking. That is, in a possible implementation of the embodiment of the present application, the above step 106 may include:
  • the object with the second highest focus tracking priority is determined as the target focus tracking object.
  • the second focus priority of each object with the highest first focus priority can be further determined, and the object with the highest second focus priority can be determined as the target focus object, so that the target focus object is the object that the user is currently most concerned about, thereby improving the accuracy of automatic focus.
  • the second focus tracking priority of each object can be determined in the following way:
  • the second focus tracking priority of each object is determined according to the size of each object.
  • the object types include portraits ranked in the top N in the gallery (protagonist portraits), portraits ranked in the top N in the non-gallery (ordinary portraits), and non-face objects of preset types
  • the protagonist portrait is a high-frequency image in the gallery determined by the gallery application based on the images collected by the user
  • the gallery application determines the protagonist portrait, it can also determine the preset priority of each protagonist portrait based on the number of images corresponding to the protagonist portrait in the gallery, that is, the more images corresponding to the protagonist portrait, the higher the preset priority of the protagonist portrait, and then send each protagonist portrait and the preset priority of each protagonist portrait to the camera application at the same time.
  • the preset priority of each protagonist portrait can be obtained as the second focus tracking priority of each protagonist portrait, and then the protagonist portrait with the highest second focus tracking priority is determined as the target focus tracking object.
  • the second focus tracking priority of each subject portrait may be determined according to the size of the subject portrait, that is, the larger the size of the subject portrait, the higher the second focus tracking priority of the subject portrait, and the subject portrait with the highest second focus tracking priority may be determined as the target focus tracking subject. That is, the subject portrait with the largest size is determined as the target focus tracking subject.
  • any one of the above methods can be selected to determine the second focus tracking priority of the portrait of the protagonist according to actual needs and specific application scenarios.
  • the embodiments of the present application are not limited to this.
  • the object types include portraits ranked in the top N in the gallery (protagonist portraits), portraits ranked in the top N in the non-gallery (ordinary portraits), and non-face objects of a preset type
  • ordinary portraits and non-face objects of a preset type appear randomly and their corresponding priorities cannot be preset
  • the object with the highest first focus tracking priority is an ordinary portrait or a non-face object of a preset type, and there are multiple objects
  • the second focus tracking priority of each object can be determined based on the size of each object with the highest first focus tracking priority, and the object with the highest second focus tracking priority (i.e., the largest object) can be determined as the target focus tracking object.
  • the focus tracking method provided in the embodiment of the present application selects the object that the user is most concerned about in the current shooting scene as the highest priority focus tracking object according to the object type of each object in the camera preview interface during the preview process, so as to focus on the object that the user is currently most concerned about, and use different focus tracking frames for displaying different types of objects. Therefore, not only can the focus tracking object be adaptively adjusted according to the real-time shooting scene, thereby improving the shooting effect of the object that the user is most concerned about, but also the user does not need to perform manual operation, thereby improving the flexibility and ease of use of focus tracking and improving the user's shooting experience.
  • users may also be allowed to manually select corresponding objects for focus tracking according to their own shooting needs, so as to further enhance the flexibility and interactivity of automatic focus tracking and further enhance the user's shooting experience.
  • the focus tracking method provided in the embodiment of the present application is further described below in conjunction with FIG. 11 .
  • FIG. 11 shows a flow chart of another focus tracking method provided in an embodiment of the present application.
  • the focus tracking method includes the following steps:
  • Step 1101 In response to a first operation of the user, a camera preview interface is displayed.
  • Step 1102 Perform recognition processing on each object displayed in the camera preview interface to determine the object type of each object.
  • Step 1103 determining the focus frame type of each object according to the object type of each object.
  • Step 1104 Determine the first focus tracking priority of each object according to the object type and the preset priority strategy of each object.
  • the preset priority strategy is set according to the user's attention level to each object type.
  • Step 1105 generating a focus frame corresponding to each object according to the focus frame type of each object, and displaying the focus frame corresponding to each object in the camera preview interface according to the coordinates of each object.
  • Step 1106 According to the first focus tracking priority of each object, any object with the highest first focus tracking priority is determined as the target focus tracking object, and the target focus tracking object is processed.
  • Step 1107 in response to a user's click operation on any object, determine any object as a designated focus tracking object.
  • the object with the highest user attention be automatically selected as the target focus object based on the object type, focus priority and other parameters of each object in the camera preview interface, and the target focus object can be continuously focused during the subsequent preview and shooting processes without any subsequent user interaction, but the user can also be allowed to select any object in the camera preview interface as the designated focus object according to the current actual shooting needs, and the designated focus object selected by the user can be continuously focused during the preview and subsequent shooting processes without any further interactive operations by the user.
  • Step 1108 If the designated focus object is the target focus object, the designated focus object is continuously focused until a click operation of the user on any object is obtained.
  • the target focus object is an automatic focus object determined according to the focus priority of each object in the camera preview interface
  • the target focus object has been focused before the user clicks on any object in the camera preview interface. Therefore, if the designated focus object selected by the user is the target focus object, the designated focus object (i.e., the previous target focus object) can continue to be focused until the user selects another object as the designated focus object, then the focus on the target focus object is stopped, and the designated focus object newly selected by the user is focused.
  • Step 1109 if the designated focus object is not the target focus object, the focus processing on the target focus object is suspended, and the focus processing on the designated focus object is continued until a click operation of the user on any object is obtained.
  • the focus processing of the target focus object can be paused and switched to continuous focusing processing of the designated focus object until the user selects another object as the designated focus object, then the focus processing is switched to the new designated focus object selected by the user.
  • the user clicks to select a specified focus object it can be determined that the currently locked focus object is the specified focus object, so only the focus frame of the specified focus object can be displayed, so as to make the camera display interface more concise and reduce the impact of displaying too many focus frames on the user's shooting experience.
  • the following may also be included:
  • the designated focus object is the target focus object, and the object type of the designated focus object is a portrait (protagonist portrait) ranked in the top N in the gallery, the focus frame type of the designated focus object remains unchanged, the focus frame of the designated focus object continues to be displayed, and the focus frames of all objects except the designated focus object are temporarily displayed;
  • the focus frame type of the designated focus object is changed to the first focus frame type, and a first focus frame corresponding to the designated focus object is generated and continuously displayed according to the first focus frame type, and the focus frames of all objects except the designated focus object are temporarily displayed;
  • the focus frame type of the specified focus object will be changed to the fourth focus frame type, and the fourth focus frame corresponding to the specified focus object will be generated and continuously displayed according to the fourth focus frame type, and the focus frames of all objects except the specified focus object will be temporarily displayed.
  • the object types include a protagonist portrait, an ordinary portrait, and a preset type of non-face object
  • the focus frame type of the target focus object can be a first focus frame type (such as a double-layer yellow frame), so as to indicate through the first focus frame type that the target focus object is currently being focused, so as to explicitly display the protagonist portrait currently being focused to the user.
  • the focus frame of the designated focus object is a focus frame of the first focus frame type, which can be used to indicate the protagonist portrait being focused. Therefore, the focus frame of the designated focus object can be kept unchanged, and the focus frame of the designated focus object can be continuously displayed, and the focus frames of the remaining objects in the camera preview interface can be paused.
  • the camera preview interface 800 shown in FIG8 includes two ordinary portraits 801 and 802, whose corresponding focus frames 8011 and 8021 are single-layer white frames (the third focus frame type), and a protagonist portrait 803, and the protagonist portrait 803 is the target focus object, and its corresponding focus frame 8031 is a double-layer yellow frame (the first focus frame type). If the protagonist portrait 803 is clicked in the camera preview interface 800, the protagonist portrait 803 can be determined as the designated focus object, and the focus frame 8031 can be kept unchanged, and the focus frames 8011 and 8021 corresponding to the ordinary portraits 801 and 802 can be paused, as shown in FIG12.
  • the designated focus object is not the target focus object, and the object type of the designated focus object is a portrait of a protagonist, it can be determined that before the designated focus object is clicked by the user, its corresponding focus frame type is a second focus frame type (such as a double-layer white frame).
  • the second focus frame type can be used to indicate that the object is a protagonist object, but is not currently being focused on.
  • the designated focus object needs to be focused, so that the focus frame type of the designated focus object can be changed from the second focus frame type to the first focus frame type (such as a double-layer yellow frame) to indicate that the designated focus object is the portrait of the protagonist currently being focused on.
  • the camera preview interface 900 includes two ordinary portraits 901 and 902, whose corresponding focus frames 9011 and 9021 are single-layer white frames (third focus frame type), and two protagonist portraits 903 and 904, wherein protagonist portrait 904 is the target focus object, and its corresponding focus frame 9041 is a double-layer yellow frame (first focus frame type), and protagonist portrait 903 is not the target focus object, and its corresponding focus frame 9031 is a double-layer white frame (second focus frame type).
  • protagonist portrait 903 in the camera preview interface 900 protagonist portrait 903 can be determined as the designated focus object, and focus frame 9031 can be changed to a double-layer yellow frame, and the display of ordinary people can be paused.
  • the focus frames 9011 and 9021 corresponding to the images 901 and 902, and the focus frame 9041 corresponding to the paused display of the protagonist portrait 904, are shown in FIG. 13 .
  • the designated focus object is not the protagonist portrait, that is, the designated focus object is an ordinary portrait or a preset type of non-face object
  • the focus frame type corresponding to these two types of objects is the third focus frame type (such as a single-layer white frame)
  • this type of focus frame will not be displayed continuously and cannot indicate that the focus object has been locked.
  • the focus frame type of the designated focus object can be changed to a fourth focus frame type (such as a single-layer yellow frame), and a fourth focus frame of the designated focus object is generated and continuously displayed according to the fourth focus frame type, and the focus frames of the remaining objects in the camera preview interface are temporarily displayed, so that the designated focus object that has been locked in focus can be explicitly displayed to the user through the fourth focus frame.
  • a fourth focus frame type such as a single-layer yellow frame
  • the camera preview interface 900 includes two ordinary portraits 901 and 902, whose corresponding focus frames 9011 and 9021 are single-layer white frames (third focus frame type), and two protagonist portraits 903 and 904, wherein the protagonist portrait 904 is the target focus object, and its corresponding focus frame 9041 is a double-layer yellow frame (first focus frame type), and the protagonist portrait 903 is not the target focus object, and its corresponding focus frame 9031 is a double-layer white frame (second focus frame type).
  • the protagonist portrait 901 can be determined as the designated focus object, and the focus frame 9011 can be changed to a single-layer yellow frame, and the focus frame 9021 corresponding to the ordinary portrait 902 can be paused, and the focus frames 9031 and 9041 corresponding to the protagonist portraits 903 and 904 can be paused, as shown in FIG14 .
  • the locked focus on the designated focus object can be canceled and the automatic focus mode can be re-entered. That is, in a possible implementation of the embodiment of the present application, after the above step 1107, the following may also be included:
  • the focus processing on the designated focus object is paused, and based on the first focus priority of each object, any object with the highest first focus priority is determined as the target focus object, and the focus processing is performed on the target focus object.
  • the focus tracking process for the designated focus object can be canceled, and the automatic focus tracking process of the embodiment of the present application can be re-executed, that is, return to execute step 1102 and its subsequent steps of the embodiment of the present application.
  • the focus tracking method provided in the embodiment of the present application selects the object that the user is most concerned about in the current shooting scene as the highest priority focus tracking object according to the object type of each object in the camera preview interface during the preview process, so as to focus on the object that the user is currently most concerned about, and different focus tracking frames are used for displaying different types of objects; and allows the user to manually select any object as the designated focus tracking object during the preview process, and continue to focus on the designated focus tracking object, so that not only can the focus tracking object be adaptively adjusted according to the real-time shooting scene, the shooting effect of the object that the user is most concerned about is improved, and the flexibility and ease of use of focus tracking are improved, but also by allowing the user to select or change the focus tracking object according to actual shooting needs, the flexibility and interactivity of automatic focus tracking are improved, and the user's shooting experience is further improved.
  • FIG. 15 shows a software architecture diagram of a focus tracking method provided in an embodiment of the present application.
  • the software architecture of the focus tracking method includes a camera application layer, a camera framework layer, a camera hardware abstraction layer and a camera driver layer.
  • the camera application layer includes user interface, plug-in module and camera management.
  • the user interface includes photo, video, portrait, etc., which are used to display the operation controls of photo, video, portrait, etc. in the user interface of the camera application;
  • the plug-in module includes AutoTrack plug-in, flash plug-in, filter plug-in, etc.;
  • the camera management includes device management, session control management, surface management, etc. It should be noted that the AutoTrack plug-in is used to carry user interaction response and algorithm result processing.
  • the camera framework layer includes the camera service, which includes the CamManager class, session control, camera device, and output.
  • the camera hardware abstraction layer includes CamX and CHI.
  • CamX represents a set of code implementations of general functional interfaces; CHI represents a set of code implementations of customizable requirements.
  • CamX includes Camera3Device, session control, output, semantic engine (semanticEngine), SWL and sensor node (sensornode).
  • the semantic engine includes the cyberFocus node, face feature algorithm (faceFeature) node, motion detection algorithm (motionDec) node, etc.
  • the all-things tracking algorithm node is a node that carries out the execution of the all-things tracking algorithm, and is located on a node in the camera post-processing pipeline;
  • the face feature algorithm node is an algorithm node for identifying the protagonist portrait (i.e., the portraits in the top N in the sorting of the gallery mentioned in the aforementioned embodiment).
  • SWL also includes an autofocus algorithm node for executing the focus service.
  • CHI includes the chiusecase class, which is mainly responsible for the service processing and resource management in CHI.
  • the camera driver layer includes at least one camera driver; the number of drivers corresponds to the number of cameras installed in the terminal device.
  • FIG. 16 shows a timing diagram of a focus tracking method provided in an embodiment of the present application.
  • the timing diagram of the focus tracking method involves the shooting mode module, the all-things focus tracking plug-in and the camera management module in the camera application layer in the software architecture diagram, as well as the camera service in the camera framework layer, the Camera3Device in the camera hardware abstraction layer, the semantic engine, the all-things focus tracking algorithm node, the face feature algorithm node and the autofocus algorithm node. Specifically, it includes the following steps:
  • the shooting mode module receives a request from a user to start a camera application
  • the shooting mode module sends a camera start request to the camera management module
  • the camera management module sends a request to obtain the camera service to the camera service
  • the camera service sends a request to Camera3Device to construct a camera instance
  • the shooting mode module sends a request to load the all-things focus tracking plug-in to the all-things focus tracking plug-in;
  • the all-object focus tracking plug-in sends a request to activate the all-object focus tracking algorithm to the camera management module;
  • the camera management module sends a request to construct an all-object tracking algorithm to the semantic engine
  • Camera3Device obtains preview frames from the frame buffer frame by frame and sends them to the semantic engine
  • S1611 The semantic engine inputs the preview frame into the all-things tracking algorithm node to identify the object in the preview frame;
  • S1612 the all-things tracking algorithm node inputs the preview frame into the face feature algorithm node to identify the protagonist portrait in the preview frame (i.e., the portraits ranked in the top N in the image library mentioned in the above embodiment);
  • S1615 The user interface draws a first type of focus tracking frame (double-layer yellow frame) corresponding to the protagonist's portrait;
  • the all-object tracking algorithm node sends an auto-focusing region of interest instruction to the auto-focusing algorithm node, so as to automatically track the focus on the subject portrait;
  • S1620 The user interface draws a third type of focus tracking frame (single-layer white frame);
  • S1625 The user interface draws a third type of focus tracking frame (single-layer white frame) corresponding to an ordinary portrait or a preset type of non-face object;
  • S1629 The all-object tracking algorithm node detects that the user manually selects a non-protagonist portrait
  • S1631 The user interface draws a fourth type of focus frame (single-layer yellow frame) corresponding to the specified focus object selected by the user;
  • the user interface displays a fourth type of focus frame (a single-layer yellow frame) corresponding to the designated focus object, and maintains the frame on the object selected by the user, that is, maintains the frame on the designated focus object;
  • a fourth type of focus frame a single-layer yellow frame
  • S1635 The All Things Focus Plug-in detects that the user has deselected the selected object or has locked the focus object;
  • Figure 17 shows a structural block diagram of the focus tracking device provided in the embodiment of the present application. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.
  • the apparatus 1700 includes:
  • the first display module 1701 is used to display a camera preview interface in response to a first operation of the user;
  • the first determination module 1702 is used to identify each object displayed in the camera preview interface to determine Determine the object type of each object;
  • a second determining module 1703 is used to determine a focus frame type of each object according to the object type of each object;
  • a third determination module 1704 is used to determine a first focus tracking priority of each object according to the object type of each object and a preset priority strategy, wherein the preset priority strategy is set according to the user's attention level to each object type;
  • the second display module 1705 is used to generate a focus frame corresponding to each object according to the focus frame type of each object, and display the focus frame corresponding to each object in the camera preview interface according to the coordinates of each object;
  • the first focus tracking module 1706 is used to determine any object with the highest first focus tracking priority as a target focus tracking object according to the first focus tracking priority of each object, and perform focus tracking processing on the target focus tracking object.
  • the focus tracking device provided in the embodiment of the present application can be configured in any terminal device to execute the aforementioned focus tracking method.
  • the focus tracking device selects the object that the user is most concerned about in the current shooting scene as the highest priority focus tracking object according to the object type of each object in the camera preview interface during the preview process, so as to focus on the object that the user is currently most concerned about, and use different focus tracking frames for displaying different types of objects. Therefore, not only can the focus tracking object be adaptively adjusted according to the real-time shooting scene, thereby improving the shooting effect of the object that the user is most concerned about, but also the user does not need to perform manual operation, thereby improving the flexibility and convenience of focus tracking and improving the user's shooting experience.
  • the above-mentioned object types include the following types: portraits ranked in the top N in the gallery, portraits ranked in the top N in the non-gallery, and non-face objects of a preset type, where N is a positive integer greater than or equal to 1;
  • the focus frame type of the portraits ranked in the top N in the gallery is the first focus frame type or the second focus frame type
  • the focus frame type of the portraits ranked in the top N in the non-gallery and the focus frame type of the non-face objects of the preset type is the third focus frame type, wherein the first focus frame type, the second focus frame type and the third focus frame type are all different;
  • the preset priority strategy is: the first focus tracking priority of the top N portraits in the gallery is higher than the first focus tracking priority of the top N portraits outside the gallery, and the first focus tracking priority of the top N portraits outside the gallery is higher than the first focus priority of non-face objects of a preset type.
  • the second display module 1705 includes:
  • a first display unit is used to generate a first tracking focus frame corresponding to the first object according to the second tracking focus frame type when the object includes a first object whose object type is a portrait ranked in the top N in the gallery, and display the first tracking focus frame corresponding to the first object in the camera preview interface according to the coordinates of the first object;
  • the second display unit is used to generate a first tracking frame corresponding to the first object according to the first tracking frame type, and generate second tracking frames corresponding to each second object according to the second tracking frame type, when the objects include a first object whose object type is a portrait ranked in the top N in the gallery and at least one second object, and display the first tracking frame corresponding to the first object and the second tracking frames corresponding to each second object in the camera preview interface according to the coordinates of the first object and each second object, wherein the size of the first object is larger than the size of each second object.
  • the second display module 1705 further includes:
  • the first changing unit is used to determine any second object as a new first object if it is determined that the size of any second object is larger than the size of the first object, and to determine the first object as a new second object and change the new first object to a new second object.
  • the focus frame corresponding to the object is changed from the second focus frame to the first focus frame, and the focus frame corresponding to the new second object is changed from the first focus frame to the second focus frame.
  • the apparatus 1700 further includes:
  • a fourth determination module configured to determine a display duration of a focus tracking frame corresponding to the object when the object type is a non-human face object that is in the top N of the image gallery or a preset type;
  • the first display stopping module is used to stop displaying the focus tracking frame corresponding to the object when the display time of the focus tracking frame corresponding to the object reaches a time threshold.
  • the first focus tracking module 1706 includes:
  • a first judging unit used to judge whether the objects include a first object whose object type is a portrait ranked in the top N in the gallery;
  • a first determining unit configured to determine the first object as an object with the highest first priority if the objects include at least one first object, and to determine any first object as a target focus tracking object;
  • a second judgment unit is used to judge whether the objects contain a second object whose object type is not a portrait ranked in the top N in the image library if the objects do not contain the first object;
  • a second determining unit configured to determine the second object as the object with the highest first priority if the object includes at least one second object, and determine any second object as a target focus tracking object;
  • a third judgment unit configured to judge whether the object contains a third object whose object type is a non-face object of a preset type if the object does not contain the second object;
  • a third determination unit configured to determine the third object as the object with the highest first priority if the objects include at least one third object, and determine any third object as a target focus tracking object;
  • the first focusing unit is used to perform center focusing processing in the preview interface if the objects do not include the third object.
  • the apparatus 1700 further includes:
  • a fifth determining module configured to determine any object as a designated focus tracking object in response to a user's click operation on any object
  • a second focus tracking module is used for, if the designated focus tracking object is the target focus tracking object, continuously performing focus tracking processing on the designated focus tracking object until a user clicks on any object;
  • the third focus tracking module is used to suspend the focus tracking process on the target focus tracking object if the designated focus tracking object is not the target focus tracking object, and continue the focus tracking process on the designated focus tracking object until a user click operation on any object is obtained.
  • the apparatus 1700 further includes:
  • a third display module is used for maintaining the focus frame type of the specified focus object unchanged and continuously displaying the focus frame of the specified focus object, and pausing displaying the focus frames of objects other than the specified focus object, if the specified focus object is the target focus object and the object type of the specified focus object is a portrait ranked in the top N in the gallery;
  • a fourth display module configured to change the focus frame type of the specified focus object to a first focus frame type if the specified focus object is not the target focus object and the object type of the specified focus object is a portrait ranked in the top N in the gallery, and to generate and continuously display a first focus frame corresponding to the specified focus object according to the first focus frame type, and to pause displaying focus frames of objects other than the specified focus object;
  • the fifth display module is used for, if the object type of the designated focus tracking object is not a portrait ranked in the top N in the gallery,
  • the focus frame type of the specified focus object is changed to the fourth focus frame type, and the fourth focus frame corresponding to the specified focus object is generated and continuously displayed according to the fourth focus frame type, and the focus frames of each object except the specified focus object are temporarily displayed.
  • the apparatus 1700 further includes:
  • the fourth focus tracking module is used to respond to the user's click operation on the designated focus tracking object, pause the focus tracking process on the designated focus tracking object, and determine any object with the highest first focus tracking priority as the target focus tracking object according to the first focus tracking priority of each object, and perform focus tracking on the target focus tracking object.
  • the above-mentioned objects include multiple objects with the highest first focus tracking priority; accordingly, the above-mentioned first focus tracking module 1706 includes:
  • a fourth determining unit configured to determine a second focus tracking priority for each object having the highest first focus tracking priority
  • the fifth determining unit is used to determine the object with the highest second focus tracking priority as the target focus tracking object.
  • the fourth determining unit is specifically configured to:
  • the preset priority of each object is determined as the second focus tracking priority of each object.
  • the second focus tracking priority of each object is determined according to the size of each object.
  • the technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration.
  • the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
  • the functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
  • the present application also proposes a terminal device.
  • FIG18 is a schematic diagram of the structure of a terminal device according to an embodiment of the present application.
  • the terminal device 1800 includes:
  • a memory 1810 (internal memory 1810) and at least one processor 1820, a bus 1830 connecting different components (including the memory 1810 and the processor 1820), the memory 1810 stores a computer program, and when the processor 1820 executes the program, the focus tracking method described in the embodiment of the present application is implemented.
  • Bus 1830 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
  • ISA Industry Standard Architecture
  • MAC Micro Channel Architecture
  • VESA Video Electronics Standards Association
  • PCI Peripheral Component Interconnect
  • the terminal device 1800 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the terminal device 1800, including volatile and non-volatile media, removable and non-removable media.
  • the memory 1810 may also include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) 1840 and/or a cache memory 1850.
  • the terminal device 1800 may further include other removable/non-removable, volatile/non-volatile computer system storage media.
  • the storage system 1860 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 18, usually referred to as a "hard drive").
  • a disk drive for reading and writing a removable non-volatile disk such as a "floppy disk"
  • an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical medium)
  • each drive may be connected to the bus 1830 via one or more data medium interfaces.
  • the memory 1810 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
  • a program/utility 1880 having a set (at least one) of program modules 1870 may be stored, for example, in memory 1810, such program modules 1870 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
  • Program modules 1870 generally perform the functions and/or methods of the embodiments described herein.
  • the terminal device 1800 may also communicate with one or more external devices 1890 (e.g., keyboard, pointing device, display 1891, etc.), may also communicate with one or more devices that enable a user to interact with the terminal device 1800, and/or communicate with any device that enables the terminal device 1800 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input/output (I/O) interface 1892.
  • the terminal device 1800 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and/or public network, such as the Internet) through a network adapter 1893. As shown, the network adapter 1893 communicates with other modules of the terminal device 1800 through a bus 1830.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • terminal device 1800 may be used in conjunction with the terminal device 1800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
  • the processor 1820 executes various functional applications and data processing by running the programs stored in the memory 1810 .
  • An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
  • An embodiment of the present application provides a computer program product.
  • the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the present application implements the above embodiment. All or part of the process in the method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium.
  • the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form.
  • the computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera/terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.
  • ROM read-only memory
  • RAM random access memory
  • electric carrier signal telecommunication signal and software distribution medium.
  • a USB flash drive a mobile hard disk, a magnetic disk or an optical disk.
  • computer-readable media cannot be electric carrier signals and telecommunication signals.
  • the disclosed devices/terminal equipment and methods can be implemented in other ways.
  • the device/terminal equipment embodiments described above are only schematic.
  • the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the relative movement between the camera and the person or object being photographed may cause a defocus problem.
  • the shooting target since there is a delay between selecting the shooting target to be focused and shooting, if the shooting target moves, it is impossible to focus on the shooting target, resulting in defocus.
  • Another possible reason for defocus is that there is no target to be photographed at the focus position selected by the user, which can also cause defocus.
  • the focusing method provided by the present application can be applied Applicable to electronic devices such as cameras, camcorders, or terminals with photo or video recording functions.
  • FIG19 is a schematic diagram of an applicable focusing scene of an embodiment of the present application. As shown in FIG19 , it is a preview interface after the camera application of electronic device A is opened. FIG19 mainly takes the case where the shooting target includes a car and the car moves relative to the electronic device as an example.
  • the preview window also referred to as a viewfinder or viewfinder, etc.
  • the preview window includes elements such as mountains, trees and the sun, and there is a car at position 1.
  • the user clicks on the screen position where the car is located as shown in interface 1901.
  • the click position can be used as the focus position for focusing, as shown in interface 1902, a focus frame A appears on the car at position 1.
  • the traditional solution does not track and focus on the target at the focus position selected by the user, which results in the loss of the focus frame, and the situation shown in interface 1904 appears, that is, when the target moves, it is not focused on the car, and this situation may cause a false focus.
  • FIG19 takes the example of a moving target while a stationary camera, but it is also possible that the target is stationary while the camera is moving, which will not be elaborated herein.
  • the embodiments of the present application mainly detect whether there is a target at the focus position, and focus in a targeted manner according to the target detection result, so as to avoid the occurrence of false focus.
  • a target that is, a person, animal, plant or object, such as the car, mountain, tree and sun in Figure 19 can all be used as targets
  • a corresponding focus strategy is adopted to avoid the occurrence of false focus.
  • FIG20 is a comparison chart of the shooting results of different focusing schemes. If the focusing scheme of the embodiment of the present application is adopted, assuming that the user presses the shooting button in interface 1902, picture A can be obtained. It can be seen that picture A is a picture with normal clarity, and the position of the car is relatively displaced from the position in interface 1902. Because the focusing scheme of the embodiment of the present application can adopt different focusing strategies in a targeted manner, taking interface 1902 as an example, if the target detection result of the focus position is that there is a target at the focus position, the focus strategy corresponding to the target will be adopted to avoid out-of-focus.
  • FIG21 is a schematic diagram of another applicable focus scene of an embodiment of the present application. As shown in FIG21, it is a preview interface after the camera application of electronic device A is opened.
  • FIG21 mainly takes the case where there is no target at the focus position selected by the user as an example.
  • interface 2101 clouds can be seen, that is, the scene to be photographed in the viewfinder here is the sky.
  • a focus frame B will appear as shown in interface 2102.
  • it since there is no target that can form a focus at this focus position, it will cause focus failure and a virtual focus situation.
  • FIG22 is a schematic flow chart of a focusing method according to an embodiment of the present application.
  • the method can be applied to electronic devices with camera functions such as cameras, mobile phones, and tablet computers.
  • the steps of FIG22 are introduced below.
  • the focus position can be understood as the position that the user wants to focus on.
  • the user can select the position that he wants to focus on through the viewfinder, that is, the corresponding screen position.
  • the user clicks on the screen position where the car is located in interface 1901.
  • the screen position where the car is located is the focus position.
  • the user can click on any screen position in the preview window in the preview interface as the focus position.
  • you can select the screen positions corresponding to mountains, trees, sun, blank spaces, etc.
  • Figure 21 as an example, you can select the screen position where the clouds are located, or the screen position in other preview windows.
  • the user can select the focus position by touch and click, line of sight control or gesture control, without limitation.
  • This application mainly takes touch and click as an example.
  • the user can select the position by touching and clicking the screen; or by looking at the desired position, that is, by locking it according to the detected user's gaze point; or by gesture operation such as pinching or clicking in the air, that is, by selecting the position corresponding to the detected user's gesture operation.
  • S2202 Focus according to the target detection result at the focus position.
  • the target detection result is used to indicate whether there is a target at the focus position.
  • target detection does not need to confirm the category of the target, but only needs to determine whether the target exists. Therefore, the neural network model used for target classification will not be used to identify the category of the target to confirm whether the target exists, because there are many types of targets and it is difficult for a model to have the ability to identify all types. For example, it is difficult for a neural network model used to identify people to have the ability to identify objects at the same time.
  • a neural network model that can recognize texture complexity can be trained here to determine whether there is a target based on texture complexity.
  • the camera can focus successfully only when the texture complexity exceeds a certain threshold. So when there is nothing at a certain location or when the shape, color and other textures of the sky and water surface are too simple, it will be difficult to focus. When there is a relatively complex object at a certain location and it exceeds this threshold, it can focus successfully.
  • step S2202 may include: when there is a target at the focus position, performing continuous focusing (continuous auto focus, CAF) on the target; or, when there is no target at the focus position, performing single focusing (touch auto focus, TAF).
  • different focusing strategies are adopted to perform focusing mainly according to two different target detection results, namely, the presence of a target and the absence of a target, so as to avoid out-of-focus.
  • Continuous focus is a method of continuously focusing frame by frame.
  • Single focus is the most common focusing method in traditional solutions, that is, through touch, each time the touch is made, the frame to be shot at the time of the touch is focused once. It can be understood that continuous focus is to focus on multiple frames after one trigger, while single focus is to focus only once each time it is triggered.
  • different focus frames can be set to distinguish them, so that users can
  • the focus strategy used can be distinguished by the difference in the focus frame.
  • the color and/or shape of the focus frame can be different.
  • the color can include at least one of the line color and the background color of the focus frame.
  • the shape can include at least one of the line thickness and the shape of the focus frame.
  • the color of the focus frame of continuous focus is different from the color of the focus frame of single focus, and/or the shape of the focus frame of continuous focus is different from the shape of the focus frame of single focus.
  • the color of the focus frame of continuous focus is yellow; the color of the focus frame of single focus is white.
  • the target detection result can be obtained through texture complexity comparison or through single object tracking technology.
  • Single object tracking is an object tracking technology that can detect whether there is a trackable object. In the embodiment of the present application, it can be used to detect whether there is a trackable target at the focus position selected by the user, and focus separately according to whether the result is "yes" or "no".
  • the above method may further include a step of obtaining a target detection result according to the focus position.
  • the step of obtaining a target detection result according to the focus position may include:
  • the SOT result includes a focus tracking success or a focus tracking failure. It should be understood that for a selected focus position, the SOT result includes a focus tracking success or a focus tracking failure, and it is impossible to have both success and failure.
  • a successful focus tracking corresponds to the existence of a target
  • a failed focus tracking corresponds to the non-existence of a target. That is, there is a one-to-one correspondence between the target detection result and the SOT focus tracking result.
  • the focus tracking When the focus tracking is successful, it means that there is a target that can be focused at the focus position. At this time, if you use continuous focus to track and focus on this target, you can always focus on this target. If you use the traditional conventional focus solution, the target will deviate from the focus position, resulting in out-of-focus problems.
  • the focus tracking fails, it means that there is no focusable target at the focus position.
  • the focus will fail and become defocused, because according to the traditional solution, when the system detects that it cannot focus on the focus position selected by the user, it is defocused.
  • the solution of the embodiment of the present application directly changes to a single focus strategy in this case, so it is possible to avoid defocus.
  • the traditional solution will fail to focus because there is no focusable target at the focus position, resulting in defocus.
  • the solution in the present application changes to a single focus when there is no focusable target at the focus position and it cannot focus, so defocus can be avoided.
  • the steps of performing single object tracking on the focus position and obtaining the tracking result include:
  • the focus tracking result is determined to be a successful focus tracking result
  • the focus tracking result is determined to be a focus tracking failure.
  • This example can be performed based on an existing feature matching solution, such as the SOT algorithm in the cyberfocus unit in the camera framework layer.
  • the steps of performing single object tracking on the focus position and obtaining the tracking result include:
  • the focus tracking result is considered to be successful; or,
  • the focus tracking result is deemed to be a focus tracking failure.
  • the steps of performing single object tracking on the focus position and obtaining the tracking result include:
  • the neural network model is used to process the image feature vector to obtain the target detection result.
  • the training data set of the neural network model may include an image sample with at least one focus position and a target detection result label corresponding to each focus position.
  • the label of a focus position in a certain image sample is that a target exists, and the label of another focus position is that a target does not exist, etc., without limitation.
  • the step of continuous focusing may include:
  • the target is continuously tracked and focused according to the position coordinates of the focus position in the SOT coordinate system.
  • the focus when there is a trackable target at the focus position, the focus can be performed according to the coordinate position in the SOT coordinate system converted from the focus position, which can make tracking and focusing on the target faster and more accurate.
  • the step of single focusing may include: performing single focusing according to the position coordinates of the focus position in the camera coordinate system.
  • the focus can be performed directly according to the position coordinates of the focus position in the camera coordinate system. This can save the coordinate conversion calculation, improve processing efficiency, and make focusing faster.
  • the single focusing step may include: focusing on the current shooting scene without considering the focus position.
  • the focus position is already known and there is no target on which to form focus, there is no need to consider this position anymore. Instead, the entire shooting scene can be refocused as if this position does not exist. On the one hand, this eliminates the need for processing such as coordinate confirmation and issuance, and on the other hand, it allows the focus to be on a more appropriate target, such as a person or animal in the shooting scene, which can further improve the focus accuracy.
  • the method before obtaining the focus position selected by the user, the method further includes: turning on the cyberfocus function.
  • the cyberfocus function is a technology that can track and focus on a moving target. It can also be understood that the scheme of the embodiment of the present application is provided with a startup interface, and the above method is used for focusing only when the cyberfocus function is turned on. When it is not turned on, the original traditional focus solution can be used, giving the user room for independent choice.
  • the method shown in FIG. 22 mainly detects whether there is a target at the focus position, and performs focusing in a targeted manner according to the target detection result, thereby avoiding the occurrence of out-of-focus.
  • FIG23 is a schematic diagram of a logical architecture of a camera function in an embodiment of the present application.
  • the logical architecture includes a camera application (CamApp) layer, a camera service (framework, FWK) layer, and a camera Hardware abstraction (CamHAL) layer, and hardware (HW) layer.
  • CameraApp camera application
  • FWK camera service
  • CamHAL camera Hardware abstraction
  • HW hardware
  • the CamApp layer includes a human-computer interaction module (represented by UI in the figure), a plug-in module, and a camera management module (represented by Cam Management in the figure).
  • the UI module includes units such as photo taking, video recording, and portrait, that is, human-computer interaction units for different shooting functions.
  • the plug-in module includes units such as AutoTrack plug-in, flash, and filter. Among them, the AutoTrack plug-in is used to carry the response to user operations and the processing of algorithm results in human-computer interaction.
  • the Cam management module includes units such as device management, session management, and service (surface) management.
  • the FWK layer includes the camera service module (represented by CameraService in the figure), which includes the management unit (represented by CamMgr in the figure), the session unit (represented by session in the figure), the device unit (represented by CamDev in the figure) and the output unit (represented by Output in the figure).
  • the main function of the FWK layer is equivalent to a data channel to realize data interaction between the CamApp layer and the CamHAL layer.
  • the CamHAL layer includes the CamX module and the CHI module under the CamX-CHI architecture.
  • CamX-CHI some highly unified functional interfaces are extracted and placed in CamX, and the customizable parts are placed in CHI for different manufacturers to modify and realize their own unique features. The benefit of this design is obvious, that is, even if the developer does not know much about CamX, it is still very convenient to add custom functions, thereby reducing the difficulty of development.
  • CamX includes a set of code implementations of general functional interfaces
  • CHI includes a set of code implementations of customizable requirements.
  • CamX includes a Camera3Device module, a session module, a semantic engine module, a sensor node module, and an output module.
  • the semantic engine module includes a cyberfocus unit for tracking everything, a faceFeature unit for face recognition, a motionDec unit for motion capture, etc.
  • the cyberfocus unit's tracking everything function is mainly used.
  • the HW layer includes multiple drivers.
  • FIG24 is a schematic diagram of the execution process of the focusing method of an embodiment of the present application.
  • FIG24 can be regarded as a specific example of the method shown in FIG22.
  • the various execution units/modules involved in FIG24 can be the corresponding units/modules in FIG23.
  • the shooting mode module obtains the user's operation of turning on the camera's shooting/video recording mode, and sends the instruction to turn on the camera to the Cam management module.
  • S2402 can be executed through the camera management (CameraService) module of the FWK layer.
  • S2402 can be executed by the camera device (Camera3Device) module of the CamHAL layer.
  • the Camera3Device module returns the camera instance to the Cam management module.
  • S2401-S2404 are equivalent to the steps of opening the camera function and entering the preview interface. Taking the execution process of FIG25 as an example, steps S2401-S2404 are executed from the user clicking the icon of the camera application in interface 2501 to the preview window in interface 2502 being displayed.
  • the all-things tracking focus plug-in module loads the all-things tracking focus plug-in (plugin).
  • This step can be performed by the Cam management module.
  • semanticEngine module constructs the all-object tracking algorithm.
  • the cyberfocus unit enables the SOT algorithm.
  • S2405-S2408 can be regarded as an example of the specific execution process of enabling the all-object tracking function.
  • the all-things tracking plug-in module obtains the user's operation on the clicked area and sends the coordinates of the user's clicked area to the Cam management module.
  • the click area can be regarded as an example of the above-mentioned focus position.
  • the area coordinates can be coordinates in the camera coordinate system.
  • the area coordinates may include (x, y, width, height), that is, the coordinates of the coordinate axis, width and height.
  • it can be understood as the relative coordinates of this focus position in the entire viewfinder, that is, x, y are the coordinates of the entire focus position, and width and height can be the width and height of the entire viewfinder respectively.
  • width and height can also be the coordinates of the entire focus position, and x, y can be the width and height of the entire viewfinder respectively.
  • x, y can be the width and height of the entire viewfinder respectively.
  • the Cam management module sends the area coordinates to the Camera3Device module.
  • S2409 or S2409-S2410 can be regarded as an example of S2201.
  • the scale space can be a DOG (difference of Gaussian) scale space.
  • DOG difference of Gaussian
  • the DOG operator and the LOG (Laplacian of Gaussian) operator are commonly used extreme point detection (blob detection) methods, and the DOG operator has relatively low complexity.
  • the cyberfocus unit performs feature matching and reasoning, and when tracking is successful, outputs the tracking result of the SOT tracking success and the coordinates of the tracking result to the Camera3Device module.
  • the coordinates of the tracking result are an example of the position coordinates of the above-mentioned focus position in the coordinate system corresponding to the SOT.
  • Camera3Device module executes CAF strategy according to SOT coordinates and sends SOT success data to the Everything Focus Tracking plug-in module.
  • the All Things Tracking plug-in module displays a yellow frame on the tracking target through the UI module.
  • the semanticEngine module sends the SOT failure data to the Everything Tracking Plug-in Module.
  • the all-things tracking plug-in module displays a white frame on the focus position through the UI module.
  • the all-things tracking focus plug-in module sends the TAF strategy and the coordinates of the focus position to the Camera3Device module.
  • the Camera3Device module executes the TAF strategy according to the coordinates.
  • S2412-S2418 can be seen as an example of S2202.
  • FIG25 is a schematic diagram of an execution process of the focusing method of an embodiment of the present application. As shown in FIG25, when the user clicks the icon of the camera application in interface 2501, the preview window in interface 2502 can be seen.
  • the click operation on interface 2501 can correspond to the opening operation of step S2401. S2401-S2404 occur between interface 2501 and interface 2502.
  • the focus solution of the embodiment of the present application is executed.
  • S201 and S202 may be executed to obtain the focus frame C shown in the interface 2503.
  • the focus frame C may be a yellow focus frame or a bold focus frame, which is used to indicate that the focus is being executed in accordance with the CAF focus strategy.
  • FIG26 is a schematic diagram of another execution process of the focusing method of an embodiment of the present application.
  • the user clicks the icon of the camera application in interface 2601 the preview window in interface 2602 can be seen.
  • the click operation on interface 2601 can correspond to the opening operation of step S2401, and S2401-S2404 occur between interface 2601 and interface 2602.
  • the focus scheme of the embodiment of the present application is executed.
  • S201 and S202 may be executed to obtain the focus frame D shown in the interface 2603. It may also be obtained by executing S2409-S2411 and S2415-S2418.
  • the focus frame D may be a white focus frame, or a thinner focus frame, which is used to indicate that the focus of the TAF focus strategy is being executed at this time.
  • steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
  • the device of the embodiment of the present application is introduced below in conjunction with the accompanying drawings.
  • Fig. 27 is a schematic diagram of a focusing device according to an embodiment of the present application.
  • the device 2000 includes an acquisition unit 2001 and a processing unit 2002.
  • the device 2000 can be integrated in an electronic device such as a camera, a video camera, a mobile phone, a tablet computer, a touch-screen laptop computer, etc.
  • the device 2000 can be used to perform any of the above focusing methods.
  • the acquisition unit 2001 can be used to perform step S201, and the processing unit 2002 can be used to perform step S202.
  • the acquisition unit can be used to perform steps S2401 and S2409, and the processing unit 2002 can be used to perform other steps shown in FIG. 24.
  • the device 2000 may further include a storage unit for storing data such as coordinates of the focus position, target detection results, etc.
  • the storage unit may be integrated in any one of the above units, or may be a unit independent of all the above units.
  • Figure 28 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
  • the electronic device 90 may include a processor 910, an external memory interface 920, an internal memory 921, a universal serial bus (USB) interface 930, a charging management module 940, a power management module 941, a battery 942, an antenna 1, an antenna 2, a mobile communication module 950, a wireless communication module 960, an audio module 970, a speaker 970A, a receiver 970B, a microphone 970C, an earphone interface 970D, a sensor module 980, a button 990, a motor 991, an indicator 992, a camera 993, a display screen 994, and a subscriber identification module (SIM) card interface 995, etc.
  • SIM subscriber identification module
  • the sensor module 980 may include a pressure sensor 980A, a gyroscope sensor 980B, an air pressure sensor 980C, a magnetic sensor 980D, an acceleration sensor 980E, a distance sensor 980F, a proximity light sensor 980G, a fingerprint sensor 980H, a temperature sensor 980J, a touch sensor 980K, an ambient light sensor 980L, a bone conduction sensor 980M, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 90.
  • the electronic device 90 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 910 shown in FIG. 28 may include one or more processing units, for example, the processor 910 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural-network processing unit (neural-network processing unit, NPU), etc.
  • different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 90.
  • the controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
  • the processor 910 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 910 is a cache memory.
  • the memory may store instructions or data that the processor 910 has just used or cyclically used. If the processor 910 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 910, and thus improves the efficiency of the system.
  • the processor 910 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.
  • I2C inter-integrated circuit
  • I2S inter-integrated circuit sound
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 910 may include multiple groups of I2C buses.
  • the processor 910 may be coupled to the touch sensor 980K, the charger, the flash, the camera 993, etc. through different I2C bus interfaces.
  • the processor 910 may be coupled to the touch sensor 980K through the I2C interface, so that the processor 910 communicates with the touch sensor 980K through the I2C bus interface, thereby realizing the touch function of the electronic device 90.
  • the I2S interface can be used for audio communication.
  • the processor 910 can include multiple I2S buses.
  • the processor 910 can be coupled to the audio module 970 via the I2S bus to achieve communication between the processor 910 and the audio module 970.
  • the audio module 970 can transmit audio signals to the wireless communication module 960 through the I2S interface to implement the function of answering calls through a Bluetooth headset.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals.
  • the audio module 970 and the wireless communication module 960 can be coupled via a PCM bus interface.
  • the audio module 970 can also transmit audio signals to the wireless communication module 960 through the PCM interface to implement the function of answering calls through a Bluetooth headset. It should be understood that both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 910 and the wireless communication module 960.
  • the processor 910 communicates with the Bluetooth module in the wireless communication module 960 through the UART interface to implement the Bluetooth function.
  • the audio module 970 can transmit an audio signal to the wireless communication module 960 through the UART interface to implement the function of playing music through a Bluetooth headset.
  • the MIPI interface can be used to connect the processor 910 with peripheral devices such as the display screen 994 and the camera 993.
  • the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc.
  • the processor 910 and the camera 993 communicate through the CSI interface to realize the shooting function of the electronic device 90.
  • the processor 910 and the display screen 994 communicate through the DSI interface to realize the display function of the electronic device 90.
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 910 with the camera 993, the display screen 994, the wireless communication module 960, the audio module 970, the sensor module 980, etc.
  • the GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
  • the USB interface 930 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 90, and can also be used to transmit data between the electronic device 90 and a peripheral device. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other electronic devices, such as AR devices, etc.
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 90.
  • the electronic device 90 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
  • the charging management module 940 is used to receive charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 940 may receive charging input from a wired charger through the USB interface 930.
  • the charging management module 940 may receive wireless charging input through a wireless charging coil of the electronic device 90. While the charging management module 940 is charging the battery 942, it may also power the electronic device through the power management module 941.
  • the power management module 941 is used to connect the battery 942, the charging management module 940 and the processor 910.
  • the power management module 941 receives input from the battery 942 and/or the charging management module 940, and supplies power to the processor 910, the internal memory 921, the external memory, the display screen 994, the camera 993, and the wireless communication module 960.
  • the power management module 941 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
  • the power management module 941 can also be set in the processor 910.
  • the power management module 941 and the charging management module 940 can also be set in the same device.
  • the wireless communication function of the electronic device 90 can be implemented through the antenna 1, the antenna 2, the mobile communication module 950, the wireless communication module 960, the modem processor and the baseband processor.
  • Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 90 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas.
  • antenna 1 can be reused as a diversity antenna for a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 950 can provide a wireless communication solution applied to the electronic device 90, such as at least one of the following solutions: a second generation (2G) mobile communication solution, a third generation (3G) mobile communication solution, a fourth generation (5G) mobile communication solution, and a fifth generation (5G) mobile communication solution.
  • the mobile communication module 950 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
  • the mobile communication module 950 can receive electromagnetic waves from the antenna 1, and filter and amplify the received electromagnetic waves, and then transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 950 can also amplify the signal modulated by the modulation and demodulation processor, and the amplified signal is converted into electromagnetic waves and radiated out through the antenna 1.
  • at least some of the functional modules of the mobile communication module 950 can be set in the processor 910.
  • at least some of the functional modules of the mobile communication module 950 can be set in the same device as at least some of the modules of the processor 910.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the application processor outputs a sound signal through an audio device (not limited to a speaker 970A, a receiver 970B, etc.), or displays an image or video through a display screen 994.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 910 and be set in the same device as the mobile communication module 950 or other functional modules.
  • the wireless communication module 960 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to the electronic device 90.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the wireless communication module 960 can be one or more devices integrating at least one communication processing module.
  • the wireless communication module 960 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 910.
  • the wireless communication module 960 can also receive the signal to be sent from the processor 910, modulate the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
  • the antenna 1 of the electronic device 90 is coupled to the mobile communication module 950, and the antenna 2 of the electronic device 90 is coupled to the wireless communication module 960, so that the electronic device 90 can communicate with the network and other electronic devices through wireless communication technology.
  • the wireless communication technology may include at least one of the following communication technologies: global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, IR technology.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA wideband code division multiple access
  • TD-SCDMA time-division code division multiple access
  • LTE long term evolution
  • BT GNSS
  • WLAN NFC
  • FM FM
  • IR technology IR technology
  • the GNSS may include at least one of the following positioning technologies: global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 90 implements the display function through a GPU, a display screen 994, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 994 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 910 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 994 is used to display images, videos, etc.
  • the display screen 994 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-led, Micro-Led, Micro-oLed, quantum dot light-emitting diodes (QLED), etc.
  • the electronic device 90 may include 1 or N display screens 994, where N is a positive integer greater than 1.
  • the electronic device 90 can realize the shooting function through ISP, camera 993, video codec, GPU, display screen 994 and application processor.
  • ISP is used to process the data fed back by camera 993. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 993.
  • the camera 993 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor.
  • CMOS complementary metal oxide semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • the DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format.
  • the electronic device 90 may include 1 or N cameras 993, where N is a positive integer greater than 1.
  • the digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 90 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital videos.
  • the electronic device 90 may support one or more video codecs.
  • the electronic device 90 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG Moving Picture Experts Group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • the external memory interface 920 can be used to connect an external memory card, such as a secure digital (SD) card, to expand the storage capacity of the electronic device 90.
  • the external memory card communicates with the processor 910 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
  • the internal memory 921 can be used to store computer executable program codes, and the executable program codes include Instructions.
  • the processor 910 executes various functional applications and data processing of the electronic device 90 by running instructions stored in the internal memory 921.
  • the internal memory 921 may include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
  • the data storage area may store data created during the use of the electronic device 90 (such as audio data, a phone book, etc.), etc.
  • the internal memory 921 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • UFS universal flash storage
  • the electronic device 90 can implement audio functions such as music playing and recording through the audio module 970, the speaker 970A, the receiver 970B, the microphone 970C, the headphone jack 970D, and the application processor.
  • the audio module 970 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 970 can also be used to encode and decode audio signals.
  • the audio module 970 can be arranged in the processor 910, or some functional modules of the audio module 970 can be arranged in the processor 910.
  • the speaker 970A also called a "speaker" is used to convert an audio electrical signal into a sound signal.
  • the electronic device 90 can listen to music or listen to a hands-free call through the speaker 970A.
  • the receiver 970B also called a "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be received by placing the receiver 970B close to the ear.
  • Microphone 970C also called “microphone” or “microphone” is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 970C to input the sound signal into the microphone 970C.
  • the electronic device 90 can be provided with at least one microphone 970C. In other embodiments, the electronic device 90 can be provided with two microphones 970C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 90 can also be provided with three, four or more microphones 970C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
  • the earphone interface 970D is used to connect a wired earphone.
  • the earphone interface 970D may be the USB interface 930, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 980A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 980A can be set on the display screen 994.
  • the capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 980A, the capacitance between the electrodes changes.
  • the electronic device 90 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 994, the electronic device 90 detects the touch operation intensity according to the pressure sensor 980A.
  • the electronic device 90 can also calculate the touch position according to the detection signal of the pressure sensor 980A.
  • touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the gyroscope sensor 980B can be used to determine the motion posture of the electronic device 90.
  • the angular velocity of the electronic device 90 around three axes i.e., x, y, and z axes
  • the gyroscope sensor 980B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 980B detects the angle of the electronic device 90 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 90 through reverse movement to achieve anti-shake.
  • the gyroscope sensor 980B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 980C is used to measure air pressure.
  • the electronic device 90 calculates the altitude through the air pressure value measured by the air pressure sensor 980C to assist in positioning and navigation.
  • the magnetic sensor 980D includes a Hall sensor.
  • the electronic device 90 can use the magnetic sensor 980D to detect the opening and closing of the flip leather case.
  • the electronic device 90 can detect the opening and closing of the flip cover according to the magnetic sensor 980D; according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, set the flip cover to automatically unlock and other features.
  • the acceleration sensor 980E can detect the magnitude of the acceleration of the electronic device 90 in all directions (generally three axes). When the electronic device 90 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
  • the distance sensor 980F is used to measure the distance.
  • the electronic device 90 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 90 can use the distance sensor 980F to measure the distance to achieve fast focusing.
  • the proximity light sensor 980G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode.
  • the light-emitting diode may be an infrared light-emitting diode.
  • the electronic device 90 emits infrared light outward through the light-emitting diode.
  • the electronic device 90 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 90. When insufficient reflected light is detected, the electronic device 90 can determine that there is no object near the electronic device 90.
  • the electronic device 90 can use the proximity light sensor 980G to detect that the user holds the electronic device 90 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 980G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
  • the ambient light sensor 980L is used to sense the ambient light brightness.
  • the electronic device 90 can adaptively adjust the brightness of the display screen 994 according to the perceived ambient light brightness.
  • the ambient light sensor 980L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 980L can also cooperate with the proximity light sensor 980G to detect whether the electronic device 90 is in a pocket to prevent accidental touch.
  • the fingerprint sensor 980H is used to collect fingerprints.
  • the electronic device 90 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
  • the temperature sensor 980J is used to detect temperature.
  • the electronic device 90 uses the temperature detected by the temperature sensor 980J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 980J exceeds a threshold, the electronic device 90 performs a reduction in the performance of a processor located near the temperature sensor 980J to reduce power consumption and implement thermal protection.
  • the electronic device 90 heats the battery 942 to avoid abnormal shutdown of the electronic device 90 due to low temperature.
  • the electronic device 90 when the temperature is lower than another threshold, the electronic device 90 performs a boost on the output voltage of the battery 942 to avoid abnormal shutdown caused by low temperature.
  • the touch sensor 980K is also called a "touch panel”.
  • the touch sensor 980K can be set on the display screen 994.
  • the touch sensor 980K and the display screen 994 form a touch screen, also called a "touch screen”.
  • the touch sensor 980K is used to detect a touch operation on or near it.
  • the touch sensor can transmit the detected touch operation to the application.
  • the processor is used to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 994.
  • the touch sensor 980K can also be arranged on the surface of the electronic device 90, which is different from the position of the display screen 994.
  • the bone conduction sensor 980M can obtain a vibration signal. In some embodiments, the bone conduction sensor 980M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 980M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 980M can also be set in an earphone and combined into a bone conduction earphone.
  • the audio module 970 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 980M to realize a voice function.
  • the application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 980M to realize a heart rate detection function.
  • the key 990 includes a power button, a volume button, etc.
  • the key 990 can be a mechanical key or a touch key.
  • the electronic device 90 can receive key input and generate key signal input related to user settings and function control of the electronic device 90.
  • Motor 991 can generate vibration prompts.
  • Motor 991 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • touch operations acting on different areas of the display screen 994 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminders, receiving messages, alarm clocks, games, etc.
  • the touch vibration feedback effect can also support customization.
  • Indicator 992 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
  • the SIM card interface 995 is used to connect a SIM card.
  • the SIM card can be connected to and separated from the electronic device 90 by inserting it into the SIM card interface 995 or pulling it out from the SIM card interface 995.
  • the electronic device 90 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 995 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 995 at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 995 can also be compatible with different types of SIM cards.
  • the SIM card interface 995 can also be compatible with external memory cards.
  • the electronic device 90 interacts with the network through the SIM card to implement functions such as calls and data communications.
  • the electronic device 90 uses an eSIM, i.e., an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 90 and cannot be separated from the electronic device 90.
  • Figure 29 is a schematic diagram of the hardware structure of another electronic device of an embodiment of the present application.
  • the electronic device 3000 includes: at least one processor 3001 (only one is shown in Figure 29), a memory 3002, and a computer program 3003 stored in the memory 3002 and executable on the at least one processor 3001, and the processor 3001 implements the steps in any of the above methods when executing the computer program 3003.
  • FIG29 is merely an example of an electronic device and does not constitute a limitation on the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
  • the processor 3001 may be a central processing unit (CPU), other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • CPU central processing unit
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • a general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
  • the memory 3002 may be an internal storage unit of the electronic device 3000, such as a hard disk or memory of the electronic device 3000. In other embodiments, the memory 3002 may also be an external storage device of the electronic device 3000, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 3000. Optionally, the memory 3002 may also include both an internal storage unit of the electronic device 3000 and an external storage device.
  • the memory 3002 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 3002 may also be used to temporarily store data that has been output or is to be output.
  • the technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration.
  • the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
  • the functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
  • An embodiment of the present application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor can implement the steps in any of the above methods when executing the computer program.
  • An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
  • An embodiment of the present application provides a computer program product, which includes a computer program.
  • the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor.
  • the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form.
  • the computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera/electronic device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.
  • ROM read-only memory
  • RAM random access memory
  • electric carrier signal telecommunication signal and software distribution medium.
  • a USB flash drive a mobile hard disk, a magnetic disk or an optical disk.
  • computer-readable media cannot be electric carrier signals and telecommunication signals.
  • the disclosed devices/equipment and methods can be implemented in other ways.
  • the device/equipment embodiments described above are only schematic.
  • the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the term “if” can be interpreted as “when” or “uponce” or “in response to determining” or “in response to detecting”, depending on the context.
  • the phrase “if it is determined” or “if [described condition or event] is detected” can be interpreted as meaning “uponce it is determined” or “in response to determining” or “uponce [described condition or event] is detected” or “in response to detecting [described condition or event]", depending on the context.
  • references to "one embodiment” or “some embodiments” etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements “in one embodiment”, “in some embodiments”, “in some other embodiments”, “in some other embodiments”, etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean “one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
  • the terms “including”, “comprising”, “having” and their variations all mean “including but not limited to”, unless otherwise specifically emphasized in other ways.
  • the shooting function has become an essential function of smart terminals.
  • Users can use electronic devices with shooting functions to take photos or videos of the subject.
  • the electronic device can call the focus tracking function to track the focus.
  • the electronic device can call the focus tracking function to track the face.
  • Focus tracking can also be called focus tracking. Focus tracking means that after the electronic device focuses on the subject such as the face, it controls the focus to continue to focus on the subject, thereby improving the quality of the shooting.
  • Figure 30 is a schematic diagram of a shooting scene.
  • the user interface 100 displays a page with application icons, which may include multiple application icons (for example, weather application icon, calendar application icon, album application icon, note application icon, email application icon, application store application icon, setting application icon, etc.).
  • a page indicator may also be displayed below the above multiple application icons to indicate the positional relationship between the currently displayed page and other pages.
  • There are multiple application icons for example, camera application icon 11 below the page indicator. These application icons remain displayed when the page is switched.
  • the camera application icon 11 is an icon of a camera application (i.e., a camera application).
  • the camera application icon 11 can be used to trigger the launch of the camera application.
  • the electronic device can detect a user operation on the camera application icon 11, and in response to the operation, the electronic device can display a preview interface 3101 as shown in B in FIG. 30.
  • the preview interface 3101 is a shooting interface of the default shooting mode of the camera application, and the user can preview the image and complete the shooting on this interface.
  • the shooting object includes multiple subjects, such as people and pets, there are faces or pets and their focus frames in the preview interface 3101 of the camera, and the user can select the focus object, and the electronic device focuses according to the focus object selected by the user.
  • the user needs to manually select the focus object, which brings inconvenience to the use and reduces the user experience of focusing and shooting.
  • the present application provides a shooting method.
  • the shooting method can be applied to an electronic device equipped with a camera.
  • the electronic device in a shooting scene where multiple shooting objects are in the same frame, the electronic device can automatically focus on one of the shooting objects with the highest priority, and always display the "focusing frame" of the priority focused object.
  • the electronic device can automatically focus on the shooting object with the highest priority and multiple objects with lower priorities and objects that are not in the priority list at the same time, and display the "focusing frame" of the focused object according to the priority.
  • focusing in this application refers to the process of changing the distance and position of the object to be focused by the camera focus mechanism to make the image of the focused object clear.
  • Focus tracking means to focus continuously after setting the focus point. Even if the focused object moves, the focus point can be kept in focus, that is, the focus tracking is a continuous focus state.
  • FIG. 31 shows a hardware system of an electronic device suitable for the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
  • the structure shown in FIG31 does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than those shown in FIG31, or the electronic device 100 may include a combination of some of the components shown in FIG31, or the electronic device 100 may include sub-components of some of the components shown in FIG31.
  • the components shown in FIG31 may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include at least one of the following processing units: an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU).
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • Different processing units may be independent devices or integrated devices.
  • the controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the processor 110 may include at least one of the following interfaces: an inter-integrated circuit (I2C) interface, an internal Inter-integrated circuit sound (I2S) interface, pulse code modulation (PCM) interface, universal asynchronous receiver/transmitter (UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM interface, USB interface.
  • I2C inter-integrated circuit
  • I2S internal Inter-integrated circuit sound
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • the electronic device 100 can realize the display function through the GPU, the display screen 194 and the application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 194 can be used to display images or videos.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED or a quantum dot light emitting diode (QLED).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED active-matrix organic light-emitting diode
  • FLED flexible light-emitting diode
  • Mini LED mini light-emitting diode
  • Micro LED micro light-emitting diode
  • QLED quantum dot light emitting diode
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
  • the ISP can perform algorithm optimization on the noise, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene and other parameters. In some embodiments, the ISP can be set in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor.
  • CMOS complementary metal oxide semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • the DSP converts the digital image signal into an image signal in a standard red green blue (RGB), YUV or other format.
  • the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include at least one of the following processing units: an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU).
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • Different processing units may be independent devices or integrated devices.
  • Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other He digital signal.
  • Video codecs are used to compress or decompress digital videos.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
  • MPEG Moving Picture Experts Group
  • MPEG2 MPEG2, MPEG3, and MPEG4.
  • NPU is a processor that draws on the structure of biological neural networks, such as the transmission mode between neurons in the human brain to quickly process input information, and can also continuously self-learn. Through NPU, the electronic device 100 can realize intelligent cognition and other functions, such as image recognition, face recognition, voice recognition and text understanding.
  • the external memory interface 120 can be used to connect an external memory card, such as a secure digital (SD) card, to expand the storage capacity of the electronic device 100.
  • an external memory card such as a secure digital (SD) card
  • the internal memory 121 can be used to store computer executable program codes, which include instructions.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the program storage area may store an operating system, and an application required for at least one function (for example, a sound playback function and an image playback function).
  • the data storage area may store data created during the use of the electronic device 100 (for example, audio data and a phone book).
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as: at least one disk storage device, a flash memory device, and a universal flash storage (UFS).
  • the processor 110 executes various processing methods of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 can implement audio functions, such as music playing and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor.
  • audio functions such as music playing and recording
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 1000 can measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the electronic device 1000 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the ambient light sensor 180L is used to sense the ambient light brightness.
  • the electronic device 1000 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 1000 is in a pocket to prevent accidental touches.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 1000 can use the collected fingerprint characteristics to realize functions such as unlocking, accessing application locks, taking photos, and answering calls.
  • the touch sensor 180K is also called a touch control device.
  • the touch sensor 180K can be set on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, which is also called a touch control screen.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K can also be set on the surface of the electronic device 100 and set at a different position from the display screen 194.
  • the key 190 includes a power key and a volume key.
  • the key 190 may be a mechanical key or a touch key.
  • the electronic device 100 may receive a key input signal and implement a function related to the key input signal.
  • FIG. 31 For ease of understanding, the following embodiments of the present application will take an electronic device having a structure as shown in FIG. 31 as an example.
  • the storage module in the gallery application stores the collected original image data, and the gallery sends the original image data in the image to the face feature extraction and clustering algorithm in the algorithm library through the image transfer module in the application framework layer for processing.
  • the face feature extraction and clustering algorithm block will perform feature extraction, clustering and other processing on the images of the same face, and return the clustered images to the storage module of the gallery.
  • the storage module of the gallery application After receiving the clustered image data, the storage module of the gallery application will cluster and store the images of the same face.
  • the verification module of the gallery application will verify whether the camera application has turned on the "main character tracking focus" switch, if the switch is turned on.
  • the gallery application storage module will send the stored clustered image data to the camera HAL through the transfer module of the application framework layer.
  • the storage module only sends the feature data of N clustered faces after clustering according to the same face.
  • the feature data of the clustered face can be a face feature model calculated based on multiple images after the same face is recognized in multiple different images.
  • to generate a facial feature model it is necessary to have at least X photos of a single face (such as person A) in the gallery, so that a facial feature model of person A is generated based on X photos. This application does not limit the number of X.
  • the feature data of N clustered faces is called “registered face” data.
  • the embodiment of this application introduces "registered face” to describe the portrait data in the gallery.
  • a registered face refers to a face that an electronic device automatically focuses on through a focus frame.
  • the registered face can be predetermined.
  • the embodiment of this application does not specifically limit the method for determining the registered face. It can be understood that the description here takes "registered face" as an example of an implementation method, and the embodiment of this application is not limited to this.
  • the registered face can also be other registered objects, such as cats, dogs, and other objects.
  • the image captured by the camera of the electronic device is passed to the face detection algorithm through the camera HAL.
  • the face detection algorithm recognizes the facial feature information in the image and then transmits it back to the camera HAL.
  • the camera HAL provides the facial feature information determined by the face detection algorithm and the "registered face” feature data to the target tracking algorithm for target recognition.
  • the target recognition algorithm transmits the recognized subject information back to the camera HAL, and the camera HAL reports the tracking target to the camera application.
  • the display module of the camera application displays the "focus frame" of the tracking target in a way that distinguishes it from other subjects.
  • the target recognition algorithm can send the optimal "registered face” data to the autofocus algorithm, and the autofocus algorithm adjusts the camera to focus on the tracking target according to the optimal recognition target.
  • the user can manually select an area to determine the tracking target. If the target recognition algorithm identifies a subject in the area selected by the user, the identified subject will be sent to the autofocus algorithm for tracking. If the target recognition algorithm does not identify a subject in the area selected by the user, the autofocus algorithm will track the focus based on the area selected by the user.
  • protagonist focus tracking the above-mentioned mode in which the autofocus algorithm adjusts the camera to perform focus tracking according to the optimal identification target is referred to as "protagonist focus tracking".
  • the "protagonist focus tracking” used here is not limited to the focus tracking effect on the person described and shown.
  • the term “protagonist” is intended to represent any form of effect that will distinguish it from other photographed objects. Examples of such effects include changing the size, shape, color, contrast and/or other visual features of the relevant name, or other items.
  • protagonist refers to displaying one or more photographed objects in a specific area of the screen or window to highlight them as distinguished from other display methods. In other embodiments, highlighting is achieved using non-visual methods, and those skilled in the art should think of other optional embodiments.
  • the portrait data in the gallery has been generated, which can be understood as multiple registered faces have been determined.
  • FIG33 shows a schematic diagram of the interface of the gallery discovery page showing “Registered Face”.
  • the screen display system of the electronic device displays the currently output interface content, and the interface content displays multiple application programs APP.
  • the user can instruct the electronic device to open the gallery application by clicking the “Gallery” application icon 3301 on the electronic device desktop, and the electronic device displays the interface shown in FIG33 (2).
  • the gallery displays a photo page, wherein the photo page contains photos taken by the user (such as photos taken by the user today and photos taken by the user yesterday).
  • the gallery interface also includes albums, moments, and discovery controls 3302. When the user clicks the discovery control 3302, the gallery discovery page can be entered, and the interface display is shown in FIG33 (3).
  • the discovery page includes a portrait area 3303.
  • portrait data in the gallery is displayed.
  • FIG33 (3) shows 4 portraits.
  • the four portraits shown in (3) of FIG. 33 are sorted in descending order according to the number of portraits appearing in the photo.
  • the dotted box shown in the portrait area 3303 also includes a "more" control 3304.
  • the control 3304 When the user clicks the control 3304, the portrait page is entered, and the portrait page can display the person that the electronic device focuses on by default, such as the interface shown in (4) of FIG. 33.
  • the dotted frame 3306 is used to display the statistical data of multiple portraits.
  • the statistical data of multiple portraits displayed in the dotted frame 3306 include the names of the portraits and the corresponding numbers.
  • the multiple portraits in the dotted frame 3306 can be displayed in order from large to small.
  • the dotted frame 3306 includes: a portrait named Dad (the corresponding number is 58), a portrait named Mom (the corresponding number is 53), a portrait named Sister (the corresponding number is 46), a portrait named Brother (the corresponding number is 45), and a portrait named Friends (the corresponding numbers are 42 and 30, respectively).
  • the name of each portrait is in the lower left corner of the portrait frame, and the number of each portrait appearing in the photo is located in the lower right corner of the portrait frame.
  • the name of the portrait 307 is "Dad” and the number of portraits appearing in the photo is 58.
  • the portrait statistics shown in (4) of FIG. 33 are illustrated by taking photos of the "personal” category as an example, and the embodiments of the present application are not limited thereto.
  • the portrait interface shown in (4) of FIG. 33 also includes a "group photo” category. When the user clicks on the "group photo” category, the portrait statistics under the group photo category can be displayed in the interface.
  • S500 The gallery application sends the original image data to the face feature extraction and clustering algorithm.
  • the electronic device can be in a charging and screen-off state, and the storage module sends the original image data to avoid the power consumption of image processing affecting the user's normal usage experience.
  • the storage module can send the original image data to the face data transmission module of the framework layer, and then the face data transmission module sends the original image data to the face feature extraction and clustering algorithm.
  • the electronic device determines whether the device is currently in a charging and screen-off state and whether the current battery level is greater than or equal to a preset battery threshold. If the electronic device is currently in a charging and screen-off state and the current battery level is greater than or equal to the preset battery threshold, the gallery application sends the original image data to the face feature extraction and clustering module for processing. If the electronic device is not currently in a charging and screen-off state, or the current battery level is less than a preset battery level If the threshold is exceeded, the gallery application will not send the original image data temporarily.
  • the facial feature recognition, extraction and clustering module processes the facial image and returns the facial feature data to the gallery application.
  • the original image when the original image includes a face, the original image may be referred to as a face image.
  • Face feature extraction may be implemented by techniques such as histogram of oriented grids (HOG) or convolutional neural network (CNN) to generate face feature data.
  • high-frequency face feature data may be generated preferentially, where a high-frequency face refers to a face that appears multiple times in an image stored by an electronic device. Alternatively, it may be understood as a face that is photographed multiple times by an electronic device.
  • a high-frequency face may be a user (N is an integer) corresponding to the top N in the descending order of the number of photos containing feature faces in a gallery application. As shown in (4) in FIG.
  • the high-frequency face is a portrait named Dad (corresponding to 58), a portrait named Mom (corresponding to 53), and a portrait named Sister (corresponding to 46).
  • a high-frequency face may also be a user preset by a user, and the specific method for determining a high-frequency face is not limited in the embodiment of the present application.
  • the face feature extraction and clustering algorithm can compare and cluster the extracted features with any one of the multiple features of the high-frequency face.
  • the face extraction and clustering algorithm can calculate the similarity of the extracted features and the features of the high-frequency face for comparison.
  • the electronic device can cluster the original images of the same face based on the extracted features and the high-frequency face, when the calculated cosine value (cos value) is less than a preset value, the extracted features are the features corresponding to the high-frequency user, and the comparison results are consistent.
  • the high-frequency facial feature data is returned to the gallery application.
  • the high-frequency facial feature data in the algorithm library is returned to the gallery application through the facial data transmission module of the framework layer.
  • the facial feature recognition, extraction and clustering module processes the facial image, it can return all facial feature data to the gallery application, not just the high-frequency facial feature data.
  • one implementation method is to use the top N high-frequency faces (the top N users corresponding to the number of photos containing feature faces in the gallery application sorted from large to small) as the facial feature data that meets the "registered face" conditions referred to in this application.
  • the facial feature data of high-frequency faces and the number of photos containing feature faces greater than X are used as the "registered face” data for "protagonist tracking" referred to in this application.
  • the top 5 high-frequency faces automatically determined according to the number of photos can be: a portrait named Dad (corresponding to 58), a portrait named Mom (corresponding to 53), a portrait named Sister (corresponding to 46), a portrait named Brother (corresponding to 45), and a portrait named Friend (corresponding to 42).
  • These 5 high-frequency faces can be used as "registered faces” for automatic tracking of the electronic device.
  • An optional implementation is to use the top 5 automatically determined by the number of photos and the number of photos greater than M as "registered faces": Optionally, if M is selected as 50, in (4) in FIG. 33 , only the portrait of Dad (corresponding to 58) meets the conditions, so the portrait of Dad is selected as the "registered face”.
  • step S501 is an embodiment of the present application of using the top N high-frequency faces as facial feature data that meets the "registered face” condition. It is understood that when the "registered face” can be other subjects, such as human body, cat or dog, etc., the feature recognition and extraction algorithm can be used to process the image and return the corresponding subject feature data to the gallery application.
  • the gallery application stores the facial feature status identifier.
  • the gallery application when there is facial feature data in the storage module of the gallery application, the gallery application writes mark 1 to the database; when there is no facial feature data in the storage module, the gallery application writes mark 2 to the database.
  • the gallery application when there is facial feature data that meets the "registered face” in the storage module, the gallery application writes mark 1 to the database; when there is no facial feature data that meets the "registered face” in the storage module, the gallery application writes mark 2 to the database.
  • the database can be a database encapsulated in the framework layer to provide data sharing for the application layer App, which is used to save user preference settings.
  • S503 The gallery application sends a query request for the camera's main character tracking mode status.
  • the "Protagonist Focus Tracking" mode status flag will be saved to the database.
  • the flag ON means that the "Protagonist Focus Tracking” mode is currently on, and the flag OFF means that the "Protagonist Focus Tracking" mode is currently off.
  • the gallery application can send a query request to the database to request information about the on status of "Protagonist Focus Tracking".
  • the "Main Character Focus Tracking" mode status identifier initially stored in the database is OFF.
  • the camera application When the user turns on the "Main Character Focus Tracking" switch for the first time, the camera application writes the identifier ON to the database. If the user turns off the "Main Character Focus Tracking” switch, the camera application writes the identifier OFF to the database again.
  • the database Upon receiving the camera application's request to query the "Main Character Focus Tracking" mode status, the database returns the latest identifier representing the current "Main Character Focus Tracking" on/off state to the gallery application based on the stored "Main Character Focus Tracking" mode status identifier.
  • step S505 may be further included. If the database returns an indicator to the gallery application indicating that the "main character tracking focus” mode is off, step S506 will be executed.
  • the database returns the flag ON to the gallery application, it means that the "main character tracking focus" mode is turned on.
  • the electronic device when the electronic device is in the charging and screen-off state, it will extract and cluster the facial feature data of the face image and store it in the gallery application.
  • the gallery application can send the facial feature data stored last time to the camera HAL.
  • the gallery application can send the "registered face” feature data stored last time to the camera HAL.
  • the gallery application can send the "registered face” feature information stored last time to the camera HAL when the "registered face” feature data stored by the gallery application last time is changed compared to the "registered face” feature data stored last time and the "main character tracking focus” mode is turned on.
  • the gallery application sends facial feature data to the camera HAL through a transfer module of the framework layer.
  • the electronic device may first execute steps S503-S504, may first execute step S502, or may simultaneously execute steps S502 and steps S503-S504.
  • An optional implementation is to enable the "main character tracking focus" mode in the camera application.
  • the process of the "main character tracking focus” mode is introduced below in conjunction with steps S506-S516 in FIG. 34:
  • the user can trigger the electronic device to start the camera application.
  • the camera application in the electronic device can receive the request to start the camera application.
  • the user can click on the camera application icon 11, and accordingly, the electronic device can receive a request to start the camera application.
  • the electronic device can start the camera application and display the user interface 3101 shown in B of FIG. 30 .
  • the user can also start the camera application by voice, gesture, etc., and the present application does not limit the specific method in which the user triggers the electronic device to start the camera application.
  • the camera can be started. Moreover, after the camera is started, the original image data can be continuously collected. The camera can send the collected original image data to the camera HAL.
  • the camera HAL can process the raw image data and send the processed image to the display screen for display.
  • the preview mode mentioned here can include a photo preview mode, a video preview mode, etc.
  • steps S500-S505 are not necessary steps before step S506, and the electronic device may first execute steps S500-S505, or may first execute step S506.
  • the camera application can request the database to obtain the identifier.
  • the database stores facial feature data representing whether the gallery application satisfies the "registered face”
  • the camera application can request the database to obtain the identifier, thereby obtaining the information of the "registered face” storage status of the gallery application without directly interacting with the gallery application.
  • the database stores a "protagonist focus tracking" mode status identifier
  • the camera application queries the facial feature data storage status
  • the camera application can also request the database to obtain the mark.
  • the present application does not restrict the order in which the electronic device queries the facial feature data storage status and the "protagonist focus tracking" mode status.
  • the camera application can first query the facial feature data storage status and the "protagonist focus tracking" mode status, and can also query them at the same time.
  • the database when receiving a request from the camera application to query the storage status of facial feature data, the database returns one of the identifiers 1 and 2 to the camera application according to the stored facial feature data status identifier. Specifically, returning identifier 1 represents that the facial feature data identifier exists in the gallery application (or the facial feature data that satisfies the "registered face"), and returning identifier 2 represents that the facial feature data identifier does not exist in the gallery application (or the facial feature data that satisfies the "registered face").
  • the camera application also sends a request to query the "main character focus tracking" mode status to the database in step S507
  • the database when receiving the camera application's request to query the main character focus tracking mode status, the database returns an identifier representing the current "main character focus tracking" on or off state to the gallery application based on the stored "main character focus tracking" mode status identifier.
  • the database facial feature data storage status flag when the database facial feature data storage status flag exists, it means that the "main character tracking focus" mode is in a state that can be used. At this time, if the "main character tracking focus" mode switch is turned off, the electronic device can prompt the user to turn on the "main character tracking focus” mode switch, specifically after executing steps S506-S508, it can also include S509-S512. It should be understood that steps S509-S512 are not necessary steps after steps S506-S508.
  • the database facial feature data storage status mark 1 and the "main character tracking focus” mode on/off state mark are OFF, it means that there is "registered face” data in the application gallery and the main character tracking focus mode is in the off state.
  • Window 3501 i.e., an implementation of the first interface
  • window 3501 is used to prompt the user whether to turn on the "main character tracking focus” function.
  • the content displayed in window 3501 is: Is the "main character tracking focus” function turned on? Identify the portraits that are often taken in the gallery and give priority to tracking focus. Thereby prompting the user to turn on the "main character tracking focus” mode.
  • the user can also trigger the electronic device to enter the tracking focus mode through voice, gestures, etc.
  • the "main character tracking focus” mode will be turned on. Specifically, the camera application will write the flag ON to the database, indicating that the main character tracking focus mode has been turned on. It is understandable that the original OFF flag will be replaced by the new flag written this time or the return priority when requested to be obtained will be reduced. It is understandable that after the "main character tracking focus” mode is turned on, at this time in the setting interface shown in (2) of FIG. 35, the "smart focus" option 351 and the "main character tracking focus” option 352 are in the turned-on state.
  • S511 The camera application calls the gallery application interface and sends a request to refresh facial feature data to the gallery application.
  • the gallery application can refresh the stored facial feature data to the camera HAL, and the camera application can send a request to refresh the facial feature data to the gallery by calling the gallery application interface.
  • S512 Upon receiving a request to refresh facial feature data, the gallery application queries the focus tracking mode status of the protagonist.
  • the database stores the "main character tracking focus” mode status flag.
  • the camera application has written the flag ON into the database, and the flag ON represents that the "main character tracking focus” mode is currently turned on, so the gallery application can query the "main character tracking focus” mode status.
  • step S510 the camera application has written the flag ON into the database, and the flag ON represents that the "main character tracking focus” mode is currently turned on, that is, the flag ON returned by the database.
  • the electronic device needs to execute steps S514-S515 before shooting in the "main character tracking focus” mode, and send the facial feature data to the algorithm library so that the tracking algorithm can determine the face that needs to be tracked.
  • the most recently saved facial feature data may be sent to the camera HAL with reference to step S505.
  • this step may only send the most recently saved facial feature data that meets the "registered face” condition.
  • S515 The camera HAL sends the facial feature data to the algorithm library.
  • the camera HAL can save the most recently acquired facial feature data and send it to the target recognition algorithm in the algorithm library.
  • the camera HAL can only send the most recently acquired facial feature data that meets the "registered face” condition to the target recognition algorithm in the algorithm library.
  • step S515 the following steps may also be included:
  • the camera application can send a registered face focus tracking instruction to the algorithm library through the camera HAL, so that the algorithm can focus on the registered face.
  • the specific focus tracking process will be introduced below.
  • An optional implementation method is that in addition to enabling the "main subject tracking focus” mode in the camera application, you can also enable the "main subject tracking focus” mode in the settings.
  • FIG36 is an example of an interface for camera settings (i.e., another implementation of the first interface).
  • FIG36 (1) shows an interface in which “Main Character Tracking” is unavailable.
  • the interface is displayed as shown in FIG36 (2), and option 352 of “Main Character Tracking” in the settings interface is available.
  • the available state can also be understood as a non-grayed state, that is, the user can operate it.
  • the "main character tracking focus” option 352 shown in (2) of FIG36 can be clicked by the user (i.e., another implementation of the first control).
  • the “main character tracking focus” option 352 When the user clicks the "main character tracking focus” option 352, the "main character tracking focus” is turned on, and the interface is displayed as shown in (3) of FIG36, and the "main character tracking focus” option 352 is turned on.
  • the "main character tracking focus” mode will be turned on. Specifically, the camera application will write the flag ON to the database, indicating that the "main character tracking focus” mode has been turned on.
  • the turning on of "Main Character Tracking” depends on whether the registered face data in the gallery is effective. If it is determined that the registered face data in the gallery is effective, or if it is determined that the gallery has generated usable portrait data, then the "Main Character Tracking" option is available. If the registered face data in the gallery is not effective, then the "Main Character Tracking” option is unavailable, for example, by graying it out to inform the user that "Main Character Tracking" is unavailable.
  • the user can also click on the "Smart Focus Tracking” option to turn it off. Since “Smart Focus Tracking” and “Protagonist Focus Tracking” are linked, and the premise for turning on “Protagonist Focus Tracking” is that "Smart Focus Tracking" is turned on, when the "Smart Focus Tracking” option is turned off, the "Protagonist Focus Tracking” option is also automatically turned off. For example, the user clicks on the "Smart Focus Tracking" option 351 shown in (3) of Figure 36 to turn off "Smart Focus Tracking", and the interface is displayed as shown in (4) of Figure 36. As shown in (4) of Figure 36, option 351 of "Smart Focus Tracking" is turned off, and option 352 of "Protagonist Focus Tracking" is not displayed in the setting options.
  • step S516 in order to turn off the "main character tracking focus" mode, after step S516, the following steps may also be included:
  • the camera application will write the flag OFF to the database, indicating that the main character tracking mode has been turned off. It is understandable that the existing ON flag will be replaced by the flag written this time or the return priority will be reduced when requested.
  • the camera application can send a command to turn off the "registered face” focus tracking to the algorithm library through the camera HAL, thereby stopping the algorithm from focusing on the "registered face”.
  • the gallery application sends an instruction to clear facial feature data to the camera HAL through the transfer module of the framework layer.
  • the present application does not limit the order in which the electronic device executes steps S517-S519.
  • the electronic device may also execute S517, S518 and S519 simultaneously.
  • the electronic device when the electronic device enters the camera application to shoot after turning on the "main subject tracking focus” mode, the electronic device will automatically identify whether the subject is a registered face. If a registered face is recognized, the electronic device will track the "registered face”.
  • the camera application sends the registered face tracking start instruction to the algorithm library in step S516, the following may be included:
  • S3700 The terminal obtains a first preview image of the scene to be photographed and determines a target subject.
  • the camera can continuously capture images.
  • the image i.e., the first image
  • the camera application calls back the preview stream through a callback function and processes the image obtained by the callback.
  • the camera HAL sends image 1 to the target recognition algorithm.
  • the target recognition algorithm performs image recognition on image 1 to obtain the identified subject information category label in the preview image.
  • the subject information category label may include: face, body, cat, dog, etc., which is not limited in this scheme.
  • the key points of the image are detected and located to identify the detection and location results of the key points, and the detection and location results include the key points of the face in the image, and the face is located by the key points of the face.
  • the face image is cropped from the image using the key points of the face, and the face image is affine transformed to complete the correction of the face, and then the feature extraction of the corrected face is performed through the Convolutional Neural Network (CNN) to obtain the features of the face.
  • CNN Convolutional Neural Network
  • the image matching module also detects and locates the key points of the images of faces in the gallery application, uses the key points of the face to crop the face from the image, and performs affine transformation on the face to complete the correction of the face, and then extracts the features of the face by extracting the features of the corrected face. Then, it judges whether the obtained facial features are consistent with the facial features of the "registered face".
  • the target recognition algorithm can also identify the subject information such as human body, cat, dog, etc.
  • the target recognition algorithm transmits the recognized subject information back to the camera HAL, and the camera HAL reports the tracking target to the camera application.
  • the focus tracking ID, focus tracking status, focus tracking area, focus tracking status, and identification of registered faces can also be reported as "identification data".
  • the focus tracking ID indicates the object ID of the focus tracking, which is used to identify the focus tracking object; the focus tracking types include face, body, cat, and dog to distinguish the focus tracking subject; the identification of registered faces is used to identify whether the facial features meet the "registered face”.
  • step S515 the image library has sent the facial feature data that meets the "registered face” condition to the target recognition algorithm.
  • the target recognition algorithm can determine the priority of the recognized subject based on the matching of all the recognized subject information and the facial feature data of the "registered face” condition.
  • the target recognition algorithm sends all the recognized subject information and its priority information to the autofocus algorithm.
  • the "registered face” may be other objects, such as a cat. Dogs, and other objects, therefore, the priority can be determined by referring to the method of registered face > unregistered face > human body > cat > dog, that is, when there is facial feature data that meets the "registered face” condition in the recognized subject information (face), the subject with facial feature data that meets the "registered face” condition is the face with the highest priority.
  • the face with the largest area among the multiple facial feature data that meet the "registered face” condition is the face with the highest priority, that is, the priority is: registered face with large face area > registered face with small face area > unregistered face > human body > cat > dog.
  • feature conditions such as gender, age, race, makeup, hairstyle, etc. can also be set to determine the face with the highest priority among the multiple faces with facial feature data that meet the "registered face” condition.
  • the target recognition algorithm sends all the recognized subject information and the subject information with the highest priority to the autofocus algorithm, and the autofocus algorithm prioritizes adjusting the camera to autofocus and track the target on some subjects.
  • the autofocus algorithm prioritizes adjusting the camera to autofocus and track the target on some subjects.
  • the autofocus algorithm can focus on the subject with a high priority first.
  • One implementation method is that when the priority is set according to whether the "registered face” condition is met, the autofocus algorithm prioritizes focusing on the subject (face) that meets the "registered face” condition in the subject information (face). When there are multiple faces that meet the "registered face” condition, the autofocus algorithm prioritizes focusing on the subject (registered face) with the highest priority.
  • the camera determines the focus based on the recognized subject information, draws the focus frame, and displays the focus frame.
  • the camera application will use the target recognition algorithm to determine whether the subject information it identifies contains a registered face, and the display of the focus frame will be different. Please refer to the previous article for specific scenarios.
  • FIG38 shows an example of the camera preview interface after the "intelligent focus tracking" and "main character focus tracking” functions are turned on.
  • the target recognition algorithm recognizes face A, and face A is an "unregistered face.”
  • the target recognition algorithm sends the information of face A to the autofocus algorithm, and the autofocus algorithm performs focus tracking on face A.
  • the target recognition algorithm reports the information of face A and "identification data" such as the registered face to the camera application for drawing a focus tracking frame for face A.
  • the focus tracking frame for the "unregistered face” A is a regular focus tracking frame 3801.
  • the regular focus tracking frame 3801 will automatically disappear after a period of time (for example, 5 seconds).
  • the optional regular focus tracking frame 3801 is usually displayed in white in the preview interface.
  • the regular focus tracking frame is displayed normally and only includes one main frame.
  • FIG. 38 (2) describes the photo shooting scene of a single registered face as an example.
  • the preview interface displays face B and the protagonist focus frame 3803.
  • the autofocus algorithm will continue to focus on face B, and the protagonist focus frame 3803 will also move with face B.
  • the main character tracking focus frame 3803 always moves along with face B.
  • the size of the main character tracking focus frame also changes as face B moves.
  • the main character tracking focus frame 3803 is used to perform main character tracking focus (or continuous tracking focus) on face B.
  • the main character tracking focus frame is highlighted and includes a main frame and a sub-frame.
  • the main character tracking focus frame shown in (2) of Figure 38 or (3) of Figure 38 can be yellow or other highlighted colors in a specific implementation to distinguish it from a conventional tracking focus frame. It is understandable that those skilled in the art can make other designs for the color, display, size, shape, etc. of the conventional tracking focus frame and the main character tracking focus frame to distinguish them.
  • the main character tracking focus frame 3803 shown in (2) of Figure 38 or (3) of Figure 38 is only an example.
  • the interface examples shown in (2) or (3) of FIG. 38 above are all shooting scenes of a single registered face. For shooting scenes of multiple people, the embodiments of the present application are still applicable.
  • a multi-person shooting scene refers to a situation where there may be multiple shooting subjects during shooting.
  • the target recognition algorithm determines the information of face Z with the highest priority among the multiple unregistered faces (the determination method is referred to in the previous text), and sends the information of face Z to the autofocus algorithm, and the autofocus algorithm focuses on face Z.
  • the target recognition algorithm reports the information of multiple unregistered faces identified and the "identification data" for identifying registered faces to the camera application for drawing focus frames for multiple unregistered face objects.
  • the camera application uses a regular focus frame for each unregistered face.
  • the regular focus frame will automatically disappear after a period of time (for example, 5 seconds).
  • the regular focus frame 3801 is usually displayed in white in the preview interface. It can be understood that as an embodiment, when shooting multiple non-registered face objects, in the focus tracking function, the autofocus algorithm can only focus on the target with the highest priority, and a regular focus tracking frame will be displayed for all recognized subjects on the camera preview interface.
  • the target recognition algorithm identifies that multiple photographed objects are all registered faces among multiple photographed objects, that is, there are multiple registered faces, as an embodiment, the target recognition algorithm will sort the multiple registered faces according to priority.
  • the target recognition algorithm determines the information of the face Y with the highest priority among multiple non-registered faces (the determination method is referred to in the previous text), and sends the information of face Y to the autofocus algorithm for focus tracking.
  • the target recognition algorithm reports the information of multiple registered faces identified and the "identification data" for identifying registered faces to the camera application for drawing focus tracking frames for multiple objects.
  • the camera application draws the protagonist focus tracking frame for the registered face with the highest priority, and draws the non-protagonist focus tracking frame for the registered faces other than the registered face with the highest priority among the multiple registered faces.
  • the protagonist focus tracking frame and the non-protagonist focus tracking frame can both be considered as registered focus tracking frames, that is, focus tracking frames for registered faces.
  • the difference between the non-protagonist focus tracking frame and the protagonist focus tracking frame is that the two have different colors.
  • the protagonist focus tracking frame will be highlighted in the interface to highlight the protagonist portrait. For example, the lines of the main character's tracking focus frame are yellow, and the lines of the non-main character's tracking focus frame are white.
  • the target recognition algorithm identifies multiple photographic subjects as registered faces and unregistered faces among multiple photographic subjects
  • the target recognition algorithm performs focus tracking on the registered face with the highest priority
  • the camera application draws a protagonist focus tracking frame for the registered face with the highest priority
  • non-protagonist focus tracking frames for registered faces other than the registered face with the highest priority among multiple registered faces
  • the regular focus tracking frame for the unregistered face
  • the regular focus tracking frame will automatically disappear after a period of time (for example, 5 seconds).
  • the non-protagonist focus tracking frame has the same frame type as the protagonist focus tracking frame, that is, the non-protagonist focus tracking frame includes a main frame and a sub-frame.
  • the regular focus tracking frame is a single frame. Therefore, from the perspective of frame type, the non-protagonist focus tracking frame is different from the regular focus tracking frame.
  • FIG39 shows an example of a multi-person shooting scene in the photo mode.
  • the conventional focus frame 3801 is used for face A
  • the focus frame for face B is the main character focus frame 3803 proposed in this application
  • the focus frames for faces C and face D are the non-main character focus frames 903 proposed in this application.
  • the conventional focus frame 3801 please refer to the description in FIG39.
  • Both the main character frame 3803 and the non-main character focus frame 903 are composed of a main frame and a sub-frame. The difference is that the main character frame 3803 is highlighted compared to the non-main character focus frame 903 to highlight the main character portrait.
  • the regular tracking focus frame 3801 for face A disappears automatically. For example, after 5 seconds, the interface is displayed as shown in (2) in Figure 39.
  • the regular tracking focus frame 3801 for face A disappears, while the main character tracking focus frame 3803 for face B and the non-main character tracking focus frames 903 for faces C and D do not disappear.
  • an optional implementation method is that the autofocus algorithm tracks the registered face with the highest priority. If the face with the largest area among multiple facial feature data that meet the "registered face” conditions is the face with the highest priority, as the face or lens moves, the order of the faces close to the lens in the picture changes, and the priority of the photographed object will change. For example, as shown in (3) in Figure 39, as the face or lens moves, face C becomes the face with the largest area among multiple registered faces (such as face B, face C, and face D). At this time, the protagonist tracking focus frame is used for face C, and the tracking focus frame of face B is switched to the non-protagonist tracking focus frame at the same time. When the tracking focus frame is redrawn, the autofocus algorithm switches from tracking face B to tracking face C.
  • the focus types including human body, cat, dog, etc. may also belong to "unregistered face".
  • a focus frame may not be drawn for the human body.
  • a conventional focus frame may be drawn, and this embodiment is not limited here.
  • different focus frames are used to display "registered faces" and "unregistered faces", and those skilled in the art can adjust the color, shape, size, display mode, etc. of the focus frame, such as using a large frame for a "registered face” and a small frame for an "unregistered face”.
  • the focus frame for a "registered face” may be displayed in a flashing manner, and a still manner for an "unregistered face”.
  • the auto focus algorithm can also automatically/according to the user's manual focus tracking of one or more other objects, and this embodiment is not limited here. The following will describe in detail the situation where the user manually intervenes in the focus tracking in the "main character focus tracking" mode.
  • the above describes the relevant embodiments of focusing when there is no human intervention during shooting.
  • the following describes the relevant embodiments of focusing when there is human intervention.
  • Human intervention refers to the user actively clicking on a certain area or object in the interface to select the object to be focused.
  • the interface includes but is not limited to a photo preview interface, a video preview interface, or a video recording interface (i.e., the screen during the video recording process).
  • the electronic device automatically identifies the subject to be photographed and performs tracking focus.
  • An optional implementation is, as described above, if the registered face is not recognized, a regular tracking focus frame is displayed for the subject to be photographed, and the object with the highest focus priority can be determined by referring to the method of faces with large face areas > faces with small face areas > humans > cats > dogs. If a registered face is recognized, a registered tracking focus frame is displayed for the face in the facial feature data that meets the "registered face" condition, and the face with the highest tracking priority is selected.
  • the electronic device when there is human intervention in the interface, for example, the user actively clicks on a face in the photo preview interface or the video preview interface, then the electronic device The person or object selected by the user is taken as the object to be tracked, without considering whether the facial feature data meets the "registered face” conditions.
  • the camera application In response to the user selecting a specific target area, the camera application provides the target area to the target recognition algorithm, and the target recognition algorithm identifies whether there is a target subject in the target area.
  • the optional camera application sends the target area to the camera HAL, and the camera HAL sends the target area to the target recognition algorithm in the algorithm library.
  • the target recognition algorithm transmits the recognized subject information back to the camera HAL, and the camera HAL reports the tracking target to the camera application.
  • the target recognition algorithm sends the recognized subject information to the autofocus algorithm, and the autofocus algorithm adjusts the camera to focus and track the target based on the recognized subject information.
  • the autofocus algorithm can not only focus on the subject recognized in the target area but also maintain the focus on the subject recognized in the non-target area.
  • the camera determines the focus based on the recognized subject information, draws the focus frame and displays the focus frame.
  • the display of the focus tracking frame can refer to that shown in (1) of FIG. 41.
  • a conventional focus tracking frame 3801 is displayed for the non-registered face A and the focus is tracked.
  • the interface is displayed as shown in (2) of FIG. 41.
  • a highlighted focus tracking frame 3804 and a small sun icon 3805 for indicating the exposure are displayed for face A.
  • the exposure can be adjusted by operating the small sun icon 3805. It can be understood that the small sun icon is only an example description and can actually be replaced by other icons indicating the exposure.
  • FIG42 shows an example of a human intervention interface in a multi-person photo scene when a registered face is recognized.
  • a conventional focus tracking frame 3801 is displayed for non-registered face A
  • a main character focus tracking frame 3803 is displayed for registered face B and focus tracking is performed
  • a non-main character focus tracking frame 903 is displayed for registered face C.
  • the user can actively click on face C to set face C as the target focus tracking object.
  • the auto focus algorithm focuses on face C
  • the camera interface is shown in (2) of FIG42.
  • a highlighted focus frame 3804 and a small sun icon 3805 are displayed for face C, and the regular focus frame 3801 of face A and the main focus frame 3803 of face B disappear.
  • the user can also click on a non-face area or an area where the algorithm cannot identify the object type. As shown in the figure, after S3704, it can also include:
  • the camera application focuses on the selected target area and displays the focus frame.
  • a regular focus frame 3801 is displayed and the focus is tracked for non-registered face A.
  • the automatic focus algorithm focuses on area 1
  • the camera interface is displayed as shown in Figure 43 (2).
  • a highlighted focus frame 3804 and a small sun icon 3805 are displayed in area 1. It can be understood that if there is a registered face, after automatically focusing on the registered face, if the user clicks on area 1, the focus frame 3804 and the small sun icon 3805 are displayed in area 1. If the user manually intervenes to select an area for focus tracking, the autofocus algorithm will focus on the area selected by the user and display the focus tracking frame on the area selected by the user instead of the registered face.
  • the electronic device may use the subject as a "registered face" and set its focusing priority to the highest. This will not be described in conjunction with the accompanying drawings.
  • the electronic device can also use the above-mentioned object tracking method to perform "protagonist tracking".
  • the "registered face” may be preset by the user in the gallery application on the electronic device. For example, the user may select face A as the "registered face” by selecting face A in the gallery.
  • the face A may be stored in the storage space of the gallery application, and the personal album of the gallery application may read the image of the "registered face” from the storage space to display all images of the "registered face” through the personal album.
  • a distinguishing mark may be added to the "registered face” image.
  • the electronic device can use objects with the same label in the gallery application as “registered faces”. For example, if images with labels of family and friends are saved in a personal album of the gallery application, all objects with the label of family in the gallery application can be used as “registered faces”.
  • the "registered face” can come from the face data of the owner's face recognition, such as the face data obtained during face unlocking.
  • the "registered face” can also come from data stored on other electronic devices. This application does not limit the source of the "registered face” data.
  • the present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.
  • the computer program product can be stored in a memory, and is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.
  • the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented.
  • the computer program can be a high-level language program or an executable target program.
  • the computer-readable storage medium may be a volatile memory or a nonvolatile memory, or may include both volatile memory and nonvolatile memory.
  • the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
  • the volatile memory may be a random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (DRAM), and so on.
  • DRAM double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct rambus RAM (direct rambus RAM, DR RAM).
  • the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not executed.
  • the device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system.
  • the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.
  • the size of the serial number of each process does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
  • system and “network” are often used interchangeably in this article.
  • the term “and/or” in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships.
  • a and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this article generally indicates that the associated objects before and after are in an "or” relationship.
  • the above is an example of three elements, A, B and C, to illustrate the optional items of the item.

Landscapes

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

Abstract

本申请适用于图像处理技术领域,提供了一种追焦方法、对焦方法、拍摄方法和电子设备,该方法包括:对相机预览界面中的各个对象进行识别处理,以确定各个对象的对象类型;根据各个对象的对象类型及预设的优先级策略,确定各个对象的追焦框类型及各个对象的第一追焦优先级;根据各个对象的追焦框类型及坐标,生成并显示各个对象对应的追焦框;根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。由此,通过在预览过程中,选取出当前拍摄场景中用户最关注的对象进行追焦,并且不同类型对象的追焦框不同,从而提升了用户最关注的对象的拍摄效果,以及追焦的灵活性和便捷性。

Description

追焦方法、对焦方法、拍摄方法和电子设备
本申请要求于2023年02月17日提交国家知识产权局、申请号为202310153939.0、发明名称为“追焦方法、装置、终端设备及计算机可读存储介质”的中国专利申请的优先权,以及于2023年02月17日提交国家知识产权局、申请号为202310162723.0、发明名称为“对焦方法和对焦装置”的中国专利申请的优先权,以及于2023年02月27日提交国家知识产权局、申请号为202310227257.X、发明名称为“一种拍摄方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术领域,并且具体地,涉及一种追焦方法、对焦方法、拍摄方法和电子设备。
背景技术
随着智能手机等终端设备的大量普及与快速发展,智能手机等终端设备的功能也越来越完善,比如,用户可以通过智能手机进行拍照。在很多拍摄场景中,为了使得成像画面清晰,需要对被拍摄物进行对焦,以满足用户更高的拍摄需求。
相关技术中,通常以相机预览界面的中心区域作为对焦区域进行对焦,或者对用户手动选择的区域进行对焦,但是这些对焦方式无法根据实际的拍摄场景自适应的调整对焦对象,从而不仅对焦效果差,而且灵活性和使用便捷性较差,影响了用户的拍摄体验。
发明内容
本申请实施例提供了一种追焦方法、装置、终端设备及计算机可读存储介质,可以解决以相机预览界面的中心区域作为对焦区域进行对焦,或者对用户手动选择的区域进行对焦等对焦方式无法根据实际的拍摄场景自适应的调整对焦对象,从而不仅对焦效果差,而且灵活性和使用便捷性较差,影响了用户的拍摄体验的问题。
第一方面,本申请实施例提供了一种追焦方法,包括:响应于用户的第一操作,显示相机预览界面;对相机预览界面中显示的各个对象进行识别处理,以确定各个对象的对象类型;根据各个对象的对象类型,确定各个对象的追焦框类型;根据各个对象的对象类型及预设的优先级策略,确定各个对象的第一追焦优先级,其中,预设的优先级策略是根据用户对各个对象类型的关注程度设定的;根据各个对象的追焦框类型,生成各个对象对应的追焦框,并根据各个对象的坐标,在相机预览界面中显示各个对象对应的追焦框;根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
在第一方面的一种可能的实现方式中,上述对象类型包括以下类型:图库中排序处于前N的人像、非图库中排序处于前N的人像、预设类型的非人脸对象,其中,N为大于或等于1的正整数;
图库中排序处于前N的人像的追焦框类型为第一追焦框类型或第二追焦框类型, 非图库中排序处于前N的人像的追焦框类型及预设类型的非人脸对象的追焦框类型为第三追焦框类型,其中,第一追焦框类型、第二追焦框类型及第三追焦框类型均不相同;
上述预设的优先级策略为:图库中排序处于前N的人像的第一追焦优先级高于非图库中排序处于前N的人像的第一追焦优先级,非图库中排序处于前N的人像的第一追焦优先级高于预设类型的非人脸对象的第一对焦优先级。
可选的,在第一方面的另一种可能的实现方式中,上述根据各个对象的追焦框类型,生成各个对象对应的追焦框,并根据各个对象的坐标,在相机预览界面中显示各个对象对应的追焦框,包括:
在对象中包含对象类型为图库中排序处于前N的人像的一个第一对象时,根据第二追焦框类型,生成第一对象对应的第一追焦框,并根据第一对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框;
在对象中包含对象类型为图库中排序处于前N的人像的一个第一对象及至少一个第二对象时,根据第一追焦框类型,生成第一对象对应的第一追焦框,以及根据第二追焦框类型,生成各个第二对象对应的第二追焦框,并根据第一对象及各个第二对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框及各个第二对象对应的第二追焦框,其中,第一对象的尺寸大于各个第二对象的尺寸。
可选的,在第一方面的再一种可能的实现方式中,上述根据第一追焦框类型,生成第一对象对应的第一追焦框,以及根据第二追焦框类型,生成各个第二对象对应的第二追焦框,并根据第一对象及各个第二对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框及各个第二对象对应的第二追焦框之后,还包括:
若确定任一第二对象的尺寸大于第一对象的尺寸,则将任一第二对象确定为新的第一对象,以及将第一对象确定为新的第二对象,并将新的第一对象对应的追焦框由第二追焦框更改为第一追焦框,以及将新的第二对象对应的追焦框由第一追焦框更改为第二追焦框。
可选的,在第一方面的又一种可能的实现方式中,上述根据各个对象的追焦框类型,生成各个对象对应的追焦框,并根据各个对象的坐标,在相机预览界面中显示各个对象对应的追焦框之后,还包括:
在对象的对象类型为非图库中排序处于前N的人像或预设类型的非人脸对象时,确定对象对应的追焦框的显示时长;
在对象对应的追焦框的显示时长达到时长阈值时,停止显示对象对应的追焦框。
可选的,在第一方面的又一种可能的实现方式中,上述根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,包括:
判断对象中是否包含对象类型为图库中排序处于前N的人像的第一对象;
若对象中包含至少一个第一对象,则将第一对象确定为第一优先级最高的对象,并将任一第一对象确定为目标追焦对象;
若对象中未包含第一对象,则判断对象中是否包含对象类型为非图库中排序处于前N的人像的第二对象;
若对象中包含至少一个第二对象,则将第二对象确定为第一优先级最高的对象, 并将任一第二对象确定为目标追焦对象;
若对象中未包含第二对象,则判断对象中是否包含对象类型为预设类型的非人脸对象的第三对象;
若对象中包含至少一个第三对象,则将第三对象确定为第一优先级最高的对象,并将任一第三对象确定为目标追焦对象;
若对象中未包含第三对象,则在预览界面中进行中心对焦处理。
可选的,在第一方面的另一种可能的实现方式中,上述根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理之后,还包括:
响应于用户对任一对象的点击操作,将任一对象确定为指定追焦对象;
若指定追焦对象为目标追焦对象,则持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作;
若指定追焦对象不为目标追焦对象,则暂停对目标追焦对象进行追焦处理,并持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作。
可选的,在第一方面的再一种可能的实现方式中,上述响应于用户对任一对象的点击操作,将任一对象确定为指定追焦对象之后,还包括:
若指定追焦对象为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像,则保持指定追焦对象的追焦框类型不变,以及持续显示指定追焦对象的追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
若指定追焦对象不为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像,则将指定追焦对象的追焦框类型更改为第一追焦框类型,以及根据第一追焦框类型生成并持续显示指定追焦对象对应的第一追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
若指定追焦对象的对象类型不为图库中排序处于前N的人像,则将指定追焦对象的追焦框类型更改为第四追焦框类型,以及根据第四追焦框类型生成并持续显示指定追焦对象对应的第四追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框。
可选的,在第一方面的又一种可能的实现方式中,上述响应于用户对任一对象的点击操作,将任一对象确定为指定追焦对象之后,还包括:
响应于用户对指定追焦对象的点击操作,暂停对指定追焦对象的追焦处理,并根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
可选的,在第一方面的又一种可能的实现方式中,上述对象中包含多个第一追焦优先级最高的对象;相应的,上述根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,包括:
确定第一追焦优先级最高的各个对象的第二追焦优先级;
将第二追焦优先级最高的对象,确定为目标追焦对象。
可选的,在第一方面的另一种可能的实现方式中,上述确定第一追焦优先级最高的各个对象的第二追焦优先级,包括:
获取第一追焦优先级最高的各个对象的预设优先级;
将各个对象的预设优先级,确定为各个对象的第二追焦优先级;
或者,
确定第一追焦优先级最高的各个对象的尺寸;
根据各个对象的尺寸,确定各个对象的第二追焦优先级。
第二方面,本申请实施例提供了一种追焦装置,包括:第一显示模块,用于响应于用户的第一操作,显示相机预览界面;第一确定模块,用于对相机预览界面中显示的各个对象进行识别处理,以确定各个对象的对象类型;第二确定模块,用于根据各个对象的对象类型,确定各个对象的追焦框类型;第三确定模块,用于根据各个对象的对象类型及预设的优先级策略,确定各个对象的第一追焦优先级,其中,预设的优先级策略是根据用户对各个对象类型的关注程度设定的;第二显示模块,用于根据各个对象的追焦框类型,生成各个对象对应的追焦框,并根据各个对象的坐标,在相机预览界面中显示各个对象对应的追焦框;第一追焦模块,用于根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
在第二方面的一种可能的实现方式中,上述对象类型包括以下类型:图库中排序处于前N的人像、非图库中排序处于前N的人像、预设类型的非人脸对象,其中,N为大于或等于1的正整数;
图库中排序处于前N的人像的追焦框类型为第一追焦框类型或第二追焦框类型,非图库中排序处于前N的人像的追焦框类型及预设类型的非人脸对象的追焦框类型为第三追焦框类型,其中,第一追焦框类型、第二追焦框类型及第三追焦框类型均不相同;
预设的优先级策略为:图库中排序处于前N的人像的第一追焦优先级高于非图库中排序处于前N的人像的第一追焦优先级,非图库中排序处于前N的人像的第一追焦优先级高于预设类型的非人脸对象的第一对焦优先级。
可选的,在第二方面的另一种可能的实现方式中,上述第二显示模块,包括:
第一显示单元,用于在对象中包含对象类型为图库中排序处于前N的人像的一个第一对象时,根据第二追焦框类型,生成第一对象对应的第一追焦框,并根据第一对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框;
第二显示单元,用于在对象中包含对象类型为图库中排序处于前N的人像的一个第一对象及至少一个第二对象时,根据第一追焦框类型,生成第一对象对应的第一追焦框,以及根据第二追焦框类型,生成各个第二对象对应的第二追焦框,并根据第一对象及各个第二对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框及各个第二对象对应的第二追焦框,其中,第一对象的尺寸大于各个第二对象的尺寸。
可选的,在第二方面的再一种可能的实现方式中,上述第二显示模块,还包括:
第一更改单元,用于若确定任一第二对象的尺寸大于第一对象的尺寸,则将任一第二对象确定为新的第一对象,以及将第一对象确定为新的第二对象,并将新的第一对象对应的追焦框由第二追焦框更改为第一追焦框,以及将新的第二对象对应的追焦框由第一追焦框更改为第二追焦框。
可选的,在第二方面的又一种可能的实现方式中,上述装置,还包括:
第四确定模块,用于在对象的对象类型为非图库中排序处于前N的人像或预设类型的非人脸对象时,确定对象对应的追焦框的显示时长;
第一停止显示模块,用于在对象对应的追焦框的显示时长达到时长阈值时,停止显示对象对应的追焦框。
可选的,在第二方面的又一种可能的实现方式中,上述第一追焦模块,包括:
第一判断单元,用于判断对象中是否包含对象类型为图库中排序处于前N的人像的第一对象;
第一确定单元,用于若对象中包含至少一个第一对象,则将第一对象确定为第一优先级最高的对象,并将任一第一对象确定为目标追焦对象;
第二判断单元,用于若对象中未包含第一对象,则判断对象中是否包含对象类型为非图库中排序处于前N的人像的第二对象;
第二确定单元,用于若对象中包含至少一个第二对象,则将第二对象确定为第一优先级最高的对象,并将任一第二对象确定为目标追焦对象;
第三判断单元,用于若对象中未包含第二对象,则判断对象中是否包含对象类型为预设类型的非人脸对象的第三对象;
第三确定单元,用于若对象中包含至少一个第三对象,则将第三对象确定为第一优先级最高的对象,并将任一第三对象确定为目标追焦对象;
第一对焦单元,用于若对象中未包含第三对象,则在预览界面中进行中心对焦处理。
可选的,在第二方面的另一种可能的实现方式中,上述装置,还包括:
第五确定模块,用于响应于用户对任一对象的点击操作,将任一对象确定为指定追焦对象;
第二追焦模块,用于若指定追焦对象为目标追焦对象,则持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作;
第三追焦模块,用于若指定追焦对象不为目标追焦对象,则暂停对目标追焦对象进行追焦处理,并持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作。
可选的,在第二方面的再一种可能的实现方式中,上述装置,还包括:
第三显示模块,用于若指定追焦对象为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像,则保持指定追焦对象的追焦框类型不变,以及持续显示指定追焦对象的追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
第四显示模块,用于若指定追焦对象不为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像,则将指定追焦对象的追焦框类型更改为第一追焦框类型,以及根据第一追焦框类型生成并持续显示指定追焦对象对应的第一追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
第五显示模块,用于若指定追焦对象的对象类型不为图库中排序处于前N的人像,则将指定追焦对象的追焦框类型更改为第四追焦框类型,以及根据第四追焦框类型生成并持续显示指定追焦对象对应的第四追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框。
可选的,在第二方面的又一种可能的实现方式中,上述装置,还包括:
第四追焦模块,用于响应于用户对指定追焦对象的点击操作,暂停对指定追焦对象的追焦处理,并根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
可选的,在第二方面的又一种可能的实现方式中,上述对象中包含多个第一追焦优先级最高的对象;相应的,上述第一追焦模块,包括:
第四确定单元,用于确定第一追焦优先级最高的各个对象的第二追焦优先级;
第五确定单元,用于将第二追焦优先级最高的对象,确定为目标追焦对象。
可选的,在第二方面的另一种可能的实现方式中,上述第四确定单元,具体用于:
获取第一追焦优先级最高的各个对象的预设优先级;
将各个对象的预设优先级,确定为各个对象的第二追焦优先级;
或者,
确定第一追焦优先级最高的各个对象的尺寸;
根据各个对象的尺寸,确定各个对象的第二追焦优先级。
第三方面,本申请实施例提供了一种终端设备,包括:存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,其中,处理器执行计算机程序时实现如前所述的追焦方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现如前所述的追焦方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行如前所述的追焦方法。
本申请实施例与现有技术相比存在的有益效果是:通过在预览过程中,根据相机预览界面中各个对象的对象类型选取出当前拍摄场景中用户最关注的对象,作为最高优先级的追焦对象,以对用户当前最关注的对象进行追焦,并且对于不同类型的对象采用不同的追焦框进行显示,从而不仅可以根据实时的拍摄场景自适应调整追焦对象,提升了用户最关注的对象的拍摄效果,而且无需用户手动操作,提升了追焦的灵活性和使用便捷性,改善了用户的拍摄体验。
本申请提供一种对焦方法和对焦装置,能够避免虚焦,提高对焦准确性。
第六方面,提供了一种对焦方法,该方法包括:获取用户选择的对焦位置;根据对焦位置的目标检测结果进行对焦,目标检测结果用于表示对焦位置是否存在目标。
在本申请技术方案中,主要通过检测对焦位置是否存在目标,并根据目标检测结果有针对性的进行对焦,从而能够避免虚焦的出现。也就是说,通过检测用户选择的对焦位置是否有可形成焦点的目标(也就是人、动物、植物或物体,)来采取对应的对焦策略,从而避免虚焦发生。
结合第六方面,在第六方面的某些实现方式中,根据对焦位置的目标检测结果进行对焦,包括:
当对焦位置存在目标时,对目标进行连续对焦,目标为人、动物、植物或物体;或者,
当对焦位置不存在目标时,进行单次对焦。
为了区分两种对焦策略,还可以设置不同的对焦框来区分,这样用户可以通过对焦框的不同来区分用了哪种对焦策略。例如,可以是对焦框的颜色和/或形状不同。颜色可以包括对焦框的线条颜色和底色中至少一项。形状可以包括对焦框的线条粗细和对焦框形状中至少一项。
结合第六方面,在第六方面的某些实现方式中,连续对焦的对焦框的颜色与单次对焦的对焦框的颜色不同,和/或,连续对焦的对焦框的形状与单次对焦的对焦框的形状不同。
结合第六方面,在第六方面的某些实现方式中,连续对焦的对焦框的颜色为黄色;单次对焦的对焦框的颜色为白色。
结合第六方面,在第六方面的某些实现方式中,上述方法还包括:
对对焦位置进行单物体追焦(SOT),得到追焦结果;
当追焦结果为追焦成功时,认定对焦位置存在目标;或者,
当追焦结果为追焦失败时,认定对焦位置不存在目标。
本申请实施例中,追焦成功对应存在目标,追焦失败对应不存在目标。也就是说目标检测结果和SOT追焦结果之间是一一对应的关系。
当追焦成功,说明对焦位置是有可以追焦的目标的,此时如果进行连续对焦对这个目标进行追踪和对焦就能够一直对焦到这个目标上。如果采用传统方案的常规对焦,就会因为目标偏离对焦位置导致虚焦的问题。
当追焦失败,说明对焦位置没有可以追焦的目标,此时按照传统方案就会对焦失败成为虚焦,因为按照传统方案,当系统检测到无法对焦到用户点选的对焦位置的时候,就虚焦了。而本申请实施例的方案则是在这种情况下直接改为单次对焦策略,所以可能避免虚焦。也就是说,传统方案会因为对焦位置没有可对焦目标而无法对焦,导致虚焦。但本申请中的方案在对焦位置没有可对焦目标而无法对焦时,改为单次对焦,因此可以避免虚焦。
结合第六方面,在第六方面的某些实现方式中,对对焦位置进行单物体追焦可以包括:
构造对焦位置的尺度空间向量;
将对焦位置的尺度空间向量与样本库中目标的特征向量进行特征匹配,得到匹配结果;
当匹配结果为匹配成功时,认定追焦结果为追焦成功;或者,
当匹配结果为匹配失败时,认定追焦结果为追焦失败。
这个例子能够基于已有的特征匹配的方案执行。例如基于相机框架层中的cyberfocus单元中的SOT算法执行。
结合第六方面,在第六方面的某些实现方式中,对对焦位置进行单物体追焦可以包括:
构造对焦位置的尺度空间向量;
计算对焦位置的尺度空间向量的特征值;
当特征值在预设范围内时,认定追焦结果为追焦成功;或者,
当特征值不在预设范围内时,认定追焦结果为追焦失败。
基于纹理复杂度越高,越说明对焦位置有可以形成焦点的目标的逻辑,在这个例子中通过为尺度空间向量设置特征值预设范围,当在预设范围内说明尺度空间向量中数值足够复杂,也就说明这个对焦位置的纹理复杂度足够高,也就说明能够追焦成功,也就是存在目标。
在又一个例子中,对对焦位置进行单物体追焦,得到追焦结果的步骤包括:
获取对焦位置的图像特征向量;
利用神经网络模型对图像特征向量进行处理,得到目标检测结果。
该神经网络模型的训练数据集可以包括带有至少一个对焦位置的图像样本,以及每个对焦位置所对应的目标检测结果标签。例如某个图像样本中的某个对焦位置的标签是存在目标,另一个对焦位置的标签是不存在目标等,不存在限定。
结合第六方面,在第六方面的某些实现方式中,当对焦位置存在目标时,对目标进行连续对焦,包括:
将对焦位置在相机坐标系下的位置坐标进行坐标转换,得到对焦位置在SOT坐标系下的位置坐标;
根据述对焦位置在SOT坐标系下的位置坐标,对目标进行连续追踪和对焦。
也就是说,当对焦位置有可以追踪的目标的时候,就可以按照对焦位置所转换出来的SOT坐标系下的坐标位置进行对焦,这样能够使得更加快速准确追踪和对焦到目标上。
结合第六方面,在第六方面的某些实现方式中,当对焦位置不存在目标时,进行单次对焦,包括:根据对焦位置在相机坐标系下的位置坐标,进行单次对焦。也就是说,当对焦位置没有可以追踪的目标的时候,就不需要进行坐标转换了,直接按照对焦位置在相机坐标系下的位置坐标进行对焦就可以,这样能够省去坐标转换的运算,提高处理效率,使得更加快速执行对焦。
结合第六方面,在第六方面的某些实现方式中,当对焦位置不包括目标时,进行单次对焦,包括:在不考虑对焦位置的情况下,对当前拍摄场景进行对焦。也就是说,如果对焦位置已经知道了没有可形成焦点的目标,那就没必要再考虑这个位置,而可以当这个位置不存在重新对整个拍摄场景进行对焦,一方面省去了坐标的确认和下发等处理,另一方面还可以使得焦点能够对到更合适的目标上,例如对焦到拍摄场景中的人或动物上,能够进一步提交对焦准确性。
结合第六方面,在第六方面的某些实现方式中,在获取用户选择的对焦位置之前,上述方法还包括:开启万物追焦功能。也可以理解为是将本申请实施例的方案设置了一个启动接口,只有在开启万物追焦功能的时候才利用上述方法进行对焦,不开启的时候则可以采用原有的传统对焦方案,给用户一个自主选择的余地。
第七方面,提供了一种对焦装置,该装置包括由软件和/或硬件组成的用于执行第六方面的任意一种方法的单元。
第八方面,提供了一种电子设备,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,当处理器执行计算机程序时能够实现第六方面的任意一种方法。
第九方面,提供了一种芯片,包括处理器,该处理器用于读取并执行存储在存储 器中的计算机程序,当计算机程序被处理器执行时能够实现第六方面的任意一种方法。
可选地,该芯片还包括存储器,存储器与处理器电连接。
可选地,该芯片还可以包括通信接口。
第十方面,提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,当计算机程序被处理器执行时能够实现第六方面的任意一种方法。
第十一方面,提供了一种计算机程序产品,该计算机程序产品包括计算机程序,当计算机程序被处理器执行时能够实现第六方面的任意一种方法。
本申请提供了一种拍摄方法和电子设备,能够实现智能追焦,有助于提升用户的拍摄体验。
第十二方面,提供了一种图像处理方法,方法应用于电子设备,方法包括:在相机应用中显示相机应用的第一界面(“主角追焦”功能的设置界面),其中第一界面包括第一控件(“主角追焦”功能的开启控件);响应于用户对第一控件的操作,获取与图库应用中N个人脸一一对应的N个注册人脸特征,N为大于0的整数;在操作第一控件之后,显示相机应用的第二界面(拍照预览界面),第二界面包括摄像头采集到的第一图像帧,当拍摄第一对象时,第一图像帧中包括第一对象;此后,需要判断第一对象的人脸特征是否与N个注册人脸特征中的一个匹配;当第一对象的人脸特征与N个注册人脸特征中的一个匹配时,在第一对象上显示第一追焦框(可以为高亮双框),并开始对第一对象自动追焦。采取第一追焦框效果的示例包括改变相关名称的尺寸、形状、颜色、对比度和/或其他视觉特征。
当第一对象的人脸特征与N个注册人脸特征均不匹配时,在第一对象上显示第一选择框(可以为白色单框),第一追焦框与第一选择框不同;在第一对象与与N个注册人脸特征均不匹配时,如果用户希望手动将第一对象设置为追焦对象,可以点击第一选择框。响应于用户对第一选择框输入的第二操作,对第一对象追焦,对第一对象追焦并在第一对象上显示第二追焦框(可以为白色单框),第二追焦框与第一追焦框不同。从而实现自动优先追焦,并将优先对焦主体区别显示。
在一种可能的实现方式中,在获取与图库应用中N个人脸一一对应的N个注册人脸特征之前,需要判断图库应用中是否存在聚类人脸。其中,聚类人脸是通过人脸特征提取、聚类算法对人脸特征数据的聚类后生成的,并且人脸特征数据存储在图库应用中。确定图库应用中存在聚类人脸之后,获取图库应用中前N个聚类人脸特征作为N个注册人脸特征。由此,可以获取用户经常拍摄的人脸作为优先对焦的主体。
在一种可能的实现方式中,为了确定图库应用中存在聚类人脸,需要相机应用先执行第一查询操作,第一查询操作用于查询聚类人脸的存储状态。当图库应用存储有聚类人脸,会向数据库写入标记1;当图库应用不存在人脸特征数据时,图库应用向数据库写入标记2。因此相机应用可以根据查询数据库获得的标记判断图库应用中是否有聚类人脸,当相机应用获取第一标记,确定存储有聚类人脸。由此,可以避免相机需要频繁的在图库应用中查找人脸,降低了功耗。
在一种可能的实现方式中,为了获取与图库应用中N个人脸一一对应的N个注册人脸特征,还需要图库应用查询第一拍摄模式(“主角追焦”拍摄模式)的开启状态。在数据库中存在标记,数据库初始存储的“主角追焦”模式状态标识为OFF代表“主 角追焦”模式关闭,ON代表“主角追焦”模式开启。因此,当图库应用获取到第二标记(ON标记)时,确定第一拍摄模式开启。由此,只有当开启了“主角追焦”拍摄模式才会进行主角追焦,避免的使用功耗的提高。
在一种可能的实现方式中,在判断第一对象的人脸特征是否与N个注册人脸特征中的一个匹配之前,需要将第一图像(拍照预览界面回调获得)发送给目标识别算法识别其中的主体的人脸特征,分别识别对图像中的不同对象的人脸特征,例如识别第一对象的第一人脸特征。由此,可以自动获取拍摄预览图像中的主体信息。
在一种可能的实现方式中,当第一人脸特征与N个注册人脸特征中的一个匹配时,首先自动对焦算法将第一对象设置为第一图像的焦点并进行对焦,接着获取下一帧图像(第二图像),将第一对象设置为第二图像的焦点并进行对焦。不仅要使用自动对焦算法对第一对象对焦,而且要根据第一人脸特征在第一对象上绘制第一追焦框。从而实现自动优先对焦,并将优先对焦主体区别显示于其他主体。
在一种可能的实现方式中,第一图像帧中还包括其他匹配注册人脸特征的第二对象时;当第二对象的人脸特征与N个注册人脸特征中的一个匹配时,比较第一对象和第二对象在第二界面中占用面积;当第一对象在第二界面中占用面积大于第二对象在第二界面中占用面积时;认为第二对象是注册人脸但是不是最优先追焦的对象,在第二对象上显示第二追焦框,并将第二追焦框显示为与第一追焦框不同。由此可以实现自动优先对焦优先级最高的注册人脸同时,区别标示出其他注册人脸以供用户选择。
在一种可能的实现方式中,第一图像帧中还包括第三对象时;当第三对象的人脸特征与N个注册人脸特征都不匹配时,在第三对象上显示第四追焦框。由此可以实现自动优先对焦优先级最高的注册人脸同时,区别标示出其他非册人脸或主体供用户选择。
在一种可能的实现方式中,当第一对象发生运动使得第二图像帧中不包括第一对象时,停止对第一对象追焦。由此可以实现自动优先对焦优先级最高的注册人脸后停止对焦。
第十三方面,提供了一种电子设备,包括用于执行第十二方面中任一种方法的单元。该电子设备可以是终端,也可以是终端内的芯片。该电子设备包括输入单元、显示单元和处理单元。
当该电子设备是终端时,该处理单元可以是处理器,该输入单元可以是通信接口,该显示单元可以是图形处理模块和屏幕;该终端还可以包括存储器,该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该终端执行第十二方面中的任一种方法。
当该电子设备是终端内的芯片时,该处理单元可以是芯片内部的逻辑处理单元,该输入单元可以是输入接口、管脚或电路等,该显示单元可以是芯片内部的图形处理单元;该芯片还可以包括存储器,该存储器可以是该芯片内的存储器(例如,寄存器、缓存等),也可以是位于该芯片外部的存储器(例如,只读存储器、随机存取存储器等);该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该芯片执行第十二方面的任一种方法。
第十四方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有 计算机程序代码,当所述计算机程序代码被电子设备运行时,使得该电子设备执行第十二方面中的任一种方法。
第十五方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码被电子设备运行时,使得该电子设备执行第十二方面中的任一种方法。
第十六方面,提供了一种芯片,芯片包括处理器,当处理器执行指令时,处理器执行第十二方面中的任一种方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例提供的追焦方法的流程示意图;
图2是本申请一实施例提供的一种终端设备的主界面的示意图;
图3是本申请一实施例提供的一种终端设备的相机预览界面的示意图;
图4是本申请一实施例提供的另一种终端设备的相机预览界面的示意图;
图5是本申请一实施例提供的一种终端设备的录制界面的示意图;
图6-图10是本申请一实施例提供的一组终端设备的相机预览界面的示意图;
图11是本申请另一实施例提供的追焦方法的流程示意图;
图12-图14是本申请一实施例提供的另一组终端设备的相机预览界面的示意图;
图15是本申请一实施例提供的追焦方法的软件架构图;
图16是本申请一实施例提供的追焦方法的时序图;
图17是本申请实施例提供的追焦装置的结构示意图;
图18是本申请实施例提供的终端设备的结构示意图;
图19是本申请实施例的一种适用的对焦场景的示意图;
图20是不同对焦方案的拍摄结果的比较图;
图21是本申请实施例的另一种适用的对焦场景的示意图;
图22是本申请实施例的一种对焦方法的示意性流程图;
图23是本申请实施例的一种相机功能的逻辑架构的示意图;
图24是本申请实施例的对焦方法的执行过程的示意图;
图25是本申请实施例的对焦方法的一种执行过程的示意图;
图26是本申请实施例的对焦方法的另一种执行过程的示意图;
图27是本申请实施例的一种对焦装置的示意图;
图28是本申请实施例的一种电子设备的硬件结构示意图;
图29是本申请实施例的另一种电子设备的硬件结构示意图;
图30为本申请实施例提供的一种界面示意图;
图31为本申请实施例提供的电子设备的硬件结构图;
图32为本申请实施例提供的电子设备的软件架构图;
图33为本申请实施例提供的界面示意图;
图34为本申请实施例提供的一种模块交互示意图;
图35为本申请实施例提供的一种界面示意图;
图36为本申请实施例提供的一种界面示意图;
图37为本申请实施例提供的一种模块交互示意图;
图38为本申请实施例提供的一种界面示意图;
图39为本申请实施例提供的一种界面示意图;
图40为本申请实施例提供的一种模块交互示意图;
图41为本申请实施例提供的一种界面示意图;
图42为本申请实施例提供的一种界面示意图;
图43为本申请实施例提供的一种界面示意图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
下面参考附图对本申请提供的追焦方法、装置、终端设备、存储介质及计算机程序进行详细描述。
图1示出了本申请实施例提供的一种追焦方法的流程示意图。
步骤101,响应于用户的第一操作,显示相机预览界面。
需要说明的是,本申请实施例的追焦方法可以由本申请实施例的追焦装置执行。 本申请实施例的追焦装置可以配置在任意终端设备中,以执行本申请实施例的追焦方法。比如,本申请实施例的追焦装置可以配置在手机、电脑、可穿戴式设备等终端设备中,以实现用户在拍摄过程中的自动追焦功能。
其中,第一操作,可以是用户在终端设备中输入的、任意可以触发打开相机预览界面的操作。比如,第一操作可以为触发终端设备中主界面中的相机应用图标、在相机运行界面触发快门控件、在相机录像过程中触发结束录制控件、在相机录像过程中触发暂停录制控件,等等。
作为一种可能的实现方式,如图2所示,终端设备的主界面200显示了一个放置有应用图标的页面,该页面可包括多个应用图标(例如,天气应用图标、日历应用图标、相册应用图标、便签应用图标、电子邮件应用图标、应用商店应用图标、设置应用图标等等)。上述多个应用图标下方还可显示有页面指示符,以表明当前显示的页面与其他页面的位置关系。页面指示符的下方有多个应用图标(例如,相机应用图标201、浏览器应用图标、信息应用图标、拨号应用图标)。这些应用图标在页面切换时保持显示。可理解,相机应用图标201为相机应用程序(即相机应用)的图标。相机应用图标201可以用于触发启动相机应用程序。
终端设备可以检测到作用于相机应用图标201的触发操作,响应于该触发操作,电子设备可以显示如图3所示的相机预览界面300。相机预览界面300为相机应用程序的默认拍照模式的拍摄界面,用户可以在该界面上预览图像并完成拍照。
如图3所示,相机预览界面300可包括预览窗301、相机模式选项302、相册快捷控件303、快门控件304和摄像头翻转控件。
预览窗301可用于显示预览图像。预览窗301显示的预览图像为终端设备的摄像头基于取景范围采集的原始图像。
相机模式选项302中可以显示有一个或多个拍摄模式选项。这一个或多个拍摄模式选项可以包括:夜景模式选项、智能人像模式选项、拍照模式选项、录像模式选项3021和更多选项。可理解,相机模式选项302中还可以包含更多或更少的拍摄模式选项。
相册快捷控件303可用于开启相册应用程序。用户通过相册快捷控件303触发电子设备开启相册应用程序后,可以查看拍摄所得的图像和视频。另外,相册快捷控件303上还可以显示有拍摄所得的图像或视频的缩略图。
作为一种可能的实现方式,快门控件304可以用于触发摄像头采集图像,完成拍照操作。终端设备可以在获取到用户对快门控件304的触发操作,并完成拍照后自动返回并显示相机预览界面300。
作为一种可能的实现方式,触发录像模式选项3021可以进入录像模式,并显示如图4所示的相机预览界面400(录像预览界面),相机预览界面400所包括的控件与相机预览界面300所包括的控件大致相同,不同的是,相机预览界面400还可以包括录像开始控件401。其中,录像开始控件402用于触发电子设备开始录像。终端设备可以在获取到用户对录像开始控件401的触发操作后,显示如图5所示的录制界面50。其中,录制界面50中包括结束录制控件51与暂停录制控件52,结束录制控件可以用于结束录制,暂停录制控件52可以用于暂停录制。终端设备可以在获取到用户对结束 录制控件51的触发操作后,结束录制并显示如图4所示的相机预览界面400;还可以在获取到用户对暂停录制控件52的触发操作后,中止录制并显示相机预览界面。
可以理解的是,本申请实施例中所提及的触发操作可以包括但不限于触摸(例如,点击等)、声控、手势等操作,本申请对此不作限制。
需要说明的是,上述列举的第一操作的类型以及触发显示相机预览界面的方式仅为示例性的,不能视为对本申请的限制。实际使用时,触发显示相机预览界面的第一操作的类型可以与终端设备及相机应用的功能有关,本申请实施例对此不做限定。
步骤102,对相机预览界面中显示的各个对象进行识别处理,以确定各个对象的对象类型。
其中,对象类型,可以包括图库中排序处于前N的人像、非图库中排序处于前N的人像、预设类型的非人脸对象,其中,N为大于或等于1的正整数。
需要说明的是,终端设备中的图库应用可以根据图库数据库中存储的用户已经采集的图像进行聚类处理,以根据各个图像中包含的对象对用户已经采集的图像进行分类,从而生成各个已采集的对象分别对应的个人相册,并根据个人相册中包含的图像数量、个人相册是否已命名等参数对各个个人相册进行排序,进而可以将图库中排序处于前N的个人相册对应的人像,确定为图库中处于前N的人像,并将图库中处于前N的人像的人脸特征下发至相机应用,以使相机应用在预览阶段根据下发的人脸特征,判断预览界面中的对象是否为图库中处于前N的人像。在本申请实施例中,以下将图库中排序处于前N的人像称作主角人像,即本申请中提及的图库中排序处于前N的人像与主角人像为同一类型的人像。其中,实际使用时,可以根据实际需要及具体的应用场景确定N的具体取值,本申请实施例对此不做限定。比如,N可以为5。
可以理解的是,由于图库中排序靠前的人像通常是在用户的图库中出现频率较高的人像,或者是用户进行命名的人像,因此图库中排序处于前N的人像通常可以认为是用户关注度高的对象。
需要说明的是,非图库中排序处于前N的人像,可以为图库中包含但是排序未处于前N的人像,也可以是图库中未包含的人像。在本申请实施例中,以下将非图库中排序处于前N的人像称作普通人像,即本申请中提及的非图库中排序处于前N的人像与普通人像为同一类型的人像。
需要说明的是,预设类型的非人脸对象,可以是除人脸图像之外的任意类型的实体对象。比如,预设类型的非人脸对象可以包括猫狗等宠物、车辆等,本申请实施例对此不做限定。实际使用时,预设类型的非人脸对象包括的类型可以根据用户的实际需要设定,本申请实施例对此不做限定。比如,预设类型的非人脸对象可以为猫狗。
在本申请实施例中,打开相机应用并显示相机预览界面之后,相机可以按照一定的帧率对取景范围进行图像采集,并将采集的图像帧存储在帧缓存中,因此,在显示相机预览界面之后,可以从帧缓存中逐帧获取相机已经采集的预览帧,并利用语义引擎中的万物追焦算法及人脸特征算法,对每帧预览帧中的对象进行识别处理,以确定每帧预览帧中的每个对象的对象类型。
步骤103,根据各个对象的对象类型,确定各个对象的追焦框类型。
在本申请实施例中,可以在相机预览界面中显示各个对象的追焦框,以使对相机 预览界面中各个对象进行追焦的过程对用户可见。并且,对于不同类型的对象,可以分别采用不同类型的追焦框进行追焦,以使用户可以根据各个对象对应的追焦框获知各个对象的类型,进而或者相机预览界面中的各个对象是否为自己关注的对象,以使用户可以根据自身的拍摄需求调整拍摄策略。
作为一种可能的实现方式,可以预先设定对象类型与追焦框类型的对应关系,在确定出相机预览界面中各个对象的对象类型之后,可以根据预设的对象类型与追焦框类型的对应关系,将与各个对象的对象类型对应的追焦框类型,分别确定为各个对象的追焦框类型。
作为一种示例,在对象类型中包括图库中排序处于前N的人像(主角人像)、非图库中排序处于前N的人像(普通人像)、预设类型的非人脸对象时,图库中排序处于前N的人像的追焦框类型可以为第一追焦框类型或第二追焦框类型,非图库中排序处于前N的人像的追焦框类型及预设类型的非人脸对象的追焦框类型可以为第三追焦框类型,其中,第一追焦框类型、第二追焦框类型及第三追焦框类型均不相同。
举例来说,主角人像的追焦框类型可以为双层黄框或双层白框,即第一追焦框类型可以为双层黄框,第二追焦框类型可以为双层白框;普通人像与预设类型的非人脸对象的追焦框类型可以为单层白框,即第三追焦框类型可以为单层白框。
步骤104,根据各个对象的对象类型及预设的优先级策略,确定各个对象的第一追焦优先级。
其中,预设的优先级策略,可以是根据用户对各个对象类型的关注程度设定的。
在本申请实施例中,在相机预览界面中出现多个对象时,如在合照场景下,用户对相机预览界面中各个对象的关注程度可能是不同的,用户通常更加希望自己关注程度高的对象的拍摄效果更好,因此,在申请实施例中,可以根据用户对各个对象类型的关注程度,预先设定优先级策略,即在预设的优先级策略中,用户关注程度越高的对象类型,对应的第一追焦优先级越高,以在拍摄过程中对用户当前关注程度最高的对象进行追焦处理,进而实现用户关注程度最高的对象拍摄最清晰的目的。
作为一种示例,在对象类型包含图库中排序处于前N的人像(主角人像)、非图库中排序处于前N的人像(普通人像)、预设类型的非人脸对象时,预设的优先级策略可以为:图库中排序处于前N的人像(主角人像)的第一追焦优先级高于非图库中排序处于前N的人像(普通人像)的第一追焦优先级,非图库中排序处于前N的人像(普通人像)的第一追焦优先级高于预设类型的非人脸对象的第一对焦优先级。
需要说明的是,由于主角人像为图库应用中出现频率较高或用户已经进行自主命名的人像,因此可以确定主角人像为用户关注程度最高的人像,因此可以将主角人像的第一对焦优先级设定为最高,以在相机预览界面中存在主角人像时,优先追焦主角人像;除主角人像外,在进行拍摄时,与其他类型的实体对象相比,用户通常对人脸对象的关注程度更高,因此可以将普通人像的第一对焦优先级设定为低于主角人像,且高于预设类型的非人脸对象,以在相机预览界面中未包含主角人像时,优先对普通人脸进行追焦;由于预设类型的非人脸对象为根据用户的使用需求设定的除人脸对象外用户关注程度较高的对象类型,因此可以将预设类型的非人脸对象的第一对焦优先级设定为低于普通人脸的第一对焦优先级,以在相机预览界面中不存在主角人脸与普 通人脸时,优先对预设类型的非人脸对象进行追焦。
作为一种可能的实现方式,在确定相机预览界面中各个对象的第一追焦优先级时,若相机预览界面中同时存在主角人像、普通人像及预设类型的非人脸对象,则可以将主角人像的第一追焦优先级确定为最高优先级、将普通人像的第一追焦优先级确定为次高优先级,以及将预设类型的非人脸对象的第一追焦优先级确定为最低优先级;若相机预览界面中未存在主角人像,且同时存在普通人像及预设类型的非人脸对象,则可以将普通人像的第一追焦优先级确定为最高优先级,以及将预设类型的非人脸对象的第一追焦优先级确定为次高优先级;若相机预览界面中未存在普通人像,且同时存在主角人像与预设类型的非人脸对象,则可以将主角人像的第一追焦优先级确定为最高优先级,以及将预设类型的非人脸对象的第一追焦优先级确定为次高优先级;若相机预览界面中仅存在主角人脸、普通人像及预设类型对象中的任意一种,则可以直接将相机预览界面中存在的该类型对象的第一对焦优先级确定为最高优先级。
步骤105,根据各个对象的追焦框类型,生成各个对象对应的追焦框,并根据各个对象的坐标,在相机预览界面中显示各个对象对应的追焦框。
在本申请实施例中,确定除相机预览界面中各个对象的追焦框类型之后,可以根据将各个对象的坐标及追焦框类型发送至相机应用中的万物追焦插件,以使万物追焦插件根据各个对象的追焦框类型绘制相应类型的追焦框,并根据各个对象的坐标将绘制完成的追焦框对应显示在相机预览界面中,以在相机预览界面中使得各个对象对应的追焦框跟随相应对象的实时位置显示。
需要说明的是,对象的坐标中可以包括对象的中心点坐标,以及对象在相机预览界面中对应的区域尺寸(高度、宽度),其中,对于人脸对象,对象的中心点坐标可以是对象的头部区域的中心点坐标,在相机预览界面中对应的区域尺寸可以是对象的头部区域对应的尺寸。在绘制追焦框时,可以将对象的在相机预览界面中对的区域尺寸作为相应追焦框的尺寸绘制追焦框,并且在显示追焦框时,可以将对象的中心点坐标作为相应追焦框的中心点坐标显示追焦框,以使追焦框的显示位置与相应对象的显示位置一致。
举例来说,假设主角人像对应的第一追焦框类型为双层黄框、第二追焦框类型为双层白框,普通人像及预设类型的非人脸对象对应的第三追焦框类型为单层白框,如图6所示,在相机预览界面600中仅存在预设类型的非人脸对象(猫)601时,可以在猫对应的显示区域绘制并显示单层白框602;如图7所示,相机预览界面700中同时存在预设类型的非人脸对象(猫)701,以及普通人像702、703、704时,可以在猫对应的显示区域绘制并显示单层白框7011,以及可以在普通人像702、703、704对应的头部区域分别显示单层白框7021、7031、7041;在相机预览界面中存在主角人像时,可以在主角人像的头部区域显示双层黄框或双层白框。
作为一种可能的实现方式,第一追焦框类型的追焦框可以用于表示被锁定追焦的主角人像,因此相机预览界面中包括多个主角人像时,可以将其中一个主角人像的追焦框确定为第一追焦框类型,并将其余各个主角人像的追焦框确定为第二追焦框类型。即在本申请实施例一种可能的实现方式中,上述步骤105,可以包括:
在对象中包含对象类型为所述图库中排序处于前N的人像(主角人像)的一个第 一对象时,根据第二追焦框类型,生成第一对象对应的第一追焦框,并根据第一对象的坐标,在相机预览界面中显示所述第一对象对应的第一追焦框;
在对象中包含对象类型为图库中排序处于前N的人像(主角人像)的一个第一对象及至少一个第二对象时,根据第一追焦框类型,生成第一对象对应的第一追焦框,以及根据第二追焦框类型,生成各个第二对象对应的第二追焦框,并根据第一对象及各个第二对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框及各个第二对象对应的第二追焦框,其中,第一对象的尺寸大于各个第二对象的尺寸。
在本申请实施例中,若相机预览界面中仅包含一个为主角人像的第一对象,则可以直接将该第一人像的追焦框类型确定为第一追焦框类型,并在该第一对象的头部区域绘制并显示第一追焦框类型的第一追焦框;若相机预览界面中包含多个主角人像,则可以根据各个主角对象的尺寸,将尺寸最大的主角人像确定为第一对象,并将其他主角人像确定为第二对象,之后将第一对象的追焦框类型确定为第一追焦框类型,以及将第二对象的追焦框类型确定为第二追焦框类型,进而在第一对象的头部区域绘制并显示第一追焦框类型的第一追焦框,以及在第二对象的头部区域绘制并显示第二追焦框类型的第二追焦框。
举例来说,假设主角人像对应的第一追焦框类型为双层黄框、第二追焦框类型为双层白框,如图8所示,在相机预览界面800中包含普通人像801、802及一个主角人像803,则可以将主角人像803确定为第一对象,并在主角人像803的头部区域绘制并显示双层黄框8031,以及在普通人像801、802的头部区域分别绘制并显示单层白框8011、8021。
如图9所示,在相机预览界面900中包含普通人像901、902及主角人像903、904,并且主角人像904的尺寸大于主角人像903的尺寸,则可以将主角人像904确定为第一对象,以及将主角人像903确定为第二对象,并在主角人像904的头部区域绘制并显示双层黄框9041、在主角人像903的头部区域绘制并显示双层白框9031、在普通人像901、902的头部区域分别绘制并显示单层白框9011、9021。
进一步的,如果在预览过程中,多个主角人像由于位置变换导致各个主角人像的尺寸发生变化,则可以根据各个主角人像的尺寸变化重新绘制各个主角人像的追焦框,以进一步提升追焦的准确性和灵活性。即在本申请实施例一种可能的实现方式中,上述根据第一追焦框类型,生成第一对象对应的第一追焦框,以及根据第二追焦框类型,生成各个第二对象对应的第二追焦框,并根据第一对象及各个第二对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框及各个第二对象对应的第二追焦框之后,还可以包括:
若确定任一第二对象的尺寸大于第一对象的尺寸,则将任一第二对象确定为新的第一对象,以及将第一对象确定为新的第二对象,并将新的第一对象对应的追焦框由第二追焦框更改为第一追焦框,以及将新的第二对象对应的追焦框由第一追焦框更改为第二追焦框。
在本申请实施例,在相机预览界面中包含多个主角人像时,可以根据各个主角人像的位置变化,实时切换各个主角人像的追焦框类型。在预览过程中,如果由于主角人像的位置变化,导致任一第二对象的尺寸大于第一对象的尺寸,则可以将该第二对 象确定为新的第一对象,并将新的第一对象的追焦框由第二追焦框更改为第一追焦框,并将第一对象确定为新的第二对象,并将新的第二对象的追焦框由第一追焦框更改第二追焦框。
举例来说,如图9所示,如果主角人像903移动至主角人像904前方,从而导致主角人像903的尺寸大于主角人像904的尺寸,比如,主角人像903与主角人像904的位置关系变为图10中主角人像1003(与主角人像103为同一对象)与主角人像1004(与主角人像904为同一人像)的位置关系时,由于主角人像1003的尺寸大于主角人像1004的尺寸,则可以将主角人像1003的追焦框由双层白框9031切换为双层黄框10031,以及将主角人像1004的追焦框由双层黄框9041切换为双层白框10041。
作为一种可能的实现方式,在相机预览界面中无交互的情况下,各个主角人像对应的追焦框可以持续显示。
进一步的,在相机预览界面中无交互时,普通人像及猫狗等预设类型的非人脸对象的追焦框,可以在显示一段时间后自动停止显示。即在本申请实施例一种可能的实现方式中,上述步骤105之后,还可以包括:
在对象的对象类型为非图库中排序处于前N的人像(普通人像)或预设类型的非人脸对象时,确定对象对应的追焦框的显示时长;
在对象对应的追焦框的显示时长达到时长阈值时,停止显示对象对应的追焦框。
作为一种可能的实现方式,在相机预览过程中无交互的情况下,对于普通人像与预设类型的非人脸对象,可以在这些对象对应的追焦框在相机预览界面的显示时长达到时长阈值时,停止在相机预览界面中继续显示这些对象对应的追焦框。也就是说,仅在相机预览界面中短时间显示普通人像与预设类型的非人脸对象对应的追焦框,以防止相机预览界面中的对象较多时,长时间显示太多的追焦框,导致相机预览界面的显示杂乱,影响用户拍摄时的视觉体验。
需要说明的是,实际使用时,可以根据实际需要及具体的应用场景设定时间阈值的具体取值,本申请实施例对此不做限定。比如,时间阈值可以为3秒、5秒、10秒,等等。
步骤106,根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
在本申请实施例中,确定出各个对象的第一追焦优先级之后,可以将第一追焦优先级最高的对象确定为目标追焦对象,以在预览过程中以及用户触发拍摄后对目标追焦对象进行追焦处理。需要说明的是,在第一追焦优先级最高的对象的有多个时,可以将任一第一追焦优先级最高的对象确定为目标追焦对象,也可以按照预设的规则从第一追焦优先级最高的各个对象中选取符合预设规则的对象,作为目标追焦对象,本申请实施例对此不做限定。
作为一种可能的实现方式,在确定出目标追焦对象之后,可以根据目标追焦对象的坐标生成自动对焦感兴趣区域命令,并将自动对焦感兴趣区域命令发送至自动对焦算法,以通过自动对焦算法对目标追焦对象进行追焦处理。
需要说明的是,在对象类型包括图库中排序处于前N的人像(主角人像)、非图库中排序处于前N的人像(普通人像)、预设类型的非人脸对象时,若最终确定的目 标追焦对象为主角人像,则可以将目标追焦对象的追焦框类型确定为第一追焦框类型(如双层黄框),并在相机预览界面中无交互时,在相机预览界面中持续显示目标追焦对象对应的第一追焦框(双层黄框);若最终确定的目标追焦对象为普通人像或者预设类型的非人脸对象,则目标追焦对象的追焦框显示策略与前述步骤相同,即确定目标追焦对象的追焦框类型为第三追焦框类型(如单层白框),并且在相机预览界面无交互的情况下,在目标追焦对象的追焦框的显示时长达到时间阈值后小时,也就是说对普通人脸及预设类型的非人脸对象进行自动追焦的过程可以不显性展示给用户。
进一步的,在对象类型包括图库中排序处于前N的人像(主角人像)、非图库中排序处于前N的人像(普通人像)、预设类型的非人脸对象时,可以通过以下方式确定目标追焦对象:
判断对象中是否包含对象类型为图库中排序处于前N的人像(主角人像)的第一对象;
若对象中包含至少一个第一对象,则将第一对象确定为第一优先级最高的对象,并将任一第一对象确定为目标追焦对象;
若对象中未包含第一对象,则判断对象中是否包含对象类型为非图库中排序处于前N的人像的第二对象;
若对象中包含至少一个第二对象,则将第二对象确定为第一优先级最高的对象,并将任一第二对象确定为所述目标追焦对象;
若对象中未包含第二对象,则判断对象中是否包含对象类型为预设类型的非人脸对象的第三对象;
若对象中包含至少一个第三对象,则将第三对象确定为第一优先级最高的对象,并将任一第三对象确定为目标追焦对象;
若对象中未包含第三对象,则在预览界面中进行中心对焦处理。
作为一种可能的实现方式,在相机预览界面中包含主角人像时,可以从主角人像中选取任一对象作为目标追焦对象;在相机预览界面中未包含主角人像、且包含普通人像时,则优先从普通人像中选取任一对象作为目标追焦对象;在相机预览界面中仅包含预设类型的非人脸对象时,则可以从预设类型的非人脸对象中选取任一对象作为目标追焦对象。
进一步的,对于对象类型相同的各个对象,其第一追焦优先级也可能是相同的,因此在第一追焦优先级最高的对象有多个时,可以对第一追焦优先级最高的各个对象的追焦优先级进行二次排序,以保证自动追焦的对象为用户当前最关注的对象,进一步提升自动追焦的精准性。即在本申请实施例一种可能的实现方式中,上述步骤106,可以包括:
确定第一追焦优先级最高的各个对象的第二追焦优先级;
将第二追焦优先级最高的对象,确定为目标追焦对象。
在本申请实施例中,在存在多个第一追焦优先级最高的对象时,可以进一步确定第一追焦优先级最高的各个对象的第二追焦优先级,并将第二追焦优先级最高的对象,确定为目标追焦对象,以使目标追焦对象为用户当前最关注的对象,进而提升自动追焦的精准性。
作为一种可能的实现方式,可以通过如下方式确定各个对象的第二追焦优先级:
获取第一追焦优先级最高的各个对象的预设优先级;
将各个对象的预设优先级,确定为各个对象的第二追焦优先级;
或者,
确定第一追焦优先级最高的各个对象的尺寸;
根据各个对象的尺寸,确定各个对象的第二追焦优先级。
作为一种示例,在对象类型包括图库中排序处于前N的人像(主角人像)、非图库中排序处于前N的人像(普通人像)、预设类型的非人脸对象时,由于主角人像是图库应用根据用户已采集的图像确定的、图库中的高频图像,因此图库应用在确定出主角人像之后,还可以根据主角人像在图库中对应的图像数量,确定各个主角人像的预设优先级,即主角人像对应的图像数量越多,该主角人像的预设优先级越高,之后将各个主角人像及各个主角人像的预设优先级同时下发至相机应用。因此,在确定第一追焦优先级最高的对象为主角人像且主角人像为多个时,可以获取各个主角人像的预设优先级作为各个主角人像的第二追焦优先级,进而将第二追焦优先级最高的主角人像确定为目标追焦对象。
或者,在第一追焦优先级最高的对象为主角人像时,也可以根据主角人像的尺寸确定各个主角人像的第二追焦优先级,即主角人像的尺寸越大,则该主角人像的第二追焦优先级越高,进而可以将第二追焦优先级最高的主角人像确定为目标追焦对象。即将尺寸最大的主角人像确定为目标追焦对象。
需要说明的是,在第一追焦优先级最高的对象为主角人像且主角人像为多个时,可以根据实际需要及具体的应用场景选择上述方式中的任意一种确定主角人像的第二追焦优先级,本申请实施例对此不做限定。
作为一种示例,在对象类型包括图库中排序处于前N的人像(主角人像)、非图库中排序处于前N的人像(普通人像)、预设类型的非人脸对象时,由于普通人像和预设类型的非人脸对象都是随机出现的,无法预设其对应的优先级,因此,如果第一追焦优先级最高的对象为普通人像或预设类型的非人脸对象、且有多个,可以根据第一追焦优先级最高的各个对象的尺寸,确定各个对象的第二追焦优先级,并将第二追焦优先级最高(即尺寸最大的对象)确定为目标追焦对象。
本申请实施例提供的追焦方法,通过在预览过程中,根据相机预览界面中各个对象的对象类型选取出当前拍摄场景中用户最关注的对象,作为最高优先级的追焦对象,以对用户当前最关注的对象进行追焦,并且对于不同类型的对象采用不同的追焦框进行显示,从而不仅可以根据实时的拍摄场景自适应调整追焦对象,提升了用户最关注的对象的拍摄效果,而且无需用户手动操作,提升了追焦的灵活性和使用便捷性,改善了用户的拍摄体验。
在本申请一种可能的实现形式中,还可以允许用户根据自身的拍摄需求,手动选择相应的对象进行追焦,以进一步提升自动追焦的灵活性和可交互性,进一步提升用户的拍摄体验。
下面结合图11,对本申请实施例提供的追焦方法进行进一步说明。
图11示出了本申请实施例提供的另一种追焦方法的流程示意图。
如图11所示,该追焦方法,包括以下步骤:
步骤1101,响应于用户的第一操作,显示相机预览界面。
步骤1102,对相机预览界面中显示的各个对象进行识别处理,以确定各个对象的对象类型。
步骤1103,根据各个对象的对象类型,确定各个对象的追焦框类型。
步骤1104,根据各个对象的对象类型及预设的优先级策略,确定各个对象的第一追焦优先级。
其中,预设的优先级策略是根据用户对各个对象类型的关注程度设定的。
步骤1105,根据各个对象的追焦框类型,生成各个对象对应的追焦框,并根据各个对象的坐标,在相机预览界面中显示各个对象对应的追焦框。
步骤1106,根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
上述步骤1101-1106的具体实现过程及原理,可以参照上述实施例的详细描述,此处不再赘述。
步骤1107,响应于用户对任一对象的点击操作,将任一对象确定为指定追焦对象。
在本申请实施例中,在预览过程中,不仅可以根据相机预览界面中各个对象的对象类型、追焦优先级等参数,自动选取出用户关注程度最高的对象作为目标追焦对象,并在后续用户无交互的情况下,在后续的预览过程及拍摄过程中持续对目标追焦对象进行追焦处理,还可以允许用户根据当前的实际拍摄需求,在相机预览界面中选取任一对象作为指定追焦对象,并在后续用户没有进一步的交互操作的前提下,在预览及后续的拍摄过程中持续对用户选择的指定追焦对象进行追焦处理。
步骤1108,若指定追焦对象为目标追焦对象,则持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作。
在本申请实施例中,由于目标追焦对象为根据相机预览界面中各个对象的追焦优先级确定出的自动追焦对象,因此,在用户对相机预览界面中的任一对象进行点击之前,就已经对目标追焦对象进行追焦处理,从而,若用户选择的指定追焦对象为目标追焦对象,则可以继续对该指定追焦对象(即之前的目标追焦对象)进行追焦处理,直至用户选择了其他对象作为指定追焦对象,则停止对目标追焦对象的追焦,并对用户新选择的指定追焦对象进行追焦处理。
步骤1109,若指定追焦对象不为目标追焦对象,则暂停对目标追焦对象进行追焦处理,并持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作。
在本申请实施例中,由于在用户手动选择指定追焦对象之前,就已经对自动选取出的目标追焦对象进行追焦处理,因此若用户选择的指定追焦对象补上目标追焦对象,则可以暂停对目标追焦对象进行追焦处理,并切换为持续对指定追焦对象进行追焦处理,直至用户选择了其他对象作为指定追焦对象,则切换为对用户选择的新的指定追焦对象进行追焦处理。
进一步的,由于用户点击选择指定追焦对象之后,可以确定当前已锁定追焦对象为指定追焦对象,因此可以仅显示指定追焦对象的追焦框,以使相机显示界面更加简洁,同时降低显示过多追焦框对用户拍摄体验的影响。即在本申请实施例一种可能的 实现方式中,上述步骤1107之后,还可以包括:
若指定追焦对象为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像(主角人像),则保持指定追焦对象的追焦框类型不变,以及持续显示指定追焦对象的追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
若指定追焦对象不为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像(主角人像),则将指定追焦对象的追焦框类型更改为第一追焦框类型,以及根据第一追焦框类型生成并持续显示指定追焦对象对应的第一追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
若指定追焦对象的对象类型不为图库中排序处于前N的人像(主角人像),则将指定追焦对象的追焦框类型更改为第四追焦框类型,以及根据第四追焦框类型生成并持续显示指定追焦对象对应的第四追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框。
在本申请实施例中,根据前述实施例的描述可知,在对象类型包括主角人像、普通人像、预设类型的非人脸对象时,若确定的目标追焦对象为主角人像,则目标追焦对象的追焦框类型可以为第一追焦框类型(如双层黄框),以通过第一追焦框类型表示当前在对目标追焦对象进行追焦处理,以将当前追焦的主角人像显性显示给用户。因此,在用户选择的指定追焦对象为目标追焦对象且目标追焦对象为主角人像时,即用户点击指定追焦对象时,指定追焦对象的追焦框即为第一追焦框类型的追焦框,可以用于表示正在追焦的主角人像,因此,可以保持指定追焦对象的追焦框不变,并持续显示指定追焦对象的追焦框,并暂停显示相机预览界面中其余各个对象的追焦框。
举例来说,如图8所示的相机预览界面800中包含两个普通人像801、802,其对应的追焦框8011与8021为单层白框(第三追焦框类型),以及一个主角人像803,且该主角人像803为目标追焦对象,其对应的追焦框8031为双层黄框(第一追焦框类型),如果在相机预览界面800中点击了主角人像803,则可以将主角人像803确定为指定追焦对象,并保持追焦框8031不变,以及暂停显示普通人像801、802对应的追焦框8011与8021,如图12所示。
在本申请实施例中,如果指定追焦对象不是目标追焦对象、且指定追焦对象的对象类型为主角人像,则可以确定指定追焦对象在被用户点击之前,其对应的追焦框类型为第二追焦框类型(如双层白框),第二追焦框类型可以用于表示该对象为主角对象,但是当前没有被追焦,而在该对象被确定为指定追焦对象之后,需要对指定追焦对象进行追焦处理,从而可以将指定追焦对象的追焦框类型由第二追焦框类型更改为第一追焦框类型(如双层黄框),以用于表示指定追焦对象为当前正在追焦的主角人像。
举例来说,如图9所示相机预览界面900中包含两个普通人像901、902,其对应的追焦框9011与9021为单层白框(第三追焦框类型),以及两个主角人像903、904,其中,主角人像904为目标追焦对象,其对应的追焦框9041为双层黄框(第一追焦框类型),主角人像903不是目标追焦对象,其对应的追焦框9031为双层白框(第二追焦框类型)。如果用户在相机预览界面900中点击了主角人像903,则可以将主角人像903确定为指定追焦对象,并将追焦框9031更改为双层黄框,以及暂停显示普通人 像901、902对应的追焦框9011与9021,以及暂停显示主角人像904对应的追焦框9041,如图13所示。
在本申请实施例中,如果指定追焦对象不是主角人像,即指定追焦对象为普通人像或预设类型的非人脸对象,由于这两种类型的对象对应的追焦框类型为第三追焦框类型(如单层白框),这种类型的追焦框不会持续显示而且无法表示已锁定追焦的对象,因此可以在指定追焦对象为普通人像或预设类型的非人脸对象时,将指定追焦对象的追焦框类型更改为第四追焦框类型(如单层黄框),并根据第四追焦框类型生成并持续显示指定追焦对象的第四追焦框,并暂停显示相机预览界面中其余各个对象的追焦框,以通过第四追焦框将已锁定追焦的指定追焦对象显性展示给用户。
举例来说,如图9所示相机预览界面900中包含两个普通人像901、902,其对应的追焦框9011与9021为单层白框(第三追焦框类型),以及两个主角人像903、904,其中,主角人像904为目标追焦对象,其对应的追焦框9041为双层黄框(第一追焦框类型),主角人像903不是目标追焦对象,其对应的追焦框9031为双层白框(第二追焦框类型)。如果用户在相机预览界面900中点击了普通人像901,则可以将主角人像901确定为指定追焦对象,并将追焦框9011更改为单层黄框,以及暂停显示普通人像902对应的追焦框9021,以及暂停显示主角人像903、904对应的追焦框9031、9041,如图14所示。
进一步的,在用户点击选择相机预览界面中任一对象作为指定追焦对象之后,如果用户再次点击该指定追焦对象,则可以取消对指定追焦对象的锁定追焦,并重新进入自动追焦模式。即在本申请实施例一种可能的实现方式中,上述步骤1107之后,还可以包括:
响应于用户对指定追焦对象的点击操作,暂停对指定追焦对象的追焦处理,并根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
在本申请实施例中,如果用户点击已经选择的指定追焦对象,即用户反选了指定追焦对象,则可以取消对指定追焦对象的追焦处理,并重新执行本申请实施例的自动追焦过程,即返回执行本申请实施例的步骤1102及其后续步骤。
本申请实施例提供的追焦方法,通过在预览过程中,根据相机预览界面中各个对象的对象类型选取出当前拍摄场景中用户最关注的对象,作为最高优先级的追焦对象,以对用户当前最关注的对象进行追焦,并且对于不同类型的对象采用不同的追焦框进行显示;以及在预览过程中允许用户手动选择任一对象作为指定追焦对象,并持续对指定追焦对象进行追焦,从而不仅可以根据实时的拍摄场景自适应调整追焦对象,提升了用户最关注的对象的拍摄效果,提升了追焦的灵活性和使用便捷性,而且通过允许用户根据实际拍摄需求选择或更改追焦对象,提升自动追焦的灵活性和可交互性,进一步改善了用户的拍摄体验。
下面结合图15,对本申请实施例提供的追焦方法的软件架构进行进一步说明。
图15示出了本申请实施例提供的一种追焦方法的软件架构图。
如图15所示,该追焦方法的软件架构包括相机应用层、相机框架层、相机硬件抽象层及相机驱动层。
其中,相机应用层中包括用户界面、插件模块及相机管理。用户界面中包括拍照、录像、人像等,用于在相机应用的用户界面中显示拍照、录像、人像等操作控件;插件模块中包括自动跟踪(AutoTrack)插件、闪光灯插件、滤镜插件等;相机管理中包括设备管理、会话控制管理、表层管理等。需要说明的是,AutoTrack插件用于承载用户交互响应与算法的结果处理。
其中,相机框架层中包括相机服务,相机服务中包括CamManager类、会话控制、相机设备、输出。
其中,相机硬件抽象层中包括CamX与CHI。其中,CamX代表了通用功能性接口的代码实现集合;CHI代表了可定制化需求的代码实现集合。CamX中包括Camera3Device、会话控制、输出、语义引擎(semanticEngine)、SWL及传感器节点(sensornode)。语义引擎中包括万物追焦算法(cyberFocus)节点、人脸特征算法(faceFeature)节点、移动检测算法(motionDec)节点等。
需要说明的是,万物追焦算法节点是承载万物追焦算法执行的节点,位于相机后处理管线的一个节点上;人脸特征算法节点是进行主角人像(即前述实施例中提及的图库中排序中处于前N的人像)识别的算法节点。SWL中还包括自动对焦算法节点,用于执行对焦业务。CHI中包括chiusecase类,主要负责CHI中的业务处理以及资源的管理。
其中,相机驱动层中包括至少一个相机的驱动;其中驱动的数量与终端设备中安装的相机的数量对应。
图16示出了本申请实施例提供的一种追焦方法的时序图。
如图16所示,该追焦方法的时序图涉及软件架构图中的相机应用层中的拍摄模式模块、万物追焦插件及相机管理模块,以及相机框架层中的相机服务、相机硬件抽象层中的Camera3Device、语义引擎、万物追焦算法节点、人脸特征算法节点及自动对焦算法节点。具体包括如下步骤:
S1601:拍摄模式模块接收到用户启动相机应用的请求;
S1602:拍摄模式模块像相机管理模块发送启动相机请求;
S1603:相机管理模块像相机服务发送获取相机服务请求;
S1604:相机服务向Camera3Device发送构造相机实例请求;
S1605:Camera3Device向相机管理模块返回相机实例;
S1606:拍摄模式模块向万物追焦插件发送加载万物追焦插件请求;
S1607:万物追焦插件向相机管理模块发送激活万物追焦算法请求;
S1608:相机管理模块向语义引擎发送构造万物追焦算法请求;
S1609:万物追焦语义感知算法使能;
S1610:Camera3Device从帧缓存中逐帧获取预览帧,发送至语义引擎;
S1611:语义引擎将预览帧输入万物追焦算法节点,以对预览帧中的对象进行识别;
S1612:万物追焦算法节点将预览帧输入人脸特征算法节点,以对预览帧中的主角人像(即前述实施例中提及的图库中排序处于前N的人像)进行识别;
S1613:人脸特征算法节点确定预览帧中存在主角人像时,向万物追焦算法节点返回主角人像坐标;
S1614:万物追焦算法节点存在主角人像时,向万物追焦插件返回主角人像坐标;
S1615:用户界面绘制主角人像对应的第一类型追焦框(双层黄框);
S1616:万物追焦算法节点向自动对焦算法节点发送自动对焦感兴趣区域指令,以对主角人像进行自动追焦;
S1617:人脸特征算法节点在无主角人像时,识别最大人像;
S1618:人脸特征算法节点在确定存在普通人像时,向万物追焦算法节点返回普通人像坐标;
S1619:万物追焦算法节点存在普通人像时,向万物追焦插件返回普通人像坐标;
S1620:用户界面绘制第三类型追焦框(单层白框);
S1621:发送自动对焦感兴趣区域指令;
S1622:检测到主角人像出镜;
S1623:无主角人像时进入主体检测算法;
S1624:存在普通人像或预设类型的非人脸对象时,返回普通人像或预设类型的非人脸对象的坐标;
S1625:用户界面绘制普通人像或预设类型的非人脸对象对应的第三类型追焦框(单层白框);
S1626:万物追焦算法节点向自动对焦算法节点发送自动对焦感兴趣区域指令;
S1627:无实体识别算法;
S1628:在预览帧中不存在可识别实体时,万物追焦算法节点向自动对焦算法节点发送中心自动对焦指令;
S1629:万物追焦算法节点检测到用户手动选择非主角人像;
S1630:跳过主角人像检测;
S1631:用户界面绘制用户选择的指定追焦对象对应的第四类型追焦框(单层黄框);
S1632:万物追焦算法节点向自动对焦算法节点发送自动对焦感兴趣区域指令;
S1633:在用户手动选择指定追焦对象后,万物追焦算法节点检测到主角人像入镜;
S1634:用户界面显示指定追焦对象对应的第四类型追焦框(单层黄框),并维持在用户选择的对象上,即维持在指定追焦对象上;
S1635:万物追焦插件检测到用户反选已选中对象或已锁定追焦对象;
S1636:反选后,万物追焦算法节点切回自动追焦策略;
S1637:万物追焦插件检测到用户手动选择主角人像;
S1638:万物追焦插件维持最高追焦优先级追焦。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的追焦方法,图17示出了本申请实施例提供的追焦装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图17,该装置1700,包括:
第一显示模块1701,用于响应于用户的第一操作,显示相机预览界面;
第一确定模块1702,用于对相机预览界面中显示的各个对象进行识别处理,以确 定各个对象的对象类型;
第二确定模块1703,用于根据各个对象的对象类型,确定各个对象的追焦框类型;
第三确定模块1704,用于根据各个对象的对象类型及预设的优先级策略,确定各个对象的第一追焦优先级,其中,预设的优先级策略是根据用户对各个对象类型的关注程度设定的;
第二显示模块1705,用于根据各个对象的追焦框类型,生成各个对象对应的追焦框,并根据各个对象的坐标,在相机预览界面中显示各个对象对应的追焦框;
第一追焦模块1706,用于根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
在实际使用时,本申请实施例提供的追焦装置,可以被配置在任意终端设备中,以执行前述追焦方法。
本申请实施例提供的追焦装置,通过在预览过程中,根据相机预览界面中各个对象的对象类型选取出当前拍摄场景中用户最关注的对象,作为最高优先级的追焦对象,以对用户当前最关注的对象进行追焦,并且对于不同类型的对象采用不同的追焦框进行显示,从而不仅可以根据实时的拍摄场景自适应调整追焦对象,提升了用户最关注的对象的拍摄效果,而且无需用户手动操作,提升了追焦的灵活性和使用便捷性,改善了用户的拍摄体验。
在本申请的一种可能的实现方式中,上述对象类型包括以下类型:图库中排序处于前N的人像、非图库中排序处于前N的人像、预设类型的非人脸对象,其中,N为大于或等于1的正整数;
图库中排序处于前N的人像的追焦框类型为第一追焦框类型或第二追焦框类型,非图库中排序处于前N的人像的追焦框类型及预设类型的非人脸对象的追焦框类型为第三追焦框类型,其中,第一追焦框类型、第二追焦框类型及第三追焦框类型均不相同;
预设的优先级策略为:图库中排序处于前N的人像的第一追焦优先级高于非图库中排序处于前N的人像的第一追焦优先级,非图库中排序处于前N的人像的第一追焦优先级高于预设类型的非人脸对象的第一对焦优先级。
进一步的,在本申请另一种可能的实现方式中,上述第二显示模块1705,包括:
第一显示单元,用于在对象中包含对象类型为图库中排序处于前N的人像的一个第一对象时,根据第二追焦框类型,生成第一对象对应的第一追焦框,并根据第一对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框;
第二显示单元,用于在对象中包含对象类型为图库中排序处于前N的人像的一个第一对象及至少一个第二对象时,根据第一追焦框类型,生成第一对象对应的第一追焦框,以及根据第二追焦框类型,生成各个第二对象对应的第二追焦框,并根据第一对象及各个第二对象的坐标,在相机预览界面中显示第一对象对应的第一追焦框及各个第二对象对应的第二追焦框,其中,第一对象的尺寸大于各个第二对象的尺寸。
进一步的,在本申请再一种可能的实现方式中,上述第二显示模块1705,还包括:
第一更改单元,用于若确定任一第二对象的尺寸大于第一对象的尺寸,则将任一第二对象确定为新的第一对象,以及将第一对象确定为新的第二对象,并将新的第一 对象对应的追焦框由第二追焦框更改为第一追焦框,以及将新的第二对象对应的追焦框由第一追焦框更改为第二追焦框。
进一步的,在本申请又一种可能的实现方式中,上述装置1700,还包括:
第四确定模块,用于在对象的对象类型为非图库中排序处于前N的人像或预设类型的非人脸对象时,确定对象对应的追焦框的显示时长;
第一停止显示模块,用于在对象对应的追焦框的显示时长达到时长阈值时,停止显示对象对应的追焦框。
进一步的,在本申请又一种可能的实现方式中,上述第一追焦模块1706,包括:
第一判断单元,用于判断对象中是否包含对象类型为图库中排序处于前N的人像的第一对象;
第一确定单元,用于若对象中包含至少一个第一对象,则将第一对象确定为第一优先级最高的对象,并将任一第一对象确定为目标追焦对象;
第二判断单元,用于若对象中未包含第一对象,则判断对象中是否包含对象类型为非图库中排序处于前N的人像的第二对象;
第二确定单元,用于若对象中包含至少一个第二对象,则将第二对象确定为第一优先级最高的对象,并将任一第二对象确定为目标追焦对象;
第三判断单元,用于若对象中未包含第二对象,则判断对象中是否包含对象类型为预设类型的非人脸对象的第三对象;
第三确定单元,用于若对象中包含至少一个第三对象,则将第三对象确定为第一优先级最高的对象,并将任一第三对象确定为目标追焦对象;
第一对焦单元,用于若对象中未包含第三对象,则在预览界面中进行中心对焦处理。
进一步的,在本申请另一种可能的实现方式中,上述装置1700,还包括:
第五确定模块,用于响应于用户对任一对象的点击操作,将任一对象确定为指定追焦对象;
第二追焦模块,用于若指定追焦对象为目标追焦对象,则持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作;
第三追焦模块,用于若指定追焦对象不为目标追焦对象,则暂停对目标追焦对象进行追焦处理,并持续对指定追焦对象进行追焦处理,直至获取到用户对任一对象的点击操作。
进一步的,在本申请再一种可能的实现方式中,上述装置1700,还包括:
第三显示模块,用于若指定追焦对象为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像,则保持指定追焦对象的追焦框类型不变,以及持续显示指定追焦对象的追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
第四显示模块,用于若指定追焦对象不为目标追焦对象、且指定追焦对象的对象类型为图库中排序处于前N的人像,则将指定追焦对象的追焦框类型更改为第一追焦框类型,以及根据第一追焦框类型生成并持续显示指定追焦对象对应的第一追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框;
第五显示模块,用于若指定追焦对象的对象类型不为图库中排序处于前N的人像, 则将指定追焦对象的追焦框类型更改为第四追焦框类型,以及根据第四追焦框类型生成并持续显示指定追焦对象对应的第四追焦框,并暂停显示除指定追焦对象之外的各个对象的追焦框。
进一步的,在本申请又一种可能的实现方式中,上述装置1700,还包括:
第四追焦模块,用于响应于用户对指定追焦对象的点击操作,暂停对指定追焦对象的追焦处理,并根据各个对象的第一追焦优先级,将第一追焦优先级最高的任一对象确定为目标追焦对象,并对目标追焦对象进行追焦处理。
进一步的,在本申请又一种可能的实现方式中,上述对象中包含多个第一追焦优先级最高的对象;相应的,上述第一追焦模块1706,包括:
第四确定单元,用于确定第一追焦优先级最高的各个对象的第二追焦优先级;
第五确定单元,用于将第二追焦优先级最高的对象,确定为目标追焦对象。
进一步的,在本申请另一种可能的实现方式中,上述第四确定单元,具体用于:
获取第一追焦优先级最高的各个对象的预设优先级;
将各个对象的预设优先级,确定为各个对象的第二追焦优先级。
或者,
确定第一追焦优先级最高的各个对象的尺寸;
根据各个对象的尺寸,确定各个对象的第二追焦优先级。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
为了实现上述实施例,本申请还提出一种终端设备。
图18为本申请一个实施例的终端设备的结构示意图。
如图18所示,上述终端设备1800包括:
存储器1810(内存1810)及至少一个处理器1820,连接不同组件(包括存储器1810和处理器1820)的总线1830,存储器1810存储有计算机程序,当处理器1820执行所述程序时实现本申请实施例所述的追焦方法。
总线1830表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及 外围组件互连(PCI)总线。
终端设备1800典型地包括多种电子设备可读介质。这些介质可以是任何能够被终端设备1800访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。
存储器1810还可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)1840和/或高速缓存存储器1850。终端设备1800可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统1860可以用于读写不可移动的、非易失性磁介质(图18未显示,通常称为“硬盘驱动器”)。尽管图18中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线1830相连。存储器1810可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本申请各实施例的功能。
具有一组(至少一个)程序模块1870的程序/实用工具1880,可以存储在例如存储器1810中,这样的程序模块1870包括——但不限于——操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块1870通常执行本申请所描述的实施例中的功能和/或方法。
终端设备1800也可以与一个或多个外部设备1890(例如键盘、指向设备、显示器1891等)通信,还可与一个或者多个使得用户能与该终端设备1800交互的设备通信,和/或与使得该终端设备1800能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1892进行。并且,终端设备1800还可以通过网络适配器1893与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1893通过总线1830与终端设备1800的其它模块通信。应当明白,尽管图中未示出,可以结合终端设备1800使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
处理器1820通过运行存储在存储器1810中的程序,从而执行各种功能应用以及数据处理。
需要说明的是,本实施例的终端设备的实施过程和技术原理参见前述对本申请实施例的追焦方法的解释说明,此处不再赘述。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行时实现可实现上述各个方法实施例中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例 方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
用户在用相机进行拍摄时,或者利用手机或平板电脑等终端设备的相机功能进行拍摄时,由于相机与被拍摄人或物(即拍摄目标)的相对移动,可能会出现虚焦的问题。也就是说,由于从选中想要对焦的拍摄目标到拍摄之间存在时延,而如果拍摄目标发生了移动,就无法对焦上这个拍摄目标了,导致了虚焦。还有一种出现虚焦的可能原因是用户选中的对焦位置并没有可拍摄目标,这种情况也会导致虚焦。
因此,如何避免虚焦,提高对焦准确性是亟待解决的技术问题。
下面结合附图对本申请实施例的方案进行介绍。本申请提供的对焦方法能够应用 于相机、摄像机,或者具备拍照或录像功能的终端等电子设备。
图19是本申请实施例的一种适用的对焦场景的示意图。如图19所示,是电子设备A的相机应用打开后的预览界面,图19主要以拍摄目标中包括车,且车相对于电子设备存在移动的情况为例。在界面1901中,可以看到预览窗口(也可以称之为取景框或取景窗等)包括山脉、树木和太阳等元素,在位置1有一辆车。假设用户点击了车所在的屏幕位置,如界面1901所示。就可以将该点击位置作为对焦位置进行对焦,如界面1902所示,位置1处的车上出现了一个对焦框A。如果车出现了移动,假设移动到界面1903所示的位置2处,用户期望的是对焦框A能够如界面1903所示继续出现在车所在的新位置上,也就是位置2上。但是传统方案并不会对用户选中的对焦位置的目标进行追踪和对焦,就导致对焦框丢失,出现界面1904所示的情况,也就是当目标移动了就没有对焦到车上了,这种情况可能会出现虚焦。
假设用户在界面1902点击了拍摄键进行拍摄,但是由于拍摄延时,车发生了移动,假设从位置1移动到了位置2,按照传统方案就会出现虚焦的问题,导致拍摄出来的照片不清晰。
假设用户在界面1901点选的是其它位置,就可能出现其它的结果。例如,假设用户点选的是山脉或树木所在位置,那么由于山脉或树木没有相对移动的问题,按照传统方案也不会出现虚焦。假设用户点选的是空白的位置,那么按照传统方案依然会出现虚焦,这是因为按照传统方案,点选的位置是空白的,系统无法对焦到合适的目标上,造成虚焦。
还应理解,图19是以目标动而相机不动为例,但也可以是目标不动而相机动,不再赘述。
针对上述问题,本申请实施例主要通过检测对焦位置是否存在目标,并根据目标检测结果有针对性的进行对焦,从而能够避免虚焦的出现。也就是说,通过检测用户选择的对焦位置是否有目标(也就是人、动物、植物或物体,例如图19中的车、山、树和太阳都可以作为目标)来采取对应的对焦策略,从而避免虚焦发生。
图20是不同对焦方案的拍摄结果的比较图。如果采用了本申请实施例的对焦方案,假设用户在界面1902按下了拍摄键,就可以得到图片A,可以看出图片A是清晰度正常的图片,且车的位置跟界面1902中的位置存在相对位移。因为本申请实施例的对焦方案能够针对性的采取不同的对焦策略,以界面1902为例,就是该对焦位置的目标检测结果是该对焦位置存在目标,就会采用存在目标所对应的对焦策略,从而避免虚焦。
而如果采用传统对焦方案,假设用户在界面1902按下了拍摄键,就会得到图片B,可以看出图片B是存在模糊的虚焦的图片。因为按照传统对焦方案,是对点选的对焦位置的直接单次对焦,但由于移动的问题,在对焦的时候这个对焦位置的车已经偏移走了,导致这个对焦位置实际上没有了可形成焦点的目标,就会对焦失败成了虚焦。
图21是本申请实施例的另一种适用的对焦场景的示意图。如图21所示,是电子设备A的相机应用打开后的预览界面,图21主要以用户点选的对焦位置没有目标的情况为例。在界面2101中,可以看到云朵,也就是说,这里取景框内的待拍摄场景是天空。假设用户点击了界面2101中所示的屏幕位置,也就是想要对焦的位置,可以称 之为对焦位置。会如界面2102所示出现一个对焦框B。但是由于这个对焦位置并没有能够形成焦点的目标,所以会导致对焦失败而出现虚焦的情况。
图22是本申请实施例的一种对焦方法的示意性流程图。该方法能够应用于相机或手机、平板电脑等具备相机功能的电子设备中。下面对图22各步骤进行介绍。
S2201、获取用户选择的对焦位置。
对焦位置可以理解为用户希望对焦到的位置。用户可以通过取景窗选定希望对焦的位置,也就是对应的屏幕位置。例如图19中用户在界面1901点击车所在的屏幕位置,这时,这个车所在的屏幕位置就是对焦位置。但应理解,用户可以在预览界面点击预览窗口中的任意屏幕位置来作为对焦位置。以图19为例,可以选择山、树、太阳、空白处等对应的屏幕位置。以图21为例可以选择云朵所在屏幕位置,或者其他预览窗口中的屏幕位置。
可选地,用户选择对焦位置的方式可以是触摸点击、视线控制或手势控制,不存在限定。本申请主要以触摸点击为例。用户可以通过触摸点击屏幕来选择位置;也可以通过注视想要选定的位置选择,也就是根据检测到的用户的注视点来锁定的方式选择;还可以是通过隔空的捏合或点击等手势操作选择,也就是根据检测的用户的手势操作对应的位置来选择。
S2202、根据所述对焦位置的目标检测结果进行对焦。
目标检测结果用于表示对焦位置是否存在目标。
需要说明的是,此处的目标检测并不需要确认目标的类别,只需要确定是否存在目标即可。因此,不会采用用来进行目标的类别分类的神经网络模型去识别目标的类别,从而确认是否存在目标,因为目标的种类是非常多的,一个模型很难具备识别所有种类的能力,例如用来识别人的神经网络模型很难同时具备识别物体的能力。
但是此处可以训练一个能够识别纹理复杂度的神经网络模型,来通过纹理复杂度确定是否存在目标。
对于相机而言,或者说对于图像而言,纹理越复杂,越说明可能是存在目标的,反之,纹理越简单,越说明可能什么都没有。换而言之,相机能够对焦成功是必须纹理复杂度超过一定阈值才可以的,所以当某个位置什么都没有或者是天空、水面这种形状、颜色等纹理过于简单的事物就会很难对焦上,而当某个位置有相对复杂的事物,且超过了这个阈值,就能对焦成功了。
在一种实现方式中,步骤S2202可以包括:当对焦位置存在目标时,对该目标进行连续对焦(continuous auto focus,CAF);或者,当对焦位置不存在目标时,进行单次对焦(touch auto focus,TAF)。
在该实现方式中,主要根据存在目标和不存在目标这两种不同的目标检测结果采用不同的对焦策略来进行对焦,从而避免虚焦。
连续对焦是一种逐帧持续对焦的方式。单次对焦是传统方案中最常见的对焦方式,也就是通过触控的方式,每触控一次,触控时的待拍摄帧对焦一次。可以理解为,连续对焦是一次触发之后持续多帧对焦,单次对焦则是每次触发只对焦一次。
连续对焦和单次对焦都是自动对焦(auto focus,AF)中所包括的不同对焦方式。
为了区分两种对焦策略,还可以设置不同的对焦框来区分,这样用户可以通过对 焦框的不同来区分用了哪种对焦策略。例如,可以是对焦框的颜色和/或形状不同。颜色可以包括对焦框的线条颜色和底色中至少一项。形状可以包括对焦框的线条粗细和对焦框形状中至少一项。
在一种实现方式中,连续对焦的对焦框的颜色与单次对焦的对焦框的颜色不同,和/或,连续对焦的对焦框的形状与单次对焦的对焦框的形状不同。在一个例子中,连续对焦的对焦框的颜色为黄色;单次对焦的对焦框的颜色为白色。
目标检测结果可以通过纹理复杂度比较得到,或者通过单物体追焦技术得到。
单物体追焦(single object track,SOT)是一种物体追踪技术,能够检测是否存在可追踪物体。在本申请实施例中,可以用于检测用户选择的对焦位置是否存在可追踪的目标,并根据结果为“是”还是“否”分别进行对焦。
在步骤S2202之前,上述方法还可以包括根据对焦位置得到目标检测结果的步骤。
在一种实现方式中,根据对焦位置得到目标检测结果的步骤可以包括:
对对焦位置进行单物体追焦,得到追焦结果;
当追焦结果为追焦成功时,认定对焦位置存在目标;或者,
当追焦结果为追焦失败时,认定对焦位置不存在目标。
也就是说,SOT结果包括追焦成功或追焦失败。应理解,对于一个选定的对焦位置,SOT结果包括追焦成功或追焦失败中的一个结果,不可能既成功又失败。
本申请实施例中,追焦成功对应存在目标,追焦失败对应不存在目标。也就是说目标检测结果和SOT追焦结果之间是一一对应的关系。
当追焦成功,说明对焦位置是有可以追焦的目标的,此时如果进行连续对焦对这个目标进行追踪和对焦就能够一直对焦到这个目标上。如果采用传统方案的常规对焦,就会因为目标偏离对焦位置导致虚焦的问题。
当追焦失败,说明对焦位置没有可以追焦的目标,此时按照传统方案就会对焦失败成为虚焦,因为按照传统方案,当系统检测到无法对焦到用户点选的对焦位置的时候,就虚焦了。而本申请实施例的方案则是在这种情况下直接改为单次对焦策略,所以可能避免虚焦。也就是说,传统方案会因为对焦位置没有可对焦目标而无法对焦,导致虚焦。但本申请中的方案在对焦位置没有可对焦目标而无法对焦时,改为单次对焦,因此可以避免虚焦。
在一个例子中,对对焦位置进行单物体追焦,得到追焦结果的步骤包括:
构造对焦位置的尺度空间向量;
将对焦位置的尺度空间向量与样本库中目标的特征向量进行特征匹配,得到匹配结果;
当匹配结果为匹配成功时,认定追焦结果为追焦成功;或者,
当匹配结果为匹配失败时,认定追焦结果为追焦失败。
这个例子能够基于已有的特征匹配的方案执行。例如基于相机框架层中的cyberfocus单元中的SOT算法执行。
在另一个例子中,对对焦位置进行单物体追焦,得到追焦结果的步骤包括:
构造对焦位置的尺度空间向量;
计算对焦位置的尺度空间向量的特征值;
当特征值在预设范围内时,认定追焦结果为追焦成功;或者,
当特征值不在预设范围内时,认定追焦结果为追焦失败。
基于纹理复杂度越高,越说明对焦位置有可以形成焦点的目标的逻辑,在这个例子中通过为尺度空间向量设置特征值预设范围,当在预设范围内说明尺度空间向量中数值足够复杂,也就说明这个对焦位置的纹理复杂度足够高,也就说明能够追焦成功,也就是存在目标。
在又一个例子中,对对焦位置进行单物体追焦,得到追焦结果的步骤包括:
获取对焦位置的图像特征向量;
利用神经网络模型对图像特征向量进行处理,得到目标检测结果。
该神经网络模型的训练数据集可以包括带有至少一个对焦位置的图像样本,以及每个对焦位置所对应的目标检测结果标签。例如某个图像样本中的某个对焦位置的标签是存在目标,另一个对焦位置的标签是不存在目标等,不存在限定。
在另一种实现方式中,连续对焦的步骤可以包括:
将所述对焦位置在相机坐标系下的位置坐标进行坐标转换,得到所述对焦位置在SOT坐标系下的位置坐标;
根据述对焦位置在SOT坐标系下的位置坐标,对所述目标进行连续追踪和对焦。
也就是说,当对焦位置有可以追踪的目标的时候,就可以按照对焦位置所转换出来的SOT坐标系下的坐标位置进行对焦,这样能够使得更加快速准确追踪和对焦到目标上。
在又一种实现方式中,单次对焦的步骤可以包括:根据所述对焦位置在相机坐标系下的位置坐标,进行单次对焦。
也就是说,当对焦位置没有可以追踪的目标的时候,就不需要进行坐标转换了,直接按照对焦位置在相机坐标系下的位置坐标进行对焦就可以,这样能够省去坐标转换的运算,提高处理效率,使得更加快速执行对焦。
在又一种实现方式中,单次对焦的步骤可以包括:在不考虑所述对焦位置的情况下,对当前拍摄场景进行对焦。
也就是说,如果对焦位置已经知道了没有可形成焦点的目标,那就没必要再考虑这个位置,而可以当这个位置不存在重新对整个拍摄场景进行对焦,一方面省去了坐标的确认和下发等处理,另一方面还可以使得焦点能够对到更合适的目标上,例如对焦到拍摄场景中的人或动物上,能够进一步提交对焦准确性。
在又一种实现方式中,在获取用户选择的对焦位置之前,上述方法还包括:开启万物追焦功能。万物追焦(cyberfocus)功能是一种能够追踪和对焦到移动的目标上的技术。也可以理解为是将本申请实施例的方案设置了一个启动接口,只有在开启万物追焦功能的时候才利用上述方法进行对焦,不开启的时候则可以采用原有的传统对焦方案,给用户一个自主选择的余地。
图22所示方法,主要通过检测对焦位置是否存在目标,并根据目标检测结果有针对性的进行对焦,从而能够避免虚焦的出现。
图23是本申请实施例的一种相机功能的逻辑架构的示意图。如图23所示,该逻辑架构包括相机的应用程序(CamApp)层,相机服务(framework,FWK)层,相机 硬件抽象(CamHAL)层,和硬件(hardware,HW)层。
CamApp层包括人机交互模块(图中用UI表示)、插件模块和相机管理模块(图中用Cam管理表示)。UI模块包括拍照、录像、人像等单元,也就是针对不同的拍摄功能的人机交互单元。插件模块包括AutoTrack插件、闪光灯、滤镜等单元,其中,AutoTrack插件用于承载人机交互中对用户操作的响应与算法结果的处理。Cam管理模块包括设备管理、会话(session)管理和服务(surface)管理等单元。
FWK层包括相机服务模块(图中用CameraService表示),CameraService中包括管理单元(图中用CamMgr表示)、会话单元(图中用session表示)、设备单元(图中用CamDev表示)和输出单元(图中用Output表示)。FWK层主要功能就是相当于一个数据通道,实现CamApp层和CamHAL层之间的数据交互。
CamHAL层包括CamX-CHI架构下的CamX模块和CHI模块。在CamX-CHI中,将一些高度统一的功能性接口抽离出来放到CamX中,将可定制化的部分放在CHI中供不同厂商进行修改,实现各自独有的特色功能。这样设计的好处显而易见,那便是即便开发者对于CamX并不是很了解,但是依然可以很方便的加入自定义的功能,从而降低了开发难度。CamX中包括通用功能性接口的代码实现集合,CHI中包括可定制化需求的代码实现集合。
如图23所示,CamX中包括Camera3Device模块、session模块、语义引擎(semanticEngine)模块、传感器(sensornode)模块以及输出(Output)模块。其中,semanticEngine模块包括用于万物追焦的cyberfocus单元、用于人脸识别的faceFeature单元、用于动作抓取的motionDec单元等。本申请实施例中,主要利用的就是cyberfocus单元的万物追焦功能。
HW层包括多个驱动。
图24是本申请实施例的对焦方法的执行过程的示意图。图24可以看作是图22所示方法的一个具体示例。图24中涉及的各个执行单元/模块可以是图23中的相应单元/模块。
S2401、拍摄模式模块获取用户打开相机的拍摄/录像模式的操作,并将打开相机的指令发送给Cam管理模块。
S2402、获取相机服务。
S2402可以通过FWK层的相机管理(CameraService)模块执行。
S2403、构造相机实例。
S2402可以通过CamHAL层的相机装置(Camera3Device)模块执行。
S2404、Camera3Device模块返回相机实例给Cam管理模块。
S2401-S2404相当于开启拍照功能进入预览界面的步骤示例。以图25执行过程为例,就是从界面2501中用户点击相机应用的图标到显示出界面2502中的预览窗口之间执行了步骤S2401-S2404。
S2405、万物追焦插件模块加载万物追焦插件(plugin)。
S2406、激活万物追焦算法。
该步骤可以由Cam管理模块执行。
S2407、semanticEngine模块构造万物追焦算法。
S2408、cyberfocus单元进行SOT算法使能。
S2405-S2408可以看作是开启万物追焦功能的具体执行过程的示例。
S2409、万物追焦插件模块获取用户的点击区域的操作,并将用户点击区域的坐标发送给Cam管理模块。
该点击区域可以看作是上述对焦位置的一个示例。区域坐标可以为相机坐标系下的坐标。区域坐标可以包括(x,y,width,height),也就是可以包括坐标轴、宽度和高度的坐标。或者可以理解为是这个对焦位置在整个取景框中的相对坐标,也就是说,x,y是整个对焦位置的坐标,width和height则可以分别是整个取景框的宽度和高度。但应理解,也可以是width和height是整个对焦位置的坐标,x,y则可以分别是整个取景框的宽度和高度。不存在限定。
S2410、Cam管理模块将区域坐标发送给Camera3Device模块。
S2409或S2409-S2410可以看作是S2201的一个示例。
S2411、semanticEngine模块构建点击区域的尺度空间、进行特征点搜索和定位之后,将构建好的特征向量发送给cyberfocus单元。
构建点击区域的尺度空间的时候还可以先进行降采样(frame buffer)再构建。
该尺度空间可以是DOG(difference of Gaussian)尺度空间。DOG算子和LOG(Laplacian of Gaussian)算子是常用的极值点检测(blob detection)方法,DOG算子复杂度相对较低。
S2412、cyberfocus单元进行特征匹配和推理,当追踪成功时,输出SOT追踪成功的追踪结果和追踪结果的坐标给Camera3Device模块。
追踪结果的坐标就是上述对焦位置在SOT对应的坐标系下的位置坐标的一个示例。
S2413、Camera3Device模块根据SOT坐标执行CAF策略,发送SOT成功的数据给万物追焦插件模块。
S2414、万物追焦插件模块通过UI模块在追踪目标上显示黄色框。
S2415、cyberfocus单元进行特征匹配和推理,当追踪失败时,semanticEngine模块发送SOT失败的数据给万物追焦插件模块。
S2416、万物追焦插件模块通过UI模块在对焦位置上显示白色框。
S2417、万物追焦插件模块下发TAF策略和对焦位置的坐标给Camera3Device模块。
S2418、Camera3Device模块根据该坐标执行TAF策略。
S2412-S2418可以看作是S2202的一个示例。
图25是本申请实施例的对焦方法的一种执行过程的示意图。如图25所示,当用户在界面2501中点击相机应用的图标,就可以看到界面2502中的预览窗口,界面2501上的点击操作可以对应步骤S2401的打开操作,S2401-S2404发生在从界面2501到界面2502之间。
还应理解,S2405-S2408的开启万物追焦功能的执行过程也是发生在界面2501之后,以及发生在界面2503之前。
假设用户在界面2502中点击对焦位置,也就是位置1,就开始执行本申请实施例的对焦方案。例如可以是执行S201和S202,得到了界面2503中所示的对焦框C。还 可以是执行S2409-S2414得到的。对焦框C可以是黄色的对焦框,或者是加粗的对焦框,用来表示此时是在执行CAF对焦策略的对焦。
图26是本申请实施例的对焦方法的另一种执行过程的示意图。如图26所示,当用户在界面2601中点击相机应用的图标,就可以看到界面2602中的预览窗口,界面2601上的点击操作可以对应步骤S2401的打开操作,S2401-S2404发生在从界面2601到界面2602之间。
还应理解,S2405-S2408的开启万物追焦功能的执行过程也是发生在界面2601之后,以及发生在界面2603之前。
假设用户在界面2602中点击如图所示对焦位置,就开始执行本申请实施例的对焦方案。例如可以是执行S201和S202,得到了界面2603中所示的对焦框D。还可以是执行S2409-S2411和S2415-S2418得到的。对焦框D可以是白色的对焦框,或者是较细的对焦框,用来表示此时是在执行TAF对焦策略的对焦。
上文主要结合附图对本申请实施例的方法进行了介绍。应理解,虽然如上所述的各实施例所涉及的流程图中的各个步骤依次显示,但是这些步骤并不是必然按照图中所示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。下面结合附图对本申请实施例的装置进行介绍。
图27是本申请实施例的一种对焦装置的示意图。如图27所示,该装置2000包括获取单元2001和处理单元2002。该装置2000可以是集成在相机、摄像机、手机、平板电脑、触屏笔记本电脑等电子设备中。
该装置2000能够用于执行上文任意一种对焦方法。例如,获取单元2001可用于执行步骤S201,处理单元2002用于执行步骤S202。又例如,获取单元可用于执行步骤S2401、S2409,处理单元2002可用于执行图24所示其他步骤。
在一种实现方式中,装置2000还可以包括存储单元,用于存储对焦位置的坐标、目标检测结果等数据。该存储单元可以是集成在上述任意一个单元中,也可以是独立于上述所有单元之外的单元。
图28是本申请实施例的一种电子设备的硬件结构示意图。如图28所示,电子设备90可以包括处理器910,外部存储器接口920,内部存储器921,通用串行总线(universal serial bus,USB)接口930,充电管理模块940,电源管理模块941,电池942,天线1,天线2,移动通信模块950,无线通信模块960,音频模块970,扬声器970A,受话器970B,麦克风970C,耳机接口970D,传感器模块980,按键990,马达991,指示器992,摄像头993,显示屏994,以及用户标识模块(subscriber identification module,SIM)卡接口995等。其中,传感器模块980可以包括压力传感器980A,陀螺仪传感器980B,气压传感980C,磁传感器980D,加速度传感器980E,距离传感器980F,接近光传感器980G,指纹传感器980H,温度传感器980J,触摸传感器980K,环境光传感器980L,骨传导传感器980M等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备90的具体限定。在本申请另一些实施例中,电子设备90可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
示例性地,图28所示的处理器910可以包括一个或多个处理单元,例如:处理器910可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备90的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器910中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器910中的存储器为高速缓冲存储器。该存储器可以保存处理器910刚用过或循环使用的指令或数据。如果处理器910需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器910的等待时间,因而提高了系统的效率。
在一些实施例中,处理器910可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
在一些实施例中,I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。处理器910可以包含多组I2C总线。处理器910可以通过不同的I2C总线接口分别耦合触摸传感器980K,充电器,闪光灯,摄像头993等。例如,处理器910可以通过I2C接口耦合触摸传感器980K,使处理器910与触摸传感器980K通过I2C总线接口通信,实现电子设备90的触摸功能。
在一些实施例中,I2S接口可以用于音频通信。处理器910可以包含多组I2S总线。处理器910可以通过I2S总线与音频模块970耦合,实现处理器910与音频模块970之间的通信。
在一些实施例中,音频模块970可以通过I2S接口向无线通信模块960传递音频信号,实现通过蓝牙耳机接听电话的功能。
在一些实施例中,PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。音频模块970与无线通信模块960可以通过PCM总线接口耦合。
在一些实施例中,音频模块970也可以通过PCM接口向无线通信模块960传递音频信号,实现通过蓝牙耳机接听电话的功能。应理解,I2S接口和PCM接口都可以用于音频通信。
在一些实施例中,UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。UART接口通常被用于连接处理器910与无线通信模块960。例如,处理器910通过UART接口与无线通信模块960中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块970可以通过UART接口向无线通信模块960传递音频信号,实现通过蓝牙耳机播放音乐的功能。
在一些实施例中,MIPI接口可以被用于连接处理器910与显示屏994,摄像头993等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。处理器910和摄像头993通过CSI接口通信,实现电子设备90的拍摄功能。处理器910和显示屏994通过DSI接口通信,实现电子设备90的显示功能。
在一些实施例中,GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。GPIO接口可以用于连接处理器910与摄像头993,显示屏994,无线通信模块960,音频模块970,传感器模块980等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。
示例性地,USB接口930是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备90充电,也可以用于电子设备90与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备90的结构限定。在本申请另一些实施例中,电子设备90也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块940用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块940可以通过USB接口930接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块940可以通过电子设备90的无线充电线圈接收无线充电输入。充电管理模块940为电池942充电的同时,还可以通过电源管理模块941为电子设备供电。
电源管理模块941用于连接电池942,充电管理模块940与处理器910。电源管理模块941接收电池942和/或充电管理模块940的输入,为处理器910,内部存储器921,外部存储器,显示屏994,摄像头993,和无线通信模块960等供电。电源管理模块941还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块941也可以设置于处理器910中。在另一些实施例中,电源管理模块941和充电管理模块940也可以设置于同一个器件中。
电子设备90的无线通信功能可以通过天线1,天线2,移动通信模块950,无线通信模块960,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备90中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如,可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块950可以提供应用在电子设备90上的无线通信的解决方案,例如下列方案中的至少一个:第二代(2th generation,2G)移动通信解决方案、第三代(3thgeneration,3G)移动通信解决方案、第四代(4th generation,5G)移动通信解决方案、第五代(5th generation,5G)移动通信解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块950可以由天线1接收电磁波,并对接收的电磁波进行滤波和放大等处理,随后传送至调制解调处理器进行解调。移动通信模块950还可以放大经调制解调处理器调制后的信号,放大后的该信号经天线1转变为电磁波辐射出去。在一些实施例中,移动通信模块950的至少部分功能模块可以被设置于处理器910中。在一些实施例中,移动通信模块950的至少部分功能模块可以与处理器910的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器970A,受话器970B等)输出声音信号,或通过显示屏994显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器910,与移动通信模块950或其他功能模块设置在同一个器件中。
无线通信模块960可以提供应用在电子设备90上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(blue tooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块960可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块960经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器910。无线通信模块960还可以从处理器910接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备90的天线1和移动通信模块950耦合,电子设备90的天线2和无线通信模块960耦合,使得电子设备90可以通过无线通信技术与网络和其他电子设备通信。该无线通信技术可以包括以下通信技术中的至少一个:全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,IR技术。该GNSS可以包括以下定位技术中的至少一个:全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS),星基增强系统(satellite based augmentation systems,SBAS)。
电子设备90通过GPU,显示屏994,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏994和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器910可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏994用于显示图像,视频等。显示屏994包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Mini-led,Micro-Led,Micro-oLed,量子点发光二极管(quantum dot light-emitting diodes,QLED)等。在一些实施例中,电子设备90可以包括1个或N个显示屏994,N为大于1的正整数。
电子设备90可以通过ISP,摄像头993,视频编解码器,GPU,显示屏994以及应用处理器等实现拍摄功能。
ISP用于处理摄像头993反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头993中。
摄像头993用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备90可以包括1个或N个摄像头993,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备90在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备90可以支持一种或多种视频编解码器。这样,电子设备90可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备90的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口920可以用于连接外部存储卡,例如安全数码(secure digital,SD)卡,实现扩展电子设备90的存储能力。外部存储卡通过外部存储器接口120与处理器910通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器921可以用于存储计算机可执行程序代码,所述可执行程序代码包括 指令。处理器910通过运行存储在内部存储器921的指令,从而执行电子设备90的各种功能应用以及数据处理。内部存储器921可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备90使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器921可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备90可以通过音频模块970,扬声器970A,受话器970B,麦克风970C,耳机接口970D,以及应用处理器等实现音频功能。例如,音乐播放,录音等。
音频模块970用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块970还可以用于对音频信号编码和解码。在一些实施例中,音频模块970可以设置于处理器910中,或将音频模块970的部分功能模块设置于处理器910中。
扬声器970A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备90可以通过扬声器970A收听音乐,或收听免提通话。
受话器970B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备90接听电话或语音信息时,可以通过将受话器970B靠近人耳接听语音。
麦克风970C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风970C发声,将声音信号输入到麦克风970C。电子设备90可以设置至少一个麦克风970C。在另一些实施例中,电子设备90可以设置两个麦克风970C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备90还可以设置三个,四个或更多麦克风970C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口970D用于连接有线耳机。耳机接口970D可以是USB接口930,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器980A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器980A可以设置于显示屏994。压力传感器980A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器980A,电极之间的电容改变。电子设备90根据电容的变化确定压力的强度。当有触摸操作作用于显示屏994,电子设备90根据压力传感器980A检测所述触摸操作强度。电子设备90也可以根据压力传感器980A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如,当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感980B可以用于确定电子设备90的运动姿态。在一些实施例中,可以 通过陀螺仪传感器980B确定电子设备90围绕三个轴(即x,y和z轴)的角速度。陀螺仪传感器980B可以用于拍摄防抖。示例性地,当按下快门,陀螺仪传感器980B检测电子设备90抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备90的抖动,实现防抖。陀螺仪传感器980B还可以用于导航,体感游戏场景。
气压传感器980C用于测量气压。在一些实施例中,电子设备90通过气压传感器980C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器980D包括霍尔传感器。电子设备90可以利用磁传感器980D检测翻盖皮套的开合。在一些实施例中,当电子设备90是翻盖机时,电子设备90可以根据磁传感器980D检测翻盖的开合;根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。
加速度传感器980E可检测电子设备90在各个方向上(一般为三轴)加速度的大小。当电子设备90静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器980F用于测量距离。电子设备90可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备90可以利用距离传感器980F测距以实现快速对焦。
接近光传感器980G可以包括例如发光二极管(light-emitting diode,LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备90通过发光二极管向外发射红外光。电子设备90使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备90附近有物体。当检测到不充分的反射光时,电子设备90可以确定电子设备90附近没有物体。电子设备90可以利用接近光传感器980G检测用户手持电子设备90贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器980G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器980L用于感知环境光亮度。电子设备90可以根据感知的环境光亮度自适应调节显示屏994亮度。环境光传感器980L也可用于拍照时自动调节白平衡。环境光传感器980L还可以与接近光传感器980G配合,检测电子设备90是否在口袋里,以防误触。
指纹传感器980H用于采集指纹。电子设备90可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器980J用于检测温度。在一些实施例中,电子设备90利用温度传感器980J检测的温度,执行温度处理策略。例如,当温度传感器980J上报的温度超过阈值,电子设备90执行降低位于温度传感器980J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备90对电池942加热,以避免低温导致电子设备90异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备90对电池942的输出电压执行升压,以避免低温导致的异常关机。
触摸传感器980K,也称“触控面板”。触摸传感器980K可以设置于显示屏994,由触摸传感器980K与显示屏994组成触摸屏,也称“触控屏”。触摸传感器980K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应 用处理器,以确定触摸事件类型。可以通过显示屏994提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器980K也可以设置于电子设备90的表面,与显示屏994所处的位置不同。
骨传导传感器980M可以获取振动信号。在一些实施例中,骨传导传感器980M可以获取人体声部振动骨块的振动信号。骨传导传感器980M也可以接触人体脉搏,接收血压跳动信号。在一些实施例中,骨传导传感器980M也可以设置于耳机中,结合成骨传导耳机。音频模块970可以基于所述骨传导传感器980M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于所述骨传导传感器980M获取的血压跳动信号解析心率信息,实现心率检测功能。
按键990包括开机键,音量键等。按键990可以是机械按键。也可以是触摸式按键。电子设备90可以接收按键输入,产生与电子设备90的用户设置以及功能控制有关的键信号输入。
马达991可以产生振动提示。马达991可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏994不同区域的触摸操作,马达991也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器992可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口995用于连接SIM卡。SIM卡可以通过插入SIM卡接口995,或从SIM卡接口995拔出,实现和电子设备90的接触和分离。电子设备90可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口995可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口995可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口995也可以兼容不同类型的SIM卡。SIM卡接口995也可以兼容外部存储卡。电子设备90通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备90采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备90中,不能和电子设备90分离。
图29是本申请实施例的另一种电子设备的硬件结构示意图。如图29所示,该电子设备3000包括:至少一个处理器3001(图29中仅示出一个)处理器、存储器3002以及存储在所述存储器3002中并可在所述至少一个处理器3001上运行的计算机程序3003,所述处理器3001执行所述计算机程序3003时实现上述任意一种方法中的步骤。
本领域技术人员可以理解,图29仅仅是电子设备的举例,并不构成对电子设备限定,实际中电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
处理器3001可以是中央处理单元(central processing unit,CPU),其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器3002在一些实施例中可以是电子设备3000的内部存储单元,例如电子设备3000的硬盘或内存。存储器3002在另一些实施例中也可以是电子设备3000的外部存储设备,例如电子设备3000上配备的插接式硬盘,智能存储卡(smart media card,SMC),安全数字(secure digital,SD)卡,闪存卡(flash card)等。可选地,存储器3002还可以既包括电子设备3000的内部存储单元也包括外部存储设备。存储器3002用于存储操作系统、应用程序、引导装载程序、数据以及其他程序等,例如所述计算机程序的程序代码等。存储器3002还可以用于暂时地存储已经输出或者将要输出的数据。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
本申请实施例还提供了一种电子设备,该电子设备包括:至少一个处理器、存储器以及存储在所述存储器中并可在所述至少一个处理器上运行的计算机程序,所述处理器执行所述计算机程序时可实现上述任意方法中的步骤。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机程序,当计算机程序被处理器执行时可实现上述各个方法实施例中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/电子设备的任何实体或装置、记录介质、计算机存储器、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神 和范围,均应包含在本申请的保护范围之内。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
应当理解,本申请的说明书和权利要求书及附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本申请所描述的实施例可以与其它实施例相结合。
随着智能终端日益发展,拍摄功能成为智能终端的必备功能。用户能够利用具备拍摄功能的电子设备对拍摄对象进行拍照或录像,在拍照或录像过程中,电子设备可以调用追焦功能进行追焦。例如在拍摄人像时,电子设备可以调用追焦功能对人脸进行追焦。追焦也可以称为焦点追踪,追焦是指电子设备的焦点对准人脸等拍摄对象后,控制该焦点持续对准拍摄对象,从而提高了拍摄的质量。
但当前在存在多个拍摄主体时,现有技术的拍摄功能无法直接选定需要对焦的主体,需要用户手动选择对焦对象,如此给使用带来不便,降低了用户体验。
请参阅图30,图30为一种拍摄场景的示意图。如图30中A所示的,用户界面100显示了一个放置有应用图标的页面,该页面可包括多个应用图标(例如,天气应用图标、日历应用图标、相册应用图标、便签应用图标、电子邮件应用图标、应用商店应用图标、设置应用图标等等)。上述多个应用图标下方还可显示有页面指示符,以表明当前显示的页面与其他页面的位置关系。页面指示符的下方有多个应用图标(例如,相机应用图标11)。这些应用图标在页面切换时保持显示。可理解,相机应用图标11为相机应用程序(即相机应用)的图标。相机应用图标11可以用于触发启动相机应用程序。
电子设备可以检测到作用于相机应用图标11的用户操作,响应于该操作,电子设备可以显示如图30中B所示的预览界面3101。预览界面3101为相机应用程序的默认拍照模式的拍摄界面,用户可以在该界面上预览图像并完成拍照。当拍摄对象包括多个主体时,例如人和宠物,在相机的预览界面3101中存在人脸或者宠物及其追焦框,用户可以选择对焦对象,电子设备依照用户选择的对焦对象进行对焦。在存在多个主体时,用户需要手动选择对焦对象,如此给使用带来不便,降低了用户对焦拍摄的用户体验。
本申请提供了一种拍摄方法。该拍摄方法可以应用于设置有摄像头的电子设备。根据该拍摄方法,多个拍摄对象同框的拍摄场景下,电子设备可以自动针对其中一个优先级最高的拍摄对象进行追焦,并一直显示该优先被追焦对象的“追焦框”。在本申请的一些实施例中,电子设备可以同时自动追焦优先级最高的拍摄对象和多个优先级次之的对象和不在优先级行列的对象,并根据优先级区分显示追焦对象的“追焦框”。
可理解,在本申请中“对焦”的概念是指过照相机对焦机构变动物距和相距的位置,使被对焦对象成像清晰的过程。“追焦”就是设定对焦点后连续对焦,即便对焦对象发生运动,也能一直保持这个对焦点处于被对准,即追焦为连续对焦的状态。
以下结合图31描述本申请实施例应用的硬件架构。
参考图31,图31示出了一种适用于本申请的电子设备的硬件系统。
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。
其中,传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
需要说明的是,图31所示的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图31所示的部件更多或更少的部件,或者,电子设备100可以包括图31所示的部件中某些部件的组合,或者,电子设备100可以包括图31所示的部件中某些部件的子部件。图31示的部件可以以硬件、软件、或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元。例如,处理器110可以包括以下处理单元中的至少一个:应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、神经网络处理器(neural-network processing unit,NPU)。其中,不同的处理单元可以是独立的器件,也可以是集成的器件。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。例如,处理器110可以包括以下接口中的至少一个:内部集成电路(inter-integrated circuit,I2C)接口、内部 集成电路音频(inter-integrated circuit sound,I2S)接口、脉冲编码调制(pulse code modulation,PCM)接口、通用异步接收传输器(universal asynchronous receiver/transmitter,UART)接口、移动产业处理器接口(mobile industry processor interface,MIPI)、通用输入输出(general-purpose input/output,GPIO)接口、SIM接口、USB接口。图31所示的各模块间的连接关系只是示意性说明,并不构成对电子设备100的各模块间的连接关系的限定。可选地,电子设备100的各模块也可以采用上述实施例中多种连接方式的组合。
电子设备100可以通过GPU、显示屏194以及应用处理器实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194可以用于显示图像或视频。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)、有源矩阵有机发光二极体(active-matrix organic light-emitting diode,AMOLED)、柔性发光二极管(flex light-emitting diode,FLED)、迷你发光二极管(mini light-emitting diode,Mini LED)、微型发光二极管(micro light-emitting diode,Micro LED)、微型OLED(Micro OLED)或量子点发光二极管(quantum dot light emitting diodes,QLED)。
电子设备100可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP可以对图像的噪点、亮度和色彩进行算法优化,ISP还可以优化拍摄场景的曝光和色温等参数。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的红绿蓝(red green blue,RGB),YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
处理器110可以包括一个或多个处理单元。例如,处理器110可以包括以下处理单元中的至少一个:应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、神经网络处理器(neural-network processing unit,NPU)。其中,不同的处理单元可以是独立的器件,也可以是集成的器件。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其 他数字信号。
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1、MPEG2、MPEG3和MPEG4。
NPU是一种借鉴生物神经网络结构的处理器,例如借鉴人脑神经元之间传递模式对输入信息快速处理,还可以不断地自学习。通过NPU可以实现电子设备100的智能认知等功能,例如:图像识别、人脸识别、语音识别和文本理解。
外部存储器接口120可以用于连接外部存储卡,例如安全数码(secure digital,SD)卡,实现扩展电子设备100的存储能力。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能(例如,声音播放功能和图像播放功能)所需的应用程序。存储数据区可存储电子设备100使用过程中所创建的数据(例如,音频数据和电话本)。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如:至少一个磁盘存储器件、闪存器件和通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种处理方法。
电子设备100可以通过音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D以及应用处理器等实现音频功能,例如,音乐播放和录音。
距离传感器180F用于测量距离。电子设备1000可以通过红外或激光测量距离。在一些实施例中,例如在拍摄场景中,电子设备1000可以利用距离传感器180F测距以实现快速对焦。
环境光传感器180L用于感知环境光亮度。电子设备1000可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备1000是否在口袋里,以防误触。
指纹传感器180H用于采集指纹。电子设备1000可以利用采集的指纹特性实现解锁、访问应用锁、拍照和接听来电等功能。
触摸传感器180K,也称为触控器件。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,触摸屏也称为触控屏。触摸传感器180K用于检测作用于其上或其附近的触摸操作。触摸传感器180K可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,并且与显示屏194设置于不同的位置。
按键190包括开机键和音量键。按键190可以是机械按键,也可以是触摸式按键。电子设备100可以接收按键输入信号,实现于按键输入信号相关的功能。
以下实施例中所涉及的技术方案均可以在具有上述硬件架构的电子设备100中实现。
为了便于理解,本申请以下实施例将以具有图31所示结构的电子设备为例,结合 附图和应用场景,对本申请实施例提供的拍摄方法进行具体阐述。
下面结合图32介绍本申请实施例提供的一种电子设备的软件结构。
基于图32所示的电子设备的软件结构,介绍本申请实施例提供的一种“主角追焦”拍摄方法。
如图32所示,在图库应用中的存储模块存储有已采集的原始图像数据,图库将图像中的原始图像数据通过应用框架层中的图像传递模块下发给算法库中的人脸特征提取、聚类算法进行处理。人脸特征提取、聚类算法块会对相同人脸的图像进行特征提取、聚类等处里,并将聚类后的图像返回给图库的存储模块。接收到聚类后的图像数据,图库应用的存储模块会对相同人脸的图像进行聚类存储。图库应用的校验模块会对相机应用是否已经开启了“主角追焦”开关进行校验,如果开关已经打开。图库应用存储模块会将存储的聚类图像数据通过应用框架层的传递模块下发到相机HAL。可选的,存储模块只下发依照相同人脸聚类后,N个聚类人脸的特征数据。可以理解的,聚类人脸的特征数据可以是多张不同图像中相同人脸识别后基于多张图像对该人脸计算得到的人脸特征模型。可选的,要生成人脸特征模型,需要在图库中对单个人脸(如A人)至少存在X张照片,从而基于X张照片生成有A人脸特征模型。本申请对X的数量不做限制。在本申请中,选取N个聚类人脸的特征数据称为“注册人脸”数据。本申请实施例引入“注册人脸”对图库中的人像数据进行描述。注册人脸是指电子设备通过追焦框进行自动追焦的人脸。注册人脸可以是预先确定好的。本申请实施例对注册人脸的确定方式不作具体限定。可以理解,此处是以“注册人脸”为一种实现方式为例描述的,本申请实施例并不限于此。比如,注册人脸也可以是其他的注册对象,比如,猫,狗,等其他物。
电子设备的摄像头采集到的图像通过相机HAL传递到人脸检测算法,人脸检测算法识别图像中的人脸特征信息后回传给相机HAL。相机HAL将人脸检测算法确定的人脸特性信息和“注册人脸”特征数据提供给目标追踪算法进行目标识别。目标识别算法将识别到的主体信息回传给相机HAL,相机HAL将追踪目标上报给相机应用。相机应用的显示模块以区分其他主体的方式显示追踪目标的“追焦框”。目标识别算法可以将最优的“注册人脸”数据下发给自动对焦算法,自动对焦算法根据最优的识别目标调整摄像头进行追焦追踪目标。
用户可以手动选择区域确定追踪目标,如果用户选择的区域经目标识别算法识别有主体,将把识别的主体发送至自动对焦算法进行追焦。如果用户选择的区域经目标识别算法未识别到主体,自动对焦算法根据用户选择的区域追焦。
本申请中将上述使自动对焦算法根据最优的识别目标调整摄像头进行追焦追踪的模式称为“主角追焦”,此处使用的“主角追焦”并不限于所描述和示出的对人物的追焦效果。然而,术语“主角”意在表示将与其他被拍摄对象区分开的任何效果形式。这样效果的示例包括改变相关名称的尺寸、形状、颜色、对比度和/或其他视觉特征,或其他项。在其他实施例中,“主角”指在屏幕或窗口特定区域中显示一个或多个被拍摄对象,以区别于其他的显示方式突出将它们。在其他实施例中,使用非可视化方式实现突出,本领域技术人员应该想到其他可选实施例。
下面结合图33-图35说明前述实施例的具体实现。
一、“注册人脸”数据准备
需要说明的是,“主角追焦”是否可用,需取决于图库应用中的人像数据是否生成。当图库数据已生成时,“主角追焦”可用;当图库数据未生成时,“主角追焦”不可用。
其中,图库中的人像数据已生成可以理解为多个注册人脸已确定。
下将对“注册人脸”的场景进行介绍:
图33示出了图库发现页的显示“注册人脸”的界面示意图。例如,如图33中(1)所示,电子设备的屏幕显示系统显示了当前输出的界面内容,该界面内容显示了多款应用程序APP。用户可以通过在电子设备桌面上点击“图库”应用图标3301,指示电子设备开启图库应用,电子设备显示如图33中(2)所示的界面。如图33中(2)所示,图库中显示的是照片页面,其中,照片页面中包含用户拍摄的照片(比如今天用户拍摄的照片和昨天用户拍摄的照片)。图库界面中还包括相册、时刻、发现控件3302。当用户点击发现控件3302后,可进入图库的发现页,界面显示如图33中(3)所示。如图33中(3)所示,发现页面中包括人像专区3303。在人像专区3303所示的虚线框内,显示有图库中的人像数据,比如,图33中(3)示出了4个人像。可选地,图33中(3)示出的4个人像的排序按照出现在照片中的数量由大到小排序。在人像专区3303所示的虚线框内还包括“更多”控件3304。当用户点击控件3304后,进入人像页面,人像页面中可显示电子设备默认追焦的人物,比如,图33中(4)所示的界面。
如图33中(4)所示,虚线框3306内用于显示多个人像的统计数据。可选地,虚线框3306内显示的多个人像的统计数据包括人像的命名和对应的数量。可选地,虚线框3306内的多个人像可以按照数量从大到小的顺序进行显示。比如,虚线框3306内包括:命名为爸爸的人像(对应数量为58),命名为妈妈的人像(对应数量为53),命名为姐姐的人像(对应数量为46),命名为哥哥的人像(对应数量为45),命名为朋友的人像(对应数量分别为42和30)。其中,每个人像的命名为人像框的左下角,每个人像在照片中出现的数量位于人像框的右下角。比如,以虚线框3306中的人像307为例,人像307的名称为“爸爸”,出现在照片的数量为58。可以理解,图33中(4)示出的人像统计数据是以“个人”类目的照片为例进行说明,本申请实施例并不限于此。比如,图33中(4)示出的人像界面还包括“合影”类目,当用户点击“合影”类目后,界面中可显示合影类目下的人像统计数据。
以下将结合图34中的步骤S500-S505对“注册人脸”的数据准备过程进行介绍:
S500:图库应用下发原始图像数据至人脸特征提取、聚类算法。
示例性的,电子设备可以处于充电息屏状态下,存储模块下发原始图像数据,从而避免图像处理的功耗影响用户的正常使用体验。具体的,存储模块可以将原始图像数据发送给框架层的人脸数据传递模块,然后,人脸数据传递模块再将原始图像数据发送给人脸特征提取、聚类算法。可选的,电子设备确定设备当前是否处于充电灭屏状态以及当前电量是否大于或等于预设电量阈值,若电子设备当前处于充电灭屏状态且当前电量大于或等于预设电量阈值,图库应用下发原始图像数据至人脸特征提取、聚类模块进行处理。若电子设备当前未处于充电灭屏状态,或当前电量小于预设电量 阈值,则图库应用暂不下发原始图像数据。
S501:人脸特征识别提取聚类模块对处理人脸图像,并将人脸特征数据返回给图库应用。
示例性的,当原始图像中包括人脸时,该原始图像可以被称为人脸图像。可以通过方向梯度直方图(histogram of orientedgridients,HOG)或卷积神经网络(convolutional neural network,CNN)等技术实现人脸特征提取生成人脸特征数据。可选的,可以优先生成高频人脸特征数据,高频人脸是指电子设备保存的图像中多次出现的人脸。或者,可以理解为电子设备多次拍摄的人脸。高频人脸可以为图库应用的中包含特征人脸的照片数量从大至小排序中排名前N对应的用户(N为整数)。如图33中(4)所示,多个人像可以按照数量从大到小的顺序排列后,高频人脸为命名为爸爸的人像(对应数量为58),命名为妈妈的人像(对应数量为53),命名为姐姐的人像(对应数量为46)。高频人脸还可以为用户预设的用户,本申请实施例对于高频人脸的具体确定方式不做限定。
可选的,人脸特征提取、聚类算法可以将提取的特征和高频人脸的多个特征中的任意一个特征进行比对、聚类。也可以是,人脸提取、聚类算法将提取的特征和高频人脸的特征计算相似度进行比对。本申请实施例中,电子设备可以通过基于提取的特征与高频人脸的,计算的余弦值(cos值)小于预设值时,提取的特征为高频用户对应的特征,比对结果一致,对相同人脸的原始图像进行聚类。
具体的,在人脸特征提取、聚类算法完成对高频人脸特征数据的聚类后,高频人脸特征数据的回传给图库应用。可理解,算法库中的高频人脸特征数据通过框架层的人脸数据传递模块回传到图库应用。可选的,人脸特征识别提取聚类模块对处理人脸图像后,可以将将全部人脸特征数据返回给图库应用,并不仅限于高频人脸特征数据。
在人脸特征提取、聚类算法完成对高频人脸特征数据的聚类后,一种实施方式是,将排名前N的高频人脸(图库应用的中包含特征人脸的照片数量从大至小排序中排名前N对应的用户)作为本申请中所指代的符合“注册人脸”条件的人脸特征数据。
另一种实施方式是,高频人脸且包含特征人脸的照片数量大于X张的人脸特征数据作为本申请中所指代进行“主角追焦”的“注册人脸”数据。示例性的,对于图33中(4)所示的界面,假设高频人脸为排名前5的人脸,按照照片数量的多少自动确定的前5个高频人脸可分别为:命名为爸爸的人像(对应数量为58),命名为妈妈的人像(对应数量为53),命名为姐姐的人像(对应数量为46),命名为哥哥的人像(对应数量为45),命名为朋友的人像(对应数量为42)。这5个高频人脸可作为电子设备自动追焦的“注册人脸”。一种可选的实施方式是,将照片数量的多少自动确定的前5个且照片数量大于M的作为“注册人脸”:可选的,如果选定M为50,在如图33中(4)中,只有爸爸的人像(对应数量为58)满足条件,因此选择爸爸的人像作为“注册人脸”。
可理解,S501步骤,是本申请中将排名前N的高频人脸作为符合“注册人脸”条件的人脸特征数据的一个实施例。可理解,“注册人脸”可以为采取其他主体时,如人体、猫狗等,可以采取特征识别提取算法对处理图像后,将相对应的主体特征数据返回给图库应用。
S502:图库应用存储人脸特征状态标识。
可理解,可以当图库应用的存储模块中有人脸特征数据时,图库应用向数据库写入标记1;当存储模块中不存在人脸特征数据时,图库应用向数据库写入标记2。可选的,也可以当存储模块中有满足“注册人脸”的人脸特征数据时,图库应用向数据库写入标记1;当存储模块中不存在满足“注册人脸”的人脸特征数据时,图库应用向数据库写入标记2。其中,数据库可以为一个封装在框架层为应用层App提供数据共享的数据库,用于保存用户的偏好设置。
S503:图库应用下发相机主角追焦模式状态的查询请求。
可理解,每次用户对“主角追焦”的控件进行开启或关闭操作(具体开启或关闭方式见下文),都会向数据库中保存“主角追焦”模式状态标识。标识ON代表“主角追焦”模式目前为开启状态,标识OFF代表“主角追焦”模式目前为关闭状态。图库应用可以向数据库发送查询请求,请求获得关于“主角追焦”的开启状态情况。
S504:响应于图库应用对相机主角追焦模式状态的查询请求,数据库返回标识。
可理解,在用户进行设置之前,由于“主角追焦”初始为默认关闭状态,因此数据库初始存储的“主角追焦”模式状态标识为OFF。当用户首次打开了“主角追焦”的开关,相机应用会向数据库写入标识ON。如果用户关闭“主角追焦”的开关,相机应用会再向数据库写入标识OFF。接收相机应用查询“主角追焦”模式状态的请求,数据库根据存储的“主角追焦”模式状态标识,向图库应用返回代表当前“主角追焦”开闭状态中的最新标识。
可选的,如果数据库向图库应用返回标识代表代表“主角追焦”模式开启,在步骤S504之后,还可以包括S505步骤。如果数据库向图库应用返回标识代表代表“主角追焦”模式关闭,将执行S506步骤。
S505:当主角追焦模式开启且人脸特征数据存在,图库应用向相机HAL下发最近一次获得的人脸特征数据。
可理解,数据库向图库应用返回标识ON时,代表“主角追焦”模式开启。如前所述,电子设备处于充电息屏状态下会对人脸图像进行人脸特征数据提取、聚类处理后存储到图库应用。可选的,在步骤S505之前,当图库应用最近一次存储人脸特征数据相比上一次存储人脸特征数据存在变化且“主角追焦”模式开启时,图库应用可以向相机HAL下发最近一次存储的人脸特征数据。可选的,图库应用可以向相机HAL下发最近一次存储的“注册人脸”特征数据。可选的,图库应用可以在当图库应用最近一次存储的“注册人脸”特征数据相比上一次存储“注册人脸”特征数据存在变化且“主角追焦”模式开启时,向相机HAL下发最近一次存储的“注册人脸”特征信息。
可选的,图库应用向相机通过框架层的传递模块向相机HAL下发人脸特征数据。
可理解,本申请对电子设备执行步骤S502和步骤S503-S504的先后顺序不作限制。电子设备可以首先执行步骤S503-S504,可以首先执行步骤S502,还可以同时执行步骤S502和步骤S503-S504。
二、“主角追焦”模式开启
一种可选的实施方式是,可以在相机应用中开启“主角追焦”模式。以下将结合图34中的步骤S506-S516对“主角追焦”模式的过程进行介绍:
S506,用户启动相机应用。
可理解,用户可以触发电子设备启动相机应用。相应的,电子设备中的相机应用可以接收到该启动相机应用的请求。
示例性的,如图30中A所示,用户可以点击相机应用图标11,相应的,电子设备可以接收到启动相机应用的请求。响应于该启动相机应用的请求,电子设备可以启动相机应用并显示图30中B所示的用户界面3101。可理解,用户也可以通过语音、手势等方式启动相机应用,本申请对用户触发电子设备启动相机应用的具体方式不作限制。
可理解,摄像头接收相机应用发送的启动摄像头的请求之后,可以启动。并且,摄像头启动之后,可以持续采集原始图像数据。摄像头可以将采集的原始图像数据发送给相机HAL。
可理解,当相机应用处于预览模式时,相机HAL可以对原始图像数据进行处理,并将处理后的图像送到显示屏进行显示。可理解,这里所提及的预览模式可以包括拍照预览模式、录像预览模式等。
应理解,步骤S500-S505步骤并不是步骤S506之前的必要步骤,电子设备可以首先执行步骤S500-S505,可以首先执行步骤S506。
S507:相机应用查询人脸特征数据存储状态
可理解,当数据库存储有代表图库应用是否存在人脸特征数据标识时,相机应用可以向数据库请求获取标识。可选的,如果数据库存储的是代表图库应用是否存在满足“注册人脸”的人脸特征数据时,相机应用可以向数据库请求获取该标识,从而不与图库应用直接交互就能获取图库应用的“注册人脸”存储状态的信息。可选的,当数据库存储有“主角追焦”模式状态标识时,相机应用查询人脸特征数据存储状态时,相机应用也可以向数据库请求获取该标记。本申请对电子设备查询人脸特征数据存储状态和查询的“主角追焦”模式状态先后顺序不作限制。相机应用可以首先查询人脸特征数据存储状态可以首先查询的“主角追焦”模式状态,还可以同时查询。
S508:数据库返回人脸特征数据标识
可理解,当接受到相机应用查询人脸特征数据存储状态的请求,数据库根据存储的人脸特征数据状态标识,向相机应用返回标识1或者标识2中的一个。具体的,返回标识1代表图库应用中存在人脸特征数据标识(或者满足“注册人脸”的人脸特征数据),返回标识2代表图库应用中不存在人脸特征数据标识(或者满足“注册人脸”的人脸特征数据)。
可选的,如果在S507步骤中相机应用向数据库还发送了查询的“主角追焦”模式状态的请求,当接收相机应用查询主角追焦模式状态的请求,数据库根据存储的“主角追焦”模式状态标识,向图库应用返回代表当前“主角追焦”开闭状态中的标识。
可选的,作为一个实施例,当数据库人脸特征数据存储状态标识存在时,代表“主角追焦”模式是可以被使用的状态。此时,如果“主角追焦”模式开关关闭时,电子设备可以提示用户开启“主角追焦”模式开关,具体为在执行S506-S508步骤后,还可以包括S509-S512。应理解,步骤S509-S512步骤并不是步骤S506-S508之后的必要步骤。
S509:当主角追焦模式关闭且人脸特征数据存在时,显示第一界面。
示例性的,数据库人脸特征数据存储状态标识1和“主角追焦”模式开闭状态标识为OFF时,代表应用图库中有“注册人脸”数据且主角追焦模式处于关闭状态。在电子设备启动相机应用之后,电子设备识别到图库已经生成可用人脸数据时,可以显示如图35中(1)所示的用户界面。拍照预览界面中显示窗口3501(即第一界面的一种实施方式),窗口3501用于提示用户是否开启“主角追焦”功能。比如,窗口3501中展示的内容为:是否开启“主角追焦”功能?识别图库中常拍的人像,优先进行追焦。从而提示用户开启“主角追焦”模式。可理解,用户也可以通过语音、手势等方式触发电子设备进入追焦模式。
S510:响应于用户开启主角追焦模式的操作,相机应用向数据库写入主角追焦模式状态标识。
示例性的,当出现提示框后,当用户操作开启“主角追焦”模式,例如操作了图35中(1)所示的开启控件353(即第一控件的一种实施方式),“主角追焦”模式将开启。具体的,相机应用会向数据库写入标识ON,代表主角追焦模式已经开启。可理解,原始OFF标识会被本次写入的新标识替代或降低被请求获取时的返回优先级。可理解,在“主角追焦”模式开启后,此时在如图35中(2)所示的设置界面,“智能追焦”的选项351和“主角追焦”的选项352处于开启状态。
S511:相机应用调用图库应用接口,下发刷新人脸特征数据请求至图库应用。
可理解,图库应用可以向相机HAL刷新存储的人脸特征数据,相机应用可以通过调用图库应用接口向图库下发刷新人脸特征数据的请求。
S512:接收到刷新人脸特征数据请求,图库应用查询主角追焦模式状态。
可理解,数据库中保存有“主角追焦”模式状态标识。在本实施例中,S510步骤中相机应用已经数据库写入标识ON,标识ON代表“主角追焦”模式目前为开启状态,因此图库应用可以查询“主角追焦”模式状态。
S513:响应于图库应用对相机主角追焦模式状态的查询请求,数据库返回标识。
在本实施例中,S510步骤中相机应用已经数据库写入标识ON,标识ON代表“主角追焦”模式目前为开启状态,即数据库返回的标识ON。
如果“主角追焦”模式开关已经为打开状态时,电子设备在进行“主角追焦”模式拍摄之前,还需要执行S514-S515步骤,下发人脸特征数据到算法库,以便追焦算法确定需要追焦的人脸进行追焦。
S514:当主角追焦模式开启时,图库应用向相机HAL下发人脸特征数据。
在本实施例中,可选的,可以参照S505步骤向相机HAL下发最近一次保存的人脸特征数据。可选的,本步骤可以只下发最近一次保存的符合“注册人脸”条件的人脸特征数据。
S515:相机HAL将人脸特征数据发送给算法库。
作为一种实施例,相机HAL可以保存最近一次获取的人脸特征数据并下发给算法库中目标识别算法。可选的,相机HAL可以只下发最近一次获取的符合“注册人脸”条件的人脸特征数据至算法库中目标识别算法。
在本申请的一些实施例中,在S515步骤之后,还可以包括:
S516:当主角追焦模式开启时,响应于用户开启主角追焦模式的操作,相机应用下发开启注册人脸追焦指令。
在本实施例中,可理解,相机应用可以通过相机HAL向算法库下发注册人脸追焦指令,从而使算法对注册人脸进行追焦,具体追焦过程将在下文进行介绍。
一种可选的实施方式,除了在相机应用中开启“主角追焦”模式,还可以在设置中开启“主角追焦”模式。
图36是相机设置的一个界面示例图(即第一界面的另一种实施方式)。图36中(1)示出了“主角追焦”不可用的状态的界面。当图库中的注册人脸数据生效后,界面显示如图36中(2)所示,设置界面中的“主角追焦”的选项352为可用状态。可用状态也可以理解为非置灰状态,即用户可以对其进行操作。
图36中(2)所示的“主角追焦”的选项352可以被用户点击(即第一控件的另一种实施方式)。当用户点击“主角追焦”的选项352后,“主角追焦”被打开,界面显示如图36中(3)所示,“主角追焦”的选项352为开启状态。“主角追焦”模式将开启。具体的,相机应用会向数据库写入标识ON,代表“主角追焦”模式已经开启。
可理解,在相机设置界面中开启“主角追焦”开关后的实现步骤可以参考在相机应用中通过提示框开启“主角追焦”的S510-S516步骤,在此不再赘述。
可理解,无论相机设置界面中开启“主角追焦”模式或是相机应用中开启“主角追焦”,“主角追焦”的开启需取决于图库中的注册人脸数据是否生效。如果判断出图库中的注册人脸数据生效,或者判断图库已经生成可用人像数据,那么“主角追焦”的选项为可用状态。如果图库中的注册人脸数据未生效,那么“主角追焦”的选项为不可用状态,比如,通过置灰禁用的方式告知用户“主角追焦”不可用。
三、“主角追焦”模式关闭
进一步地,用户还可以点击“智能追焦”的选项进行关闭。由于“智能追焦”与“主角追焦”是联动的,且开启“主角追焦”的前提是“智能追焦”已打开,因此当“智能追焦”的选项关闭后,“主角追焦”的选项也自动关闭。例如,用户点击图36中(3)所示的“智能追焦”的选项351关闭“智能追焦”,界面显示如图36中(4)所示。如图36中(4)所示,“智能追焦”的选项351为关闭状态,设置选项中也不显示“主角追焦”的选项352。
在本申请的一些实施例中,为了实现关闭“主角追焦”模式,在S516步骤之后,还可以包括:
S517:响应于用户关闭主角追焦模式的操作,相机应用向数据库写入主角追焦模式状态标识。
具体的,相机应用会向数据库写入标识OFF,代表主角追焦模式已经关闭。可理解,已经存在的ON标识会被本次写入的标识替代或降低被请求获取时的返回优先级。
S518:当主角追焦模式关闭时,响应于用户开启主角追焦模式的操作,相机应用下发关闭注册人脸追焦指令。
在本实施例中,可选的,可理解,相机应用可以通过相机HAL向算法库下发关闭“注册人脸”追焦指令,从而停止算法对“注册人脸”追焦。
S519:当主角追焦模式关闭时,相机应用下发清除人脸特征数据的指令。
可选的,当“主角追焦”模式关闭,在图库应用向相机通过框架层的传递模块向相机HAL下发清除人脸特征数据的指令。
可理解,本申请对电子设备执行步骤S517-S519执行先后顺序不作限制。电子设备还可以同时执行S517、S518和S519。
四、自动“主角追焦”
如图37所示的流程图,电子设备在开启“主角追焦”模式后进入相机应用拍摄时,电子设备会自动识别拍摄主体是否为注册人脸。如果识别到注册人脸,则电子设备对“注册人脸”进行追焦。
在S516步骤相机应用下发开启注册人脸追焦指令至算法库后,可以包括:
S3700:终端获取待拍摄场景的第一预览图像,确定目标主体。
相机应用启动之后,摄像头可以持续采集图像,终端将采集到的图像预览显示时,可以将图像(即第一图像)发送给相机HAL。可选的,相机应用通过回调函数,回调预览流,对回调获得的图像进行处理。示例性的,以对图像1的处理为例,相机HAL将图像1发送至目标识别算法。目标识别算法对图像1进行图像识别,以、获得预览图像中的识别到的主体信息类别标签。其中主体信息类别标签可以包括:人脸、人体、猫、狗等,本方案在此不做限制。
S3701:当存在可识别的主体时,上报识别到的主体信息
可选的,以对目标识别算法输入图像1识别人脸为例,对该图像进行关键点的检测定位,以识别到关键点的检测定位结果,检测定位结果包括该图像中人脸的关键点,通过人脸的关键点定位出人脸。利用人脸的关键点从图像中裁剪出人脸的图像,并对人脸的图像进行仿射变换完成对人脸的矫正,然后通过卷积神经网络(Convolutional Neural Network,CNN)对矫正后的人脸进行特征提取,得到人脸的特征。
对图库应用中人脸的图像,图像匹配模块同样对图库应用中人脸的图像进行关键点的检测定位,利用人脸的关键点从图像中裁剪出人脸,并对人脸进行仿射变换完成对人脸的矫正,然后通过对矫正后的人脸进行特征提取,得到人脸的特征。进而对获得的人脸特征是否符合“注册人脸”的人脸特征进行判断。可理解,目标识别算法还可以识别人体、猫、狗等主体信息。
目标识别算法将识别到的主体信息回传给相机HAL,相机HAL将追踪目标上报给相机应用。可选的在上报识别到的主体信息时,还可以上报追焦ID、追焦状态,追焦区域,追焦状态、标识已注册人脸等作为“标识数据”。其中,追焦ID表明追焦的对象ID,用于标识追焦对象;追焦类型包括人脸、人体、猫、狗,用以区分追焦主体;标识已注册人脸用于标识是否符合“注册人脸”的人脸特征。
S3702:基于最高优先级的目标进行自动对焦
由于在S515步骤中,图库已经向目标识别算法下发了符合“注册人脸”条件的人脸特征数据。目标识别算法可以根据识别到的所有主体信息和“注册人脸”条件的人脸特征数据的匹配情况确定识别到的主体的优先级。目标识别算法将识别到的所有主体信息及其优先级信息下发给自动对焦算法。
在一种可能的实施方式中,“注册人脸”之外的也可以是其他的对象,比如,猫, 狗,等其他物,因此可以参照注册人脸>非注册人脸>人体>猫>狗的方法方式确定优先级,即当识别到的主体信息(人脸)中有符合“注册人脸”条件的人脸特征数据时,符合“注册人脸”条件的人脸特征数据的主体为优先级最高的人脸。在一种可能的实现方式中,当识别到的主体信息(人脸)中有多个符合“注册人脸”条件的人脸特征数据时,以多个符合“注册人脸”条件的人脸特征数据的人脸中面积最大的为优先级最高的人脸,即优先级为:人脸面积大的注册人脸>人脸面积小的注册人脸>非注册人脸>人体>猫>狗。在其他实施方式中,也可以设置性别、年龄、人种、妆容、发型等特征条件确定多个符合“注册人脸”条件的人脸特征数据的人脸中优先级最高的人脸。
可选的,目标识别算法将识别到的所有主体信息和优先级最高主体信息发给自动对焦算法,自动对焦算法优先对部分主体调整摄像头进行自动对焦追踪目标。可理解,当自动对焦算法对部分主体对焦时,可以先对焦优先级高的主体。一种实施方式是,当根据是否符合“注册人脸”条件设定优先级,自动对焦算法优先对焦主体信息(人脸)中符合“注册人脸”条件的主体(人脸)。当存在多个符合“注册人脸”条件的人脸,自动对焦算法优先对焦其中优先级最高的主体(注册人脸)。
S3703:显示追踪目标的对焦框
相机根据识别到的主体信息确定焦点,绘制对焦框并显示对焦框。
在单人、多人的场景下,相机应用根据目标识别算法将识别到的主体信息是否存在注册人脸,追焦框的显示会存在不同,具体场景参照前文。
可理解,本申请对电子设备执行步骤S3702-S3703执行先后顺序不作限制,电子设备还可以同时执行S3702、S3703。
当开启了“智能追焦”和“主角追焦”后,用户在使用相机拍摄时,电子设备会自动识别拍摄主体是否为注册人脸。如果识别到注册人脸,则电子设备对注册人脸进行追焦。以下将结合各个界面详细介绍识别到注册人脸进行自动“主角追焦”的实施例。
图38示出了开启“智能追焦”和“主角追焦”功能后的相机预览界面示例图。当只有单人时,目标识别算法识别到人脸A,且人脸A为“非注册人脸。目标识别算法将人脸A的信息下发给自动对焦算法,自动对焦算法对人脸A进行追焦。目标识别算法将人脸A的信息及标识已注册人脸等“标识数据”上报给相机应用用于绘制针对人脸A的追焦框。如图38中(1)所示,此时针对“非注册人脸”A的追焦框为常规追焦框3801。常规追焦框3801在一段时间(比如,5秒)后会自动消失。可选的常规追焦框3801通常在预览界面中通常显示为白色。可选的,常规追焦框为常规显示,且仅包括一个主框。
随着镜头的移动,当拍照预览界面出现人脸B时,目标识别算法识别到识别到人脸B为注册人脸时,目标识别算法将人脸B的信息及标识已注册人脸等“标识数据”上报给相机应用用于绘制针对人脸B的追焦框。此时针对人脸B的追焦框为本申请提出的主角追焦框。图38中(2)是以单个注册人脸的拍照场景为例进行描述。如图38中(2)所示,预览界面显示人脸B以及主角追焦框3803。当人脸B发生移动时,自动对焦算法会持续追焦人脸B,主角追焦框3803也会跟随人脸B进行移动。比如,当 人脸B发生移动时,图38中(2)示出的画面帧和图38中(3)示出的画面帧中,主角追焦框3803一直跟随人脸B发生移动。并且,主角追焦框的大小也会随着人脸B的移动随之发生变化。
主角追焦框3803用于对人脸B进行主角追焦(或持续追焦)。可选的,主角追焦框高亮显示,且包括主框和副框。应理解,图38中(2)或图38中(3)示出的主角追焦框在具体实现时可以为黄色或其他高亮颜色,以区分于常规追焦框。可理解,本领域技术人员可以对常规追焦框和主角追焦框的颜色、显示、大小、形状等进行其他设计,以进行区分,图38中(2)或图38中(3)示出的主角追焦框3803仅是示例。
上述图38中(2)或图38中(3)示出的界面示例均为单个注册人脸的拍摄场景。对于多人拍摄场景,本申请实施例仍然适用。
作为一种实施例,多人拍摄场景是指:在进行拍摄时,拍摄对象可能会有多个的情况。对于多个拍摄对象,若目标识别算法在多个拍摄对象中没有识别到注册人脸,即多个拍摄对象均为非注册人脸。目标识别算法确定多个非注册人脸中优先级最高的人脸Z的信息(确定方法参考前文),将人脸Z的信息下发给自动对焦算法,自动对焦算法对人脸Z进行对焦。目标识别算法将识别到的多个非注册人脸信息及标识已注册人脸等的“标识数据”上报给相机应用用于绘制针对多个非注册人脸对象的追焦框,相机应用针对每个非注册人脸的追焦框均为常规追焦框。参考前述,常规追焦框在一段时间(比如,5秒)后会自动消失。常规追焦框3801通常在预览界面中通常显示为白色。可理解,作为一种实施例,在拍摄多个非注册人脸对象时,在追焦功能上,自动对焦算法可以只对焦优先级最高的目标,而在相机预览界面上会对识别到的所有主体都显示常规追焦框。
若目标识别算法在多个拍摄对象中识别多个拍摄对象均为注册人脸,即存在多个注册人脸,作为一种实施例,目标识别算法将根据优先级对多个注册人脸进行排序。目标识别算法确定多个非注册人脸中优先级最高的人脸Y的信息(确定方法参考前文),将人脸Y的信息下发给自动对焦算法进行追焦。目标识别算法将识别到的多个注册人脸信息及标识已注册人脸等的“标识数据”上报给相机应用用于绘制针对多个对象的追焦框。相机应用对优先级最高的注册人脸绘制主角追焦框,对多个注册人脸中除去优先级最高的注册人脸以外的注册人脸,绘制非主角追焦框。其中,主角追焦框与非主角追焦框可以均认为是注册追焦框,即针对注册人脸的追焦框。非主角追焦框与主角追焦框的区别在于:二者的颜色不同。相比于非主角追焦框而言,主角追焦框会在界面中高亮显示,以突出主角人像。比如,主角追焦框的线条采用黄色,非主角追焦框采用白色。
可理解,若目标识别算法在多个拍摄对象中识别多个拍摄对象为注册人脸和非注册人脸,作为一种实施例,目标识别算法对优先级最高的注册人脸进行追焦,相机应用对优先级最高的注册人脸绘制主角追焦框,对多个注册人脸中除去优先级最高的注册人脸以外的注册人脸,绘制非主角追焦框,对非注册人脸绘制常规追焦框,常规追焦框在一段时间(比如,5秒)后会自动消失。另外,非主角追焦框与主角追焦框的框型相同,即非主角追焦框包括主框和副框。而常规追焦框为单框。因此,从框型的角度来讲,非主角追焦框不同于常规追焦框。
图39示出了在拍照模式下多人拍摄场景的一种示例图。如图39中(1)所示,在追焦框显示上,拍照预览界面中出现人脸A、人脸B、人脸C、人脸D时,如果电子设备识别到人脸A为非注册人脸,人脸B、人脸C和人脸D均为注册人脸,并且,人脸B是多个注册人脸(比如人脸B、人脸C和人脸D)中最靠近镜头的人脸,那么此时针对人脸A采用常规追焦框3801,针对人脸B的追焦框为本申请提出的主角追焦框3803,针对人脸C和人脸D的追焦框为本申请提出的非主角追焦框903。常规追焦框3801的相关描述可以参考图39处的描述。主角框3803和非主角追焦框903均由主框和副框组成,区别在于主角框3803相比于非主角追焦框903而言会高亮显示,以突出主角人像。在一段时间后,针对人脸A的常规追焦框3801自动消失,比如,在5秒后,界面显示如图39中(2)所示,针对人脸A的常规追焦框3801消失,而针对人脸B的主角追焦框3803、针对人脸C和人脸D的非主角追焦框903未消失。
在追焦功能上,一种可选的实施方式是自动对焦算法追焦优先级最高的注册人脸。若多个符合“注册人脸”条件的人脸特征数据的人脸中面积最大的为优先级最高的人脸时,随着人脸或镜头的移动,画面中人脸靠近镜头的排序发生变化,拍摄对象的优先级会发生变化。例如,如图39中(3)所示,随着人脸或镜头的移动,人脸C成为多个注册人脸(比如人脸B、人脸C和人脸D)中面积最大的人脸,那么此时针对人脸C采用主角追焦框,并同时将人脸B的追焦框切换为非主角追焦框。在追焦框重新绘制的时,自动对焦算法从追焦人脸B到追焦人脸C。
在其他实施例中,追焦类型包括人体、猫、狗等也可以属于“非注册人脸”。可选的,当拍照预览界面中出现了人体时,可以不对人体绘制追焦框。当拍照预览界面中出现了猫或狗时,可以绘制常规追焦框,本实施例在此不做限制。应理解,对于“注册人脸”和“非注册人脸”采取不同的追焦框以显示,本领域技术人员可以调整追焦框的颜色、形状、大小、显示方式等,比如对于“注册人脸”采取大框,对于“非注册人脸”采取小框。或者对于“注册人脸”的追焦框以闪烁显示,对于“非注册人脸”以静止显示等。
可理解,在其他实施例中,自动对焦算法也可以自动/依照用户手动追焦一个或多个其他对象,本实施例在此不做限制。以下将详细介绍在“主角追焦”模式下,用户手动人为干预追焦的情形。
五、自动主角追焦后人为干预
上面描述的是拍摄时不存在人为干预时进行追焦的相关实施例。以下将描述存在人为干预时进行追焦的相关实施例。人为干预是指用户通过主动点击界面中的某个区域或某个对象,以选择期望被追焦的对象。界面包括但不限于拍照预览界面、录像预览界面或录制视频界面(即录制视频过程中的画面)。
在界面被人为干预前,电子设备自动识别拍摄主体进行追焦。一种可选的实施方式是,如前文所述,如果未识别到注册人脸,则对拍摄对象显示常规追焦框,对焦优先级最高的对象,可以参照人脸面积大的人脸>人脸面积小的人脸>人体>猫>狗的方法方式确定优先级。如果识别到注册人脸,则对符合“注册人脸”条件的人脸特征数据中的人脸显示注册追焦框,追焦优先级最高的人脸。但是,当界面存在人为干预时,比如,用户主动点击拍照预览界面或录像预览界面中的某个人脸,那么电子设备 以用户选择的人或物为准,将用户选择的人或物作为被追焦的对象,而不考虑是否符合“注册人脸”条件的人脸特征数据的因素。
具体的,如图40,在S3703显示追踪目标的追焦框后,还可以包括:
S3704:接收到用户选择特定目标区域,对目标区域进行识别
响应于用户选择特定目标区域的操作,相机应用将目标区域提供给目标识别算法,目标识别算法对目标区域是否存在目标主体进行识别。可选的相机应用将目标区域发送给相机HAL,相机HAL将目标区域发送给算法库中的目标识别算法。
S3705:当存在可识别的主体时,上报识别到的主体信息
当存在可识别的主体时,目标识别算法将识别到的主体信息回传给相机HAL,相机HAL将追踪目标上报给相机应用。
S3706:基于识别到的主体信息进行自动追焦
目标识别算法将识别到的主体信息发给自动对焦算法,自动对焦算法根据将识别到的主体信息调整摄像头进行对焦追踪目标。可选的,自动对焦算法可以不仅可以追焦目标区域识别到的主体还可以保持追焦追踪目标非目标区域识别的主体。
S3707:显示追焦框
相机根据识别到的主体信息确定焦点,绘制追焦框并显示追焦框。
可理解,本申请对电子设备执行步骤S3706-S3707执行先后顺序不作限制。
追焦框的显示可以参考如图41中(1)所示,在单人拍照场景的预览界面中,对非注册人脸A显示常规追焦框3801并追焦。当用户点击人脸A后,界面显示为如图41中(2)。如图41中(2)所示,在拍照预览界面中,针对人脸A显示高亮追焦框3804和用于标示曝光量的小太阳图标3805。可以通过操作小太阳图标3805调整曝光量,可以理解,小太阳图标仅为示例描述,事实上可以替换为其他标识曝光量的图标。
图42中示出了多人拍照场景下且识别到注册人脸时存在人为干预界面示例图。如图42中(1)所示,在多人拍照场景的预览界面中,对非注册人脸A显示常规追焦框3801,对注册人脸B显示主角追焦框3803并进行追焦,对注册人脸C显示非主角追焦框903。用户可主动点击人脸C,将人脸C作为目标追焦对象。
比如,当用户点击人脸C后,自动对焦算法追焦人脸C,相机界面显示如图42中(2)所示。如图42中(2)所示,在拍照预览界面中,针对人脸C显示高亮追焦框3804和小太阳图标3805,并且,人脸A的常规追焦框3801与人脸B的主角追焦框3803均消失。
前述描述了开启“主角追焦”模式后。用户人为干预后选中了人脸进行追焦的场景,在一个实施例中,用户还可以点击非人脸区域或者算法无法识别对象类型的区域,如图在S3704后,还可以包括:
S3708:当目标不存在可识别的主体时,对目标区域进行自动追焦并显示追焦框
当目标识别算法没有识别到任何主体信息或者识别到的主体信息不符合条件,相机应用对选定的目标区域进行追焦并显示追焦框。比如,如图43中(1),对非注册人脸A显示常规追焦框3801并追焦。当用户点击区域1后,自动追焦算法追焦区域1,相机界面显示如图43中(2)所示。在拍照预览界面中,在区域1显示高亮追焦框3804和小太阳图标3805。可理解,如果存在注册人脸,在自动对注册人脸追焦后,如果用 户手动干预选择某个区域进行追焦,自动对焦算法将追焦用户选择的区域,并且在用户选择的区域而非注册人脸上显示追焦框。
在一种可能的实现方式中,在对用户选择特定目标区域的主体进行追焦后,电子设备可以将该主体作为“注册人脸”且将其追焦优先级设置为最高,此处不再结合附图进行说明
在一种可能的实现方式中,“注册人脸”为宠物、建筑物时,电子设备也可以利用上述对象追焦方法进行“主角追焦”。
在一种可能的实现方式中,“注册人脸”可以是在电子设备上由用户在图库应用中预设的,例如用户可以通过在图库中选定人脸A的方式将人脸A选定为“注册人脸”。可以存储到图库应用的存储空间中,图库应用的个人相册能够从存储空间中读取“注册人脸”的图像,以通过个人相册显示“注册人脸”的所有图像。此外,为了能够区分“注册人脸”图像和非“注册人脸”图像,可以为“注册人脸”的图像添加区分标记。
在一种可能的实现方式中,电子设备可以将图库应用中的同一标签下的对象作为“注册人脸”。例如,图库应用的个人相册中保存了标签为家人和朋友的图像,可以将图库应用中标签为家人的对象都作为“注册人脸”。
在其他一些可能的实现方式中,“注册人脸”可以来源于机主人脸识别的人脸数据,如人脸解锁时获取的人脸数据。“注册人脸”也可以来自其他电子设备上存储的数据,本申请对“注册人脸”数据的来源不做限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请还提供了一种计算机程序产品,该计算机程序产品被处理器执行时实现本申请中任一方法实施例所述的方法。
该计算机程序产品可以存储在存储器中,经过预处理、编译、汇编和链接等处理过程最终被转换为能够被处理器执行的可执行目标文件。
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被计算机执行时实现本申请中任一方法实施例所述的方法。该计算机程序可以是高级语言程序,也可以是可执行目标程序。
该计算机可读存储介质可以是易失性存储器或非易失性存储器,或者,可以同时包括易失性存储器和非易失性存储器。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous  DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
本领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和设备的具体工作过程以及产生的技术效果,可以参考前述方法实施例中对应的过程和技术效果,在此不再赘述。
在本申请所提供的几个实施例中,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的方法实施例的一些特征可以忽略,或不执行。以上所描述的装置实施例仅仅是示意性的,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,多个单元或组件可以结合或者可以集成到另一个系统。另外,各单元之间的耦合或各个组件之间的耦合可以是直接耦合,也可以是间接耦合,上述耦合包括电的、机械的或其它形式的连接。
应理解,在本申请的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请的实施例的实施过程构成任何限定。
另外,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中的术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请实施例中出现的术语(或者说编号)“第一”、“第二”、…等,仅用于描述目的,即只是为了区分不同的对象,比如,不同的“标定数据”等,并不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、…等的特征可以明示或者隐含地包括一个或者更多个特征。在本申请实施例的描述中,“至少一个(项)”是指一个或多个。“多个”的含义是两个或两个以上。“以下至少一个(项)”或其类似表达,是指这些项中的任意组合,包括单个(项)或复数个(项)的任意组合。
例如,本申请实施例中出现的类似于“项目包括如下中至少一种:A,B,以及C”表述的含义,如无特别说明,通常是指该项目可以为如下中任一个:A;B;C;A和B;A和C;B和C;A,B和C;A和A;A,A和A;A,A和B;A,A和C,A,B和B;A,C和C;B和B,B,B和B,B,B和C,C和C;C,C和C,以及其他A,B和C的组合。以上是以A,B和C共3个元素进行举例来说明该项目的可选用条目,当表达为“项目包括如下中至少一种:A,B,……,以及X”时,即表达中具有更多元素时,那么该项目可以适用的条目也可以按照前述规则获得。
总之,以上所述仅为本申请技术方案的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (40)

  1. 一种追焦方法,其特征在于,包括:
    响应于用户的第一操作,显示相机预览界面;
    对所述相机预览界面中显示的各个对象进行识别处理,以确定各个所述对象的对象类型;
    根据各个所述对象的对象类型,确定各个所述对象的追焦框类型;
    根据各个所述对象的对象类型及预设的优先级策略,确定各个所述对象的第一追焦优先级,其中,所述预设的优先级策略是根据所述用户对各个所述对象类型的关注程度设定的;
    根据各个所述对象的追焦框类型,生成各个所述对象对应的追焦框,并根据各个所述对象的坐标,在所述相机预览界面中显示各个所述对象对应的追焦框;
    根据各个所述对象的第一追焦优先级,将所述第一追焦优先级最高的任一所述对象确定为目标追焦对象,并对所述目标追焦对象进行追焦处理。
  2. 如权利要求1所述的方法,其特征在于,所述对象类型包括以下类型:图库中排序处于前N的人像、非图库中排序处于前N的人像、预设类型的非人脸对象,其中,N为大于或等于1的正整数;
    所述图库中排序处于前N的人像的追焦框类型为第一追焦框类型或第二追焦框类型,所述非图库中排序处于前N的人像的追焦框类型及所述预设类型的非人脸对象的追焦框类型为第三追焦框类型,其中,所述第一追焦框类型、所述第二追焦框类型及所述第三追焦框类型均不相同;
    所述预设的优先级策略为:所述图库中排序处于前N的人像的第一追焦优先级高于所述非图库中排序处于前N的人像的第一追焦优先级,所述非图库中排序处于前N的人像的第一追焦优先级高于所述预设类型的非人脸对象的第一对焦优先级。
  3. 如权利要求2所述的方法,其特征在于,所述根据各个所述对象的追焦框类型,生成各个所述对象对应的追焦框,并根据各个所述对象的坐标,在所述相机预览界面中显示各个所述对象对应的追焦框,包括:
    在所述对象中包含所述对象类型为所述图库中排序处于前N的人像的一个第一对象时,根据所述第二追焦框类型,生成所述第一对象对应的第一追焦框,并根据所述第一对象的坐标,在所述相机预览界面中显示所述第一对象对应的第一追焦框;
    在所述对象中包含所述对象类型为所述图库中排序处于前N的人像的一个所述第一对象及至少一个第二对象时,根据所述第一追焦框类型,生成所述第一对象对应的第一追焦框,以及根据所述第二追焦框类型,生成各个所述第二对象对应的第二追焦框,并根据所述第一对象及各个所述第二对象的坐标,在所述相机预览界面中显示所述第一对象对应的第一追焦框及各个所述第二对象对应的第二追焦框,其中,所述第一对象的尺寸大于各个所述第二对象的尺寸。
  4. 如权利要求3所述的方法,其特征在于,所述根据所述第一追焦框类型,生成所述第一对象对应的第一追焦框,以及根据所述第二追焦框类型,生成各个所述第二对象对应的第二追焦框,并根据所述第一对象及各个所述第二对象的坐标,在所述相机预览界面中显示所述第一对象对应的第一追焦框及各个所述第二对象对应的第二追 焦框之后,还包括:
    若确定任一第二对象的尺寸大于所述第一对象的尺寸,则将所述任一第二对象确定为新的第一对象,以及将所述第一对象确定为新的第二对象,并将所述新的第一对象对应的追焦框由所述第二追焦框更改为所述第一追焦框,以及将所述新的第二对象对应的追焦框由所述第一追焦框更改为所述第二追焦框。
  5. 如权利要求2所述的方法,其特征在于,所述根据各个所述对象的追焦框类型,生成各个所述对象对应的追焦框,并根据各个所述对象的坐标,在所述相机预览界面中显示各个所述对象对应的追焦框之后,还包括:
    在所述对象的对象类型为所述非图库中排序处于前N的人像或所述预设类型的非人脸对象时,确定所述对象对应的追焦框的显示时长;
    在所述对象对应的追焦框的显示时长达到时长阈值时,停止显示所述对象对应的追焦框。
  6. 如权利要求2所述的方法,其特征在于,所述根据各个所述对象的第一追焦优先级,将第一追焦优先级最高的任一所述对象确定为目标追焦对象,包括:
    判断所述对象中是否包含所述对象类型为图库中排序处于前N的人像的第一对象;
    若所述对象中包含至少一个所述第一对象,则将所述第一对象确定为第一优先级最高的对象,并将任一所述第一对象确定为所述目标追焦对象;
    若所述对象中未包含所述第一对象,则判断所述对象中是否包含所述对象类型为所述非图库中排序处于前N的人像的第二对象;
    若所述对象中包含至少一个所述第二对象,则将所述第二对象确定为第一优先级最高的对象,并将任一所述第二对象确定为所述目标追焦对象;
    若所述对象中未包含所述第二对象,则判断所述对象中是否包含所述对象类型为所述预设类型的非人脸对象的第三对象;
    若所述对象中包含至少一个所述第三对象,则将所述第三对象确定为第一优先级最高的对象,并将任一所述第三对象确定为所述目标追焦对象;
    若所述对象中未包含所述第三对象,则在所述预览界面中进行中心对焦处理。
  7. 如权利要求2-6任一所述的方法,其特征在于,所述根据各个所述对象的第一追焦优先级,将第一追焦优先级最高的任一所述对象确定为目标追焦对象,并对所述目标追焦对象进行追焦处理之后,还包括:
    响应于所述用户对任一对象的点击操作,将所述任一对象确定为指定追焦对象;
    若所述指定追焦对象为所述目标追焦对象,则持续对所述指定追焦对象进行追焦处理,直至获取到用户对任一所述对象的点击操作;
    若所述指定追焦对象不为所述目标追焦对象,则暂停对所述目标追焦对象进行追焦处理,并持续对所述指定追焦对象进行追焦处理,直至获取到所述用户对任一所述对象的点击操作。
  8. 如权利要求7所述的方法,其特征在于,所述响应于所述用户对任一对象的点击操作,将所述任一对象确定为指定追焦对象之后,还包括:
    若所述指定追焦对象为所述目标追焦对象、且所述指定追焦对象的对象类型为所述图库中排序处于前N的人像,则保持所述指定追焦对象的追焦框类型不变,以及持 续显示所述指定追焦对象的追焦框,并暂停显示除所述指定追焦对象之外的各个所述对象的追焦框;
    若所述指定追焦对象不为所述目标追焦对象、且所述指定追焦对象的对象类型为所述图库中排序处于前N的人像,则将所述指定追焦对象的追焦框类型更改为所述第一追焦框类型,以及根据所述第一追焦框类型生成并持续显示所述指定追焦对象对应的第一追焦框,并暂停显示除所述指定追焦对象之外的各个所述对象的追焦框;
    若所述指定追焦对象的对象类型不为所述图库中排序处于前N的人像,则将所述指定追焦对象的追焦框类型更改为第四追焦框类型,以及根据所述第四追焦框类型生成并持续显示所述指定追焦对象对应的第四追焦框,并暂停显示除所述指定追焦对象之外的各个所述对象的追焦框。
  9. 如权利要求7所述的方法,其特征在于,所述响应于所述用户对任一对象的点击操作,将所述任一对象确定为指定追焦对象之后,还包括:
    响应于所述用户对所述指定追焦对象的点击操作,暂停对所述指定追焦对象的追焦处理,并根据各个所述对象的第一追焦优先级,将所述第一追焦优先级最高的任一所述对象确定为所述目标追焦对象,并对所述目标追焦对象进行追焦处理。
  10. 如权利要求1-6任一所述的方法,其特征在于,所述对象中包含多个所述第一追焦优先级最高的对象,所述根据各个所述对象的第一追焦优先级,将第一追焦优先级最高的任一所述对象确定为目标追焦对象,包括:
    确定所述第一追焦优先级最高的各个所述对象的第二追焦优先级;
    将所述第二追焦优先级最高的所述对象,确定为所述目标追焦对象。
  11. 如权利要求10所述的方法,其特征在于,所述确定所述第一追焦优先级最高的各个所述对象的第二追焦优先级,包括:
    获取所述第一追焦优先级最高的各个所述对象的预设优先级;
    将各个所述对象的预设优先级,确定为各个所述对象的第二追焦优先级;
    或者,
    确定所述第一追焦优先级最高的各个所述对象的尺寸;
    根据各个所述对象的尺寸,确定各个所述对象的第二追焦优先级。
  12. 一种追焦装置,其特征在于,包括:
    第一显示模块,用于响应于用户的第一操作,显示相机预览界面;
    第一确定模块,用于对所述相机预览界面中显示的各个对象进行识别处理,以确定各个所述对象的对象类型;
    第二确定模块,用于根据各个所述对象的对象类型,确定各个所述对象的追焦框类型;
    第三确定模块,用于根据各个所述对象的对象类型及预设的优先级策略,确定各个所述对象的第一追焦优先级,其中,所述预设的优先级策略是根据所述用户对各个所述对象类型的关注程度设定的;
    第二显示模块,用于根据各个所述对象的追焦框类型,生成各个所述对象对应的追焦框,并根据各个所述对象的坐标,在所述相机预览界面中显示各个所述对象对应的追焦框;
    第一追焦模块,用于根据各个所述对象的第一追焦优先级,将所述第一追焦优先级最高的任一所述对象确定为目标追焦对象,并对所述目标追焦对象进行追焦处理。
  13. 一种对焦方法,其特征在于,包括:
    获取用户选择的对焦位置;
    根据所述对焦位置的目标检测结果进行对焦,所述目标检测结果用于表示所述对焦位置是否存在目标。
  14. 根据权利要求13所述的方法,其特征在于,所述根据所述对焦位置的目标检测结果进行对焦,包括:
    当所述对焦位置存在目标时,对所述目标进行连续对焦,所述目标为人、动物、植物或物体;或者,
    当所述对焦位置不存在目标时,进行单次对焦。
  15. 根据权利要求14所述的方法,其特征在于,连续对焦的对焦框的颜色与单次对焦的对焦框的颜色不同,和/或,连续对焦的对焦框的形状与单次对焦的对焦框的形状不同。
  16. 根据权利要求15所述的方法,其特征在于,连续对焦的对焦框的颜色为黄色;单次对焦的对焦框的颜色为白色。
  17. 根据权利要求14所述的方法,其特征在于,所述方法还包括:
    对所述对焦位置进行单物体追焦SOT,得到追焦结果;
    当追焦结果为追焦成功时,认定所述对焦位置存在目标;或者,
    当追焦结果为追焦失败时,认定所述对焦位置不存在目标。
  18. 根据权利要求17所述的方法,其特征在于,所述对所述对焦位置进行单物体追焦SOT,得到追焦结果,包括:
    构造所述对焦位置的尺度空间向量;
    将所述对焦位置的尺度空间向量与样本库中目标的特征向量进行特征匹配,得到匹配结果;
    当匹配结果为匹配成功时,认定追焦结果为追焦成功;或者,
    当匹配结果为匹配失败时,认定追焦结果为追焦失败。
  19. 根据权利要求17所述的方法,其特征在于,所述对所述对焦位置进行单物体追焦SOT,得到追焦结果,包括:
    构造所述对焦位置的尺度空间向量;
    计算所述对焦位置的尺度空间向量的特征值;
    当所述特征值在预设范围内时,认定追焦结果为追焦成功;或者,
    当所述特征值不在所述预设范围内时,认定追焦结果为追焦失败。
  20. 根据权利要求14所述的方法,其特征在于,所述当所述对焦位置存在目标时,对所述目标进行连续对焦,包括:
    将所述对焦位置在相机坐标系下的位置坐标进行坐标转换,得到所述对焦位置在SOT坐标系下的位置坐标;
    根据述对焦位置在SOT坐标系下的位置坐标,对所述目标进行连续追踪和对焦。
  21. 根据权利要求14所述的方法,其特征在于,当所述对焦位置不存在目标时, 进行单次对焦,包括:
    根据所述对焦位置在相机坐标系下的位置坐标,进行单次对焦。
  22. 根据权利要求14所述的方法,其特征在于,当所述对焦位置不包括目标时,进行单次对焦,包括:
    在不考虑所述对焦位置的情况下,对当前拍摄场景进行对焦。
  23. 根据权利要求13至22中任一项所述的方法,其特征在于,在获取用户选择的对焦位置之前,所述方法还包括:开启万物追焦功能。
  24. 一种对焦装置,其特征在于,包括:
    获取单元,用于获取用户选择的对焦位置;
    处理单元,用于根据所述对焦位置的目标检测结果进行对焦,所述目标检测结果用于表示所述对焦位置是否存在目标。
  25. 一种拍摄方法,其特征在于,所述方法应用于电子设备,所述方法包括:
    显示相机应用的第一界面,所述第一界面包括第一控件;
    响应于用户对所述第一控件输入的第一操作,获取与图库应用中N个人脸一一对应的N个注册人脸特征,N为大于0的整数;
    显示所述相机应用的第二界面,所述第二界面包括摄像头采集到的第一图像帧,所述第一图像帧中包括第一对象;
    判断所述第一对象的人脸特征是否与所述N个注册人脸特征中的一个匹配;
    当所述第一对象的人脸特征与所述N个注册人脸特征中的一个匹配时,在所述第一对象上显示第一追焦框,并开始对所述第一对象自动追焦;
    当所述第一对象的人脸特征与所述N个注册人脸特征均不匹配时,在所述第一对象上显示第一选择框,所述第一对选择框与所述第一追焦框不同;
    响应于用户对所述第一选择框输入的第二操作,在所述第一对象上显示第二追焦框,
    并开始对所述第一对象追焦;
    所述第二追焦框与所述第一追焦框不同。
  26. 根据权利要求25所述的方法,其特征在于,所述响应于用户对所述第一控件输入的第一操作,获取与图库应用中N个人脸一一对应的N个注册人脸特征,包括:
    判断所述图库应用中是否存在聚类人脸,所述聚类人脸由对所述图库应用中对人脸图像聚类后生成;
    确定所述图库应用中存在所述聚类人脸,获取所述图库应用中前N个聚类人脸特征作为所述N个注册人脸特征。
  27. 根据权利要求26所述的方法,其特征在于,在所述确定图库应用中存在所述聚类人脸之前包括:
    所述相机应用执行第一查询操作,所述第一查询操作用于查询所述聚类人脸的存储状态;
    所述相机应用获取第一标记,其中,所述第一标记由所述图库应用存储所述聚类人脸后生成的标记。
  28. 根据权利要求25所述的方法,其特征在于,在响应于用户对所述第一控件输 入的第一操作之后,在获取与图库应用中N个人脸一一对应的N个注册人脸特征之前,包括:
    所述图库应用进行第二查询操作,所述第二查询操作用于查询第一拍摄模式的开启状态;
    所述第一拍摄模式用于自动追焦与所述N个注册人脸特征匹配的对象;
    所述图库应用获取到第二标记时,确定所述第一拍摄模式开启;
    其中,所述第二标记为响应用户对所述第一控件输入的第一操作之后生成的标记。
  29. 根据权利要求25所述的方法,其特征在于,在判断所述第一对象的人脸特征是否与所述N个注册人脸特征中的一个匹配之前,包括:
    获取第一图像,所述第一图像与所述第一图像帧相同;
    将所述第一图像发送至目标识别算法;
    所述目标识别算法识别所述第一对象的第一人脸特征。
  30. 根据权利要求29所述的方法,其特征在于,判断所述第一对象的人脸特征是否与所述N个注册人脸特征中的一个匹配包括:
    判断所述第一人脸特征是否与所述注册人脸特征匹配。
  31. 根据权利要求29所述的方法,其特征在于,所述第一对象的人脸特征与所述N个注册人脸特征中的一个匹配时,开始对所述第一对象自动追焦包括:
    自动对焦算法将所述第一对象设置为第一图像的焦点并进行对焦;
    获取第二图像,所述第二图像为所述第一图像帧的下一帧图像;
    自动对焦算法将所述第一对象设置为第二图像的焦点并进行对焦。
  32. 根据权利要求29所述的方法,其特征在于,所述第一对象的人脸特征与所述N个注册人脸特征中的一个匹配时,在所述第一对象上显示第一追焦框,包括:
    获取所述第一人脸特征;
    根据所述第一人脸特征,在所述第一对象上绘制第一追焦框;
    显示所述第一对象和所述第一追焦框。
  33. 根据权利要求25至32任一项所述的方法,其特征在于包括:所述第一图像帧中还包括第二对象,所述第二对象的人脸特征与所述N个注册人脸特征中的一个匹配;
    比较所述第一对象和所述第二对象在所述第二界面中占用面积;
    当所述第一对象在第二界面中占用面积大于所述第二对象在第二界面中占用面积时;
    在所述第二对象上显示第三追焦框,所述第三追焦框与所述第一追焦框不同。
  34. 根据权利要求25至32任一项所述的方法,其特征在于包括:所述第一图像帧中还包括第三对象,所述第三对象的人脸特征与所述N个注册人脸特征都不匹配;
    在所述第三对象上显示第四追焦框。
  35. 根据权利要求25至32任一项所述的方法,其特征在于包括:
    显示所述相机应用的第三界面,所述第三界面包括摄像头采集到的第二图像帧,所述第二图像帧中不包括所述第一对象;
    停止对所述第一对象自动追焦。
  36. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1-11中任一项所述的方法。
  37. 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求13至23中任一项所述的方法。
  38. 一种电子设备,其特征在于,包括处理器和存储器,所述处理器和所述存储器耦合,所述存储器用于存储计算机程序,当所述计算机程序被所述处理器执行时,使得所述电子设备执行权利要求25至35中任一项所述的方法。
  39. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至11、13至23、25至35中任一项所述的方法。
  40. 一种芯片,其特征在于,包括处理器,当所述处理器执行指令时,所述处理器执行如权利要求1至11、13至23、25至35中任一项所述的方法。
PCT/CN2023/138113 2023-02-17 2023-12-12 追焦方法、对焦方法、拍摄方法和电子设备 WO2024169363A1 (zh)

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
CN202310153939.0A CN118524284A (zh) 2023-02-17 2023-02-17 追焦方法、装置、终端设备及计算机可读存储介质
CN202310162723.0A CN118524286A (zh) 2023-02-17 2023-02-17 对焦方法和对焦装置
CN202310162723.0 2023-02-17
CN202310153939.0 2023-02-17
CN202310227257.XA CN118555478A (zh) 2023-02-27 2023-02-27 一种拍摄方法和电子设备
CN202310227257.X 2023-02-27

Publications (1)

Publication Number Publication Date
WO2024169363A1 true WO2024169363A1 (zh) 2024-08-22

Family

ID=92422201

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/138113 WO2024169363A1 (zh) 2023-02-17 2023-12-12 追焦方法、对焦方法、拍摄方法和电子设备

Country Status (1)

Country Link
WO (1) WO2024169363A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010217613A (ja) * 2009-03-18 2010-09-30 Nec Corp オートフォーカス機能を有する情報処理装置、オートフォーカス機能を有する情報処理装置の制御方法等
CN106060407A (zh) * 2016-07-29 2016-10-26 努比亚技术有限公司 一种对焦方法及终端
CN110677592A (zh) * 2019-10-31 2020-01-10 Oppo广东移动通信有限公司 主体对焦方法、装置、计算机设备和存储介质
WO2022267464A1 (zh) * 2021-06-25 2022-12-29 荣耀终端有限公司 一种对焦的方法及相关设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010217613A (ja) * 2009-03-18 2010-09-30 Nec Corp オートフォーカス機能を有する情報処理装置、オートフォーカス機能を有する情報処理装置の制御方法等
CN106060407A (zh) * 2016-07-29 2016-10-26 努比亚技术有限公司 一种对焦方法及终端
CN110677592A (zh) * 2019-10-31 2020-01-10 Oppo广东移动通信有限公司 主体对焦方法、装置、计算机设备和存储介质
WO2022267464A1 (zh) * 2021-06-25 2022-12-29 荣耀终端有限公司 一种对焦的方法及相关设备

Similar Documents

Publication Publication Date Title
WO2020259038A1 (zh) 一种拍摄方法及设备
CN111526314B (zh) 视频拍摄方法及电子设备
CN112887583B (zh) 一种拍摄方法及电子设备
WO2021129198A1 (zh) 一种长焦场景下的拍摄方法及终端
WO2021143269A1 (zh) 一种长焦场景下的拍摄方法及移动终端
WO2021185250A1 (zh) 图像处理方法及装置
WO2020140726A1 (zh) 一种拍摄方法及电子设备
CN111345028A (zh) 图像拾取装置及其控制方法
WO2020029306A1 (zh) 一种图像拍摄方法及电子设备
CN110471606B (zh) 输入方法及电子设备
WO2021047567A1 (zh) 一种回调流的处理方法及设备
WO2021115483A1 (zh) 一种图像处理方法及相关装置
WO2021185296A1 (zh) 一种拍摄方法及设备
WO2022143921A1 (zh) 一种图像重建方法、相关装置及系统
CN114019744A (zh) 图像拾取装置及其控制方法
CN115525188A (zh) 拍摄方法和电子设备
WO2024179101A1 (zh) 一种拍摄方法
WO2024179101A9 (zh) 一种拍摄方法
WO2024169363A1 (zh) 追焦方法、对焦方法、拍摄方法和电子设备
CN117119284B (zh) 一种拍摄方法
WO2022206605A1 (zh) 确定目标对象的方法、拍摄方法和装置
WO2024169338A1 (zh) 一种拍摄方法和电子设备
WO2022228010A1 (zh) 一种生成封面的方法及电子设备
WO2021197014A1 (zh) 图片传输方法及装置
CN113473057B (zh) 一种录像方法与电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23922479

Country of ref document: EP

Kind code of ref document: A1