Object focus tracking method and device

By presetting the recognition and display priority of objects in the gallery application and using different display methods to highlight high-frequency objects, the problem of insufficient accuracy of the focus tracking function of electronic devices is solved, and the smoothness and intelligence of the shooting operation are improved.

CN118555484APending Publication Date: 2024-08-27HONOR DEVICE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310212173.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The focus tracking function of existing electronic devices makes it difficult to accurately align the object during the shooting process, resulting in insufficient smoothness and intelligence in the shooting operation.

Method used

By presetting the recognition and display priority of objects in the gallery application, different display methods are used to highlight high-frequency objects, and the focus area is automatically adjusted to achieve accurate focus tracking.

Benefits of technology

It improves the accuracy of the focus tracking function of electronic devices and the smoothness of user operations, and reduces the need for users to manually select the focus area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118555484A
    Figure CN118555484A
Patent Text Reader

Abstract

The embodiment of the invention provides an object focus tracking method and device which are applied to electronic equipment, the electronic equipment comprises a camera application and an image library application, the image library application stores an image of at least one preset object, and the method comprises the steps that in response to an opening operation on the camera application, a preview interface of the camera application is displayed, and a first object is displayed in the preview interface, the first object is associated with one preset object, the first object is displayed in a first display mode, and the first display mode is used for prompting the electronic equipment to focus the first object, so that the first object for automatic focus tracking is recognized by means of the preset object in the image library application, the link of manually selecting a focusing area by a user is omitted, and the user experience is improved. And the smoothness and intelligence of the shooting operation are improved. And the first object can be accurately recognized from the preview interface by means of the preset object in the image library application, so that the electronic equipment can control the focusing area to be accurately aligned with the first object according to the position of the first object in the preview interface, and the accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an object tracking method and device. Background Art

[0002] Users can use electronic devices with shooting functions to take photos or videos of the subject. During the process of taking photos or videos, the electronic device can call the focus tracking function to track the focus. For example, when shooting a portrait, 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, the focus is controlled to continue to focus on the subject. At present, the focus tracking function of electronic devices needs to be improved. Summary of the invention

[0003] The present application provides an object tracking focus method and device, the purpose of which is to improve the tracking focus function of an electronic device. To achieve this purpose, the present application provides the following technical solutions:

[0004] In a first aspect, the present application provides an object tracking method, which is applied to an electronic device, the electronic device includes a camera application and a gallery application, the gallery application stores images of at least one preset object, and the method includes: in response to an opening operation of the camera application, displaying a preview interface of the camera application, wherein a first object is displayed in the preview interface, the first object is associated with one of all preset objects, the first object is displayed in the preview interface using a first display mode, and the first display mode is used to prompt the electronic device to track the first object, so that the first object that is automatically tracked is recognized with the help of the preset object in the gallery application, eliminating the step of the user manually selecting the focus area, and improving the fluency and intelligence of the shooting operation. Moreover, the first object can be accurately identified from the preview interface with the help of the preset object in the gallery application, and then the electronic device can control the focus area to accurately align with the first object according to the position of the first object in the preview interface, thereby improving the accuracy of the focus area, thereby improving the focus tracking function of the electronic device.

[0005] Among them, the preset object corresponds to the high-frequency object described below. The preset object is an object that the user pays more attention to, and at least one image of the preset object is saved in the gallery application. The preview interface can be an interface in the photo preview mode or the video preview mode of the camera application. The first display method is to highlight the first object, such as the first display method can be a double border, and the first object is framed by the double border. For example, if the first object is a person, the electronic device can use a double border to frame the face and focus on the face. For another example, the first display method is to improve the clarity of the first object, such as the electronic device improves the clarity of the first object by blurring the objects other than the first object in the preview interface; for another example, the first display method is to add color to the first object, add special effects, etc. At least one method.

[0006] In a possible implementation, the preview interface also displays a second object, the second object is associated with one of all preset objects, and the second object is displayed in the preview interface using a second display mode, and the second display mode is used to prompt that the focus priority of the second object is lower than the focus priority of the first object. It can be understood that when multiple objects associated with preset objects are displayed in the preview interface, the electronic device can determine a first object with the highest focus priority and at least one second object with a lower focus priority, and the first object and the second object are displayed in different display modes to highlight the first object and prompt the user to focus on the second object. For example, the second display mode can also be a double border, but the style of the double border is different from the style of the double border as the first display mode, so as to distinguish the first object and the second object by double borders of different styles, and while distinguishing the first object and the second object, the user is prompted to select the second object for focus through the second display mode. For example, the first display mode can be a double yellow frame, and the second display mode can be a double white frame; for another example, the first display mode can be a double black frame, and the second display mode can be a double gray frame, and so on. The double border may be composed of two rectangles of different sizes, that is, each side of the double border may include two lines, and there may be a breakpoint between each line. In some examples, the first display mode and the second display mode may also be single borders of different styles, and the single border may be a rectangle, that is, each side of the single border includes a line, and there may be a breakpoint between each line.

[0007] In a possible implementation, a third object is also displayed in the preview interface. The third object has no association with any preset object. The third object is displayed in the preview interface using a third display mode. The third display mode is used to indicate that the third object has the lowest focus priority (i.e., the lowest focus priority). The third display mode may be to not add any elements to the third object and display the third object as it is. In some examples, the third display mode may be a double border or a single border, etc. The style of the third display mode is different from that of the first display mode, and the style of the third display mode is the same as or different from that of the second display mode.

[0008] In a possible implementation, a fourth object is also displayed in the preview interface, and the method further includes: when the attention of the fourth object is greater than that of the first object, the fourth object is displayed in the preview interface in the first display mode, the first object is switched from the first display mode to the fourth display mode, and the focus priority of the first object displayed in the fourth display mode is less than the focus priority of the fourth object, so as to adjust the focus priority according to the attention of the fourth object and the first object. The fourth object may be associated with the preset object, or may not be associated with the preset object. In some examples, the fourth display mode may be displayed as the object is; in some examples, the fourth display mode may be a double border or a single border, etc. The style of the fourth display mode is different from the style of the first display mode, and the style of the fourth display mode, the style of the third display mode, and the style of the second display mode may be the same or different.

[0009] In a possible implementation, the attention degree of the fourth object is greater than the attention degree of the first object, including: the fourth object is selected by the user, such as the user clicks on the fourth object, and the user's eyes track the fourth object; or, the display of the fourth object in the preview interface is more prominent than the display of the first object in the preview interface, such as the fourth object is in the middle of the preview interface, and the area occupied by the fourth object in the preview interface is greater than the area occupied by the first object in the preview interface, or, the type level of the fourth object is greater than the type level of the first object, such as the fourth object is a face, the first object is an animal or a building, the type level of the face is greater than the type level of the animal or building, and the type level can be set according to the application scenario. In this embodiment, the electronic device can set the use strategy of attention degree according to the application scenario to track the focus in combination with the application scenario. For example, in some application scenarios, the attention degree is determined by whether the user selects the object, the more times the selection is made, the higher the attention degree is, or the user currently selects an object, then the attention degree of the object is the largest; for example, in some application scenarios, the attention degree is determined by whether the display of the object in the preview interface is prominent, and so on.

[0010] In a possible implementation manner, the method further includes: displaying the number of attentions of the fourth object and the number of attentions of the first object in the preview interface, the number of attentions of the fourth object being greater than the number of attentions of the first object.

[0011] In one possible implementation, the method further includes: displaying a label of the first object in the preview interface, the label of the first object being used to indicate the relationship between the first object and the user, so as to prompt the user of the relationship between the first object and the user through the label of the first object. If the preview interface displays a fifth object, and the fifth object is associated with the preset object, the label of the fifth object is displayed in the preview interface, so that the user can determine whether to change the object to be focused on based on the label of the first object and the label of the fifth object. The label of each object in the preview interface is the label of the preset object that is associated with it. The electronic device can pre-set the label of the preset object, and use the label to distinguish the application scenario, the relationship between the preset object and the user, etc., so that the electronic device can use the set label to accurately focus on the object that the user wants to focus on.

