Determining a focus area in an image

Through object detection and priority determination technology, the focus area in the image is calculated, which solves the problem of incomplete representative content of the image in containers of different sizes and achieves the effect of automatic adaptation and complete presentation of the image in the container.

CN120614525APending Publication Date: 2025-09-09MICROSOFT TECHNOLOGY LICENSING LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410269536.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-08
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

When images are filled into image containers of different sizes, existing technologies have difficulty ensuring that the representative content of the image is always fully presented. Especially in web design and advertising design, changes in the size of the image container may cause partial incompleteness or distortion of the image.

Method used

The object detection information in the image is obtained through object detection technology, the attributes and occupied area of ​​the object are determined, the focused object is selected based on the object priority, and the focused area is calculated using the geometric center or occupied area of ​​the focused object to adapt to the size change of the image container.

Benefits of technology

It achieves automatic adaptation and complete presentation of representative parts of the image when the image container size changes, improving the flexibility and accuracy of image filling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120614525A_ABST
    Figure CN120614525A_ABST
Patent Text Reader

Abstract

The invention provides a method, a device and a non-transitory computer readable medium for determining a focus area in an image. An image may be received. Object detection information of the image may be obtained, the object detection information indicating an occupied area and an attribute of each of a plurality of objects detected in the image. An object priority may be determined based on an attribute of each object of the plurality of objects. At least one set of focused objects may be selected from the plurality of objects according to the object priorities. For a set of focus objects in the at least one set of focus objects, a focus area corresponding to the set of focus objects may be calculated using an occupied area of the set of focus objects.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] Images often contain rich visual information. In some scenarios, an image can be placed in a specific area, for example, as a background image for that area. The dimensions of this specific area may not match the original image size. In this case, users may need to use some image processing functions to render a portion of the image content within this specific area. Summary of the Invention

[0002] This summary is provided to introduce a set of concepts that will be further described in the following detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

[0003] Embodiments of the present disclosure provide a method, apparatus, and non-transitory computer-readable medium for determining a focused area in an image. An image may be received. Object detection information for the image may be obtained, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image. Object priorities may be determined based on the attributes of each of the plurality of objects. At least one group of focused objects may be selected from the plurality of objects based on the object priorities. For a group of focused objects in the at least one group of focused objects, a focused area corresponding to the group of focused objects may be calculated using the occupied areas of the group of focused objects.

[0004] It should be noted that one or more of the above aspects include features described in detail below and particularly pointed out in the claims. The following description and drawings set forth in detail certain illustrative features of the one or more aspects. These features are merely indicative of the various ways in which the principles of the various aspects may be implemented, and the present disclosure is intended to include all such aspects and their equivalents. BRIEF DESCRIPTION OF THE DRAWINGS

[0005] The disclosed aspects will be described below with reference to the accompanying drawings, which are provided to illustrate rather than limit the disclosed aspects.

[0006] Figure 1 An exemplary process of determining a focus area in an image according to an embodiment is shown.

[0007] Figure 2 A schematic diagram illustrating an image for processing according to the focus region determination mechanism of the present disclosure according to an embodiment is shown.

[0008] Figure 3 A schematic diagram showing multiple objects detected in an image according to an embodiment is shown.

[0009] Figure 4A schematic diagram showing that a selected group of focus objects includes only one focus object according to an embodiment is shown.

[0010] Figure 5 A schematic diagram illustrating that a selected group of focus objects includes two or more focus objects according to an embodiment.

[0011] Figure 6 A schematic diagram of calculating the geometric center of a focused object according to an embodiment is shown.

[0012] Figure 7 Shown according to Figure 6 Schematic diagram of the calculated geometric center to define the focus area.

[0013] Figure 8 A schematic diagram of calculating the geometric centers of multiple focused objects according to an embodiment is shown.

[0014] Figure 9 Shown according to Figure 8 Schematic diagram of the calculated geometric center to define the focus area.

[0015] Figure 10 A schematic diagram illustrating defining a focus area according to an occupied area of ​​a focus object according to an embodiment is shown.

[0016] Figure 11 A schematic diagram illustrating defining a focus area according to occupied areas of a plurality of focus objects according to an embodiment is shown.

[0017] Figure 12 A schematic diagram illustrating defining a focus area according to occupied areas of a plurality of focus objects according to an embodiment is shown.

[0018] Figure 13 A schematic diagram showing multiple focus areas determined for an image according to an embodiment is shown.

[0019] Figure 14 A schematic diagram illustrating corresponding preview views for multiple focus areas according to an embodiment is shown.

[0020] Figure 15 A schematic diagram illustrating filling an image container according to a focus area according to an embodiment is shown.

[0021] Figure 16 A schematic diagram showing that an image container includes a blank area that is not partially covered by an inserted image.

[0022] Figure 17 A schematic diagram illustrating preview views generated for multiple container sizes based on a focus area according to an embodiment is shown.

[0023] Figure 18A schematic diagram illustrating preview views generated for multiple container sizes based on multiple focus areas according to an embodiment is shown.

[0024] Figure 19 A flow chart illustrating an exemplary method for determining a focus area in an image according to an embodiment is shown.

[0025] Figure 20 An exemplary apparatus for determining a focus area in an image according to an embodiment is shown.

[0026] Figure 21 An exemplary apparatus for determining a focus area in an image according to an embodiment is shown. DETAILED DESCRIPTION

[0027] The present disclosure will now be discussed with reference to various exemplary embodiments. It should be understood that the discussion of these embodiments is only for enabling those skilled in the art to better understand and thereby implement the embodiments of the present disclosure, and does not teach any limitation on the scope of the present disclosure.

[0028] Some scenarios may involve filling an image into a specific area. For clarity, in this disclosure, the specific area used to accommodate the filled image is referred to as an image container. An example of this scenario is a web design application that supports responsive design. A web designer can use this application to edit a web page during the design phase. This editing process can include filling an image into an image container. Once the editing process takes effect, a web page can be generated for the viewer to browse. During browsing, responsive design allows the web page to automatically adjust its layout and content based on the different screen sizes and resolutions of different viewers' devices (e.g., desktop computers, laptops, tablets, and smartphones) to provide an optimal browsing experience. In this case, as the viewer's screen size and resolution change, the size of the image container may change, and the portion of the image presented in the image container will change accordingly. Another example of this scenario is an advertising design application, where an advertising designer may wish to fill a specific image into image containers of different sizes to create advertisements of varying sizes. It should be understood that this scenario may exist in various applications related to user interface (UI) design.

[0029] In the above scenario, users (e.g., web designers, advertising designers, etc.) generally expect that a specific image portion can always be presented during the process of image container size changes. In one example, the subject of the image to be filled into the image container may be, for example, a person in a specific scene. Thus, the user may want the image portion containing the person to be presented as completely as possible during the image container change. In order to achieve such a function, there is currently a mechanism called a focal point. This mechanism allows the user to manually set a pixel in the image as the focal point of the image. The mechanism can also automatically set a pixel at the center of the image as the focal point of the image. The set focal point ensures that when the image is filled into the image container, the image portion surrounding the focal point is always presented regardless of how the size of the image container changes.

[0030] The present disclosure improves upon the aforementioned focus point mechanism and proposes a mechanism for determining a focus area within an image. The focus area determination mechanism of the present disclosure can automatically determine a focus area within an image based on the image's content. The focus area provides guidance regarding which portion of the image carries more valid information or contains more representative content. The guidance provided by the focus area can, for example, be used to guide how the image is filled into an image container, ensuring that a representative portion of the image is always present within the image container. Compared to existing solutions that automatically set a pixel at the center of the image as the focus point, the mechanism proposed in the present disclosure achieves the technical effect of flexibly adapting the focus area determined for an image to the specific content of the image.

[0031] In one aspect, embodiments of the present disclosure can receive an image and obtain object detection information generated by performing an object detection task on the image. The object detection information can indicate the occupied area and attributes of each of multiple objects detected in the image. Such object detection information provides a description of the content contained in the image. Obtaining such object detection information can achieve the technical effect of helping to more accurately determine which part of the image carries more valid information or contains more representative content in subsequent processes.

[0032] In one aspect, embodiments of the present disclosure can determine object priority based on the attributes of each object. Object priority can be determined according to predetermined rules, such that objects with higher priorities generally carry more valid information or contain more representative content. At least one group of focused objects can be selected from multiple objects detected in an image based on the determined object priorities. The occupied areas of the group of focused objects can then be used to calculate a corresponding focused area. Through these operations, the technical effect of efficiently determining a focused area can be achieved, wherein the focused area helps to include a representative portion of the image in the image container.

[0033] Exemplary embodiments of the present disclosure will be described below with reference to the accompanying drawings.

[0034] Figure 1 An exemplary process 100 for determining a focus area in an image is shown, according to an embodiment.

[0035] Image 110 may be received, and the operations for determining a focus region discussed in embodiments of the present disclosure may be performed on image 110. Image 110 may be any image that is intended to be populated into an image container. In one example, the focus region determination mechanism of the present disclosure may be used to process image data, and in this example, image 110 may be a single image. In another example, the focus region determination mechanism of the present disclosure may be used to process video data, and in this example, image 110 may be any frame in a video. Image 110 may include multiple objects, where an object is anything visible in image 110.

[0036] Object detection information 120 of the image 110 may be obtained. The object detection information 120 is descriptive information for the objects detected in the image 110. The object detection information 120 may indicate an occupied area 121 and attributes 122 of each of the multiple objects detected in the image 110. The occupied area 121 of the object may represent the portion of the image occupied by the object in the image 110. The attributes 122 of the object may represent characteristics, properties, or features of the object. The attributes 122 may include multiple types of attributes. Each type of attribute describes a characteristic, property, or feature of the object in one aspect. Figure 1 As shown, the attributes 122 may include, for example, category attributes 122-1, geometric attributes 122-2, and appearance attributes 122-3. The category attribute 122-1 may represent the category into which the object is classified. The geometric attribute 122-2 may represent the geometric characteristics, properties, or features of the object in terms of size, position, and orientation. The appearance attribute 122-3 may represent the appearance characteristics, properties, or features of the object in terms of color, brightness, clarity, etc. In one example, the attributes 122 may include Figure 1Other attributes not shown in the image may provide a description of the object in terms other than the category, geometry, and appearance discussed above. Object detection information 120 provides a description of the content of the image through the object's occupied area 121 and attributes 122. Thus, operations for determining a focused area in an image can be performed based on the content of the image indicated by object detection information 120.

[0037] In one example, object detection information 120 may be generated by performing an object detection task on image 110. The object detection task may be a task known in the field of computer vision for identifying objects in an image, such as a target detection task, an instance segmentation task, an image segmentation task, and the like. Exemplarily, an object detection model may be used to perform the object detection task. The object detection model may be a machine learning model of any architecture for performing the object detection task on image 110, such as a RetinaNet model for performing target detection tasks, a FasterRCNN model and a Mask-RCNN model for performing instance segmentation tasks, or a SegmentAnything model for performing image segmentation tasks. In this example, the object detection model may receive image 110 and automatically detect which objects are contained in image 110, which area of ​​image 110 each object occupies, and what attributes each object possesses. For example, the object detection model may indicate the area occupied by each object by providing a bounding box surrounding the object or a mask covering the object. The object detection model can also generate an attribute label for each object, and the attribute label can include one or more attribute values ​​that describe the object. In another example, the object detection information 120 can be generated by manual annotation. For example, an annotator can manually annotate the occupied area and attribute label of each object. In another example, the object detection information can be generated in part using the object detection model and in part by manual annotation. It should be understood that process 100 is not limited to any specific method of generating object detection information 120, but can obtain the object detection information 120 from any source that can generate object detection information 120 (e.g., object detection model, annotator, etc.).

[0038] An object priority may be determined at 140 based on the attributes of each object. The object priority provides information regarding the corresponding priority of each object in the plurality of objects detected in the image 110. In one example, the object priority may indicate a value of the priority of each object detected in the image 110. For example, the object priority may indicate that a first object in the plurality of objects detected in the image 110 has a second priority, a second object in the plurality of objects has a third priority, a third object in the plurality of objects has a first priority, and so on. In another example, the object priority may simply indicate the order in which the plurality of detected objects are sorted by priority. For example, the object priority may maintain the following object ordering: [third object, first object, second object]. Such an ordering indicates that the third object has a higher priority than the first object, and the first object has a higher priority than the second object.

[0039] The object priority can be determined according to a predetermined rule 130. The rule 130 can specify which attributes of an object have a higher or lower priority. The object determined to have a higher priority by the above rule usually carries more valid information or contains more representative content. Figure 3 Details regarding determining object priorities based on attributes of each object according to predetermined rules are discussed further in detail.

[0040] At 150, based on the object priorities determined at 140, at least one group of focused objects may be selected from the plurality of objects detected in image 110. A focused object is an object that is more representative than other objects in image 110, and is therefore suitable for determining a focus area based on the focused object. Based on the object priorities, one or more objects with higher priorities may be selected as a group of focused objects. In one example, the group of focused objects selected based on the object priorities may include only one focused object. In another example, the group of focused objects selected based on the object priorities may include two or more focused objects.

[0041] At 160, subsequent operations may be performed for each of the multiple groups of focused objects to calculate a focus region corresponding to the group of focused objects. A focus region is a specific image portion defined in image 110 that helps include a representative portion of the image in the image container. In one example, the focus region may be a pixel region consisting of a group of pixels in the image, for example, a rectangular region. In another example, the focus region may be a single pixel in the image. Embodiments of the present disclosure provide different exemplary methods for calculating a focus region corresponding to a group of focused objects.