[0012] In a possible implementation, the first display mode is a first double border, the color of at least one side of the first double border is a first preset color, and the first double border is used to frame the main characteristic parts of the first object; the second object in the preview interface is displayed in a second display mode, the second object is associated with the preset object, the focus tracking priority of the second object is lower than the focus tracking priority of the first object, the second display mode is a second double border, the color of at least one side of the second double border is a second preset color, and the second double border is used to frame the main characteristic parts of the second object. If the first object and the second object are people, the first double border and the second double border are used to frame the face of the person; if the first object and the second object are animals, the first double border and the second double border are used to frame the face of the animal; if the first object and the second object are buildings, the first double border and the second double border are used to frame the entire building.

[0013] In a possible implementation, at least two target objects are displayed in the preview interface, and the target objects are associated with preset objects. The method also includes: when it is determined that there are target objects with equal similarity based on the maximum similarity between the target object and the preset object, judging whether there are target objects with equal similarity that occupy an equal area in the preview interface among the target objects with equal similarity; when there are target objects with equal similarity that occupy an equal area in the preview interface among the target objects with equal similarity, judging whether the number of images of the target objects with equal area in the gallery application is equal; when the number of images of the target objects with equal area in the gallery application is equal, judging that the target object closest to the middle position of the preview interface has the highest focus tracking priority, and the target object with the highest focus tracking priority is the first object, so that the influence of multiple factors on the focus tracking priority can be comprehensively considered, so that the target object with the highest focus tracking priority can be the most prominent object in the preview interface and the one that the user pays the most attention to, thereby improving the accuracy of focus tracking.

[0014] In a possible implementation, the method further includes: in the case where there are no target objects with equal similarity, determining that the target object with the greatest similarity has the highest priority for tracking focus; or, in the case where there are no target objects with equal occupied areas, determining that the target object with the greatest similarity has the highest priority for tracking focus; or, in the case where the number of images of target objects with equal occupied areas in the gallery application is unequal, determining that the target object with the largest number of images has the highest priority for tracking focus. The number of images of the target object in the gallery application may be the number of images of a preset object associated with the target object in the gallery application, and the number of images is the total number of all images of the preset object in the gallery application.

[0015] In a possible implementation, at least two target objects are displayed in the preview interface, and the target objects are associated with preset objects. The method further includes: if the preset object associated with the target object has the largest number of images in the gallery application, determining that the target object associated with the preset object with the largest number of images has the highest focus tracking priority; or determining that the target object with the largest number of similarities with each preset object exceeding a threshold among all target objects has the highest focus tracking priority; or determining that the target object currently being focused on by the user has the highest focus tracking priority, whereby the electronic device can determine the focus tracking priority according to at least one of the focus tracking strategies among the number of images in the gallery application, the number of similarities exceeding a threshold, and whether the user is paying attention, etc., and further, the electronic device can set the corresponding relationship between the focus tracking strategy and the application scenario, so as to use different focus tracking strategies in different application scenarios, so as to accurately focus on the object that the user wants to focus on in different application scenarios according to the focus tracking requirements of the application scenario. The target object currently being focused on by the user can be the target object currently clicked by the user or the target object tracked by the user's eyes.

[0016] In one possible implementation, the method also includes: when the attention level of a target object whose focus tracking priority is not the highest among at least two target objects is greater than the attention level of the target object with the highest focus tracking priority, lowering the focus tracking priority of the target object with the highest focus tracking priority, and determining that the target object with the highest attention level has the highest focus tracking priority.

[0017] In one possible implementation, the attention level of the target object whose focus priority is not the highest among at least two target objects is greater than the attention level of the target object with the highest focus priority, including: the target object whose focus priority is not the highest is selected by the user, and the attention level of the target object selected by the user is the highest, so as to adjust the focus priority through user selection to realize personalized modification of the focus priority.

[0018] In one possible implementation, the existence of an association relationship between the target object and the preset object is determined at least based on the similarity between the target object and the preset object being greater than a threshold; the similarity between the target object and the preset object is obtained based on features of the image of the target object and features of each image in a matching template of the preset object; and each image in the matching template of the preset object is selected from all images of the preset object in a gallery application.

[0019] In a possible implementation, each image in the matching template of the preset object is selected from all images of the preset object in the gallery application, including: obtaining the features of each image of the preset object and the central feature of the preset object, the central feature of the preset object being the average feature of the features of all images of the preset object; obtaining the similarity between the features of each image of the preset object and the central feature of the preset object; sorting all similarities of the preset object according to the similarity, and dividing all sorted similarities into at least two similarity ranges according to the similarity; selecting a preset number of images from the image set corresponding to each similarity range, the matching template includes the preset number of images, and the similarity of each image in the image set is within the similarity range. Thus, the electronic device reduces the number of images of the preset object used to match each object in the preview interface, so that the electronic device does not need to match the features of all images of each preset object in the gallery application one by one, thereby improving the matching efficiency. And in the process of selecting the matching template, the images with smaller differences can be divided into one image set according to the similarity, so that the images with larger differences are divided into different image sets. The greater the difference, the different presentation of the preset object in the image. For example, the posture and shooting distance of the preset object are different. The similarity range selection can cover preset objects with different postures and shot at different shooting distances to ensure the comprehensiveness of the image in the matching template.

[0020] In a possible implementation, if a preset number of images are not selected within a similarity range, images are selected from an image set corresponding to an adjacent similarity range of the similarity range, and there are no duplicate images among the selected images.

[0021] In a possible implementation, the angle of the target object in the preview interface satisfies a preset angle constraint condition, such as the angle constraint condition may be a left and right deflection angle (-45, +45) and a pitch angle (-45, +45), so that when the target object is a face, the front face of the face displayed in the preview interface can be recognized; and / or the area occupied by the target object in the preview interface is greater than a preset area threshold to avoid interference from objects serving as a background in the preview interface.

[0022] In a possible implementation, the target object and the preset object are associated with each other, including: detecting and locating key points of the image on the preview interface to identify the key points of the object, and using the key points of the object to crop the image of the object from the image on the preview interface; performing an affine transformation on the image of the object, and extracting features from the image of the object after the affine transformation to obtain features of the object; when the features of the object match the features of at least one image of the preset object, determining that the object and the preset object are associated with each other, and the object that is associated with the preset object is the target object.

[0023] In a possible implementation, the method also includes: selecting a preset number of preset objects from a gallery application, the preset number of preset objects being used to identify objects having an associated relationship in a preview interface; selecting a preset number of preset objects from the gallery application includes: if images of the same preset object in the gallery application are saved in a folder, selecting a preset number of preset objects according to the number of images in the folder; if images of the same preset object in the gallery application are not saved in a folder, clustering the images of the preset object to save the images of the same preset object in a folder, and selecting a preset number of preset objects according to the number of images in the folder.

[0024] In a second aspect, the present application provides an electronic device, which includes: one or more processors and a memory; the memory is used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the above-mentioned object tracking method.

[0025] In a third aspect, the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program implements the above-mentioned object tracking method when executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1A schematic diagram of an interface of the object tracking focus method provided by this application;

[0027] Figure 2 Another schematic diagram of the interface of the object tracking method provided by this application;

[0028] Figure 3 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0029] Figure 4 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0030] Figure 5 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0031] Figure 6 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0032] Figure 7 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0033] Figure 8 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0034] Fig. 9 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0035] Fig.10 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0036] Fig.11 A schematic diagram of another interface of the object tracking focus method provided by the present application;