[0042] A first example approach can calculate a focus area using the geometric centers of a group of focused objects, corresponding to the operations shown at 170 and 175. At 170, the geometric center of the group of focused objects can be calculated based on the occupied area of ​​each focused object in the group. In one example, when the group of focused objects includes only one focused object, the geometric center of the group of focused objects can be calculated based on the occupied area of ​​the focused object. In another example, when the group of focused areas includes two or more focused objects, a corresponding geometric center can be calculated based on the occupied area of ​​each focused object, and then the geometric center of the group of focused objects can be calculated based on the calculated geometric centers. In one example, the geometric center of the group of focused objects can be calculated by performing a weighted average operation on the coordinates of the calculated geometric centers. In another example, the weighted average operation can be performed by assigning a corresponding weight value to each focused object in the group based on the object priority. At 175, a focus area corresponding to the group of focused objects can be defined based on the calculated geometric centers of the group of focused objects. In an example where the focus area is a pixel region in an image, the focus area may be defined by extending a pixel region outward from the determined geometric center of the group of focus objects. In an example where the focus area is a pixel point in an image, the focus area may be defined by the determined geometric center of the group of focus objects.

[0043] A second example approach can directly calculate a focus area using the occupied areas of a group of focused objects, corresponding to the operation shown at 180. At 180, a focus area corresponding to the group of focused objects can be defined based on the occupied areas of each focused object in the group. For example, the focus area can be formed by expanding a specific boundary of the occupied areas of the group of focused objects outward by a predetermined size.

[0044] Through the example discussed above, a focus area corresponding to a group of focus objects can be determined. Similarly, the above operations can be performed for multiple groups of focus objects to determine corresponding focus areas.

[0045] An exemplary process of automatically determining a focus region in image 110 based on the content of image 110 indicated by object detection information 120 is discussed above. The determined focus region provides an indication of which image portion of image 110 is generally more representative.

[0046] Figure 1An example scenario related to the application of the determined focus area is also shown. At optional step 190, the image container can be automatically populated with image 110 based on the determined focus area. When image 110 is populated into the image container, the determined focus area is always presented regardless of how the image container changes size. This allows the portion of image 110 that carries more effective information or contains more representative content to be presented in the image container as much as possible.

[0047] Figure 2 A schematic diagram 200 is shown of an image for processing according to the focus region determination mechanism of the present disclosure according to an embodiment. The image may correspond to a combination of Figure 1 Image 110 of discussion. Figure 2 The image shown shows the back of a person kicking a ball and the ball next to the back in the upper left position, a child eating cookies in the lower middle position, and an adult watching the child eating cookies in the right position.

[0048] Can Figure 2 The image shown performs object detection tasks, for example, by combining the above Figure 1 The object detection information is generated by using an object detection model and / or by manual annotation. The object detection information may indicate the occupied area and attributes of each of the multiple objects detected in the image.

[0049] Figure 3 Schematic diagram 300 showing multiple objects detected in an image according to an embodiment. Figure 3 In the illustrated example, the plurality of objects detected in the image may include object 302 , object 304 , object 306 , object 308 , object 310 , object 312 , and object 314 .

[0050] exist Figure 3 In the example, each detected object is surrounded by a rectangular bounding box. The area surrounded by the bounding box of the object is the area occupied by the object in the image. It should be understood that Figure 3 The rectangular bounding box shown is only an example form of the occupied area of ​​the object. In other examples, the occupied area of ​​the object can be represented by any other form known in the art for indicating the area occupied by the detected object in the image, such as a bounding box of a non-rectangular shape, a mask covering the object, etc.

[0051] Although Figure 3The occupied area of ​​each image is intuitively shown in the form of a bounding box. However, in one example, instead of showing the occupied area of ​​the object in the image, information indicating the occupied area of ​​each object can be stored separately. For example, the occupied area information of each object can be stored as the coordinates of the bounding box of the object in the image.

[0052] In addition, the object detection information may also include attributes for each detected object. Figure 1 As discussed above, the attributes of each object may include one or more types of attributes, including one or more of category attributes, geometric attributes, and appearance attributes.

[0053] In one aspect, the category attribute may characterize what category the object is classified as. In one example, the category attribute may include a human object category. For example, the object detection information may indicate Figure 3 The category attribute of objects 302, 306, 308, 312, and 314 in the image is “human.” In one example, the category attribute may also include other categories besides the human object category, such as an animal object category, an inanimate object category, and the like.

[0054] In one example, the category attributes can be further subdivided into one or more subcategories. For example, for the human object category, one or more subcategories associated with human facial features can be defined, where human facial features can be facial organs such as face, eyes, nose, mouth, etc. For example, the object detection information can indicate Figure 3 The category attribute of objects 308 and 314 in is "human", and the subcategory attribute is "face". In addition, one or more other subcategories associated with body parts other than face, for example, limbs, torso, etc., can also be similarly defined. Similarly, categories other than the human object category, such as the animal object category and the inanimate object category, can also be subdivided into one or more subcategories. For the animal object category, for example, one or more subcategories associated with animal species, such as "cat", "dog", etc., can be defined; and one or more subcategories associated with animal body parts, such as face, eyes, nose, mouth, limbs, torso, etc., can be defined similarly to the discussion above for the human object category. For the inanimate object category, for example, one or more subcategories associated with specific types of objects can be defined. As Figure 3 In the example shown, the object detection information may indicate that the category attribute of object 304 is "inanimate object" and the subcategory attribute is "ball"; the category attribute of object 310 is "inanimate object" and the subcategory attribute is "biscuit", etc. It should be understood that the specific classification of categories and subcategories can be flexible and can be associated with different object detection granularities.

[0055] On the other hand, geometric attributes can characterize the geometric characteristics, properties, or features of an object in terms of size, position, and orientation.

[0056] The size of an object can characterize the size of the space occupied by the object in the image and can be measured by the size of the occupied area discussed above. In one example, when the occupied area of ​​an object is defined by a bounding box or a mask, the size of the object can be calculated by the area enclosed by the bounding box or the number of pixels covered by the mask. For example, according to Figure 3 For example, the object detection information may indicate that the size of object 312 is 100*200 pixels and the size of object 306 is 80*110 pixels.

[0057] The position of an object can represent the position of the object in the spatial scene captured by the image or the position of the object in the image. In one example, the position of the object in the spatial scene can be measured by the spatial longitudinal depth of the object. By using the above measurement method, it can be determined whether the object is in the foreground position or the background position. For example, according to Figure 3 In an example, it can be determined that objects 306 and 312 are foreground objects, while object 302 is a background object. In one example, the position of an object in an image can be measured by the coordinates of the center of the object's occupied area in the image. By using the above measurement method, it can be determined that the object is in the middle of the image or at the edge of the image. For example, according to Figure 3 For example, it can be determined that object 306 is in the middle of the image and object 312 is at the edge of the object.

[0058] The orientation of an object can represent the orientation of the object in the spatial scene captured by the image, or the orientation of the object in the image. In one example, the orientation of the object in the spatial scene can be measured by defining the direction facing the lens capturing the image as 0 degrees and the direction facing away from the lens as 180 degrees. Figure 3 For example, it can be determined that the spatial orientation of object 308 is 15 degrees, while the spatial orientation of object 314 is -45 degrees. In one example, the orientation of an object in an image can be measured by the horizontal or vertical tilt angle of the object in the image.

[0059] On the other hand, appearance attributes can characterize what kind of appearance characteristics, properties or features an object has in terms of color, brightness, clarity, and other aspects that describe what kind of appearance the object presents. The color of an object can be characterized by general terms that describe colors such as "red" or "gray", or can be characterized by RGB values. When RGB values ​​are used to characterize the color of an object, the RGB value of the object can be calculated, for example, by averaging the RGB values ​​of each pixel of the object. The brightness of an object refers to the brightness of the image area where the object is located. The clarity of an object can indicate whether the object is clear or blurred. Generally, clear objects have high clarity, while blurred objects have low clarity.

[0060] In some examples, the attributes of each object can be presented in the image in the form of a label (for clarity, Figure 3 (No such labels are shown in the image). In another example, the attributes of each image can be stored as a vector having a predetermined data structure. For example, the data elements in the vector can correspond to the following example data structure: {"category", "subcategory", "size", "spatial position", "image position", "heading angle", "horizontal / vertical tilt angle", "color", "brightness", "sharpness"}.

[0061] Based on the attributes of each object, a group of focused objects may be selected from the plurality of objects according to predetermined rules, which may include various types of rules.

[0062] In one aspect, the first rule can specify a correspondence between object attributes and object priorities. The first rule is applicable to scenarios where priority can be determined solely by attributes. For example, the correspondence between object attributes and object priorities can be maintained, for example, in a mapping table. Thus, when determining the attributes of an object, the priority of the object can be determined based on the correspondence between the object attributes and the object priorities.

[0063] In one example, the first rule may be set for a category attribute. In this case, the first rule may specify which priority the corresponding category attribute corresponds to. For example, the first rule may specify that "human objects" correspond to a high priority, "animal objects" correspond to a medium priority, and "inanimate objects" correspond to a low priority. Figure 3For example, the object detection information of an image may indicate that the category attribute of object 306 is "human object," while the category attribute of object 304 is "inanimate object." In this example, the object priority determined according to the first rule is: object 306 has a high priority, and object 304 has a low priority. In one example, the first rule may also specify which priority corresponds to corresponding subcategory attributes under the same category attribute. For example, for the human category attribute, the first rule may specify that objects with subcategories associated with human facial features have a high priority, while objects with subcategories associated with body parts other than the face have a low priority.

[0064] In another example, the first rule may be set for geometric attributes. In the case where the geometric attributes are associated with the size of the object, the first rule may specify a correspondence between the object size and the priority. For example, a size threshold may be set, and the first rule may specify that objects with a size greater than the set size threshold have a high priority, while objects with a size less than the set size threshold have a low priority. The first rule may similarly specify a correspondence between the position / orientation of the object and the priority.

[0065] In another example, the first rule can be set for an appearance attribute. In the case where the appearance attribute is associated with the color of an object, the first rule can specify a correspondence between the color of the object and the priority. For example, it can be specified that objects whose colors fall within a first range have a first priority, objects whose colors fall within a second range have a second priority, and so on. The first rule can similarly specify a correspondence between the brightness / clarity of an object and the priority.

[0066] In a second aspect, the second rule may specify a correspondence between comparison results of object attributes of multiple objects and object priorities. The second rule may be applicable to scenarios where it is necessary to compare the attributes of an object with the attributes of other objects to determine priorities.

[0067] In one example, the second rule can be set for a category attribute. The second rule can specify which categories of objects have a higher priority. For example, the second rule can specify that the human object category has a higher priority than the animal object category. In one example, the second rule can also specify which subcategories of objects have a higher priority under the same category attribute. For example, the second rule can specify that under the "human" category attribute, the priority of objects in the face subcategory is higher than the priority of objects in the torso subcategory, the priority of objects in the eye subcategory is higher than the priority of objects in the mouth subcategory, and so on.

[0068] In another example, the second rule may be set for geometric attributes. In the case where the geometric attributes are associated with the size of the object, the object priority may be determined based on the comparison of the object size. In one example, the second rule may specify that an object with a larger size has a higher priority, while an object with a smaller size has a lower priority. Figure 3 For example, since the size of object 312 is larger than that of object 306, the priority of object 312 can be determined to be higher than that of object 306 according to the second rule. In the case where the geometric attributes are associated with the positions of the objects, the object priority can be determined based on the comparison of the object positions. The second rule can specify, for example, that the priority of foreground objects is higher than that of background objects, or that the priority of objects in the middle of the image is higher than that of objects at the edge of the image, etc. For example, according to Figure 3 For example, the object detection information may indicate that when comparing object 306 and object 312, the position of object 306 in the image is closer to the middle of the image. Therefore, according to the second rule, it can be determined that the priority of object 306 is higher than the priority of object 312. In the case where the geometric attribute is associated with the orientation of the object, the object priority can be determined based on the comparison of the object orientation. For example, the second rule may specify that an object with a smaller offset angle relative to the front or a smaller horizontal / vertical tilt angle in the image has a higher priority. For example, according to Figure 3 For example, since the offset angle of object 308 relative to the front is smaller than the offset angle of object 314 relative to the front, according to the second rule, it can be determined that the priority of object 308 is higher than the priority of object 314.

[0069] For appearance attributes, in the case where the appearance attribute indicates the color of the object, the priority can be determined based on the comparison of the colors. The second rule can specify that an object with a more prominent color has a higher priority. For example, if one object is red and the other objects are gray, the second rule can determine that the red object has a higher priority than the other gray objects. In the case where the appearance attribute indicates the brightness of the object, the brightness of multiple objects can be compared, and the object priority can be determined based on the comparison result. The second rule can specify that an object with higher brightness has a higher priority. In the case where the appearance attribute indicates the clarity of the object, the clarity of multiple objects can be compared, and the object priority can be determined based on the comparison result. The second rule can specify that an object with higher clarity has a higher priority.

[0070] In a third aspect, the third rule may specify the priority of each of the multiple attributes. The third rule may be applicable to scenarios where multiple attributes are considered simultaneously. For example, the priority of the attributes specified by the third rule may be that the category attribute takes precedence over the geometric attribute, and the geometric attribute takes precedence over the appearance attribute. Therefore, according to the third rule, the object priority may be determined in the order of the category attribute, the geometric attribute, and the appearance attribute. For example, according to Figure 3 For example, it can be determined that the human objects 302, 306 and 314 have higher priorities based on the category attribute, then it can be determined that the large human objects 306 and 314 have higher priorities based on the size attribute, and finally it can be determined that the large human object 306 with higher brightness has the highest priority based on the appearance attribute.

[0071] In a fourth aspect, a fourth rule can specify a weight for each of the multiple attributes. This fourth rule can be applied to scenarios where multiple attributes are considered simultaneously. According to the fourth rule, different weight values ​​can be assigned to various attributes. In this way, attributes with higher weight values ​​can have a more significant impact when determining object priority.

[0072] In one example, one or more of the above four rules may be applied to determine the corresponding one or more object priorities.

[0073] Based on the determined object priorities, at least one group of focused objects can be selected from the plurality of objects detected in the image. In one example, one or more groups of focused objects can be selected for each object priority, thereby selecting at least one group of focused areas for one or more object priorities. In one example, at least one group of focused objects can be selected by pre-defining a different number of focused objects to be included in each group of focused objects. For example, a first group of focused objects can include one focused object, a second group of focused objects can include two focused objects, and so on.

[0074] In an example where a group of focused objects includes only one focused object, one object having the highest priority indicated by the determined object priority may be selected as the focused object. Figure 4 A schematic diagram 400 is shown in which a selected set of focus objects includes only one focus object according to an embodiment. Figure 4 As shown, the selected set of focus objects includes only one focus object 406. The focus object may correspond to Figure 3 Object 306 is shown.

[0075] In an example where a group of focused objects may include two or more focused objects, first two or more objects with higher priorities indicated by the determined object priorities may be selected as a group of focused objects. Figure 5Schematic diagram 500 showing a selected set of focus objects including two or more focus objects according to an embodiment. Figure 5 As shown, the selected set of focus objects includes two focus objects 506 and 512. The focus objects 506 and 512 may correspond to Figure 3 Objects 306 and 312 are shown.

[0076] For each group of focus objects, a focus area corresponding to the group of focus objects can be determined based on the occupied area of ​​the group of focus objects. Figure 1 As discussed, there are two example ways to calculate the focus area.

[0077] The first example method of calculating the focus area can use the geometric center of a group of focus objects to calculate the focus area. Figures 6 to 9 For the first example above, the following will be combined with Figures 6 and 7 For the case where a group of focused objects only includes one focused object, combined with Figures 8 and 9 The case where a group of focus objects includes two or more focus objects is discussed separately.

[0078] Figure 6 A schematic diagram 600 is shown for calculating the geometric center of a focused object according to an embodiment. Figure 6 For example, the selected set of focus objects includes only one focus object 606, wherein the focus object 606 may correspond to Figure 4 The focused object 406 is shown. Figure 6 In the example of FIG, the area defined by the rectangular bounding box surrounding the focused object 606 is the occupied area of ​​the focused object 606. The geometric center of the focused object 606 can be calculated based on the coordinates of the bounding box. For example, the position at 1 / 2 the length and 1 / 2 the width of the coordinates of the bounding box can be calculated and used as the geometric center 605 of the focused object 606.

[0079] Figure 7 Shown according to Figure 6 Schematic diagram 700 of calculating the geometric center to define the focus area. Figure 7 The focus object 706 and the geometric center 705 of the focus object 706 are shown. The focus object 706 may correspond to the above combination Figure 6 The focus object 606 discussed above and the geometric center 705 may correspond to the above combined Figure 6 The geometric center of discussion is 605.

[0080] As above combined Figure 1As discussed, in one example, a focus region can be a pixel region formed by a group of pixels in an image, for example, a rectangular region. The size of the focus region can be predefined, for example, M*N pixels. In this case, focus region 715 can be defined based on geometric center 705 and the predefined focus region size. For example, the left boundary of focus region 715 can be defined by subtracting M / 2 pixels from the horizontal coordinate of geometric center 705, and the right boundary of focus region 715 can be defined by adding M / 2 pixels to the horizontal coordinate of geometric center 705. The lower boundary of focus region 715 can be defined by subtracting N / 2 pixels from the vertical coordinate of geometric center 705, and the upper boundary of focus region 715 can be defined by adding N / 2 pixels to the vertical coordinate of geometric center 705.

[0081] As above combined Figure 1 As discussed, in one example, the focus area may also be a pixel in the image. In this case, the determined geometric center 705 may be directly defined as the focus area.

[0082] Figure 8 A schematic diagram 800 is shown for calculating geometric centers of multiple focused objects according to an embodiment.

[0083] according to Figure 8 For example, the selected set of focus objects includes two focus objects 806 and 812, wherein the focus object 806 may correspond to Figure 5 As shown in the focus object 506, the focus object 812 may correspond to Figure 5 The focus object 512 is shown. It can be combined with the above Figure 6 In a manner similar to that discussed above, the geometric center 805 of the focused object 806 and the geometric center 815 of the focused object 812 are calculated. Then, the geometric center of the group of focused objects can be calculated based on the calculated geometric center 805 of the focused object 806 and the calculated geometric center 815 of the focused object 812. In one example, the geometric center 825 of the group of focused objects can be calculated by performing a weighted average operation on the coordinates of the geometric center 805 of the focused object 806 and the geometric center 815 of the focused object 812.

[0084] In one example, a weighted averaging operation can be performed by assigning a corresponding weight value to each focused object in the group of focused objects based on the object priority. For example, based on the object priority, focused object 806 can be determined to have a first priority, and focused object 812 to have a second priority. The first priority and the second priority can then be mapped to corresponding priority values. A normalization operation can be performed on the priority values ​​to calculate the corresponding weight values ​​assigned to focused objects 806 and 812. By performing the normalization operation, the weight value of each focused object can be ensured to fall within a data interval, such as [0, 1], and the sum of the weight values ​​of the group of focused objects can be equal to 1. The geometric center of the group of focused objects can then be calculated based on the coordinates of the geometric center of each focused object and the weight value of the focused object. In this way, focused objects with higher priorities are assigned higher weight values, thereby having a greater influence on the calculation of the geometric center of the group of focused objects. This weighting method based on object priority facilitates more accurate determination of the focused area in the image, thereby helping to include representative portions of the image in the image container.

[0085] In another example, each focused object may be assigned an equal weight value, for example, equal to 1. In this case, the process of performing the weighted average can be simplified to a process of taking the arithmetic average of the coordinates of the geometric center of each focused object in the group of focused objects.

[0086] Figure 9 Shown according to Figure 8 Schematic diagram 900 of calculating the geometric center to define the focus area. Figure 9 The focus object 906, the focus object 912, and the calculated geometric center 925 of the group of focus objects are shown. The focus object 906 may correspond to the above combination of Figure 8 The focus object 806 and the focus object 912 discussed above may correspond to Figure 8 The focus object 812 discussed above and the geometric center 925 may correspond to the above combined Figure 8 The geometric center of discussion 825.

[0087] Can be combined with the above Figure 7 Similarly, the focus area is defined based on the geometric center 925. In the example where the focus area is a pixel area in the image, the focus area 935 can be defined based on the geometric center 925 and the predefined focus area size. In the example where the focus area is a pixel point in the image, the determined geometric center 925 can be directly defined as the focus area.

[0088] The second example method of calculating the focus area can directly use the occupied area of ​​a group of focus objects to calculate the focus area. Figures 10 to 12 For the second example above, the following will be combined with Figure 10 For the case where a group of focused objects only includes one focused object, combined with Figures 11 to 12 The case where a group of focus objects includes two or more focus objects is discussed separately.

[0089] Figure 10 FIG100 shows a schematic diagram 1000 of defining a focus area according to an occupied area of ​​a focus object according to an embodiment. Figure 10 In the example shown, the selected set of focus objects includes only one focus object 1008, wherein the focus object 1008 may correspond to Figure 3 The object 308 is shown. Figure 10 In the example shown in FIG1 , the area defined by the rectangular bounding box surrounding the focused object 1008 is the occupied area of ​​the focused object 1008. The boundaries of the occupied area of ​​the focused object 1008 may be expanded outward by a predetermined size to form the focused area 1005, so that the focused area 1005 can completely cover the occupied area of ​​the focused object 1008. For example, the left and right boundaries of the focused object 1008 may be expanded outward by P pixels in the horizontal direction, and the upper and lower boundaries of the focused object 1008 may be expanded outward by Q pixels in the vertical direction, to define the focused area 1005.

[0090] Figure 11 1100 shows a schematic diagram of defining a focus area according to the occupied areas of multiple focus objects according to an embodiment. Figure 11 In the example shown, the selected set of focus objects includes two focus objects 1108 and 1114, where the focus object 1108 may correspond to Figure 3 As shown in the object 308, the focus object 1114 may correspond to Figure 3 The outermost boundaries of the occupied areas of focused object 1108 and focused object 1114 can be expanded outward by a predetermined size to form focused area 1105, so that focused area 1105 can completely cover the occupied areas of focused object 1008 and focused object 1114. For example, the leftmost and rightmost boundaries of focused object 1108 and focused object 1114 can be expanded outward by P pixels in the horizontal direction, and the uppermost and lowermost boundaries of focused object 1108 and focused object 1114 can be expanded outward by Q pixels in the vertical direction, respectively, to define focused area 1105.

[0091] Figure 12 FIG1200 shows a schematic diagram of defining a focus area according to the occupied areas of multiple focus objects according to an embodiment. Figure 12As shown, the selected set of focus objects may include focus object 1202, focus object 1204, focus object 1206, focus object 1208, focus object 1210, and focus object 1212. Figure 11 In a similar manner to that discussed above, the outermost boundaries of the occupied areas of the multiple focused objects are expanded outward by a predetermined size to form the focused area 1205 , so that the focused area 1205 can completely cover the occupied area of ​​each focused object.

[0092] exist Figure 12 In the image shown, a group of focused objects are relatively dispersed in the image. For such an image, the application of Figures 10 to 12 The second example discussed, directly using the occupied area of ​​a group of focused objects to calculate the focused area may have a more advantageous technical effect. This is because by combining Figures 10 to 12 The focus area determined in the discussed manner may completely cover the occupied area of ​​each focused object, so that each focused object is retained in the determined focus area.

[0093] In one example, the user may be allowed to further adjust the focus area calculated by any of the two exemplary methods of calculating the focus area described above.

[0094] The above discussion discusses how to calculate focus regions corresponding to a group of focus objects. In one example, as discussed above, more than one group of focus objects may be selected in an image. In this example, the above operations may be performed separately for each group of focus objects to calculate multiple corresponding focus regions.

[0095] Figure 13 A schematic diagram 1300 shows multiple focus regions determined for an image according to an embodiment. Figure 13 A first focus region 1305 and a second focus region 1315 determined for an image are shown. In one example, the multiple focus regions may be determined based on different sets of focus objects. For example, the first focus region 1305 may be determined for a first set of focus objects, and the second focus region 1315 may be determined for a second set of focus objects, and the first set of focus objects may be different from the second set of focus objects. In another example, two or more of the multiple focus regions may be for the same set of focus objects. Since, as discussed above, focus regions can be calculated based on a set of focus objects in different ways, different focus regions may be determined for the same set of focus objects.

[0096] Figure 14 1400 shows a schematic diagram of corresponding preview views for multiple focus areas according to an embodiment. Figure 14 As shown, a first preview view 1402 for a first focus area 1404, a second preview view 1412 for a second focus area 1414, a third preview view 1422 for a third focus area 1424, etc. may be generated. The first focus area 1404 may correspond to the above combined Figure 10 Focus area 1005 of discussion or combined Figure 13 The focus area 1305 discussed above, the second focus area 1414 may correspond to Figure 13 The focus area 1315 discussed above and the third focus area 1424 may correspond to the above combined Figure 11 The focus area 1105 discussed above is provided. Providing preview views for different focus areas can intuitively present to the user which focus areas have been determined according to the focus area determination mechanism of the present disclosure. In one example, the user may prefer to use one or more focus areas among the determined multiple focus areas. In this example, the user can conveniently select the focus area of ​​the user's preference by selecting the corresponding preview view.

[0097] Figure 15 Schematic diagram 1500 of filling an image container according to a focus area according to an embodiment is shown. Figure 1 As discussed, the determined focus region can be used to guide how the image is filled into the image container so that a representative portion of the image is always present in the image container. The image can be aligned with the image container 1502 by placing the focus region at a predetermined location within the image container 1502. In one example, the focus region can be placed at the center of the image container 1502. If the focus region is a single pixel, the pixel can be aligned with the center of the image container 1502. If the focus region is a single pixel, the center of the pixel can be aligned with the center of the image container 1502. In another example, the focus region can be placed at a predetermined location other than the center within the image container 1502. For example, the focus region can be aligned with the top edge of the image container 1502, the bottom edge of the image container 1502, or any other alignment method, such as left alignment, right alignment, or left and top alignment, can be used. After the image is aligned with the image container 1502 in the above manner, the image portion 1504 containing the focus region can be cropped from the image and inserted into the image container 1502 based on the size of the image container 1502. The size of the image portion 1504 matches the size of the image container 1502. In one example, when the aspect ratio of the image portion 1504 is consistent with the aspect ratio of the image container 1502, the sizes of the two can be considered to match.

[0098] In some cases, when the difference between the image size and the image container size is significant, it may not be possible to crop the image portion that exactly matches the container size. This situation may occur, for example, when the image size is smaller than the image container size, or when the focused area size is larger than the image container size. Various exemplary approaches can be used to address these situations.

[0099] In one exemplary embodiment, filling an image container can be achieved by performing a color fill operation. A portion of the image corresponding to the focused area can be cropped from the image. This portion of the image can include the focused area and be smaller than, but closer to, the size of the image container. This portion of the image can then be inserted into the image container. Since the size of the portion of the image is smaller than the size of the image container, a blank area will exist within the image container. Figure 16 Schematic diagram 1600 is shown where an image container includes a blank area that is not partially covered by an inserted image. Figure 16 As shown, the image portion 1604 corresponding to the focus area is inserted into the image container 1602, and the image container includes a blank area not covered by the image portion 1604. It should be understood that Figure 16 The blank area shown is only an example, and the blank area may be located at one or more of the left side, right side, top, and bottom of the image container 1602 .

[0100] These blank areas can be filled with colors. In one example, the blank areas can be filled based on predefined colors, user-specified colors, etc. In one example, a machine learning model capable of performing color detection can be used to detect the image's subject color or dominant color, and the blank areas can be filled with the detected colors. In another example, the color of the image's edges can be detected, and the blank areas can be filled with a color gradient.

[0101] In another example, the image container can be filled by performing an image scaling operation. In one example, scaling the image may include performing an overall scaling of the image. Overall scaling may refer to enlarging or reducing the overall size of the image. In one example, scaling the image may include performing a local scaling of the image. Local scaling may refer to locally enlarging or reducing the focused area or the focused area and its surrounding portion within the image. After performing the above-described image scaling operation, a portion of the image that includes the focused area and matches the container size can be cropped from the scaled image to be used to fill the image container.

[0102] As above combined Figure 1As discussed above, the image container can be of varying sizes. In other words, the image container can have different sizes. For each of the multiple image containers of varying sizes, the image container can be filled with an image using the example filling method discussed above, based on the focus area. Multiple preview views can be generated corresponding to each of the multiple image containers, allowing the user to intuitively see how the image container will be filled.

[0103] Figure 17 Schematic diagram 1700 showing preview views generated for multiple container sizes based on a focus area according to an embodiment. Figure 17 As shown, multiple preview views can be generated by filling image containers of four example sizes with an image according to a focus area. The four example image container sizes have an aspect ratio of 4:3, an aspect ratio of 2:1, an aspect ratio of 1:1, and an aspect ratio of 1:2. Figure 17 The left side of FIG shows an enlarged preview view 1702 for an image container with an aspect ratio of 4:3. The enlarged preview view helps the user to view the details of the image filling. Figure 17 The right side of FIG shows thumbnail preview views 1704, 1706, 1708, and 1710 for each size of image container. The user can select any one of the thumbnails 1706, 1708, and 1710, and Figure 17 The enlarged preview view shown on the left side of the image can be switched accordingly to enable the user to conveniently view the details of image filling for different image container sizes.

[0104] When multiple focus areas are determined, preview views may be generated for multiple container sizes according to each focus area. Figure 18 Schematic diagram 1800 showing preview views generated for multiple container sizes based on multiple focus areas according to an embodiment. Figure 18 As shown, for the first focus area, a preview view 1802 corresponding to the first container size, a preview view 1804 corresponding to the second container size, a preview view 1806 corresponding to the third container size, etc. may be generated. For the second focus area, a preview view 1812 corresponding to the first container size, a preview view 1814 corresponding to the second container size, a preview view 1816 corresponding to the third container size, etc. may be generated. In the above example, the first container size may correspond to an aspect ratio of 4:3, the second container size may correspond to an aspect ratio of 2:1, and the third container size may correspond to an aspect ratio of 1:1.

[0105] Figure 19 A flow chart illustrating an exemplary method 1900 for determining a focus area in an image is shown, according to an embodiment.

[0106] At 1910, an image can be received.

[0107] At 1920 , object detection information for the image may be obtained, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image.

[0108] At 1930 , an object priority can be determined based on the attributes of each object in the plurality of objects.

[0109] At 1940 , at least one group of focused objects may be selected from the plurality of objects based on the object priorities.

[0110] At 1950 , for a group of focused objects in the at least one group of focused objects, a focus area corresponding to the group of focused objects may be calculated using occupied areas of the group of focused objects.

[0111] In one implementation, the attribute may include a category attribute, and the category attribute may include a human object category. In one example, the human object category may include one or more subcategories associated with human facial features. The attribute may include a geometric attribute, and the geometric attribute may be associated with at least one of the size, position, and orientation of the object. The attribute may include an appearance attribute, and the appearance attribute may be associated with at least one of the color, brightness, and clarity of the object.

[0112] In one implementation, determining the object priority may include determining the object priority according to a predetermined rule. The predetermined rule may specify at least one of the following: a correspondence between object attributes and object priorities; a correspondence between a comparison result between object attributes of multiple objects and object priorities; a priority order of each of the multiple attributes; and a weight of each of the multiple attributes.

[0113] In one implementation, calculating the focus area corresponding to the group of focused objects may include: calculating a geometric center of the group of focused objects using occupied areas of the group of focused objects; and defining the focus area based on the calculated geometric center. In another implementation, calculating the focus area corresponding to the group of focused objects may include: defining a portion of the image containing the occupied areas of the group of focused objects as the focus area using the occupied areas of the group of focused objects.

[0114] In one implementation, method 1900 may further include: for multiple groups of focused objects in the at least one group of focused objects, respectively calculating multiple focus areas corresponding to the multiple groups of focused objects. Method 1900 may further include generating multiple preview views corresponding to the multiple focus areas, respectively.

[0115] In one implementation, obtaining the object detection information may include receiving the object detection information from an object detection model, where the object detection model is used to perform an object detection task on the image.

[0116] In one implementation, method 1900 may further include: filling an image container with the image based on the focus area. In one implementation, filling the image container with the image may include: placing the focus area at a predetermined position in the image container, and inserting a portion of the image containing the focus area into the image container. In one implementation, filling the image container with the image may include: inserting a portion of the image corresponding to the focus area into the image container, and filling blank areas in the image container with a color. In one implementation, filling the image container with the image may include: scaling the image, and inserting a portion of the scaled image containing the focus area into the image container.

[0117] In one implementation, method 1900 may further include: filling each image container among a plurality of image containers having different sizes with the image according to the focus area; and generating a plurality of preview views corresponding to the plurality of image containers, respectively.

[0118] It should be understood that method 1900 may further include any steps / processes for determining a focus area in an image according to the above-mentioned embodiments of the present disclosure.

[0119] Figure 20 An exemplary apparatus 2000 for determining a focus area in an image is shown according to an embodiment.

[0120] The apparatus 2000 may include: an image receiving module 2010 for receiving an image; an object detection information obtaining module 2020 for obtaining object detection information from the image, the object detection information indicating an occupied area and attributes of each object among a plurality of objects detected in the image; an object priority determination module 2030 for determining an object priority based on the attributes of each object among the plurality of objects; a focused object selection module 2040 for selecting at least one group of focused objects from the plurality of objects based on the object priority; and a focused area calculation module 2050 for calculating, for a group of focused objects in the at least one group of focused objects, a focused area corresponding to the group of focused objects using the occupied areas of the group of focused objects.

[0121] In addition, the apparatus 2000 may further include any other modules configured to perform any operation of the method for determining a focus area in an image according to the above-mentioned embodiment of the present disclosure.

[0122] Figure 21 An exemplary apparatus 2100 for determining a focus area in an image is shown according to an embodiment.

[0123] The apparatus 2100 may include at least one processor 2110. The apparatus 2100 may also include a memory 2120 connected to the at least one processor 2110. The memory 2120 may store computer-executable instructions that, when executed, cause the at least one processor 2110 to: receive an image; obtain object detection information for the image, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image; determine an object priority based on the attributes of each of the plurality of objects; select at least one group of focused objects from the plurality of objects based on the object priority; and, for a group of focused objects in the at least one group of focused objects, calculate a focused area corresponding to the group of focused objects using the occupied areas of the group of focused objects. Furthermore, the at least one processor 2110 may also be configured to perform any other operations of the method for determining a focused area in an image according to the aforementioned embodiments of the present disclosure.

[0124] Embodiments of the present disclosure may be implemented in a non-transitory computer-readable medium. The non-transitory computer-readable medium may include instructions that, when executed, may cause at least one processor to: receive an image; obtain object detection information for the image, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image; determine an object priority based on the attributes of each of the plurality of objects; select at least one group of focused objects from the plurality of objects based on the object priority; and, for a group of focused objects in the at least one group of focused objects, calculate a focused area corresponding to the group of focused objects using the occupied areas of the group of focused objects. Furthermore, when executed, the instructions may cause at least one processor to perform any steps / processes of the method for determining a focused area in an image according to the above-described embodiments of the present disclosure.

[0125] Embodiments of the present disclosure provide a computer program product comprising a computer program that can be executed by a processor to: receive an image; obtain object detection information from the image, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image; determine an object priority based on the attributes of each of the plurality of objects; select at least one group of focused objects from the plurality of objects based on the object priority; and, for a group of focused objects in the at least one group of focused objects, calculate a focused area corresponding to the group of focused objects using the occupied areas of the group of focused objects. Furthermore, the computer program can be executed by the processor to perform any steps / processes of the method for determining a focused area in an image according to the above-described embodiments of the present disclosure.

[0126] It should be understood that all operations in the method described above are merely exemplary, and the present disclosure is not limited to any operations in the method or the order of these operations, but should cover all other equivalent transformations under the same or similar concept.

[0127] In addition, the articles "a" and "an" as used in this specification and the appended claims should generally be construed to mean "one" or "one or more" unless specified otherwise or clear from context to be directed to a singular form.

[0128] It should also be understood that all modules in the above-described device can be implemented in various ways. These modules can be implemented as hardware, software, or a combination thereof. In addition, any module in these modules can be further divided into submodules or combined together functionally.

[0129] Processors have been described in conjunction with various devices and methods. These processors can be implemented using electronic hardware, computer software or any combination thereof. Whether these processors are implemented as hardware or software will depend on specific application and the overall design constraints imposed on the system. As an example, the processor provided in this disclosure, any part of the processor or any combination of processors can be implemented as a microprocessor, microcontroller, digital signal processor (DSP), field programmable gate array (FPGA), programmable logic device (PLD), state machine, gate logic, discrete hardware circuit and other suitable processing components configured for performing the various functions described in this disclosure. The function of the processor provided in this disclosure, any part of the processor or any combination of processors can be implemented as software performed by a microprocessor, microcontroller, DSP or other suitable platforms.

[0130] Software should be broadly considered to mean instructions, instruction sets, codes, code segments, program codes, programs, subroutines, software modules, applications, software applications, software packages, routines, subroutines, objects, running threads, processes, functions, etc. Software can reside in a computer-readable medium. A computer-readable medium can include, for example, a memory, which can be, for example, a magnetic storage device (e.g., a hard disk, a floppy disk, a magnetic stripe), an optical disk, a smart card, a flash memory device, a random access memory (RAM), a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), a register, or a removable disk. Although the memory is shown as being separate from the processor in various aspects provided in the present disclosure, the memory can also be located inside the processor (e.g., a cache or register).