[0037] Fig.12 Hardware structure diagram of the electronic device provided for this application;

[0038] Fig.13 Software architecture diagram of the electronic device provided for this application;

[0039] Fig.14 A schematic diagram of selecting a matching template when software and hardware interact in an electronic device provided by the present application;

[0040] Fig.15 A schematic diagram of focusing using matching templates when software and hardware interact in an electronic device provided by the present application;

[0041] Fig.16 A timing diagram of the object tracking method provided in this application;

[0042] Fig.17A schematic diagram of the object tracking focus method provided in this application;

[0043] Fig.18 A schematic diagram of selecting a matching template provided for this application;

[0044] Fig.19 A schematic diagram for determining focus tracking priority provided for this application. DETAILED DESCRIPTION

[0045] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0046] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at 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.

[0047] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0048] The focus tracking function of the electronic device includes manual focus tracking and automatic focus tracking. Manual focus tracking is a user manually selecting an object (referred to as the first object) from a number of shooting objects. The first object is the shooting object that the user is concerned about. Referring to the position of the first object in the display screen of the electronic device, the user manually selects a focus area. For example, after the user touches a position in the display screen, the electronic device generates a focus frame according to the position, and the area where the focus frame is located is used as the focus area. However, the position touched by the user may cause the focus area to differ from the position of the first object on the screen of the electronic device, so that the focus area cannot be accurately aligned with the first object, and the smoothness and intelligence of the shooting operation are reduced. Automatic focus tracking is an electronic device automatically selecting a focus area. Automatic focus tracking is limited by environmental parameters such as light contrast, brightness, and distance during shooting, so that there is a problem that the focus area cannot be accurately aligned with the first object during the automatic focus tracking process.

[0049] In response to the above problems, the present application provides an object tracking focus method, which can identify a first object that is associated with a high-frequency object in a gallery application from at least one shooting object displayed on a preview interface. The first object can be displayed in a first display mode, and the first display mode is used to indicate the tracking focus on the first object, thereby realizing the automatic tracking focus of the first object by identifying the high-frequency object in the gallery application, eliminating the step of the user manually selecting the focus area, and improving the fluency and intelligence of the shooting operation. In addition, the first object can be accurately identified from the preview interface by using the high-frequency object in the gallery application, and then the electronic device can control the focus area to accurately align with the first object according to the position of the first object in the preview interface, thereby improving the accuracy of the focus area, thereby improving the tracking focus function of the electronic device.

[0050] The high-frequency object may also be called a preset object, which is an object that the user pays more attention to, and at least one image of the high-frequency object is saved in the gallery application. The preview interface may be an interface in a photo preview mode or a video preview mode of a camera application.

[0051] The first object associated with the high-frequency object in the gallery application can be determined based on the similarity between the high-frequency object and the photographed object. For example, if the similarity between a photographed object and the high-frequency object is greater than a preset similarity threshold, the photographed object can be the first object associated with the high-frequency object in the gallery application. The similarity between the high-frequency object and the photographed object can be the similarity between the features of the high-frequency object and the features of the photographed object. The value of the preset similarity threshold is not limited in this embodiment.

[0052] In some examples, the first object associated with the high-frequency object in the gallery application means that the first object and the high-frequency object in the gallery application are the same object. When the similarity between the high-frequency object and the photographed object is greater than a preset similarity threshold, the electronic device can determine that the photographed object and the high-frequency object are the same object, and the photographed object can be used as the first object.

[0053] In some examples, the object tracking method can also identify a second object in the preview interface that is associated with a high-frequency object in the gallery application, and the second object can be displayed in a display mode different from the first display mode. After the second object is clicked by the user, the object can be displayed in the first display mode. In some examples, the object tracking method can also identify a third object in the preview interface that is not associated with a high-frequency object in the gallery application, and the third object can be displayed in a display mode different from the first display mode.

[0054] like Figure 1 A schematic diagram of an interface of an object tracking focus method is shown. Figure 1 (1) in the figure shows that the portrait album of the gallery application includes a personal album and a group photo album. The personal album stores an image of at least one high-frequency object. Multiple images of a high-frequency object can be stored in the same folder of the personal album. Figure 1 (1) in the figure shows a folder of a person who is a high-frequency object. The number under the folder indicates the number of images of the high-frequency object. The "Add Name" under the folder allows the user to manually add the name of the folder where the high-frequency object is located. Figure 1 In (1), 23 images are saved in a folder in the personal album, but the folder name is not added.

[0055] After the user opens the camera application, the electronic device may display a preview interface of the camera application, and display at least one shooting object within the shooting range of the electronic device in the preview interface. Figure 1 (2) in the figure shows that a person is displayed in the preview interface, and the electronic device recognizes that the person is associated with the person in the gallery application. A registration frame (using a double frame as an example) is displayed at the position of the face in the preview interface. The area where the registration frame is located is the focus area, and the registration frame is used to at least frame the face of the person. Figure 1 As shown in (2), the registration frame is a double black frame, which frames the face. The double black frame is only an example, and the registration frame can also adopt other styles, such as the registration frame can be a double yellow frame, etc. This embodiment does not limit the style of the registration frame.

[0056] Figure 2 Another interface diagram of the object tracking method is shown. Figure 1 The difference is that in Figure 2In (1), two folders are saved in the personal album. The two folders correspond to different people, and the two folders can be sorted in the personal album according to the number of images. For example, the folder with more images is ranked higher in the personal album. Figure 2 The preview interface shown in (2) shows three people. The electronic device matches the image of each person in the preview interface with the image saved in each folder in the personal album, and recognizes that the two people in the preview interface are associated with the two people saved in the personal album. The electronic device can use the same registration frame or different registration frames for the two people. When using different registration frames, the electronic device can highlight the person with a high focus priority based on the focus priority of the associated people. In some examples, the focus priority can be determined based on the number of images of the person in the personal album. For example, the larger the number of images, the higher the user's attention to the person, and thus the higher the focus priority of the person.

[0057] like Figure 2 (2) in the figure shows an example of an electronic device using different registration frames. The one with a large number of images among two people who are in an associated relationship uses a double black frame, and the one with a small number of images uses a single gray frame. The double black frame is more likely to attract the user's attention than the single gray frame. Therefore, the electronic device uses the double black frame to highlight the person with a high priority for tracking focus, and performs tracking focus on the person with a high priority for tracking focus. The single gray frame is a display method. The single gray frame is used to indicate that the object using the single gray frame can be used as an alternative object for tracking focus. The electronic device may not perform tracking focus on the alternative object. After the user clicks on the alternative object, the electronic device performs tracking focus on it. In some examples, the electronic device can perform tracking focus on people who are in an associated relationship in the preview interface, but the tracking focus priorities are different. For example, the tracking focus priority of the person using the single gray frame is lower than the tracking focus priority of the person using the double black frame.

[0058] For a person in the preview interface who has no association with a person in the personal album, the focus tracking priority of the person who has no association can be the lowest (i.e., the smallest). When displaying the person who has no association, the display method used for the person who has no association and the person with a low focus tracking priority can be the same. For example, the electronic device can display a registration box at the face position of the person who has no association, and the style of the registration box can be the same as the style of the registration box used for the person with a low focus tracking priority, such as Figure 2 As shown in (2) in the figure, people who have no association relationship and people with low focus priority are framed with a single gray frame.

[0059] Figure 3 Another interface diagram of the object tracking method is shown. Figure 2 The difference is that the display method used for people who have no associated relationship and people with low focus priority is different. For example, the style of the registration box used for people who have no associated relationship and people with low focus priority is different. Figure 3 (2) in the figure shows an example, in which a person with a low priority for tracking is shown with a double gray frame, and a person with no associated relationship is shown with a single gray frame, thereby prompting the focus priority of people in the preview interface through different display methods. In this way, when a user wants to select a person in the preview interface for tracking, the user can learn about the person he or she is more concerned about through the registration frame, and then the user can select the person he or she is more concerned about for tracking. The double gray frame and the single gray frame are an example, and this embodiment does not limit the style of the registration frame used for objects with a low priority for tracking, nor does it limit the style of the registration frame used for objects with no associated relationship. For example, a double white frame can be used for an object with a low priority for tracking, and a single white frame can be used for an object with no associated relationship.