[0131] The above description is provided to enable any person skilled in the art to implement the various aspects described herein. Various modifications to these aspects will be apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects. Therefore, the claims are not intended to be limited to the aspects shown herein. All structural and functional equivalents of the elements of the various aspects described in this disclosure that are known or soon to become known to those skilled in the art are intended to be covered by the claims.

Claims

1. A method for determining a focus area in an image, comprising: receiving an image; obtaining object detection information for the image, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image; determining an object priority based on an attribute of each of the plurality of objects; selecting at least one group of focused objects from the plurality of objects according to the object priorities; as well as For a group of focused objects in the at least one group of focused objects, a focus area corresponding to the group of focused objects is calculated using occupied areas of the group of focused objects.

2. The method according to claim 1, wherein The attributes include category attributes, and The category attribute includes a human object category.

3. The method according to claim 2, wherein: The human object category includes one or more subcategories associated with human facial features.

4. The method according to claim 1, wherein The attributes include geometric attributes, and The geometric attribute is associated with at least one of a size, a position, and an orientation of the object.

5. The method according to claim 1, wherein The attributes include appearance attributes, and The appearance attribute is associated with at least one of color, brightness, and clarity of the object.

6. The method according to claim 1, wherein Determining the object priority includes: The object priority is determined according to a predetermined rule.

7. The method according to claim 6, wherein: The predetermined rule specifies at least one of the following: The correspondence between object attributes and object priorities; The correspondence between the comparison results of the object attributes of multiple objects and the object priorities; the order of precedence for each of the multiple attributes; as well as The weight of each of the multiple attributes.

8. The method according to claim 1, wherein The calculating the focus areas corresponding to the set of focus objects comprises: calculating the geometric centers of the set of focused objects using the occupied areas of the set of focused objects; and The focus area is defined according to the calculated geometric center.

9. The method according to claim 1, wherein The calculating the focus areas corresponding to the set of focus objects comprises: Using the occupied areas of the group of focused objects, a portion of the image including the occupied areas of the group of focused objects is defined as the focused area.

10. The method according to claim 1, further comprising: For multiple groups of focus objects in the at least one group of focus objects, multiple focus areas corresponding to the multiple groups of focus objects are calculated respectively.

11. The method according to claim 10, further comprising: A plurality of preview views corresponding to the plurality of focus areas are generated.

12. The method according to claim 1, wherein The obtaining of object detection information includes: The object detection information is received from an object detection model, where the object detection model is configured to perform an object detection task on the image.

13. The method according to claim 1, further comprising: An image container is filled with the image according to the focus area.

14. The method according to claim 13, wherein Filling the image container with the image includes: placing the focus area at a predetermined position in the image container; and A portion of the image including the focus area is inserted into the image container.