[0060] Figure 4 Another interface diagram of the object tracking method is shown. Figure 4 People who have no relationship with you in the same way as people with low priority in the focus tracking are displayed differently, but these two people are Figure 4 The display mode in Figure 3 Different, as in Figure 4 In (2), people with low focus tracking priority use double gray frames, and people who have no associated relationship do not use registration frames. Similarly, different display methods are used to prompt the focus tracking priority of people in the preview interface.

[0061] Figure 5 Another interface diagram of the object tracking method is shown, which is similar to the above Figures 1 to 4 The difference is that in Figure 5 In (1), three folders corresponding to different people are saved in the personal album, and these two folders can be sorted in the personal album according to the number of images. Figure 5 The preview interface shown in (2) shows three persons. The electronic device matches the image of each person in the preview interface with the image saved in each folder in the personal photo album, and recognizes that the three persons in the preview interface are associated with the three persons saved in the personal photo album. The electronic device can use the same registration frame or different registration frames for the three persons.

[0062] For example, if the number of images of the person in the middle of the preview interface saved in the personal album is the largest, the electronic device may determine that the person in the middle of the preview interface has the highest priority for tracking focus, and the electronic device may display the person in a special way to highlight the person with the highest priority for tracking focus. Figure 5 In (2), the person in the middle of the preview interface uses double black frames, and the people on the left and right sides use double gray frames.

[0063] In the above Figures 1 to 5In the interface diagram shown, the electronic device may use the registration frame only for people with a high priority for tracking focus, and not use the registration frame for other people. This embodiment will not be described in conjunction with the accompanying drawings.

[0064] Figure 6 Another interface diagram of the object tracking method is shown, which is an example of adjusting the tracking priority, wherein: Figure 6 (1) and Figure 5 The same as (1) in Figure 6 (2) and Figure 5 The same as (2) in FIG. 1 , after the electronic device displays the person in the middle of the preview interface with double black frames, the user can click on the people on the left and right sides. Figure 6 As shown in (3), the user clicks on the person on the left, and the user selects the person on the left as having the highest priority for tracking focus. Then the electronic device can use a double black frame for the person on the left. The person in the middle of the preview interface has a lower priority for tracking focus, and the electronic device can use a double gray frame for the person in the middle. In some examples, after the user selects the person with the highest priority for tracking focus, the electronic device only uses the registration frame for the person with the highest priority for tracking focus, and does not use the registration frame for other people.

[0065] In some scenarios, the user may click on a person in the preview interface multiple times, and the person clicked each time may be the same or different. Then the electronic device may determine that the last person clicked has the highest priority for tracking focus. Alternatively, the electronic device may determine the priority for tracking focus based on the number of clicks for each person. Figure 7 Each registration box in (4) shows the number of clicks, and the electronic device can determine that the person with the highest number of clicks has the highest tracking priority.

[0066] Figure 8 Another interface diagram of the object tracking method is shown, which is another example of adjusting the tracking priority, and shows that the electronic device can adjust the tracking priority according to the position of the person in the preview interface. Figure 8 (1) and Figure 6 The same as (1) in Figure 8 (2) and Figure 6 The same as (2) in Figure 8 In (2), the person in the middle of the preview interface has the highest priority for tracking focus. Then the person in the middle can use double black frames, and the others can use double gray frames or single gray frames, or no registration frame is used for the others. If the person on the left side of the preview interface moves to the middle, such as Figure 8 As shown in (3), the focus tracking priority of the person moving to the middle is adjusted to the highest, so the person moving to the middle can use a double black frame.

[0067] In addition to adjusting the focus priority of an object in the preview interface based on the click situation of the object and / or the position of the object in the preview interface, the electronic device can also track the user's eyes to determine the object the user is looking at, and adjust the focus priority of the object the user is looking at to the highest.

[0068] Fig. 9 Another interface diagram of the object tracking method is shown, which is similar to the above Figures 1 to 8 The difference between the interface diagram shown is that the gallery application includes an object album, the object album includes a personal album and a group album, and the personal album can include images of high-frequency objects of different categories / types. Figure 8 (1) in the figure shows that a personal album can include images of people and images of animals. Images of the same person can be saved in one folder, and images of the same animal can be saved in another folder. These two folders can be sorted in the personal album according to the number of images. Fig. 9 The preview interface shown in (2) shows a person and an animal. The electronic device recognizes that the person and the animal in the preview interface are associated with high-frequency objects stored in the personal album. The electronic device can use the same registration frame or different registration frames for the person and the animal in the preview interface. Fig. 9 (2) shows an example of an electronic device using different registration frames, where a double black frame is used for images of people and animals with a large number of associated relationships, and a double gray frame is used for images of people and animals with a small number of associated relationships.

[0069] Fig.10 Another interface diagram of the object tracking method is shown. Fig. 9 The difference is that Fig.10 In the preview interface shown in (2), an animal is displayed. The electronic device recognizes that the animal is associated with the animals stored in the personal album, and the electronic device can use a registration box for the animal. Fig.10 (2) in the figure shows that the electronic device uses a double black frame for the animal.

[0070] In addition, the electronic device can set a label for the high-frequency object in the gallery application, and the label can be used to indicate the relationship between the high-frequency object and the user, such as whether the high-frequency object is a friend or idol of the user. Fig.11 As shown in (1) in FIG. 1 , the personal album of the gallery application stores images of friends and idols. When the images of friends and idols are displayed in the preview interface, the electronic device may display labels in the preview interface, such as Fig.11 As shown in (2), the "idol" label is displayed at the idol position, and the "friend" label is displayed at the friend position. Specifically, the label can be displayed at the registration box.

[0071] In the preview interface, the face area of ​​the idol is larger than that of the friend. The electronic device determines that the idol's focus tracking priority is higher than that of the friend based on the face area. Fig.11 The idol shown in (2) can use a double black frame, and the friend can use a double gray frame.

[0072] After the user clicks on a friend, the friend has the highest priority in tracking, and the electronic device can change the registration frame used by the idol and the friend, such as Fig.11 As shown in (3), the friend uses a double black frame, and the idol uses a double gray frame. After the user clicks on the friend, the electronic device may no longer display the label, or the electronic device may continue to display the label.

[0073] In some examples, the electronic device can also set the priority of the tag when setting the tag. The higher the priority of the tag, the higher the focus tracking priority. The electronic device can determine the registration box used for each object in the preview interface according to the priority of the tag.

[0074] Combined with the above Figures 1 to 11 As shown in the interface diagram, the object tracking method provided by the present application can be combined with application scenario detection or device settings and other means to set different tracking strategies and set priorities for different tracking strategies according to different application scenarios, wherein the tracking strategy is used to indicate that the objects that meet the conditions are tracked. For example, the tracking strategy can be to focus on the high-frequency object with the largest number of images in the gallery application, to focus on the object located in the middle of the preview interface, to focus on the object that has a specific relationship with the user, and so on. For another example, the user can set labels for high-frequency objects in the gallery application in the electronic device, and use the labels to distinguish application scenarios, the relationship between high-frequency objects and users, etc., so that the electronic device can focus according to the labels of high-frequency objects. Therefore, the object tracking method provided by the present application can use the application scenarios and / or set labels to accurately focus on the object that the user wants to focus on.

[0075] For example, in a street shooting scene, you take a photo of a friend with an idol billboard as the background. The preview interface shows both the idol and the friend, and the personal album of the gallery app contains both the idol and the friend's photos. The electronic device can focus on the face size in the street shooting scene. If the face size is larger, the focus priority is higher. So when the idol's face size is larger than the friend's face size, the electronic device can focus on the idol. Specifically, the idol uses a double black frame, and the friend uses a double gray frame. Fig.11As shown. However, if the user wants to focus on a friend at this time, the user can click on the friend and modify the focus target through the user's click, thereby realizing personalized modification of the focus priority. For another example, when the electronic device sets two labels, idol and friend, the idol's focus priority is set to be lower than the friend's focus priority. Then, when the idol and friend are displayed in the preview interface, the friend can use a double black frame, and the idol can use a double gray frame.

[0076] In the embodiments of the present application, the object tracking method can be applied to an electronic device. In some embodiments, the electronic device can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, and the like. The present application does not specifically limit the specific form of the electronic device.

[0077] like Fig.12 As shown, the electronic device may include: a processor, an external memory interface, an internal memory, a universal serial bus (USB) interface, a charging management module, a power management module, a battery, an antenna 1, an antenna 2, a mobile communication module, a wireless communication module, a sensor module, a button, a motor, an indicator, a camera, a display screen, and a subscriber identification module (SIM) card interface, etc. The audio module may include a speaker, a receiver, a microphone, an earphone interface, etc., and the sensor module may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0078] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device 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.

[0079] The processor may include one or more processing units, for example: the processor may include 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 / or a neural network processor (NPU). Among them, different processing units can be independent devices or integrated into one or more processors. The processor is the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction opcode and timing signal to complete the control of fetching and executing instructions.

[0080] The display screen is used to display images, videos, a series of graphical user interfaces (GUIs), such as a display preview interface, etc.

[0081] The external memory interface can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor through the external memory interface to implement the data storage function. The internal memory can be used to store computer executable program code, which includes instructions. The processor executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory. For example, in the present application, the processor enables the electronic device to execute the object tracking method provided in the present application by running the instructions stored in the internal memory. In addition, the internal memory can also store images, such as storing images of each object in the preview interface, storing images of high-frequency objects in the gallery application, and so on.

[0082] The camera 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. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP for conversion 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. In some embodiments, the electronic device may include 1 or N cameras, where N is a positive integer greater than 1.

[0083] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.

[0084] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device. Fig.13 It is a software structure diagram of an electronic device. The software structure adopts a layered architecture, which divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. Taking the Android system as an example, in some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer (Framework), the Android runtime (Android runtime) and the system library, the hardware abstraction layer (HAL) and the system kernel layer (Kernel).

[0085] The application layer may include a series of application packages. Application packages may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other APPs. The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.

[0086] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0087] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0088] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0089] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0090] The HAL may include multiple library modules, each of which may implement a set of interfaces for a specific type of hardware component. For example, the HAL includes a matching template selection module, an image matching module, and a priority determination module. The matching template selection module is used to select matching templates of high-frequency objects from all images of high-frequency objects saved by the gallery application. The matching template includes at least one image of the high-frequency object. The image matching module is used to identify objects that have an association relationship with high-frequency objects from the preview interface. During the identification, the image matching module may use the matching template selected by the matching template selection module. The priority determination module is used to determine the focus priority of objects that have an association relationship with high-frequency objects. Objects with different focus priorities may have different display methods to indicate the focus object through the display method.

[0091] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0092] Fig.14 A part of the interaction process between software and hardware is shown. In this interaction process, the matching template selection module completes the selection of the matching template. The process may include the following steps:

[0093] 1) After the user clicks the shooting control in the camera application, the camera application sends a shooting instruction to the camera through the camera driver, and the camera shoots the subject to obtain an image of the subject. Among them, if the subject is a high-frequency object in a personal album, the image of the high-frequency object can be stored in the first storage space, and the personal album of the gallery application can read the image of the high-frequency object from the first storage space to display all images of the high-frequency object through the personal album. All images of the high-frequency object are used to determine the focus tracking priority of the high-frequency object. In addition, the first storage space can also store images of non-high-frequency objects. In order to distinguish the images, a high-frequency object tag is added to the image of the high-frequency object.

[0094] 2) The matching template selection module can read the image of the high-frequency object from the first storage space, and select a matching template when it is determined that the read image meets a condition, wherein the condition can be that a preset number of images of the high-frequency object are read, that is, when a preset number of images of the high-frequency object are added, the matching template selection module can select a matching template of the high-frequency object. The value of the preset number is not limited in this embodiment.

[0095] In some examples, after the user opens the camera application, the camera application can send a startup instruction to the matching template selection module, and the matching template selection module starts running under the action of the startup instruction; after the camera application is closed, the camera application can instruct the matching template selection module to stop running, thereby reducing the resource occupation of the matching template selection module.

[0096] In some examples, the matching template selection module can read images from the first storage space according to certain conditions, such as the matching template selection module reading images from the first storage space at certain intervals; for example, the matching template selection module can read images from the first storage space when the electronic device is in a screen-off state; for example, the matching template selection module can read images from the first storage space when the camera application is not in use. In some examples, the first storage space can send images to the matching template selection module.

[0097] 3) The matching template selection module can store the features of each image in the matching template into the second storage space of the memory. Each matching template of a high-frequency object includes at least one image of the high-frequency object. After selecting the matching template of the high-frequency object, the matching template selection module extracts the features of each image in the matching template and stores the features of each image in the matching template into the second storage space. In this way, when identifying the object in the preview interface, the image matching module can directly read the features of the image of the high-frequency object from the second storage space, thereby improving efficiency.

[0098] Among them, the feature can be marked with a high-frequency object identifier to indicate the high-frequency object to which the feature belongs through the high-frequency object identifier. For example, the high-frequency object identifier can be the identity information of the high-frequency object. The identity information of the high-frequency object is used to uniquely identify the high-frequency object. The identity information of the high-frequency object can be the identity identification number (Identity Document, ID) of the high-frequency object. The ID of the high-frequency object is corresponded to the feature of the high-frequency object, so that the feature of the image of the high-frequency object can be found through the ID of the high-frequency object.

[0099] In some examples, the second storage space can store features of all images of the high-frequency object, and the features of all images of the same high-frequency object are marked with the high-frequency object identifier, and the features of each image in the matching template of the high-frequency object can also be marked with the matching template identifier, so as to achieve the purpose of identifying each image in the matching template through the matching template identifier.

[0100] In some examples, the second storage space can store matching templates of high-frequency objects, and the matching templates of high-frequency objects are associated with personal albums. When identifying whether there are objects associated with high-frequency objects in the preview interface, the matching templates of high-frequency objects are used for identification. The second storage space and the first storage space can also be the same storage space in the memory. After determining the matching template of the high-frequency object, a matching template identifier is added to the image in the matching template, and the purpose of identifying each image in the matching template is achieved through the matching template identifier.

[0101] Fig.15 A part of the interaction process between software and hardware is shown, in which the focus tracking is completed through the image matching module and the priority determination module, and the process may include the following steps:

[0102] 11) After the user opens the camera application, the camera application starts the camera through the camera driver.

[0103] 12) After starting the camera, the electronic device may display a preview interface of the camera application on the display screen, and at least one shooting object may be displayed in the preview interface. The image of the preview interface may be stored in the third storage space of the memory, and the third storage space is a temporary space. If the user clicks the shooting control in the preview interface, the image of the high-frequency object captured by the camera is stored in the first storage space, and the image stored in the third storage space may be deleted.

[0104] 13) The image matching module can read the image of the preview interface from the third storage space, and the image matching module identifies whether there is an object in the image of the preview interface that is associated with a high-frequency object in the personal album of the gallery application.