15. The method according to claim 13, wherein Filling the image container with the image includes: A portion of the image corresponding to the focus area is inserted into the image container, and a blank area in the image container is filled with color.

16. The method according to claim 13, wherein Filling the image container with the image includes: The image is scaled, and a portion of the scaled image including the focus area is inserted into the image container.

17. The method according to claim 1, further comprising: For each image container of a plurality of image containers having different sizes, filling the image container with the image according to the focus area; as well as A plurality of preview views corresponding to the plurality of image containers are generated.

18. An apparatus for determining a focus area in an image, comprising: at least one processor; as well as a memory storing computer-executable instructions that, when executed, cause the at least one processor to: receiving an image; obtaining object detection information for the image, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image; determining an object priority based on an attribute of each of the plurality of objects; selecting at least one group of focused objects from the plurality of objects according to the object priorities; as well as For a group of focused objects in the at least one group of focused objects, a focus area corresponding to the group of focused objects is calculated using occupied areas of the group of focused objects.

19. A non-transitory computer-readable medium comprising instructions that, when executed, cause at least one processor to: receiving an image; obtaining object detection information for the image, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image; determining an object priority based on an attribute of each of the plurality of objects; selecting at least one group of focused objects from the plurality of objects according to the object priorities; as well as For a group of focused objects in the at least one group of focused objects, a focus area corresponding to the group of focused objects is calculated using occupied areas of the group of focused objects.

20. A computer program product comprising instructions which, when executed, cause at least one processor to: receiving an image; obtaining object detection information for the image, the object detection information indicating an occupied area and attributes of each of a plurality of objects detected in the image; determining an object priority based on an attribute of each of the plurality of objects; selecting at least one group of focused objects from the plurality of objects according to the object priorities; as well as For a group of focused objects in the at least one group of focused objects, a focus area corresponding to the group of focused objects is calculated using occupied areas of the group of focused objects.