[0105] For example, the image matching module obtains the image of the subject from the image on the preview interface, matches the features of the image of the subject with the features of each image in the matching template, and when it is determined that the features of the image of the subject match the features of the image in the matching template, it is determined that there are objects in the image on the preview interface that are associated with high-frequency objects in the personal album of the gallery application. The features of each image in the matching template can be read from the second storage space. If the second storage space stores each image in the matching template, the image matching template can read each image in the matching template from the second storage space, and the image matching template calculates the features of each image.

[0106] In some examples, after the camera application is opened, the camera application can send a startup instruction to the image matching module, and the image matching module starts running under the action of the startup instruction; after the camera application is closed, the camera application can instruct the image matching module to stop running, thereby reducing the resource occupation of the image matching module.

[0107] 14) After the image matching module identifies an object that is associated with a high-frequency object in the personal album of the gallery application, the identity information of the object is sent to the priority determination module. For example, the identity information of the object can be the ID of the object, and the identity information of the object can be identified in the image of the object to associate the identity information of the object with the image of the object.

[0108] Each high-frequency object in the personal album of the gallery application also has an ID, and the image of each high-frequency object can be associated with the ID of the high-frequency object, so that the matching template selection module can select matching templates from all images associated with the same ID to obtain the matching template of the high-frequency object corresponding to the ID. The image matching template can use the ID of the high-frequency object to obtain the matching template of the ID, and match the image of each object in the preview interface with the matching template of each ID respectively. When it is recognized that the image of the object matches the matching template of an ID, it is determined that the object has an association relationship with the high-frequency object of the ID, and then the ID of the high-frequency object is used as the ID of the object in the preview interface that has an association relationship with the high-frequency object.

[0109] 15) The priority determination module determines the focus tracking priority of the object according to the identity information of the object. The priority determination module can determine the focus tracking priority according to the focus tracking strategy. For example, the priority determination module can obtain the number of images of the object in the personal album according to the identity information of the object, and determine the focus tracking priority according to the number of images. For example, the priority determination module can determine the position of the object in the preview interface according to the identity information of the object, and determine the focus tracking priority according to the position, etc.

[0110] 16) The priority determination module performs focus tracking according to the focus tracking priority of the object. The priority determination module can determine the display mode of the object according to the focus tracking priority of the object, and then the priority determination module can perform focus tracking according to the display mode of the object. For example, the display mode of the object can be the style of the registration frame used by the object. If an object uses a double black frame, the priority determination module can determine to focus on the object.

[0111] The object tracking method provided by the present application is described in conjunction with the timing diagram, such as Fig.16 The process of the object tracking method is shown. The object tracking method includes a matching template selection stage and a matching template use stage. The matching template selection stage mainly selects the matching template of the high-frequency object by the matching template selection module. The matching template use stage mainly uses the matching template, which may specifically include the following steps:

[0112] S101: A camera application instructs a camera to shoot a subject through a camera driver.

[0113] S102: When the photographed object is a high-frequency object, the camera stores an image of the high-frequency object in a first storage space, wherein the image of the high-frequency object can be displayed in a personal album of a gallery application.

[0114] S103: The matching template selection module reads the image of the high-frequency object from the first storage space.

[0115] S104 . When determining that the read image of the high-frequency object meets the condition, the matching template selection module selects an image from the images of the high-frequency object.

[0116] S105. The matching template selection module saves the selected image in the matching template, and stores the features of each image in the matching template in the second storage space.

[0117] S106: In the preview mode of the camera application, the image matching module reads the image of the preview interface from the third storage space.

[0118] S107: The image matching module obtains the image of the object from the image in the preview interface, and matches the features of the image of the object with the features of each image in the matching template.

[0119] S108: When the image matching module determines that the features of the image of the object match the features of the image in the matching template, it is determined that there is an object in the preview interface that is associated with the high-frequency objects in the personal album of the gallery application.

[0120] S109: The image matching module sends the identity information of the object associated with the high-frequency object to the priority determination module.

[0121] S110. The priority determination module determines the focus tracking priority of the object according to the identity information of the object associated with the high-frequency object.

[0122] S111. The priority determination module determines a display mode of the object according to the focus tracking priority of the object, and performs focus tracking according to the display mode of the object.

[0123] Among them, the image matching module can perform the following processing on the image of the high-frequency object and the image of the preview interface respectively: for the image of any object, the key point detection and positioning of the image is performed to obtain the key points of the object in each image, the image is cropped using the key points of the object in each image to obtain the image of the object, and the image of the object is affine transformed to correct the angle of the image to reduce the angle effect. Then the image matching module extracts features from the image after the affine transformation to obtain the features of the object. The features of the high-frequency object and the features of the object in the preview interface are used to determine whether the object in the preview interface is associated with the high-frequency object. If the features of the image of the high-frequency object have been pre-saved in the second storage space, the image matching module only needs to calculate the features of the images of each object in the preview interface.

[0124] The following uses the example where the high-frequency object is a face and an image of a face is also displayed in the preview interface to illustrate the object tracking method provided by the present application. Fig.17 The process of determining whether the face displayed in the preview interface is associated with the face of the high-frequency object (i.e., the same person) by the image matching module is shown. Taking the image of the preview interface as input, the image matching module detects and locates the key points of the image to identify the detection and positioning results of the key points. The detection and positioning 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.

[0125] For the images of faces in the gallery application, 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, performs affine transformation on the face to complete the correction of the face, and then extracts the features of the face after correction to obtain the features of the face. The image matching module further performs focus tracking on the protagonist face based on the features of the face in the preview interface and the features of the face in the gallery application, thereby realizing the protagonist focus tracking function. For example, the protagonist face can be a face in the preview interface whose features are similar to those of the face in the gallery application. The protagonist face is used as the face to be focused on in the preview interface, and the display method of the protagonist face is different from that of other faces, such as the protagonist face uses a double black frame.

[0126] In an embodiment of the present application, the personal album of the gallery application can save multiple images of the same face, and the image matching module can extract facial features from multiple images of the same person (the same person using the same ID), and then match them with the features of the face in the preview interface to determine whether it is the protagonist's face through multiple matches of the same facial features.

[0127] It is understandable that the face in the preview interface may be similar to different faces in the personal album, and the image matching module can determine the protagonist face based on the similarity distribution between the face in the preview interface and the same ID in the personal album. For example, the image matching module can determine the face with the most similarities exceeding the threshold as the protagonist face. If there are multiple faces with the most similarities exceeding the threshold, the image matching module can randomly select one face as the protagonist face, or determine the protagonist face according to the display of the face with the largest number of similarities in the preview interface.

[0128] In some examples, the image matching module can match the face in the preview interface with all the faces in the personal album. In some examples, the image matching module can match the face in the preview interface with the candidate face in the personal album, and the candidate face is the face obtained in the personal album. There are two ways to obtain the candidate face: if the personal album has divided the images of the same face into the same folder, then the faces in the folders ranked in the top N positions in the personal album are selected as candidate faces, N can be a natural number greater than or equal to 1, such as N = 5, and the sorting of faces in the personal album can be sorted according to the number of images in the folder, and the more images, the higher the ranking; if the personal album does not divide the faces, then the features of the faces in the personal album are extracted, and the faces are clustered using the features of the faces to divide the images of the same face into the same folder, and then the candidate faces are selected according to the sorting of the folders.

[0129] Each folder in a personal album can store all images of a person's face, and all images of a person's face are captured by a camera. However, as the use time of electronic devices increases, the number of images of people's faces in personal albums increases. If features are extracted one by one for matching, the matching efficiency will be affected. Therefore, this embodiment uses a matching template selection module to select representative images from a large number of images as images in the matching template, and uses the images in the matching template to identify faces that are associated with faces in the gallery application from the preview interface. The process of selecting matching templates by the matching template selection module is as follows: Fig.18 As shown, Fig.18 Taking a human face as an example, the process of selecting a matching template for the face is described, which may include the following steps:

[0130] 21) Obtain the center feature of the face. All images of a face are stored in the same folder, each folder corresponds to an ID, and each ID corresponds to a face in a folder. For the face in the folder corresponding to each ID, the matching template selection module can calculate the average feature of the features of all images of the same face, and use the average feature as the center feature of the face in the folder corresponding to the ID.

[0131] 22) Calculate the similarity between the features of each face image and the central feature, and arrange them according to the similarity. For example, calculate the cosine similarity and arrange them in descending order according to the cosine similarity.

[0132] 23) According to the similarity, the similarity is divided into multiple similarity ranges, and a certain number of images are selected from each similarity range, and the selected images are used as images in the matching template. For example, the similarity is evenly divided into 4 similarity ranges according to the similarity, and 5 images are selected for each similarity range. If there are not enough images in one similarity range, non-repeated images in adjacent similarity ranges are selected. The number of divisions and the number of images selected for each similarity range can be adjusted according to actual conditions.

[0133] It can be understood that the images in a folder corresponding to an ID are the same face, and the images of the same face can be affected by the environment, posture, shooting distance, makeup, etc. The similarity between the features of each image and the central features represents the compactness with the center of the face. The higher the similarity, the higher the compactness, and the smaller the difference between different similarities, the smaller the difference between the images. Therefore, the matching template selection module can select matching templates according to the similarity range to divide images with smaller image differences into the same similarity range. In this way, the matching template selection module can select images with different features, such as images of faces with different postures and makeup, to ensure the comprehensiveness of the images in the matching template.

[0134] The matching template selected by the matching template selection module is used by the image matching module, which can calculate the similarity between the image of the face displayed in the preview interface of the camera application and the image in the matching template. The ID corresponding to the matching template with the highest similarity exceeding a threshold (such as 0.6) is the ID of the object in the preview interface. For example, the cosine similarity between at least one face in the preview interface and the face in the matching template is calculated. The ID corresponding to the matching template with the highest cosine similarity exceeding 0.6 is the ID of the face in the preview interface. The priority determination module can instruct to track the face corresponding to the ID, thereby obtaining the identity information of the object using the feature extraction method in the preview interface of the photo and video preview modes, thereby realizing automatic focus tracking of the face in conjunction with the image in the gallery application.

[0135] Multiple faces can be displayed in a preview interface. The priority determination module can control the focus tracking of faces. The process is as follows: Fig.19 As shown, the following steps may be included:

[0136] 31) For each face, obtain the similarity between the face and the face in the gallery application. The similarity between the face and the face in the gallery application is obtained by the image matching module, specifically, the similarity is obtained when there is a face in the recognition preview interface that is associated with the face in the gallery application.

[0137] 32) Determine whether the similarity of the faces meets the similarity constraint condition. If yes, execute step 33. If no, the face with the largest area in the automatic tracking preview interface is the face with the highest tracking priority, and the face is displayed with double black frames. The similarity constraint condition can be that the similarity is greater than a threshold.

[0138] 33) For each face, obtain the ID of the face in the gallery application that is most similar to the face.

[0139] 34) Determine whether the angle of the face in the preview interface meets the angle constraint condition. If yes, execute step 35. If not, automatically track the focus on the face with the largest area in the preview interface.

[0140] Each image is subjected to an affine transformation before feature extraction. During the affine transformation, changes in the flip angle (roll) do not affect the image posture, and thus Roll does not affect the image features, while the pitch angle (pitch) and left and right deflection angles (yaw) affect the features. Therefore, angle constraints are introduced in this embodiment, such as angle constraints including yaw (-45, +45) and pitch (-45, +45), to recognize and track faces within the angle range.

[0141] 35) Select the face with the highest priority for focus tracking from all faces that meet the similarity constraint and the angle constraint. The face with the highest priority for focus tracking uses a double black frame, and other faces that meet the angle constraint use a double gray frame. The process of selecting the face with the highest priority for focus tracking is as follows:

[0142] 351) Determine whether there are multiple faces with equal similarity among the faces that meet the similarity constraint and the angle constraint. If yes, execute step 352. If not, the face corresponding to the ID with the highest similarity has the highest focus tracking priority. Multiple faces with equal similarity can be faces with the highest (i.e., the largest) similarity and equal similarity.

[0143] 352) Determine whether the areas occupied by faces with equal similarity are equal. If so, execute step 353. If not, the face corresponding to the ID with the largest occupied area has the highest priority for focus tracking.

[0144] 353) Determine whether the number of images of faces with equal occupied areas in the gallery application is equal. If so, execute step 354. If not, the face corresponding to the ID with the largest number of images has the highest priority for tracking focus. The number of images in the gallery application is the number of all images corresponding to the same ID in the gallery application, including the number of images in the matching template corresponding to the ID.

[0145] 354) The face corresponding to the ID near the middle of the preview interface has the highest priority for tracking focus.

[0146] Through steps 31 to 35, the face associated with the face in the gallery application is identified from the preview interface, and then the face with the highest priority for tracking focus is determined through steps 351 to 352. The process of identifying the face and determining the face with the highest priority for tracking focus is only an example, and this embodiment does not limit it. It can be understood that when multiple faces are displayed on the preview interface, the electronic device can determine candidate faces from the preview interface based on the matching results of the multiple faces with the faces in the gallery application and multiple constraints, and determine the protagonist face from the candidate faces based on the relationship between the candidate faces. The multiple constraints may include similarity constraints and angle constraints. The candidate face is a face that matches the face in the gallery application in the preview interface and the face satisfies multiple constraints. The protagonist face is the face with the highest priority for tracking focus among the candidate faces, and the protagonist face can be determined through steps 351 to 354. For the candidate face, a double gray frame can be displayed, and the protagonist face can be displayed with a double black frame and the protagonist face can be tracked.

[0147] In some examples, the priority determination module can be set as a priority determination module, such as the priority determination mode includes an automatic (auto) mode and a user selection mode. In the automatic mode, the priority determination module can determine the similarity, the area occupied by the face, the number of faces in the gallery application, and the position of the face in the preview interface in turn to determine the face with the highest priority for tracking focus. The face with the highest priority for tracking focus uses a double black frame. If the user clicks (touch) on the face in the preview interface, the automatic mode is switched to the user selection mode, and the face clicked by the user is determined as the face with the highest priority for tracking focus. Generally, the camera focuses on one focus, so the camera can track the face with the highest priority for tracking focus. In some examples, the priority determination module can determine a candidate face from the preview interface, and the candidate face can display a double gray frame to prompt the user to track the candidate face through the double gray frame. Then the user can click on a candidate face, and the clicked candidate face is used as the protagonist face, and the camera tracks the protagonist face.

[0148] Therefore, if the preview interface provides the user with multiple matching faces, the object tracking method provided by the present application can automatically output a face with the highest tracking priority to distinguish it from other faces in the preview interface. At the same time, the user can also switch different tracking targets according to his own choice. For example, the object tracking method can be applied to a crowd scene. The user can save the image of the face of the person to be found in the personal album of the gallery application in advance. When looking for people, the user can open the camera application. Many faces are displayed in the preview interface of the camera application. The user can zoom in the preview interface through the zoom operation, and then identify whether there is a face that matches the face in the personal album from the enlarged interface. If there is a face that matches the face in the personal album, the face uses a double black frame to indicate that the face is the person currently being found.

[0149] In addition, the object tracking method provided by the present application can screen the faces in the preview interface before identifying the associated faces, and match the faces that meet certain requirements in the preview interface with the faces in the matching template to avoid interference from background faces. For example, the face is screened according to the area occupied by the face, and the faces that meet the preset area threshold are matched with the faces in the matching template.

[0150] When the high-frequency objects are pets or buildings, the electronic device can also use the above-mentioned object tracking method to perform focusing, which will not be explained here in conjunction with the drawings.

[0151] In addition, an embodiment of the present application also provides an electronic device, which includes: one or more processors and a memory; the memory is used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the above-mentioned object tracking method.

[0152] An embodiment of the present application also provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed, the above-mentioned object tracking method is implemented.

Claims

1. A method for tracking focus of an object, It is characterized in that The method is applied in an electronic device, the electronic device includes a camera application and a gallery application, the gallery application stores an image of at least one preset object, and the method includes: In response to an operation of opening the camera application, a preview interface of the camera application is displayed, wherein a first object is displayed in the preview interface, the first object is associated with one of the preset objects among all the preset objects, and the first object is displayed in the preview interface in a first display mode, and the first display mode is used to prompt the electronic device to focus on the first object.

2. The method according to claim 1, It is characterized in that The preview interface also displays a second object, which is associated with a preset object among all the preset objects. The second object is displayed in the preview interface using a second display method, and the second display method is used to prompt that the focus priority of the second object is lower than that of the first object.

3. The method according to claim 1 or 2, It is characterized in that The preview interface also displays a third object, which has no association with any of the preset objects. The third object is displayed in the preview interface in a third display mode, and the third display mode is used to prompt that the third object has the lowest focus priority.

4. The method according to any one of claims 1 to 3, It is characterized in that The preview interface further displays a fourth object, and the method further includes: When the attention degree of the fourth object is greater than that of the first object, the fourth object is displayed in the preview interface in the first display mode, the first object is switched from the first display mode to the fourth display mode, and the focus priority of the first object displayed in the fourth display mode is lower than the focus priority of the fourth object.

5. The method according to claim 4, It is characterized in that The degree of attention of the fourth object is greater than the degree of attention of the first object, including: The fourth object is selected by the user; or, The fourth object is displayed more prominently in the preview interface than the first object in the preview interface. or, The type level of the fourth object is greater than the type level of the first object.

6. The method according to any one of claims 1 to 5, It is characterized in that The method further includes: displaying a label of the first object in the preview interface, where the label of the first object is used to indicate a relationship between the first object and a user.

7. The method according to any one of claims 1 to 6, It is characterized in that The first display mode is a first double border, the color of at least one side of the first double border is a first preset color, and the first double border is used to frame a main feature part of the first object; The second object in the preview interface is displayed in a second display mode, the second object is associated with the preset object, the focus tracking priority of the second object is lower than the focus tracking priority of the first object, the second display mode is a second double border, the color of at least one side of the second double border is a second preset color, and the second double border is used to frame the main feature parts of the second object.

8. The method according to any one of claims 1 to 7, It is characterized in that At least two target objects are displayed in the preview interface, and there is an association relationship between the target objects and the preset objects. The method further includes: In a case where it is determined that there are target objects with equal similarity according to the maximum similarity between the target object and the preset object, determining whether there are target objects with equal similarity that occupy the same area in the preview interface among the target objects with equal similarity; If there are target objects with the same similarity that occupy the same area in the preview interface, determining whether the number of images of the target objects with the same area in the gallery application is equal; When the number of images of the target objects with equal occupied areas in the gallery application is equal, it is determined that the target object closest to the middle of the preview interface has the highest focus priority, and the target object with the highest focus priority is the first object.

9. The method according to claim 8, It is characterized in that The method further comprises: In the case where there are no target objects with the same similarity, determining that the target object with the greatest similarity has the highest focus tracking priority; or, In the case where there are no target objects with the same occupied area, determining that the target object with the greatest similarity has the highest focus tracking priority; or, When the target objects with the same occupied area have unequal numbers of images in the gallery application, it is determined that the target object with the largest number of images has the highest focus tracking priority.

10. The method according to any one of claims 1 to 7, wherein at least two target objects are displayed in the preview interface, and the target objects are associated with the preset objects, and the method further include: If the preset object associated with the target object has the largest number of images in the gallery application, determining that the target object associated with the preset object with the largest number of images has the highest focus tracking priority; or, Determine the target object among all target objects whose similarities with each preset object exceed the threshold the most, and the determined target object has the highest focus tracking priority; or, Determine that the target object that the user is currently paying attention to has the highest focus priority.

11. The method according to any one of claims 8 to 10, It is characterized in that The method also includes: when the attention degree of the target object whose focus priority is not the highest among the at least two target objects is greater than the attention degree of the target object with the highest focus priority, lowering the focus priority of the target object with the highest focus priority, and determining that the focus priority of the target object with the highest attention degree is the highest.

12. The method according to claim 11, It is characterized in that The attention degree of the target object whose focus tracking priority is not the highest among the at least two target objects is greater than the attention degree of the target object with the highest focus tracking priority, including: the target object whose focus tracking priority is not the highest is selected by the user, and the attention degree of the target object selected by the user is the highest.

13. The method according to claim 8 or 10, It is characterized in that The existence of an association relationship between the target object and the preset object is determined at least based on the similarity between the target object and the preset object being greater than a threshold; The similarity between the target object and the preset object is obtained based on the features of the image of the target object and the features of each image in the matching template of the preset object; each image in the matching template of the preset object is selected from all images of the preset object in the gallery application.

14. The method according to claim 13, It is characterized in that Each image in the matching template of the preset object is selected from all images of the preset object in the gallery application, including: Acquire features of each image of the preset object and a central feature of the preset object, wherein the central feature of the preset object is an average feature of features of all images of the preset object; Obtaining the similarity between the features of each image of the preset object and the central feature of the preset object; Sorting all similarities of the preset objects according to the magnitude of the similarities, and dividing all the sorted similarities into at least two similarity ranges according to the magnitude of the similarities; A preset number of images are selected from an image set corresponding to each similarity range, the matching template includes the preset number of images, and the similarity of each image in the image set is within the similarity range.

15. The method according to claim 14, It is characterized in that If the preset number of images are not selected within a similarity range, images are selected from an image set corresponding to an adjacent similarity range of the similarity range, and there are no duplicate images among the selected images.

16. The method according to any one of claims 8 to 15, It is characterized in that The angle of the target object in the preview interface satisfies a preset angle constraint condition; and / or, The target object occupies an area greater than a preset area threshold in the preview interface.

17. The method according to any one of claims 8 to 16, It is characterized in that The target object and the preset object have an association relationship including: Detecting and locating key points of the image on the preview interface to identify key points of the object, and cropping the image of the object from the image on the preview interface using the key points of the object; Performing an affine transformation on the image of the object, and performing feature extraction on the image of the object after the affine transformation to obtain features of the object; When the feature of the object matches the feature of at least one image of the preset object, it is determined that the object has an association relationship with the preset object, and the object having an association relationship with the preset object is the target object.

18. The method according to claim 17, It is characterized in that The method further includes: selecting a preset number of preset objects from the gallery application, wherein the preset number of preset objects are used to identify objects having an associated relationship in the preview interface; The selecting a preset number of the preset objects from the gallery application comprises: if images of the same preset object in the gallery application are stored in a folder, selecting a preset number of the preset objects according to the number of images in the folder; If the images of the same preset object in the gallery application are not saved in a folder, the images of the preset object are clustered to save the images of the same preset object in a folder, and a preset number of the preset objects are selected according to the number of images in the folder.

19. An electronic device, It is characterized in that The electronic device comprises: one or more processors and memory; The memory is used to store computer program code, which includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the object tracking method as described in any one of claims 1 to 18.

20. A computer-readable storage medium, It is characterized in that The computer-readable storage medium is used to store a computer program, and when the computer program is executed, it implements the object tracking method as described in any one of claims 1 to 18.

Citation Information

Cited By

  • Preview image restoration method and device, electronic equipment and computer program product

    CN122530034A