Image cutting method, electronic equipment and computer readable storage medium
By determining the aesthetic appeal of the target object in electronic devices and employing limb-first or face-first cropping methods, the problem of image cropping failing to highlight aesthetics in existing technologies is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202410767538.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-06-13
AI Technical Summary
In existing technologies, automatic image cropping methods for electronic devices cannot effectively highlight the aesthetic appeal of images, resulting in a poor user experience.
By obtaining the aesthetic appeal of the target object's limbs and/or face, the target cropping method is determined, prioritizing or highlighting limb or facial features for image cropping.
It improves the aesthetics of cropped images and enhances the user experience.
Smart Images

Figure CN118674733A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of terminal technology, and in particular relates to an image cropping method, an electronic device, and a computer-readable storage medium. Background Art
[0002] Electronic devices such as mobile phones and tablets generally have the function of automatically cropping images, that is, they can automatically crop images according to the default cropping method. For example, when setting a screen saver or lock screen image, the user can upload a personalized image. After the electronic device obtains the personalized image, it can automatically crop the personalized image into a cropped image of a specified size according to the default cropping method, and apply the cropped image to the screen saver or lock screen, etc. This cropping of all images according to the default cropping method will result in the cropped image failing to highlight the beauty of the image itself, resulting in a poor user experience. Summary of the invention
[0003] The embodiments of the present application provide an image cropping method, an electronic device, and a computer-readable storage medium, which can improve the aesthetics of the cropped image and enhance the user experience.
[0004] In a first aspect, an embodiment of the present application provides an image cropping method, which may include:
[0005] Acquire an original image, wherein the original image includes a target object;
[0006] Determining the limb beauty of the target object, and / or determining the facial beauty of the target object;
[0007] Determining a target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty;
[0008] The original image is cropped according to the target cropping method to obtain a cropped image, where the cropped image includes all or part of the target object.
[0009] In the image cropping method provided above, after acquiring the original image including the target object, the electronic device can determine the limb beauty and / or facial beauty of the target object. Subsequently, the electronic device can determine a target cropping method that can highlight the posture beauty and / or facial beauty of the target object according to the limb beauty and / or facial beauty of the target object, and can crop the original image according to the target cropping method to obtain a cropped image, so that the cropped image can retain the posture beauty and / or facial beauty of the original image itself, which can improve the beauty of the cropped image and enhance the user experience.
[0010] The target cropping mode may be a limb-prioritized cropping mode or a face-prioritized cropping mode. The limb-prioritized cropping mode may refer to the limbs being given priority when cropping an image, that is, the preservation of the integrity of the limbs being given priority. The face-prioritized cropping mode may refer to the face being given priority when cropping an image, that is, the highlighting of facial features being given priority.
[0011] That is, when the target cropping mode is determined to be a limb-prioritized cropping mode, when cropping the original image according to the target cropping mode, the electronic device may give priority to retaining the integrity of the limbs, for example, the original image may be cropped into a full-body image. When the target cropping mode is determined to be a face-prioritized cropping mode, when cropping the original image according to the target cropping mode, the electronic device may give priority to highlighting facial features, for example, the original image may be cropped into a half-body image with prominent facial features.
[0012] In some embodiments, determining the limb aesthetics of the target object may include:
[0013] Determining the limb dynamics of the target object, where the limb dynamics is used to characterize the motion state of the target object;
[0014] The limb aesthetics of the target object is determined according to the limb dynamics.
[0015] It should be noted that people generally believe that the beauty of limbs when in motion is higher than that when at rest.
[0016] In the image cropping method provided in this embodiment, when it is determined that the target object's limb dynamics is high, for example, when it is determined that the target object's movement speed is fast, the electronic device can determine that the target object's limb aesthetics is high, that is, the target cropping method corresponding to the original image can be determined as a limb-prioritized cropping method. When it is determined that the target object's limb dynamics is low, for example, when it is determined that the target object's movement speed is low (for example, in a stationary state), the electronic device can determine that the target object's limb aesthetics is low, that is, the target cropping method corresponding to the original image can be determined as a face-prioritized cropping method. When it is determined that the target object's limb dynamics is moderate, the electronic device can determine that the target object's limb aesthetics is moderate, that is, the target cropping method corresponding to the original image can be determined as a default cropping method.
[0017] It should be understood that the higher limb beauty and high limb beauty in the embodiments of the present application can be the same concept, and the lower limb beauty and low limb beauty can be the same concept. Among them, the default cropping method can be specifically determined according to the actual scene. For example, the default cropping method can be determined according to the actual scene as a face-priority cropping method. For example, the default cropping method can be determined according to the actual scene as the face center of the target object is located at the upper 1 / 3 of the cropped image, that is, the cropped image can be divided into three equal parts from top to bottom, and the face center of the target object can be located at the top 1 / 3.
[0018] In one example, determining the limb dynamics of the target object may include:
[0019] Acquire a first angle corresponding to the target object, where the first angle is an angle between a line between the top of the head and the midpoint of the pelvis of the target object and a vertical direction;
[0020] The limb dynamics of the target object is determined according to the first angle.
[0021] In the image cropping method provided in this example, the electronic device can determine the limb dynamics of the target object based on the first angle (i.e., angle a) between the line between the top of the target object's head and the midpoint of the pelvis and the vertical direction, for example, angle a can be determined as the limb dynamics of the target object. When the target object is in motion, angle a is generally larger, and the faster the motion speed, the larger the angle a will be. When the target object is stationary, angle a is generally smaller.
[0022] In a possible implementation, determining the limb aesthetics of the target object according to the limb dynamics may include:
[0023] When the limb dynamics is greater than or equal to a first threshold, determining that the limb aesthetics of the target object meets a first condition;
[0024] When the limb dynamics is less than a second threshold, it is determined that the limb aesthetics of the target object meets a second condition, and the first threshold is greater than or equal to the second threshold.
[0025] It should be understood that the first condition may refer to a high degree of limb aesthetics, and the second condition may refer to a low degree of limb aesthetics.
[0026] In the image cropping method provided by the implementation, when the target object is in motion, the angle a will be greater than or equal to the first threshold value (i.e., threshold value A1). When the target object is in a stationary state, the angle a will be less than the second threshold value (i.e., threshold value A2). Wherein, threshold value A1 and threshold value A2 can be specific values or can be a numerical range. Threshold value A1 and threshold value A2 can be the same or different, and threshold value A1 is greater than or equal to threshold value A2. That is, when it is determined that the limb dynamics is greater than or equal to the first threshold value (i.e., threshold value A1), the electronic device can determine that the limb aesthetics of the target object is high. When it is determined that the limb dynamics is less than the second threshold value (i.e., threshold value A2), the electronic device can determine that the limb aesthetics of the target object is low. When it is determined that the limb dynamics is greater than or equal to the second threshold value and less than the first threshold value, the electronic device can determine that the limb aesthetics of the target object is moderate.
[0027] In another possible implementation, determining the limb aesthetics of the target object according to the limb dynamics may include:
[0028] Determine the limb stretch of the target object, where the limb stretch is used to characterize the stretch degree of the limb of the target object;
[0029] The limb aesthetics of the target object is determined according to the limb dynamics and the limb stretch.
[0030] In the image cropping method provided by this implementation, the electronic device can determine the target object's limb aesthetics based on the target object's limb dynamics and limb stretch. The target object's limb aesthetics can be determined by comprehensively considering the target object's limb dynamics and limb stretch, which can improve the accuracy of determining the limb aesthetics, thereby improving the accuracy of determining the target cropping method and improving the aesthetic feeling of the cropped image.
[0031] In one example, determining the limb aesthetics of the target object according to the limb dynamics and the limb stretch may include:
[0032] When the limb dynamics is greater than or equal to a first threshold, and the limb stretch is greater than or equal to a third threshold, it is determined that the limb aesthetics of the target object meets a first condition;
[0033] When the limb dynamics is less than the second threshold, and the limb stretch is less than the fourth threshold, it is determined that the limb aesthetics of the target object meets the second condition;
[0034] The first threshold is greater than or equal to the second threshold, and the third threshold is greater than or equal to the fourth threshold.
[0035] It should be noted that the third threshold value may be threshold value B1, or may be threshold value C1. The fourth threshold value may be threshold value B2, or may be threshold value C2. Among them, threshold value B1 and threshold value B2, as well as threshold value C1 and threshold value C2 may be specific values, or may be value ranges. Threshold value B1 and threshold value B2 may be the same or different, and threshold value B1 is greater than or equal to threshold value B2. Threshold value C1 and threshold value C2 may be the same or different, and threshold value C1 is greater than or equal to threshold value C2.
[0036] In the image cropping method provided in this example, when it is determined that the limb dynamics is greater than or equal to the first threshold (i.e., threshold A1), and the limb stretch is greater than or equal to the third threshold (i.e., threshold B1 or threshold C1), the electronic device can determine that the limb aesthetics of the target object is high. When it is determined that the limb dynamics is less than the second threshold (i.e., threshold A2), and the limb stretch is less than the fourth threshold (i.e., threshold B2 or threshold C2), the electronic device can determine that the limb aesthetics of the target object is low. Otherwise, the electronic device can determine that the limb aesthetics of the target object is moderate.
[0037] In another possible implementation, determining the limb aesthetics of the target object according to the limb dynamics may include:
[0038] Determining a limb torsion degree of the target object, wherein the limb torsion degree is used to characterize a degree of torsion of the limb of the target object;
[0039] The limb aesthetics of the target object is determined according to the limb dynamics and the limb twisting degree.
[0040] In the image cropping method provided by this implementation, the electronic device can determine the target object's limb aesthetics based on the target object's limb dynamics and limb torsion. The target object's limb aesthetics can be determined by comprehensively considering the target object's limb dynamics and limb torsion, which can improve the accuracy of determining the limb aesthetics, thereby improving the accuracy of determining the target cropping method and improving the beauty of the cropped image.
[0041] In one example, determining the limb aesthetics of the target object according to the limb dynamics and the limb torsion may include:
[0042] When the limb dynamics is greater than or equal to a first threshold, and the limb twisting is greater than or equal to a fifth threshold, it is determined that the limb aesthetics of the target object meets a first condition;
[0043] When the limb dynamics is less than the second threshold, and the limb twisting is less than the sixth threshold, it is determined that the limb aesthetics of the target object meets the second condition;
[0044] Among them, the first threshold is greater than or equal to the second threshold, and the fifth threshold is greater than or equal to the sixth threshold.
[0045] It should be noted that the fifth threshold value may be threshold value D1. The sixth threshold value may be threshold value D2. Threshold value D1 and threshold value D2 may be specific values or value ranges. Threshold value D1 and threshold value D2 may be the same or different, and threshold value D1 is greater than or equal to threshold value D2.
[0046] In the image cropping method provided in this example, when it is determined that the limb dynamics is greater than or equal to the first threshold (i.e., threshold A1), and the limb torsion is greater than or equal to the fifth threshold (i.e., threshold D1), the electronic device can determine that the limb aesthetics of the target object is high. When it is determined that the limb dynamics is less than the second threshold (i.e., threshold A2), and the limb torsion is less than the sixth threshold (i.e., threshold D2), the electronic device can determine that the limb aesthetics of the target object is low. Otherwise, the electronic device can determine that the limb aesthetics of the target object is moderate.
[0047] In another possible implementation, determining the limb aesthetics of the target object according to the limb dynamics may include:
[0048] The limb extension and limb twist of the target object are determined, and the limb aesthetics of the target object is determined according to the limb dynamics, the limb extension and the limb twist.
[0049] In the image cropping method provided by this implementation, the electronic device can determine the target object's limb aesthetics based on the target object's limb dynamics, limb stretch and limb torsion. The target object's limb aesthetics can be determined by comprehensively considering the target object's limb dynamics, limb stretch and limb torsion. The accuracy of determining the limb aesthetics can be improved, thereby improving the accuracy of determining the target cropping method and improving the beauty of the cropped image.
[0050] In some other embodiments, determining the limb aesthetics of the target object may include:
[0051] Determining the limb extension of the target object;
[0052] The limb aesthetics of the target object is determined according to the limb stretch.
[0053] It should be noted that when the limb stretch is high, that is, the stretch degree of the limb is high, the limb beauty is generally considered to be high. When the limb stretch is low, that is, the stretch degree of the limb is low, the limb beauty is generally considered to be poor. In other words, the beauty of a limb with a high stretch degree is generally higher than that of a limb with a low stretch degree.
[0054] In the image cropping method provided in this embodiment, when it is determined that the target object's limb stretch is high, the electronic device can determine that the target object's limb beauty is high, that is, the target cropping method corresponding to the original image can be determined as a limb-prioritized cropping method. When it is determined that the target object's limb stretch is low, the electronic device can determine that the target object's limb beauty is low, that is, the target cropping method corresponding to the original image can be determined as a face-prioritized cropping method. When it is determined that the target object's limb stretch is moderate, the electronic device can determine that the target object's limb beauty is moderate, that is, the target cropping method corresponding to the original image can be determined as a default cropping method.
[0055] In one example, determining the limb extension of the target object may include:
[0056] Determine a first width and a second width, wherein the first width is a width of a first symmetrical joint point of the target object, and the second width is a width of a second symmetrical joint point of the target object;
[0057] The limb extension degree of the target object is determined according to the first width and the second width.
[0058] Exemplarily, the first symmetrical joint points may include a group of joint points corresponding to the shoulders and / or a group of joint points corresponding to the pelvis, and the second symmetrical joint points may include at least one of a group of joint points corresponding to the wrists, a group of joint points corresponding to the knees, and a group of joint points corresponding to the ankles.
[0059] In the image cropping method provided in this example, the electronic device can determine the limb stretch of the target object according to the width of each set of symmetrical joint points in at least two sets of symmetrical joint points. When the limb stretch of the target object is higher, the difference between the widths of at least two sets of symmetrical joint points of the target object (i.e., the width difference) will be greater; when the limb stretch of the target object is lower, the width difference of the target object will be smaller.
[0060] It should be understood that each group of symmetrical joint points may refer to laterally symmetrical joint points. That is, each group of symmetrical joint points may include two joint points, and these two joint points are laterally symmetrical joint points. The width of each group of symmetrical joint points may refer to the length of the line between the two joint points included in the group of symmetrical joint points.
[0061] In another example, determining the limb extension of the target object may include:
[0062] Determine a first horizontal coordinate and a second horizontal coordinate, wherein the first horizontal coordinate is the horizontal coordinate of a first target joint point of the target object, and the second horizontal coordinate is the horizontal coordinate of a second target joint point of the target object, and the first target joint point and the second target joint point are joint points on the same side of the target object;
[0063] The limb extension degree of the target object is determined according to the first horizontal coordinate and the second horizontal coordinate.
[0064] Exemplarily, the first target joint point may include a joint point corresponding to the shoulder and / or a joint point corresponding to the pelvis, and the second target joint point may include at least one of a joint point corresponding to the wrist, a joint point corresponding to the knee, and a joint point corresponding to the ankle.
[0065] In the image cropping method provided in this example, the electronic device can determine the limb stretch of the target object based on the horizontal coordinates of at least two joint points on one side. For example, when it is determined that the number of groups of symmetrical joint points of the target object is less than two groups, the electronic device can determine the limb stretch of the target object based on the horizontal coordinates of at least two joint points on one side. Among them, when the limb stretch of the target object is higher, the difference between the horizontal coordinates of at least two joint points on one side of the target object (i.e., the horizontal coordinate difference) will be greater; when the limb stretch of the target object is lower, the horizontal coordinate difference on one side of the target object will be smaller.
[0066] In a possible implementation, determining the limb aesthetics of the target object according to the limb stretch may include:
[0067] When the limb stretch is greater than or equal to a third threshold, it is determined that the limb aesthetics of the target object meets a first condition;
[0068] When the limb stretch is less than a fourth threshold, it is determined that the limb aesthetics of the target object meets a second condition, and the third threshold is greater than or equal to the fourth threshold.
[0069] In the image cropping method provided by the implementation, when it is determined that the limb stretch is greater than or equal to the third threshold (i.e., threshold B1 or threshold C1), the electronic device can determine that the limb aesthetics of the target object is high. When it is determined that the limb stretch is less than the fourth threshold (i.e., threshold B2 or threshold C2), the electronic device can determine that the limb aesthetics of the target object is low. When it is determined that the limb dynamics is greater than or equal to the fourth threshold and less than the third threshold, the electronic device can determine that the limb aesthetics of the target object is moderate.
[0070] In another possible implementation, determining the limb aesthetics of the target object according to the limb stretch may include:
[0071] The limb torsion degree of the target object is determined, and the limb aesthetics of the target object is determined according to the limb stretch degree and the limb torsion degree.
[0072] In the image cropping method provided by this implementation, the electronic device can determine the target object's limb aesthetics based on the target object's limb stretch and limb torsion. The target object's limb aesthetics can be determined by comprehensively considering the target object's limb stretch and limb torsion, which can improve the accuracy of determining the limb aesthetics, thereby improving the accuracy of determining the target cropping method and improving the beauty of the cropped image.
[0073] In one example, determining the limb aesthetics of the target object according to the limb extension and the limb twist may include:
[0074] When the limb extension is greater than or equal to the third threshold, and the limb twisting is greater than or equal to the fifth threshold, it is determined that the limb aesthetics of the target object meets the first condition;
[0075] When the limb extension is less than the fourth threshold, and the limb twisting is less than the sixth threshold, it is determined that the limb aesthetics of the target object meets the second condition;
[0076] Among them, the third threshold is greater than or equal to the fourth threshold, and the fifth threshold is greater than or equal to the sixth threshold.
[0077] In the image cropping method provided in this example, when it is determined that the limb stretch is greater than or equal to the third threshold (i.e., threshold B1 or threshold C1), and the limb twist is greater than or equal to the fifth threshold (i.e., threshold D1), the electronic device can determine that the limb aesthetics of the target object is high. When it is determined that the limb stretch is less than the fourth threshold (i.e., threshold B2 or threshold C2), and the limb twist is less than the sixth threshold (i.e., threshold D2), the electronic device can determine that the limb aesthetics of the target object is low. Otherwise, the electronic device can determine that the limb aesthetics of the target object is moderate.
[0078] In some other embodiments, determining the limb aesthetics of the target object may include:
[0079] determining a degree of limb twisting of the target subject;
[0080] The limb aesthetics of the target object is determined according to the limb twisting degree.
[0081] It should be noted that when the degree of limb twisting is high, that is, the degree of twisting of the limb is high, the limb is generally considered to have high aesthetics. When the degree of limb twisting is low, that is, the degree of twisting of the limb is low, the limb is generally considered to have poor aesthetics. In other words, the aesthetics of a limb with a high degree of twisting is generally higher than that of a limb with a low degree of twisting.
[0082] In the image cropping method provided in this embodiment, when it is determined that the target object's limb torsion is high, the electronic device can determine that the target object's limb aesthetics is high, that is, the target cropping method corresponding to the original image can be determined as a limb-prioritized cropping method. When it is determined that the target object's limb torsion is low, the electronic device can determine that the target object's limb aesthetics is low, that is, the target cropping method corresponding to the original image can be determined as a face-prioritized cropping method. When it is determined that the target object's limb torsion is moderate, the electronic device can determine that the target object's limb aesthetics is moderate, that is, the target cropping method corresponding to the original image can be determined as a default cropping method.
[0083] In one example, determining the limb torsion degree of the target object may include:
[0084] Acquire a second angle corresponding to the target object, where the second angle is an angle between a first line and a second line, where the first line is a line corresponding to a third symmetric joint point of the target object, and the second line is a line corresponding to a fourth symmetric joint point of the target object;
[0085] The limb twisting degree of the target object is determined according to the second angle.
[0086] Exemplarily, the third symmetrical joint points may include a group of joint points corresponding to shoulders, and the fourth symmetrical joint points may include a group of joint points corresponding to pelvis.
[0087] In the image cropping method provided in this example, the electronic device can determine the limb torsion of the target object based on the second angle (i.e., angle b) between the connecting line of a set of joint points corresponding to the shoulder and the connecting line of a set of joint points corresponding to the pelvis. For example, angle b can be determined as the limb torsion of the target object. When the limb torsion of the target object is large, angle b is generally large. When the limb torsion of the target object is small, angle b is generally small.
[0088] In a possible implementation, determining the limb aesthetics of the target object according to the limb twisting degree may include:
[0089] When the limb twisting degree is greater than or equal to a fifth threshold, determining that the limb aesthetics of the target object meets a first condition;
[0090] When the limb twisting degree is less than the sixth threshold, it is determined that the limb aesthetics of the target object meets the second condition, and the fifth threshold is greater than or equal to the sixth threshold.
[0091] In the image cropping method provided by the implementation, when it is determined that the limb torsion is greater than or equal to the fifth threshold (i.e., threshold D1), the electronic device can determine that the limb aesthetics of the target object is high. When it is determined that the limb torsion is less than the sixth threshold (i.e., threshold D2), the electronic device can determine that the limb aesthetics of the target object is low. When it is determined that the limb torsion is greater than or equal to the sixth threshold and less than the fifth threshold, the electronic device can determine that the limb aesthetics of the target object is moderate.
[0092] In some embodiments, determining the facial beauty of the target object may include:
[0093] The facial arousal degree and the facial pleasure degree of the target object are determined, and the facial beauty degree of the target object is determined according to the facial arousal degree and the facial pleasure degree.
[0094] It should be understood that facial beauty may include expression beauty. Expression arousal may be used to measure the degree (or intensity) of an emotion. Expression pleasure may be used to measure the positivity of an emotion. That is, the electronic device may determine the expression arousal and expression pleasure of the target object based on the original image, and determine the expression beauty of the target object based on the expression arousal and expression pleasure, thereby determining the facial beauty of the target object.
[0095] In a possible implementation, determining the facial beauty of the target object according to the expression arousal degree and the expression pleasure degree may include:
[0096] When the expression arousal degree is greater than or equal to the seventh threshold, or the expression pleasure degree is greater than or equal to the eighth threshold, it is determined that the facial beauty satisfies the third condition;
[0097] When the expression arousal degree is less than the seventh threshold, and the expression pleasure degree is less than the eighth threshold, it is determined that the facial beauty satisfies the fourth condition.
[0098] It should be understood that the third condition may refer to high facial aesthetics, and the fourth condition may refer to low facial aesthetics.
[0099] In the image cropping method provided by the implementation, when it is determined that the absolute value of the expression arousal is less than the seventh threshold value (i.e., threshold value E), and the absolute value of the expression pleasure is less than the eighth threshold value (i.e., threshold value F), the electronic device can determine that the facial beauty of the target object is low, that is, it can be determined that the facial expression of the target object is dull. When it is determined that the absolute value of the expression arousal is greater than or equal to threshold value E, or the absolute value of the expression pleasure is greater than or equal to threshold value F, the electronic device can determine that the facial beauty of the target object is high, that is, it can be determined that the facial expression of the target object has tension.
[0100] In some embodiments, determining the target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty may include:
[0101] When the limb aesthetics meets the first condition, determining the target cutting method to be the first cutting method, the first cutting method is a cutting method that prioritizes limbs;
[0102] When the limb beauty meets the second condition, the target cropping method is determined to be the second cropping method, and the second cropping method is a face-first cropping method.
[0103] In the image cropping method provided in this embodiment, the electronic device can determine the target cropping method corresponding to the original image according to the limb beauty. When the limb beauty meets the first condition, that is, the limb beauty is high, the electronic device can determine the target cropping method as a limb-priority cropping method. When the limb beauty meets the second condition, that is, the limb beauty is low, the electronic device can determine the target cropping method as a face-priority cropping method. When the limb beauty does not meet the first condition and does not meet the second condition, that is, the limb beauty is moderate, the electronic device can determine the target cropping method as the default cropping method.
[0104] In some other embodiments, determining the target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty may include:
[0105] When the facial beauty meets the third condition, determining the target cropping method to be the second cropping method, where the second cropping method is a face-priority cropping method;
[0106] When the facial aesthetics meets the fourth condition, the target cropping method is determined to be the first cropping method, and the first cropping method is a limb-prioritized cropping method.
[0107] In the image cropping method provided in this embodiment, the electronic device can determine the target cropping method corresponding to the original image according to the facial beauty. When the facial beauty meets the third condition, that is, the facial beauty is high, the electronic device can determine the target cropping method as a face-priority cropping method. When the facial beauty meets the fourth condition, that is, the facial beauty is low, the electronic device can determine the target cropping method as a limb-priority cropping method. When the facial beauty does not meet the third condition and does not meet the fourth condition, that is, the facial beauty is moderate, the electronic device can determine the target cropping method as the default cropping method.
[0108] In some other embodiments, determining the target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty may include:
[0109] When the limb beauty meets the first condition and the facial beauty meets the fourth condition, determining the target cropping method to be the first cropping method, the first cropping method is a limb-prioritized cropping method;
[0110] When the limb beauty meets the first condition and the facial beauty meets the third condition, or when the limb beauty meets the second condition, the target cropping method is determined to be the second cropping method, and the second cropping method is a face-priority cropping method.
[0111] In the image cropping method provided in this embodiment, the electronic device can determine the target cropping method corresponding to the original image according to the limb beauty and the facial beauty. Among them, when the limb beauty meets the first condition and the facial beauty meets the fourth condition, that is, the limb beauty is high and the facial beauty is low, the electronic device can determine that the target cropping method is a limb-prioritized cropping method. When the limb beauty meets the first condition and the facial beauty meets the third condition, that is, the limb beauty is high and the facial beauty is high, the electronic device can determine that the target cropping method is a face-prioritized cropping method. When the limb beauty meets the second condition, that is, the limb beauty is low, the electronic device can determine that the target cropping method is a face-prioritized cropping method. Otherwise, the electronic device can determine that the target cropping method is the default cropping method.
[0112] In some embodiments, cropping the original image according to the target cropping mode to obtain a cropped image may include:
[0113] Determining the facial orientation of the target object;
[0114] According to the facial orientation of the target object, the target position of the target object in the cropped image is determined, and the original image is cropped according to the target position and the target cropping method to obtain the cropped image, wherein the position of the target object in the cropped image is the target position.
[0115] It should be understood that the facial orientation of the target object may include front, side and back. Among them, the front may refer to the original image including the front of the face of the target object. The side may refer to the original image including the side of the face of the target object. The back may refer to the original image not including the face of the target object.
[0116] In the image cropping method provided in this embodiment, the electronic device can determine the target position of the target object in the cropped image according to the facial orientation of the target object, and can crop the original image according to the target position and the target cropping method, which can improve the beauty of the cropped image and enhance the user experience.
[0117] In a possible implementation manner, determining the target position of the target object in the cropped image according to the facial orientation of the target object may include:
[0118] When the face is facing forward or backward, the target position of the target object in the cropped image is determined to be a middle position.
[0119] In the image cropping method provided by this implementation, when the face of the target object is facing forward or backward, the electronic device can determine that the target position of the target object in the cropped image is in the middle position, so that when the original image is cropped according to the target cropping method, the original image can be cropped in a way that the target object is located in the middle position of the cropped image, which can improve the beauty of the cropped image and enhance the user experience.
[0120] In another possible implementation manner, determining the target position of the target object in the cropped image according to the facial orientation of the target object may include:
[0121] When the facial orientation is sideways, determining the offset distance of the target object according to a preset aspect ratio, the preset aspect ratio being the aspect ratio corresponding to the cropped image, and the offset distance being the distance between a target position of the target object in the cropped image and a middle position of the cropped image;
[0122] A target position of the target object in the cropped image is determined according to the offset distance of the target object.
[0123] It should be understood that the aspect ratio may be the ratio of the length (ie, the length in the horizontal direction) to the width (ie, the width in the vertical direction). The offset distance may refer to the distance between the target position of the target object in the cropped image and the middle position of the cropped image.
[0124] In the image cropping method provided by this implementation, when the face of the target object is facing sideways, the electronic device can determine the offset distance of the target object, and determine the target position of the target object in the cropped image based on the offset distance of the target object, so that when the original image is cropped according to the target cropping method, the original image can be cropped in a way that the target object is located at the target position in the cropped image, which can improve the beauty of the cropped image and enhance the user experience.
[0125] In one example, determining a target position of the target object in the cropped image according to an offset distance of the target object includes:
[0126] When the facial orientation is sideways, determining the offset direction of the target object according to the facial orientation;
[0127] A target position of the target object in the cropped image is determined according to the offset distance and the offset direction of the target object.
[0128] In the image cropping method provided in this example, when the face of the target object is facing sideways, the electronic device can also determine the offset direction of the target object, so as to determine the target position of the target object in the cropped image according to the offset distance and offset direction of the target object, so that when the original image is cropped according to the target cropping method, the original image can be cropped in such a way that the target object is located at the target position in the cropped image, which can improve the beauty of the cropped image and enhance the user experience.
[0129] Exemplarily, when the face of the target object is facing the left, the electronic device may determine that the offset direction of the target object is to the right. That is, when it is determined that the face of the target object is facing the left, the electronic device determines that the target position of the target object in the cropped image may be biased to the right side of the cropped image. When the face of the target object is facing the right, the electronic device may determine that the offset direction of the target object is to the left. When it is determined that the face of the target object is facing the right, the electronic device determines that the target position of the target object in the cropped image may be biased to the left side of the cropped image.
[0130] In a second aspect, an embodiment of the present application provides an image cropping method, comprising:
[0131] Acquire an original image, wherein the original image includes a target object;
[0132] Determining the physical aesthetics of the target object;
[0133] According to the limb beauty, determine the target cropping mode corresponding to the original image; wherein, when the limb beauty is high, the target cropping mode is a limb-prioritized cropping mode; when the limb beauty is low, the target cropping mode is a face-prioritized cropping mode;
[0134] The original image is cropped according to the target cropping method to obtain a cropped image, wherein the cropped image includes all or part of the target object; wherein, when the target cropping method is a limb-priority cropping method, the cropped image includes all of the target object; and when the target cropping method is a face-priority cropping method, the cropped image includes part of the target object, wherein the part includes the face.
[0135] In the image cropping method provided above, after acquiring the original image including the target object, the electronic device can determine the aesthetics of the limbs of the target object. When it is determined that the limbs of the target object have high aesthetics, the electronic device can crop the original image in a cropping method that gives priority to retaining the limbs, so that the cropped image can retain the more beautiful limbs of the target object itself, which can improve the beauty of the cropped image and enhance the user experience. When it is determined that the limbs of the target object have low aesthetics, the electronic device can crop the original image in a cropping method that highlights facial features, which can reduce the proportion of limbs with lower aesthetics in the cropped image, which can improve the beauty of the cropped image and enhance the user experience.
[0136] It should be noted that high limb beauty and low limb beauty are relative concepts. Among them, high limb beauty and low limb beauty can be judged by setting a threshold. For example, when the limb beauty is higher than a certain threshold, it can be considered that the limb beauty is high; when the limb beauty is lower than a certain threshold, it can be considered that the limb beauty is low. Among them, the threshold can be a value or a range of values.
[0137] For example, when the limb beauty is characterized by the limb dynamics, and the limb dynamics is characterized by angle a, when angle a is greater than or equal to threshold A1, the limb beauty can be considered high; when angle a is less than threshold A2, the limb beauty can be considered low; when angle a is greater than or equal to threshold A2, and less than threshold A1, the limb beauty can be considered moderate. It should be understood that when the limb beauty is moderate, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method. Among them, the default cropping method can be specifically determined according to the actual scene.
[0138] In some embodiments, determining the limb aesthetics of the target object may include:
[0139] Determining the limb dynamics of the target object, where the limb dynamics is used to characterize the motion state of the target object;
[0140] The limb aesthetics of the target object is determined according to the limb dynamics; when the limb dynamics is greater than or equal to a first threshold, the limb aesthetics is high; when the limb dynamics is less than a second threshold, the limb aesthetics is low, and the first threshold is greater than or equal to the second threshold.
[0141] In some other embodiments, determining the limb aesthetics of the target object may include:
[0142] Determine the limb stretch of the target object, where the limb stretch is used to characterize the stretch degree of the limb of the target object;
[0143] The limb aesthetics of the target object is determined according to the limb stretch; when the limb stretch is greater than or equal to a third threshold, the limb aesthetics is high; when the limb stretch is less than a fourth threshold, the limb aesthetics is low, and the third threshold is greater than or equal to the fourth threshold.
[0144] In some other embodiments, determining the limb aesthetics of the target object may include:
[0145] Determining a limb torsion degree of the target object, wherein the limb torsion degree is used to characterize a degree of torsion of the limb of the target object;
[0146] The limb aesthetics of the target object is determined according to the limb twisting degree; wherein, when the limb twisting degree is greater than or equal to a fifth threshold, the limb aesthetics is high; when the limb twisting degree is less than a sixth threshold, the limb aesthetics is low, and the fifth threshold is greater than or equal to the sixth threshold.
[0147] It should be noted that the specific content of determining the limb aesthetics based on the limb dynamics, limb extension or limb torsion can refer to the relevant description in the first aspect above, which will not be repeated here. In addition, the electronic device can also determine the limb aesthetics based on at least two of the limb dynamics, limb extension or limb torsion. Among them, the specific content of determining the limb aesthetics based on at least two of the limb dynamics, limb extension or limb torsion of the electronic device can also refer to the relevant description in the first aspect above, which will not be repeated here.
[0148] In some embodiments, cropping the original image according to the target cropping mode to obtain a cropped image may include:
[0149] Determining the facial orientation of the target object;
[0150] According to the facial orientation of the target object, the target position of the target object in the cropped image is determined, and the original image is cropped according to the target position and the target cropping method to obtain the cropped image, wherein the position of the target object in the cropped image is the target position.
[0151] In a possible implementation manner, determining the target position of the target object in the cropped image according to the facial orientation of the target object may include:
[0152] When the face is facing forward or backward, the target position of the target object in the cropped image is determined to be a middle position.
[0153] In a possible implementation manner, determining a target position of the target object in the cropped image according to the facial orientation of the target object includes:
[0154] When the facial orientation is sideways, determining the offset distance of the target object according to a preset aspect ratio, the preset aspect ratio being the aspect ratio corresponding to the cropped image, and the offset distance being the distance between a target position of the target object in the cropped image and a middle position of the cropped image;
[0155] A target position of the target object in the cropped image is determined according to the offset distance of the target object.
[0156] It should be noted that the specific contents of determining the target position of the target object in the cropped image according to the facial orientation of the target object and cropping the original image according to the target position and the target cropping method can refer to the relevant description in the first aspect above, which will not be repeated here. In addition, the electronic device can also determine the target cropping method corresponding to the original image according to the beauty of the limbs and the beauty of the face. The specific contents of the electronic device determining the target cropping method corresponding to the original image according to the beauty of the limbs and the beauty of the face can refer to the relevant description in the first aspect above, which will not be repeated here.
[0157] In a third aspect, an embodiment of the present application provides an image cropping device, which may include:
[0158] An original image acquisition module, used to acquire an original image, wherein the original image includes a target object;
[0159] An aesthetics determination module, used to determine the limb aesthetics of the target object and / or determine the facial aesthetics of the target object;
[0160] A cropping mode determination module, used for determining a target cropping mode corresponding to the original image according to the limb aesthetics and / or the facial aesthetics;
[0161] The image cropping module is used to crop the original image according to the target cropping method to obtain a cropped image, wherein the cropped image includes all or part of the target object.
[0162] In some embodiments, the aesthetics determination module is specifically used to determine the limb dynamics of the target object, where the limb dynamics is used to characterize the motion state of the target object; and determine the limb aesthetics of the target object based on the limb dynamics.
[0163] In one example, the aesthetics determination module is also used to obtain a first angle corresponding to the target object, where the first angle is the angle between a line between the top of the target object's head and the midpoint of the pelvis and the vertical direction; and determine the limb dynamics of the target object based on the first angle.
[0164] In a possible implementation, the aesthetics determination module is also used to determine that the limb aesthetics of the target object meets a first condition when the limb dynamics is greater than or equal to a first threshold; and to determine that the limb aesthetics of the target object meets a second condition when the limb dynamics is less than a second threshold, and the first threshold is greater than or equal to the second threshold.
[0165] In another possible implementation, the aesthetics determination module is further used to determine the limb stretch of the target object, where the limb stretch is used to characterize the degree of stretch of the target object's limbs; and to determine the limb aesthetics of the target object based on the limb dynamics and the limb stretch.
[0166] In one example, the aesthetics determination module is also used to determine that the limb aesthetics of the target object meets a first condition when the limb dynamics is greater than or equal to a first threshold and the limb stretch is greater than or equal to a third threshold; and to determine that the limb aesthetics of the target object meets a second condition when the limb dynamics is less than a second threshold and the limb stretch is less than a fourth threshold; wherein the first threshold is greater than or equal to the second threshold, and the third threshold is greater than or equal to the fourth threshold.
[0167] In another possible implementation, the aesthetics determination module is further used to determine the limb torsion degree of the target object, where the limb torsion degree is used to characterize the degree of torsion of the target object's limbs; and the limb aesthetics of the target object is determined based on the limb dynamics and the limb torsion degree.
[0168] In one example, the aesthetics determination module is also used to determine that the limb aesthetics of the target object meets a first condition when the limb dynamics is greater than or equal to a first threshold and the limb torsion is greater than or equal to a fifth threshold; and to determine that the limb aesthetics of the target object meets a second condition when the limb dynamics is less than a second threshold and the limb torsion is less than a sixth threshold; wherein the first threshold is greater than or equal to the second threshold, and the fifth threshold is greater than or equal to the sixth threshold.
[0169] In another possible implementation, the aesthetics determination module is further used to determine the limb extension and limb torsion of the target object, and determine the limb aesthetics of the target object based on the limb dynamics, the limb extension and the limb torsion.
[0170] In some other embodiments, the aesthetics determination module is further used to determine the limb stretch of the target object; and determine the limb aesthetics of the target object based on the limb stretch.
[0171] In one example, the aesthetics determination module is also used to determine a first width and a second width, wherein the first width is the width of a first symmetrical joint point of the target object, and the second width is the width of a second symmetrical joint point of the target object; based on the first width and the second width, the limb stretch of the target object is determined.
[0172] Exemplarily, the first symmetrical joint points include a group of joint points corresponding to the shoulder and / or a group of joint points corresponding to the pelvis, and the second symmetrical joint points include at least one of a group of joint points corresponding to the wrist, a group of joint points corresponding to the knee, and a group of joint points corresponding to the ankle.
[0173] In another example, the aesthetics determination module is also used to determine a first horizontal coordinate and a second horizontal coordinate, wherein the first horizontal coordinate is the horizontal coordinate of a first target joint point of the target object, and the second horizontal coordinate is the horizontal coordinate of a second target joint point of the target object, and the first target joint point and the second target joint point are joint points on the same side of the target object; the limb stretch of the target object is determined based on the first horizontal coordinate and the second horizontal coordinate.
[0174] Exemplarily, the first target joint point includes a joint point corresponding to the shoulder and / or a joint point corresponding to the pelvis, and the second target joint point includes at least one of a joint point corresponding to the wrist, a joint point corresponding to the knee, and a joint point corresponding to the ankle.
[0175] In a possible implementation, the aesthetics determination module is also used to determine that the limb aesthetics of the target object meets the first condition when the limb stretch is greater than or equal to a third threshold; and to determine that the limb aesthetics of the target object meets the second condition, and the third threshold is greater than or equal to the fourth threshold, when the limb stretch is less than a fourth threshold.
[0176] In another possible implementation, the aesthetics determination module is further configured to determine a limb twisting degree of the target object, and determine the limb aesthetics of the target object according to the limb stretch and the limb twisting degree.
[0177] In one example, the aesthetics determination module is also used to determine that the limb aesthetics of the target object meets the first condition when the limb stretch is greater than or equal to a third threshold and the limb torsion is greater than or equal to a fifth threshold; and to determine that the limb aesthetics of the target object meets the second condition when the limb stretch is less than a fourth threshold and the limb torsion is less than a sixth threshold; wherein the third threshold is greater than or equal to the fourth threshold, and the fifth threshold is greater than or equal to the sixth threshold.
[0178] In some other embodiments, the aesthetics determination module is further used to determine the limb torsion degree of the target object; and determine the limb aesthetics of the target object based on the limb torsion degree.
[0179] In one example, the aesthetics determination module is also used to obtain a second angle corresponding to the target object, where the second angle is the angle between a first line and a second line, where the first line is a line corresponding to a third symmetrical joint point of the target object, and the second line is a line corresponding to a fourth symmetrical joint point of the target object; and the limb torsion degree of the target object is determined based on the second angle.
[0180] Exemplarily, the third symmetrical joint points include a group of joint points corresponding to shoulders, and the fourth symmetrical joint points include a group of joint points corresponding to pelvis.
[0181] In a possible implementation, the aesthetics determination module is also used to determine that the limb aesthetics of the target object meets the first condition when the limb torsion degree is greater than or equal to a fifth threshold; and to determine that the limb aesthetics of the target object meets the second condition, and the fifth threshold is greater than or equal to the sixth threshold, when the limb torsion degree is less than a sixth threshold.
[0182] In some embodiments, the beauty determination module is further used to determine the expression arousal and expression pleasure of the target object, and determine the facial beauty of the target object based on the expression arousal and the expression pleasure.
[0183] In one possible implementation, the beauty determination module is also used to determine that the facial beauty satisfies the third condition when the expression arousal degree is greater than or equal to the seventh threshold, or the expression pleasantness degree is greater than or equal to the eighth threshold; and to determine that the facial beauty satisfies the fourth condition when the expression arousal degree is less than the seventh threshold and the expression pleasantness degree is less than the eighth threshold.
[0184] In some embodiments, the cropping method determination module is specifically used to determine that the target cropping method is a first cropping method when the limb beauty meets a first condition, and the first cropping method is a limb-priority cropping method; when the limb beauty meets a second condition, determine that the target cropping method is a second cropping method, and the second cropping method is a face-priority cropping method.
[0185] In other embodiments, the cropping method determination module is also used to determine that the target cropping method is the second cropping method when the facial beauty meets the third condition, and the second cropping method is a face-priority cropping method; when the facial beauty meets the fourth condition, determine that the target cropping method is the first cropping method, and the first cropping method is a limb-priority cropping method.
[0186] In other embodiments, the cropping method determination module is also used to determine that the target cropping method is the first cropping method when the limb beauty meets the first condition and the facial beauty meets the fourth condition, and the first cropping method is a limb-priority cropping method; when the limb beauty meets the first condition and the facial beauty meets the third condition, or when the limb beauty meets the second condition, determine that the target cropping method is the second cropping method, and the second cropping method is a face-priority cropping method.
[0187] In some embodiments, the image cropping module is specifically used to determine the facial orientation of the target object; determine the target position of the target object in the cropped image based on the facial orientation of the target object, and crop the original image based on the target position and the target cropping method to obtain the cropped image, wherein the position of the target object in the cropped image is the target position.
[0188] In a possible implementation, the image cropping module is further configured to determine that a target position of the target object in the cropped image is a middle position when the facial orientation is forward or backward.
[0189] In another possible implementation, the image cropping module is used to determine the offset distance of the target object according to a preset aspect ratio when the face is facing sideways, wherein the preset aspect ratio is the aspect ratio corresponding to the cropped image, and the offset distance is the distance between the target position of the target object in the cropped image and the middle position of the cropped image; and determine the target position of the target object in the cropped image according to the offset distance of the target object.
[0190] In one example, the image cropping module is further used to determine the offset direction of the target object according to the facial orientation when the facial orientation is sideways; and determine the target position of the target object in the cropped image according to the offset distance and offset direction of the target object.
[0191] In a fourth aspect, an embodiment of the present application provides an image cropping device, which may include:
[0192] An original image acquisition module, used to acquire an original image, wherein the original image includes a target object;
[0193] A beauty determination module, used to determine the beauty of the limbs of the target object;
[0194] A cropping mode determination module is used to determine a target cropping mode corresponding to the original image according to the limb aesthetics; wherein, when the limb aesthetics is high, the target cropping mode is a limb-first cropping mode; when the limb aesthetics is low, the target cropping mode is a face-first cropping mode;
[0195] An image cropping module is used to crop the original image according to the target cropping method to obtain a cropped image, wherein the cropped image includes all or part of the target object; wherein, when the target cropping method is a limb-priority cropping method, the cropped image includes all of the target object; and when the target cropping method is a face-priority cropping method, the cropped image includes part of the target object, wherein the part includes the face.
[0196] In some embodiments, the aesthetics determination module is specifically used to determine the limb dynamics of the target object, and the limb dynamics is used to characterize the motion state of the target object; the limb aesthetics of the target object is determined based on the limb dynamics; wherein, when the limb dynamics is greater than or equal to a first threshold, the limb aesthetics is high; when the limb dynamics is less than a second threshold, the limb aesthetics is low, and the first threshold is greater than or equal to the second threshold.
[0197] In other embodiments, the aesthetics determination module is also used to determine the limb stretch of the target object, and the limb stretch is used to characterize the degree of stretch of the target object's limbs; the limb aesthetics of the target object is determined based on the limb stretch; wherein, when the limb stretch is greater than or equal to a third threshold, the limb aesthetics is high; when the limb stretch is less than a fourth threshold, the limb aesthetics is low, and the third threshold is greater than or equal to the fourth threshold.
[0198] In some other embodiments, the aesthetics determination module is also used to determine the limb torsion degree of the target object, and the limb torsion degree is used to characterize the degree of torsion of the target object's limbs; the limb aesthetics of the target object is determined based on the limb torsion degree; wherein, when the limb torsion degree is greater than or equal to a fifth threshold, the limb aesthetics is high; when the limb torsion degree is less than a sixth threshold, the limb aesthetics is low, and the fifth threshold is greater than or equal to the sixth threshold.
[0199] In some embodiments, the image cropping module is specifically used to determine the facial orientation of the target object; determine the target position of the target object in the cropped image based on the facial orientation of the target object, and crop the original image based on the target position and the target cropping method to obtain the cropped image, wherein the position of the target object in the cropped image is the target position.
[0200] In a possible implementation, the image cropping module is further configured to determine that a target position of the target object in the cropped image is a middle position when the facial orientation is forward or backward.
[0201] In a possible implementation, the image cropping module is further used to determine, when the facial orientation is sideways, an offset distance of the target object according to a preset aspect ratio, wherein the preset aspect ratio is an aspect ratio corresponding to the cropped image, and the offset distance is a distance between a target position of the target object in the cropped image and a middle position of the cropped image; and determine the target position of the target object in the cropped image according to the offset distance of the target object.
[0202] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the image cropping method described in any one of the first aspect or the second aspect.
[0203] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a computer, the computer implements the image cropping method described in any one of the first aspect or the second aspect.
[0204] In a seventh aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the image cropping method described in any one of the first aspect or the second aspect.
[0205] It can be understood that the beneficial effects of the third to seventh aspects mentioned above can be found in the relevant descriptions in the first or second aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0206] Figure 1 is an example of a cropped image;
[0207] Figure 2 is a schematic diagram of the structure of an electronic device to which the image cropping method provided in an embodiment of the present application is applicable;
[0208] Figure 3 Schematic diagram of software architecture to which the image cropping method provided in the embodiment of the present application is applicable;
[0209] Figure 4 is a flowchart of an image cropping method provided in an embodiment of the present application;
[0210] Figure 5 is an example diagram of a cropped image provided in an embodiment of the present application;
[0211] Figure 6 It is a flowchart of determining a target cropping method corresponding to an original image according to the limb aesthetics of a target object provided by an embodiment of the present application;
[0212] Figure 7 is a schematic diagram of angle a provided in an embodiment of the present application;
[0213] Figure 8 is a schematic diagram of symmetrical joint points provided in an embodiment of the present application;
[0214] Fig. 9 is a schematic diagram of a unilateral joint point provided in an embodiment of the present application;
[0215] Fig.10 is a schematic diagram of angle b provided in an embodiment of the present application;
[0216] Fig.11 This is an example of an application scenario provided by the embodiment of the present application. Figure 1 ;
[0217] Fig.12 It is a flowchart of determining a target cropping method corresponding to an original image according to the facial beauty of a target object provided by an embodiment of the present application;
[0218] Fig.13 This is an example diagram of the correspondence between expression categories and expression arousal and expression pleasure;
[0219] Fig.14It is a flowchart of determining a target cropping method corresponding to an original image according to the limb beauty and facial beauty of a target object provided by an embodiment of the present application;
[0220] Fig.15 is a flowchart of another image cropping method provided in an embodiment of the present application;
[0221] Fig.16 This is an example of an application scenario provided by the embodiment of the present application. Figure 2 ;
[0222] Fig.17 is a schematic diagram of the relationship between the preset aspect ratio and the offset rate corresponding to the target object provided in an embodiment of the present application;
[0223] Fig.18 This is an example of an application scenario provided by the embodiment of the present application. Figure 3 . DETAILED DESCRIPTION
[0224] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0225] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0226] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0227] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0228] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0229] In addition, the “plurality” mentioned in the embodiments of the present application should be interpreted as two or more.
[0230] The steps involved in the image cropping method provided in the embodiments of the present application are only examples, and not all steps are mandatory steps, or not all information or messages are mandatory, and can be increased or decreased as needed during use. The same step or steps or messages with the same function in the embodiments of the present application can be referenced and learned from each other in different embodiments.
[0231] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0232] Electronic devices such as mobile phones and tablets generally have the function of automatically cropping images, that is, they can automatically crop images according to the default cropping method. For example, when setting a screen saver or lock screen image, the user can upload a personalized image. After the electronic device obtains the personalized image, it can automatically crop the personalized image into a cropped image with a specified aspect ratio according to the default cropping method, and apply the cropped image to the screen saver or lock screen, etc. This cropping of all images according to the default cropping method will result in the cropped image failing to highlight the beauty of the image itself, resulting in a poor user experience.
[0233] For example, see Figure 1 , Figure 1 An example diagram of a cropped image is shown.
[0234] When automatically cropping an image, Figure 1After the original image shown in (a) in FIG. 1 is obtained, the electronic device can automatically crop the original image according to a default cropping method (such as a face-first cropping method) to obtain a cropped image, referred to as a cropped image for short. For example, the following can be obtained: Figure 1 The cropped image shown in (b) in the figure. That is, the electronic device crops the original image with a more beautiful posture into a half-length portrait according to the default cropping method, causing the cropped image to lose the beauty of the original image, resulting in a poor user experience. In other cases, the posture of the person in the original image is relatively restrained, but the full-length image is retained, which lacks impact and the user experience is also poor.
[0235] To solve the above problems, the embodiments of the present application provide an image cropping method, an electronic device, and a computer-readable storage medium. In the method, when performing image cropping, the electronic device can obtain an original image containing a target object, and can determine the limb beauty of the target object and / or the facial beauty of the target object in the original image. Subsequently, the electronic device can determine a target cropping method that can highlight the beauty of the original image itself based on the limb beauty and / or facial beauty of the target object, so that the original image can be cropped according to the target cropping method to obtain a cropped image, so that the cropped image can highlight the beauty of the original image itself, improve the user experience, and have strong ease of use and practicality.
[0236] In the embodiment of the present application, the electronic device may be a mobile phone, a tablet computer, a wearable device, a laptop computer, a smart large screen or a desktop computer and other electronic devices with an image cropping function. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device.
[0237] The following first introduces the electronic device involved in the embodiment of the present application. Figure 2 , Figure 2 A schematic structural diagram of an electronic device 200 is shown.
[0238] The electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, an antenna 1, an antenna 2, a mobile communication module 240, a wireless communication module 250, a sensor module 260, a camera 270, and a display screen 280. The sensor module 260 may include a pressure sensor 260A, a gyroscope sensor 260B, and a touch sensor 260C.
[0239] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 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.
[0240] The processor 210 may include one or more processing units, for example, the processor 210 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 processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0241] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0242] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0243] In some embodiments, the processor 210 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0244] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple groups of I2C buses. The processor 210 may be coupled to the touch sensor 260C, the camera 270, etc. through different I2C bus interfaces. For example, the processor 210 may be coupled to the touch sensor 260C through the I2C interface, so that the processor 210 communicates with the touch sensor 260C through the I2C bus interface to realize the touch function of the electronic device 200.
[0245] 250250250The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 210 and the wireless communication module 250. The MIPI interface can be used to connect the processor 210 with peripheral devices such as the display screen 280 and the camera 270. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 210 and the camera 270 communicate via the CSI interface to realize the shooting function of the electronic device 200. The processor 210 and the display screen 280 communicate via the DSI interface to realize the display function of the electronic device 200.
[0246] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 with the camera 270, the display 280, the wireless communication module 250, the sensor module 260, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0247] The USB interface 230 is an interface that complies with the USB standard specification, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 230 may be used to transmit data between the electronic device 200 and a peripheral device. The interface may also be used to connect other electronic devices, such as an AR device, etc.
[0248] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0249] The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 240, the wireless communication module 250, the modem processor and the baseband processor.
[0250] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0251] The mobile communication module 240 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 200. The mobile communication module 240 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 240 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 240 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 240 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 240 can be set in the same device as at least some of the modules of the processor 210.
[0252] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor displays an image or video through the display screen 280. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 240 or other functional modules.
[0253] The wireless communication module 250 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 200. The wireless communication module 250 can be one or more devices integrating at least one communication processing module. The wireless communication module 250 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 250 can also receive the signal to be sent from the processor 210, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0254] In some embodiments, the antenna 1 of the electronic device 200 is coupled to the mobile communication module 240, and the antenna 2 is coupled to the wireless communication module 250, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0255] The electronic device 200 implements the display function through a GPU, a display screen 280, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 280 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.
[0256] The display screen 280 is used to display images, videos, etc. The display screen 280 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 200 may include 1 or N display screens 280, where N is a positive integer greater than 1.
[0257] The electronic device 200 can realize the shooting function through the ISP, the camera 270, the video codec, the GPU, the display screen 280 and the application processor.
[0258] The ISP is used to process the data fed back by the camera 270. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 270.
[0259] The camera 270 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 passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 270, where N is a positive integer greater than 1.
[0260] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 200 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0261] Video codecs are used to compress or decompress digital videos. The electronic device 200 may support one or more video codecs. Thus, the electronic device 200 may play or record videos in a variety of coding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0262] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 200 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0263] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0264] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 221, and / or instructions stored in a memory provided in the processor.
[0265] The pressure sensor 260A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 260A can be set on the display screen 280. There are many types of pressure sensors 260A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 260A, the capacitance between the electrodes changes. The electronic device 200 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 280, the electronic device 200 detects the touch operation intensity according to the pressure sensor 260A. The electronic device 200 can also calculate the touch position according to the detection signal of the pressure sensor 260A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0266] The gyro sensor 260B can be used to determine the motion posture of the electronic device 200. In some embodiments, the angular velocity of the electronic device 200 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 260B. The gyro sensor 260B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 260B detects the angle of the electronic device 200 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 200 through reverse movement to achieve anti-shake. The gyro sensor 260B can also be used for navigation and somatosensory game scenes.
[0267] The touch sensor 260C is also called a "touch control device". The touch sensor 260C can be set on the display screen 280, and the touch sensor 260C and the display screen 280 form a touch screen, also called a "touch control screen". The touch sensor 260C is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 280. In other embodiments, the touch sensor 260C can also be set on the surface of the electronic device 200, which is different from the position of the display screen 280.
[0268] The software system of the electronic device 200 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. For example, the software system of the electronic device 200 may adopt an Android operating system (OS), a Harmony OS, or an IOS with a layered architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to exemplify the software structure of the electronic device 200.
[0269] Figure 3 It is a software structure block diagram of the electronic device 200 according to an embodiment of the present application.
[0270] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0271] The application layer can include a series of application packages.
[0272] like Figure 3 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0273] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0274] like Figure 3 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0275] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0276] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0277] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0278] The phone manager is used to provide communication functions of the electronic device 200, such as management of call status (including connecting, hanging up, etc.).
[0279] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0280] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0281] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0282] 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.
[0283] 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.
[0284] 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.
[0285] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0286] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0287] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0288] A 2D graphics engine is a drawing engine for 2D drawings.
[0289] 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.
[0290] The image cropping method provided in the embodiment of the present application will be described in detail below with reference to the accompanying drawings and specific application scenarios.
[0291] See also Figure 4 , Figure 4 The schematic flow chart of an image cropping method provided by an embodiment of the present application is shown. The method can be applied to electronic devices with image cropping functions such as mobile phones, tablet computers or laptop computers. The image cropping function can refer to a function of automatically cropping images. The image cropping function can be a system function of the electronic device, or can be a function provided by an application installed in the electronic device. Figure 4 As shown, the method may include:
[0292] S401: The electronic device obtains an original image, where the original image includes a target object.
[0293] S402: The electronic device determines the body aesthetics of the target object and / or determines the facial aesthetics of the target object.
[0294] S403: The electronic device determines a target cropping method corresponding to the original image according to the limb beauty and / or facial beauty.
[0295] S404: The electronic device crops the original image according to the target cropping method to obtain a cropped image, where the cropped image includes all or part of the target object.
[0296] In an embodiment of the present application, after acquiring an original image including a target object, the electronic device can determine the limb beauty and / or facial beauty of the target object. Subsequently, the electronic device can determine a target cropping method that can highlight the posture beauty and / or facial beauty of the target object according to the limb beauty and / or facial beauty of the target object, and can crop the original image according to the target cropping method to obtain a cropped image, so that the cropped image can retain the posture beauty and / or facial beauty of the original image itself, which can improve the beauty of the cropped image and enhance the user experience.
[0297] It should be noted that the image cropping method provided in the embodiment of the present application can be used to crop the original image into a cropped image with a preset aspect ratio. Therefore, after acquiring the original image including the target object, the electronic device can determine the aspect ratio of the original image (hereinafter referred to as the original aspect ratio), and can determine whether the original image needs to be cropped based on the original aspect ratio and the preset aspect ratio. When the original image needs to be cropped, the electronic device can crop the original image using the image cropping method provided in the embodiment of the present application. When the original image does not need to be cropped, the electronic device may not crop the original image.
[0298] For example, when the original aspect ratio is equal to the preset aspect ratio, the electronic device may determine that the original image does not need to be cropped, that is, the electronic device may not crop the original image. When the original aspect ratio is greater than the preset aspect ratio, the electronic device may determine that the original image needs to be cropped. At this time, the electronic device may crop the original image according to the preset aspect ratio to obtain a cropped image. When the original aspect ratio is less than the preset aspect ratio, the electronic device may enlarge the original image according to the preset aspect ratio, or may infill the original image according to the preset aspect ratio. If the aspect ratio of the original image after enlargement or infilling is greater than the preset aspect ratio, the electronic device may determine that the original image needs to be cropped. At this time, the electronic device may crop the original image after enlargement or infilling to obtain a cropped image.
[0299] It should be understood that the preset aspect ratio can be determined according to the actual scenario, and the embodiments of the present application are not limited to this.
[0300] For example, the preset aspect ratio may be an aspect ratio that is customized by the user. For example, in a scenario where the original image is set as a screen saver or lock screen image, the electronic device may determine the preset aspect ratio according to the aspect ratio of the screen of the electronic device, such as the preset aspect ratio may be the aspect ratio of the screen of the electronic device, etc. The following will be described exemplarily by taking the preset aspect ratio as the aspect ratio of the screen of the electronic device as an example.
[0301] Exemplarily, the original image may be an image captured by an electronic device, such as an image captured by a camera of the electronic device. Alternatively, the original image may be an image received by the electronic device. The original image may be an image to be cropped selected by the user. For example, when setting a screen saver or lock screen image, the user may select an image. The electronic device may crop the image selected by the user, and may apply the obtained cropped image to the screen saver or lock screen. Exemplarily, the user may also use the solution provided in the embodiment of the present application when setting an avatar.
[0302] It should be noted that the image cropping method provided in the embodiment of the present application can be used to crop an image including a target object. That is, after acquiring the original image, the electronic device can determine whether the original image includes the target object. When it is determined that the original image includes the target object, the electronic device can use the image cropping method provided in the embodiment of the present application to crop the original image. When it is determined that the original image does not include the target object, the electronic device can use other image cropping methods to crop the original image.
[0303] It should be understood that other image cropping methods can be determined according to the actual scene, and the embodiments of the present application are not limited to this. In addition, the specific manner in which the electronic device determines whether the original image includes the target object can be determined according to the actual scene, and the embodiments of the present application are not limited to this. For example, the electronic device can perform target detection on the original image through an existing target detection network or target detection algorithm to determine whether the original image includes the target object.
[0304] In some embodiments, the target object may be a portrait. The portrait may refer to an image of a person. That is, the image cropping method provided in the embodiment of the present application may be used to crop an image including a portrait. For example, after acquiring the original image, the electronic device may determine whether the original image includes a portrait. When it is determined that the original image includes a portrait, the electronic device may crop the original image using the image cropping method provided in the embodiment of the present application. When it is determined that the original image does not include a portrait, the electronic device may crop the original image using other image cropping methods.
[0305] It should be noted that the embodiments of the present application do not limit the specific manner in which the electronic device determines whether the original image includes a portrait, and the determination may be made according to the actual scenario. For example, the electronic device may determine whether the original image includes a portrait through a face detection network. For example, the electronic device may determine whether the original image includes a portrait through a limb detection network, and so on.
[0306] In other embodiments, the target object may also be an animal, or other objects with facial and / or body movements, such as sculptures, pictures, etc.
[0307] In some embodiments, the target cropping method may be a limb-first cropping method, or a face-first cropping method. The limb-first cropping method may mean that when cropping an image, the limbs may be given priority, that is, preserving the integrity of the limbs may be given priority. The face-first cropping method may mean that when cropping an image, the face may be given priority, that is, highlighting facial features may be given priority.
[0308] That is, when the target cropping mode is determined to be a limb-prioritized cropping mode, when cropping the original image according to the target cropping mode, the electronic device may give priority to retaining the integrity of the limbs, for example, the original image may be cropped into a full-body image. When the target cropping mode is determined to be a face-prioritized cropping mode, when cropping the original image according to the target cropping mode, the electronic device may give priority to highlighting facial features, for example, the original image may be cropped into a half-body image with prominent facial features.
[0309] For example, see Figure 5 , Figure 5 An example diagram of a cropped image provided by an embodiment of the present application is shown.
[0310] When using limb-first cutting Figure 5 When cropping the original image shown in (a) in FIG. 1 , the electronic device may give priority to preserving the integrity of the limbs of the target object. For example, the electronic device may crop the original image into Figure 5 The full-body image shown in (b) in FIG. 1 is used to preserve all limbs of the target object.
[0311] When using face-priority cropping Figure 5 When cropping the original image shown in (a) in FIG. 1 , the electronic device can highlight the facial features of the target object. For example, the electronic device can crop the original image as shown in FIG. Figure 5 A bust portrait is shown in (c) to highlight the facial features of the target object.
[0312] In some embodiments, the original image may include one or more target objects. That is, after acquiring the original image, the electronic device may determine the number of target objects included in the original image.
[0313] When the original image includes a target object, the electronic device can determine the limb beauty and / or facial beauty of the target object, and can determine the target cropping method corresponding to the original image based on the limb beauty and / or facial beauty of the target object, so as to crop the original image according to the target cropping method.
[0314] When the original image includes multiple target objects, the electronic device can determine the limb beauty and / or facial beauty of each target object respectively, that is, for each target object, the electronic device can determine the limb beauty and / or facial beauty of the target object. Subsequently, the electronic device can determine the target object (e.g., target object T) with the highest limb beauty and / or the highest facial beauty according to the limb beauty and / or facial beauty of each target object, and can determine the target cropping mode corresponding to the original image according to the limb beauty and / or facial beauty of the target object T, so as to crop the original image according to the target cropping mode. That is, when the original image includes multiple target objects, the electronic device can crop the original image according to the target object T with the highest limb beauty and / or the highest facial beauty. Among them, the limb beauty can be used to indicate the beauty of limb movements, that is, it can be used to indicate the beauty of postures. Facial beauty can be used to indicate the beauty of facial expressions.
[0315] In other embodiments, the solution provided in the embodiments of the present application may be used in the case of only one target object, and other types of cropping methods may be used in the case of multiple target objects, such as a cropping method that highlights a group image.
[0316] The following will take an original image including a target object as an example to illustrate the process of an electronic device determining the limb beauty and / or facial beauty of the target object, and determining the target cropping method corresponding to the original image based on the limb beauty and / or facial beauty of the target object.
[0317] As can be seen from the above description, after acquiring an original image including a target object, the electronic device can determine the limb beauty of the target object, and can determine the target cropping method corresponding to the original image according to the limb beauty of the target object. Alternatively, the electronic device can determine the facial beauty of the target object, and can determine the target cropping method corresponding to the original image according to the facial beauty of the target object. Alternatively, the electronic device can determine the limb beauty and facial beauty of the target object, and can determine the target cropping method corresponding to the original image according to the limb beauty and facial beauty of the target object.
[0318] The following will be explained respectively: 1. The electronic device determines the limb beauty of the target object, and determines the target cropping method corresponding to the original image based on the limb beauty of the target object; 2. The electronic device determines the facial beauty of the target object, and determines the target cropping method corresponding to the original image based on the facial beauty of the target object; 3. The electronic device determines the limb beauty and facial beauty of the target object, and determines the target cropping method corresponding to the original image based on the limb beauty and facial beauty of the target object.
[0319] 1. The electronic device determines the physical beauty of the target object, and determines the original The target cropping method corresponding to the initial image.
[0320] After acquiring the original image including the target object, the electronic device may determine the limb beauty of the target object according to the original image. When it is determined that the limb beauty of the target object is high, the electronic device may determine that the target cropping method corresponding to the original image is a limb-first cropping method. When it is determined that the limb beauty of the target object is low, the electronic device may determine that the target cropping method corresponding to the original image is a face-first cropping method.
[0321] That is, when cropping the original image, if it is determined that the limbs of the target object are more aesthetically pleasing, the electronic device can crop the original image in a cropping manner that gives priority to retaining the limbs, so that the cropped image can retain the more aesthetically pleasing limbs of the target object itself, which can improve the aesthetics of the cropped image and enhance the user experience. When it is determined that the limbs of the target object are less aesthetically pleasing, the electronic device can crop the original image in a cropping manner that highlights facial features, which can reduce the proportion of the less aesthetically pleasing limbs in the cropped image, which can improve the aesthetics of the cropped image and enhance the user experience.
[0322] It should be understood that in the embodiments of the present application, higher limb aesthetics and high limb aesthetics may be the same concept, and lower limb aesthetics and low limb aesthetics may be the same concept.
[0323] See also Figure 6 , Figure 6 A schematic diagram of a process for determining a target cropping method corresponding to an original image according to the limb aesthetics of a target object provided in an embodiment of the present application is shown.
[0324] In one example, if Figure 6 As shown, after acquiring the original image including the target object, the electronic device can detect whether the original image includes a facial image. When no facial image is detected in the original image, for example, when the original image is an image including the back of the target object, the electronic device can directly determine that the target cropping method corresponding to the original image is a limb-first cropping method. In other words, when the electronic device does not detect a facial image in the original image, the electronic device can directly crop the original image using a limb-first cropping method.
[0325] When a facial image is detected in the original image, the electronic device may determine the limb beauty of the target object based on the original image. When it is determined that the limb beauty of the target object is high, the electronic device may determine that the target cropping method corresponding to the original image is a limb-first cropping method. When it is determined that the limb beauty of the target object is low, the electronic device may determine that the target cropping method corresponding to the original image is a face-first cropping method.
[0326] It should be understood that the embodiments of the present application do not impose any restrictions on the specific method of detecting whether the original image includes a face, which can be determined according to the actual scenario, such as a general algorithm for face recognition or other artificial intelligence algorithms.
[0327] The following will take the original image containing the face image of the target object as an example for explanation.
[0328] In an embodiment of the present application, the electronic device can determine the limb aesthetics of the target object based on at least one of the limb dynamics, limb stretch, and limb torsion of the target object. The limb dynamics can be used to characterize the motion state of the target object, for example, it can be used to characterize the motion speed of the target object. The limb stretch can be used to characterize the stretch degree of the limb of the target object. The limb torsion can be used to characterize the torsion degree of the limb of the target object.
[0329] In some embodiments, the electronic device can determine the limb aesthetics of the target object based on the limb dynamics of the target object. That is, after acquiring an original image including the target object, the electronic device can determine the limb dynamics of the target object based on the original image, and can determine the limb aesthetics of the target object based on the limb dynamics.
[0330] It should be noted that the study found that people prefer images that contain movement to static images. In other words, people generally think that the beauty of limbs in motion is higher than that of limbs in a static state.
[0331] In one example, when it is determined that the target object's limb dynamics are high, for example, when it is determined that the target object's movement speed is fast, the electronic device can determine that the target object's limb aesthetics are high, that is, the target cropping method corresponding to the original image can be determined to be a limb-prioritized cropping method. When it is determined that the target object's limb dynamics are low, for example, when it is determined that the target object's movement speed is low (for example, in a stationary state), the electronic device can determine that the target object's limb aesthetics are low, that is, the target cropping method corresponding to the original image can be determined to be a face-prioritized cropping method.
[0332] In a possible implementation, the electronic device may determine the limb dynamics of the target object based on an angle between a line between the top of the head and the midpoint of the pelvis and the vertical direction (hereinafter referred to as angle a).
[0333] For example, see Figure 7 , Figure 7 A schematic diagram of the angle a provided in an embodiment of the present application is shown.
[0334] like Figure 7 As shown, angle a may be the angle between a line 701 between the top of the head and the midpoint of the pelvis and a straight line 702 where the vertical direction is located.
[0335] Exemplarily, the electronic device may determine angle a as the limb dynamics of the target object. Alternatively, a conversion relationship between angle a and limb dynamics (hereinafter referred to as conversion relationship R1) may be provided in the electronic device, and the electronic device may determine the limb dynamics of the target object based on angle a and conversion relationship R1. Among them, the conversion relationship R1 between angle a and limb dynamics can be determined according to the actual scene, and the embodiments of the present application do not impose any restrictions on this. The following will be exemplified by taking the electronic device determining angle a as the limb dynamics of the target object as an example.
[0336] It should be noted that when the target object is in motion, angle a is generally larger, and the faster the motion speed, the larger the angle a will be. When the target object is stationary, angle a is generally smaller. That is, when the target object is in motion, angle a will be greater than or equal to a certain threshold (hereinafter referred to as threshold A1). When the target object is stationary, angle a will be less than a certain threshold (hereinafter referred to as threshold A2).
[0337] It should be understood that threshold A1 and threshold A2 may be the same or different. Threshold A1 and threshold A2 may be specific values or value ranges. Among them, the specific value of threshold A1 and the specific value of threshold A2 may be specifically determined according to the actual scene, and the embodiments of the present application do not impose any restrictions on this. For example, threshold A1 and threshold A2 may be determined according to angle a when the target object and / or other objects are in motion, such as threshold A1 may be determined to be any angle of 10 degrees, 15 degrees or 20 degrees, and threshold A2 may be determined to be any angle of 0 degrees, 3 degrees, 5 degrees or 10 degrees.
[0338] Optionally, the electronic device may determine the limb aesthetics of the target object based on whether the limb dynamics (ie, angle a) is greater than or equal to a threshold value A1, and / or based on whether the limb dynamics (ie, angle a) is less than or equal to a threshold value A2.
[0339] In one example, when threshold A1 is the same as threshold A2, when it is determined that angle a is greater than or equal to threshold A1, the electronic device can determine that the target object's limb dynamics are high, that is, it can be determined that the target object's limb aesthetics are high, and at this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-first cropping method. When it is determined that angle a is less than threshold A2, the electronic device can determine that the target object's limb dynamics are low, that is, it can be determined that the target object's limb aesthetics are low, and at this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-first cropping method.
[0340] In another example, when threshold A1 is different from threshold A2, when it is determined that angle a is greater than or equal to threshold A1, the electronic device can determine that the target object's limb dynamics is high, that is, it can be determined that the target object's limb aesthetics is high. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When it is determined that angle a is less than threshold A2, the electronic device can determine that the target object's limb dynamics is low, that is, it can be determined that the target object's limb aesthetics is low. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized cropping method. When it is determined that angle a is greater than or equal to threshold A2, and when it is determined that angle a is less than threshold A1, the electronic device can determine that the target object's limb dynamics is moderate, that is, it can be determined that the target object's limb aesthetics is moderate. Moderate can refer to being between higher and lower.
[0341] It should be understood that when it is determined that the target object's limb beauty is moderate, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method. That is, when it is determined that the target object's limb beauty is moderate, the electronic device can crop the original image according to the default cropping method to obtain a cropped image. Among them, the default cropping method can be specifically determined according to the actual scene, and the embodiments of the present application do not impose any restrictions on this. For example, the default cropping method can be a face-priority cropping method. For example, the default cropping method can be that the facial center of the target object is located at the upper 1 / 3 of the cropped image, that is, the cropped image can be divided into three equal parts from top to bottom, and the facial center of the target object can be located at the top 1 / 3.
[0342] In other embodiments, the electronic device can determine the limb beauty of the target object according to the limb stretch of the target object. That is, after acquiring the original image including the target object, the electronic device can determine the limb stretch of the target object according to the original image, and can determine the limb beauty of the target object according to the limb stretch of the target object.
[0343] In one example, when it is determined that the target object's limb stretch is high, the electronic device can determine that the target object's limb beauty is high, that is, the target cropping method corresponding to the original image can be determined as a limb-first cropping method. When it is determined that the target object's limb stretch is low, the electronic device can determine that the target object's limb beauty is low, that is, the target cropping method corresponding to the original image can be determined as a face-first cropping method.
[0344] In a possible implementation, the electronic device can determine the limb extension of the target object according to the width of each group of symmetrical joint points in at least two groups of symmetrical joint points. That is, after acquiring the original image including the target object, the electronic device can determine at least two groups of symmetrical joint points of the target object, and can determine the width of each group of symmetrical joint points. Subsequently, the electronic device can determine the limb extension of the target object according to the width of each group of symmetrical joint points.
[0345] It should be understood that each group of symmetrical joint points may refer to laterally symmetrical joint points. That is, each group of symmetrical joint points may include two joint points, and these two joint points are laterally symmetrical joint points. The width of each group of symmetrical joint points may refer to the length of the line between the two joint points included in the group of symmetrical joint points.
[0346] It should be noted that the embodiment of the present application does not impose any specific restrictions on the method of determining the width of the symmetrical joint point, and it can be determined according to the actual scene. For example, an image coordinate system can be established with the upper left vertex or the center point of the original image as the origin, and the coordinates of the symmetrical joint point in the image coordinate system can be determined, so as to determine the width of the symmetrical joint point according to the coordinates of the symmetrical joint point in the image coordinate system.
[0347] In one example, at least two groups of symmetrical joint points may include a symmetrical joint point M and a symmetrical joint point N. The symmetrical joint point M may be a symmetrical joint point whose width may vary within a smaller range. The symmetrical joint point N may be a symmetrical joint point whose width may vary within a larger range.
[0348] Exemplarily, the symmetrical joint points M may include a group of joint points corresponding to the shoulders (i.e., the joint points corresponding to the left shoulder and the joint points corresponding to the right shoulder) and / or a group of joint points corresponding to the pelvis (i.e., the joint points corresponding to the leftmost side of the pelvis and the joint points corresponding to the rightmost side of the pelvis). That is, the symmetrical joint points M may include the joint points corresponding to the left shoulder and the joint points corresponding to the right shoulder, and / or may include the joint points corresponding to the leftmost side of the pelvis and the joint points corresponding to the rightmost side of the pelvis.
[0349] Exemplarily, the symmetrical joint points N may include at least one of a group of joint points corresponding to wrists (i.e., the joint points corresponding to the left wrist and the joint points corresponding to the right wrist), a group of joint points corresponding to knees (i.e., the joint points corresponding to the left knee and the joint points corresponding to the right knee), and a group of joint points corresponding to ankles (i.e., the joint points corresponding to the left ankle and the joint points corresponding to the right ankle).
[0350] That is, after acquiring the original image including the target object, the electronic device can determine the symmetrical joint points M and N of the target object, and can determine the width of the symmetrical joint points M and the width of the symmetrical joint points N. Subsequently, the electronic device can determine the limb extension of the target object based on the width of the symmetrical joint points M and the width of the symmetrical joint points N.
[0351] See also Figure 8 , Figure 8 A schematic diagram of symmetrical joint points provided in an embodiment of the present application is shown.
[0352] like Figure 8 As shown, when the symmetrical joint points M include a group of joint points corresponding to the shoulders, and the symmetrical joint points N include a group of joint points corresponding to the wrists, after acquiring the original image including the target object, the electronic device can determine the width between the joint points corresponding to the left shoulder and the joint points corresponding to the right shoulder according to the original image (hereinafter referred to as width M1). In addition, the electronic device can also determine the width between the joint points corresponding to the left wrist and the joint points corresponding to the right wrist according to the original image (hereinafter referred to as width N1). Subsequently, the electronic device can determine the limb stretch of the target object according to the width M1 and the width N1.
[0353] like Figure 8 As shown, when the symmetrical joint points M include a group of joint points corresponding to the shoulders and a group of joint points corresponding to the pelvis, and the symmetrical joint points N include a group of joint points corresponding to the wrists, after acquiring the original image including the target object, the electronic device can determine the width M1 between the joint points corresponding to the left shoulder and the joint points corresponding to the right shoulder, and the width between the joint points corresponding to the leftmost side of the pelvis and the joint points corresponding to the rightmost side of the pelvis (hereinafter referred to as width M2) according to the original image. In addition, the electronic device can also determine the width N1 between the joint points corresponding to the left wrist and the joint points corresponding to the right wrist according to the original image. Subsequently, the electronic device can determine the limb stretch of the target object according to the width M1, the width M2 and the width N1.
[0354] like Figure 8As shown, when the symmetrical joint points M include a group of joint points corresponding to the shoulder and a group of joint points corresponding to the pelvis, and the symmetrical joint points N include a group of joint points corresponding to the wrist, a group of joint points corresponding to the knee, and a group of joint points corresponding to the ankle, after acquiring the original image including the target object, the electronic device can determine the width M1 between the joint points corresponding to the left shoulder and the joint points corresponding to the right shoulder, and the width M2 between the joint points corresponding to the leftmost side of the pelvis and the joint points corresponding to the rightmost side of the pelvis according to the original image. In addition, the electronic device can also determine the width N1 between the joint points corresponding to the left wrist and the joint points corresponding to the right wrist, the width between the joint points corresponding to the left knee and the joint points corresponding to the right knee (hereinafter referred to as width N2), and the width between the joint points corresponding to the left ankle and the joint points corresponding to the right ankle (hereinafter referred to as width N3) according to the original image. Subsequently, the electronic device can determine the limb stretch of the target object according to the width M1, the width M2, the width N1, the width N2, and the width N3.
[0355] It should be noted that the embodiment of the present application does not impose any specific restrictions on the manner in which the electronic device determines the symmetrical joint points, which can be determined based on actual scenarios.
[0356] It should be understood that when the limb stretch of the target object is higher, the difference between the widths of at least two groups of symmetrical joint points of the target object (hereinafter the difference between the widths of at least two groups of symmetrical joint points may be referred to as width difference) will be greater; when the limb stretch of the target object is lower, the width difference of the target object will be smaller.
[0357] In one example, the electronic device may determine the stretch of the target object's limbs according to the width difference of the target object, so as to determine the aesthetics of the target object's limbs according to the width difference of the target object.
[0358] For example, the electronic device may determine the width difference of the target object as the limb stretch of the target object. Alternatively, a conversion relationship between width difference and limb stretch (hereinafter referred to as conversion relationship R2) may be provided in the electronic device, and the electronic device may determine the limb stretch of the target object based on the width difference and conversion relationship R2. Among them, the conversion relationship R2 between width difference and limb stretch can be specifically determined according to the actual scenario, and the embodiments of the present application are not limited to this. The following will be exemplified by taking the electronic device determining width difference as the limb stretch of the target object as an example.
[0359] Exemplarily, the electronic device may determine the limb aesthetics of the target object based on whether the width difference of the target object is greater than or equal to a threshold (hereinafter referred to as threshold B1) and / or based on whether the width difference of the target object is less than a threshold (hereinafter referred to as threshold B2).
[0360] It should be noted that threshold B1 and threshold B2 may be the same or different. Threshold B1 and threshold B2 may be specific values or value ranges. Among them, the specific value of threshold B1 and the specific value of threshold B2 may be specifically determined according to the actual scenario, and the embodiments of the present application do not impose any restrictions on this. For example, threshold B1 and threshold B2 may be determined based on the width of the symmetrical joint point M and the width of the symmetrical joint point N when the stretch degree of the limbs of the target object and / or other objects is high, and the width of the symmetrical joint point M and the width of the symmetrical joint point N when the stretch degree of the limbs of the target object and / or other objects is low.
[0361] In one example, when threshold B1 is the same as threshold B2, when it is determined that the width difference of the target object is greater than or equal to threshold B1, the electronic device can determine that the target object has a higher degree of limb stretch, that is, it can be determined that the target object has a higher degree of limb aesthetics. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-first cropping method. When it is determined that the width difference of the target object is less than threshold B2, the electronic device can determine that the target object has a lower degree of limb stretch, that is, it can be determined that the target object has a lower degree of limb aesthetics. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-first cropping method.
[0362] In another example, when threshold B1 is different from threshold B2, when it is determined that the width difference of the target object is greater than or equal to threshold B1, the electronic device can determine that the target object's limb stretch is high, that is, it can be determined that the target object's limb beauty is high. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When it is determined that the width difference of the target object is less than threshold B2, the electronic device can determine that the target object's limb stretch is low, that is, it can be determined that the target object's limb beauty is low. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized cropping method. When it is determined that the width difference of the target object is greater than or equal to threshold B2, and it is determined that the width difference of the target object is less than threshold B1, the electronic device can determine that the target object's limb stretch is moderate, that is, it can be determined that the target object's limb beauty is moderate.
[0363] It should be understood that when it is determined that the limb aesthetics of the target object is moderate, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method. The specific content of the default cropping method can refer to the relevant content of the default cropping method in the aforementioned determination of the target cropping method corresponding to the original image according to the limb dynamics of the target object, and will not be repeated here.
[0364] In one example, when the at least two groups of symmetrical joint points include two groups of symmetrical joint points, the electronic device may determine the width difference according to the difference between the widths. For example, the electronic device may determine the difference between the widths of the two groups of symmetrical joint points and may determine the difference as the width difference.
[0365] In another example, when the at least two groups of symmetrical joint points include three or more groups of symmetrical joint points, the electronic device may determine the width difference according to the average value of the difference between the widths. For example, the electronic device may respectively determine the difference between the widths of any two groups of symmetrical joint points, and may determine the average value according to all the differences, so as to determine the average value as the width difference.
[0366] In another example, when the at least two groups of symmetrical joint points include three or more groups of symmetrical joint points, the electronic device may determine the width variability according to the variance or standard deviation of the width. For example, the electronic device may determine the width of each group of symmetrical joint points, and may determine the variance or standard deviation of the width according to the width of each group of symmetrical joint points, so as to determine the variance or standard deviation of the width as the width variability.
[0367] It should be noted that the specific values of the threshold B1 and the threshold B2 in different scenarios can be determined according to the actual scenario. Among them, the threshold B1 in different scenarios may be the same or different, and the threshold B2 in different scenarios may be the same or different. That is, the threshold B1 in the scenario where the width difference is determined according to the difference between the widths, the threshold B1 in the scenario where the width difference is determined according to the average value of the difference between the widths, and the threshold B1 in the scenario where the width difference is determined according to the variance or standard deviation of the width may be the same or different. Similarly, the threshold B2 in the scenario where the width difference is determined according to the difference between the widths, the threshold B2 in the scenario where the width difference is determined according to the average value of the difference between the widths, and the threshold B2 in the scenario where the width difference is determined according to the variance or standard deviation of the width may be the same or different.
[0368] In one example, the electronic device can also determine the binocular distance of the target object (e.g., the distance between the center point of the left eye and the center point of the right eye) based on the original image. When determining the limb stretch of the target object based on the width of at least two groups of symmetrical joint points, for each group of symmetrical joint points, after determining the width of the group of symmetrical joint points, the electronic device can normalize the width of the group of symmetrical joint points based on the binocular distance of the target object. Subsequently, the electronic device can determine the limb stretch of the target object based on the normalized width of each group of symmetrical joint points, so as to reduce the influence of limbs of different body shapes on the determination of limb stretch, improve the accuracy of limb stretch determination, and improve the accuracy of target cropping method determination.
[0369] It should be understood that for each set of symmetrical joint points, the electronic device can normalize the width of the set of symmetrical joint points according to X=L / e, where X is the width of the set of symmetrical joint points after normalization, L is the width of the set of symmetrical joint points before normalization, and e is the binocular distance of the target object.
[0370] In another possible implementation, the electronic device may determine the limb extension of the target object based on the horizontal coordinates of at least two joint points on one side. That is, after acquiring the original image including the target object, the electronic device may determine at least two joint points located on the same side of the target object based on the original image, and may determine the horizontal coordinate of each joint point. Subsequently, the electronic device may determine the limb extension of the target object based on the horizontal coordinates of each joint point.
[0371] Optionally, when it is determined that the number of groups of symmetrical joint points of the target object is less than two groups, the electronic device may determine the limb extension of the target object according to the horizontal coordinates of at least two joint points on one side. That is, when it is determined according to the original image that the number of groups of symmetrical joint points of the target object is less than two groups, for example, when it is determined that the target object contains only one group of symmetrical joint points or no symmetrical joint points, the electronic device may determine the limb extension of the target object according to the horizontal coordinates of at least two joint points on one side.
[0372] For example, when the original image includes a side image of the target object, the electronic device can determine that the number of groups of symmetrical joint points of the target object is less than two groups. At this time, the electronic device can determine the limb stretch of the target object based on the horizontal coordinates of at least two joint points on one side of the target object.
[0373] It should be noted that the electronic device can establish an image coordinate system with the upper left vertex or the center point of the original image as the origin, so as to determine the horizontal coordinate of the joint point according to the image coordinate system.
[0374] In one example, the at least two joint points on one side may include a joint point Q and a joint point W. The joint point Q may be a joint point whose horizontal coordinate may vary within a smaller range. The joint point W may be a joint point whose horizontal coordinate may vary within a larger range. The one side may be the left side of the target object, that is, the joint point Q and the joint point W may be joint points on the left side of the target object. Alternatively, the one side may be the right side of the target object, that is, the joint point Q and the joint point W may be joint points on the right side of the target object.
[0375] Exemplarily, when the unilateral side is the left side of the target object, the joint point Q may include the joint point corresponding to the left shoulder, and / or the joint point corresponding to the leftmost side of the pelvis. The joint point W may include at least one of the joint point corresponding to the left wrist, the joint point corresponding to the left knee, and the joint point corresponding to the left ankle.
[0376] Exemplarily, when the unilateral side is the right side of the target object, the joint point Q may include the joint point corresponding to the right shoulder, and / or the joint point corresponding to the rightmost side of the pelvis. The joint point W may include at least one of the joint point corresponding to the right wrist, the joint point corresponding to the right knee, and the joint point corresponding to the right ankle.
[0377] That is, after acquiring the original image including the target object, the electronic device can determine the joint point Q and the joint point W on one side of the target object, and can determine the horizontal coordinate of the joint point Q and the horizontal coordinate of the joint point W. Subsequently, the electronic device can determine the limb extension degree of the target object according to the horizontal coordinate of the joint point Q and the horizontal coordinate of the joint point W.
[0378] For example, see Fig. 9 , Fig. 9 A schematic diagram of a unilateral joint point provided in an embodiment of the present application is shown.
[0379] like Fig. 9 As shown, when the joint point Q includes the joint point 910 corresponding to the left shoulder and the joint point 911 corresponding to the leftmost side of the pelvis, and the joint point W includes the joint point 920 corresponding to the left wrist, the joint point 921 corresponding to the left knee, and the joint point 922 corresponding to the left ankle, after acquiring the original image including the target object, the electronic device can determine the horizontal coordinate of the joint point 910 corresponding to the left shoulder and the horizontal coordinate of the joint point 911 corresponding to the leftmost side of the pelvis according to the original image. In addition, the electronic device can also determine the horizontal coordinate of the joint point 920 corresponding to the left wrist, the horizontal coordinate of the joint point 921 corresponding to the left knee, and the horizontal coordinate of the joint point 922 corresponding to the left ankle according to the original image. Subsequently, the electronic device can determine the limb stretch of the target object according to the horizontal coordinate of the joint point 910 corresponding to the left shoulder, the horizontal coordinate of the joint point 911 corresponding to the leftmost side of the pelvis, the horizontal coordinate of the joint point 920 corresponding to the left wrist, the horizontal coordinate of the joint point 921 corresponding to the left knee, and the horizontal coordinate of the joint point 922 corresponding to the left ankle.
[0380] It should be noted that when the original image includes a side image of the target object, the higher the limb stretch of the target object, the greater the difference between the horizontal coordinates of at least two joint points on one side of the target object (hereinafter the difference between the horizontal coordinates of at least two joint points may be referred to as horizontal coordinate difference) will be; when the limb stretch of the target object is lower, the horizontal coordinate difference on one side of the target object will be smaller.
[0381] In one example, the electronic device may determine the limb stretch of the target object according to the horizontal coordinate difference on one side of the target object, so as to determine the limb beauty of the target object according to the horizontal coordinate difference on one side of the target object.
[0382] For example, the electronic device may determine the horizontal coordinate difference on one side of the target object as the limb stretch of the target object. Alternatively, a conversion relationship between the horizontal coordinate difference and the limb stretch (hereinafter referred to as the conversion relationship R3) may be provided in the electronic device, and the electronic device may determine the limb stretch of the target object based on the width difference and the conversion relationship R3. Among them, the conversion relationship R3 between the horizontal coordinate difference and the limb stretch can be specifically determined according to the actual scenario, and the embodiments of the present application are not limited to this. The following will be exemplified by taking the electronic device determining the horizontal coordinate difference on one side of the target object as the limb stretch of the target object as an example.
[0383] Exemplarily, the electronic device can determine the limb aesthetics of the target object based on whether the horizontal coordinate difference on one side of the target object is greater than or equal to a threshold (hereinafter referred to as threshold C1), and / or based on whether the horizontal coordinate difference on one side of the target object is less than a threshold (hereinafter referred to as threshold C2).
[0384] It should be noted that the threshold C1 and the threshold C2 may be the same or different. The threshold C1 and the threshold C2 may be specific values or value ranges. Among them, the specific value of the threshold C1 and the specific value of the threshold C2 may be specifically determined according to the actual scenario, and the embodiments of the present application do not impose any restrictions on this. For example, the threshold C1 and the threshold C2 may be determined based on the horizontal coordinates of the joint point Q and the horizontal coordinates of the joint point W when the stretch degree of the limbs of the target object and / or other objects is high, and the horizontal coordinates of the joint point Q and the horizontal coordinates of the joint point W when the stretch degree of the limbs of the target object and / or other objects is low.
[0385] In one example, when threshold C1 is the same as threshold C2, when it is determined that the horizontal coordinate difference of the target object is greater than or equal to threshold C1, the electronic device can determine that the target object has a higher degree of limb stretch, that is, it can be determined that the target object has a higher degree of limb beauty. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-first cropping method. When it is determined that the horizontal coordinate difference of the target object is less than threshold C2, the electronic device can determine that the target object has a lower degree of limb stretch, that is, it can be determined that the target object has a lower degree of limb beauty. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-first cropping method.
[0386] In another example, when threshold C1 is different from threshold C2, when it is determined that the horizontal coordinate difference of the target object is greater than or equal to threshold C1, the electronic device can determine that the target object's limb stretch is high, that is, it can be determined that the target object's limb beauty is high. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When it is determined that the horizontal coordinate difference of the target object is less than threshold C2, the electronic device can determine that the target object's limb stretch is low, that is, it can be determined that the target object's limb beauty is low. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized cropping method. When it is determined that the horizontal coordinate difference of the target object is greater than or equal to threshold C2, and it is determined that the horizontal coordinate difference of the target object is less than threshold C1, the electronic device can determine that the target object's limb stretch is moderate, that is, it can be determined that the target object's limb beauty is moderate.
[0387] It should be understood that when it is determined that the limb aesthetics of the target object is moderate, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method. The specific content of the default cropping method can refer to the relevant content of the default cropping method in the aforementioned determination of the target cropping method corresponding to the original image according to the limb dynamics of the target object, and will not be repeated here.
[0388] In one example, when the at least two joint points on one side include two joint points, the electronic device may determine the horizontal coordinate difference according to the difference between the horizontal coordinates. For example, the electronic device may determine the difference between the horizontal coordinates of the two joint points, and may determine the difference as the horizontal coordinate difference.
[0389] In another example, when the at least two joint points on one side include three or more joint points, the electronic device may determine the horizontal coordinate difference according to the average value of the difference between the horizontal coordinates. For example, the electronic device may determine the difference between the horizontal coordinates of any two joint points, and may determine the average value according to all the differences, so as to determine the average value as the horizontal coordinate difference.
[0390] In another example, when the at least two joint points on a single side include three or more joint points, the electronic device may determine the horizontal coordinate difference according to the variance or standard deviation of the horizontal coordinate. For example, the electronic device may determine the horizontal coordinate of each joint point, may determine the variance or standard deviation of the horizontal coordinate according to the horizontal coordinate of each joint point, and may determine the variance or standard deviation of the horizontal coordinate as the horizontal coordinate difference.
[0391] It should be noted that the specific values of the threshold C1 and the threshold C2 in different scenarios can be determined according to the actual scenario. Among them, the threshold C1 in different scenarios may be the same or different, and the threshold C2 in different scenarios may be the same or different. That is, the threshold C1 in the scenario where the horizontal coordinate difference is determined according to the difference between the horizontal coordinates, the threshold C1 in the scenario where the horizontal coordinate difference is determined according to the average value of the difference between the horizontal coordinates, and the threshold C1 in the scenario where the horizontal coordinate difference is determined according to the variance or standard deviation of the horizontal coordinates may be the same or different. Similarly, the threshold C2 in the scenario where the horizontal coordinate difference is determined according to the difference between the horizontal coordinates, the threshold C2 in the scenario where the horizontal coordinate difference is determined according to the average value of the difference between the horizontal coordinates, and the threshold C2 in the scenario where the horizontal coordinate difference is determined according to the variance or standard deviation of the horizontal coordinates may be the same or different.
[0392] In other embodiments, the electronic device can determine the limb aesthetics of the target object based on the limb twisting degree of the target object. That is, after acquiring the original image including the target object, the electronic device can determine the limb twisting degree of the target object based on the original image, and can determine the limb aesthetics of the target object based on the limb twisting degree of the target object.
[0393] It should be noted that when the degree of limb twisting is high, that is, the degree of twisting of the limb is high, the limb is generally considered to have high aesthetics. When the degree of limb twisting is low, that is, the degree of twisting of the limb is low, the limb is generally considered to have poor aesthetics. In other words, the aesthetics of a limb with a high degree of twisting is generally higher than that of a limb with a low degree of twisting.
[0394] In one example, when it is determined that the target object's limb twisting degree is high, the electronic device may determine that the target object's limb aesthetics is high, that is, the target cropping method corresponding to the original image may be determined to be a limb-first cropping method. When it is determined that the target object's limb twisting degree is low, the electronic device may determine that the target object's limb aesthetics is low, that is, the target cropping method corresponding to the original image may be determined to be a face-first cropping method.
[0395] In a possible implementation, the electronic device may determine the limb torsion degree of the target object according to an angle (hereinafter referred to as angle b) between a line where the shoulders are located and a line where the pelvis is located.
[0396] For example, see Fig.10 , Fig.10 A schematic diagram of the angle b provided in an embodiment of the present application is shown.
[0397] like Fig.10 As shown, angle b may be the angle between a line 1010 where the shoulders are located and a line 1020 where the pelvis is located.
[0398] Exemplarily, the electronic device may determine the angle b as the limb torsion degree of the target object. Alternatively, a conversion relationship between the angle b and the limb torsion degree (hereinafter referred to as conversion relationship R4) may be provided in the electronic device, and the electronic device may determine the limb torsion degree of the target object based on the angle b and the conversion relationship R4. It should be understood that the conversion relationship R4 between the angle b and the limb torsion degree may be specifically determined according to the actual scenario, and the embodiments of the present application are not limited to this. The following will be exemplified by taking the electronic device determining the angle b as the limb torsion degree of the target object as an example.
[0399] It should be noted that when the degree of twisting of the limbs of the target object is high, the angle b is generally large. When the degree of twisting of the limbs of the target object is low, the angle b is generally small. That is, when the degree of twisting of the limbs of the target object is higher, the angle b will be larger; when the degree of twisting of the limbs of the target object is lower, the angle b will be smaller.
[0400] In one example, the electronic device can determine the target object's limb aesthetics based on whether the target object's limb twisting degree is greater than or equal to a threshold (hereinafter referred to as threshold D1) and / or based on whether the target object's limb twisting degree is less than a threshold (hereinafter referred to as threshold D2).
[0401] It should be noted that threshold D1 and threshold D2 may be the same or different. Threshold D1 and threshold D2 may be specific values or value ranges. The specific value of threshold D1 and the specific value of threshold D2 may be determined based on the actual scenario, and the embodiments of the present application do not impose any restrictions on this. For example, threshold B1 and threshold B2 may be determined based on the angle b when the degree of twisting of the limbs of the target object and / or other objects is high, and the angle b when the degree of twisting of the limbs of the target object and / or other objects is low.
[0402] In one example, when threshold D1 is the same as threshold D2, when it is determined that angle b is greater than or equal to threshold D1, the electronic device can determine that the target object's limb twisting degree is high, that is, it can be determined that the target object's limb aesthetics is high, and at this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When it is determined that angle b is less than threshold D2, the electronic device can determine that the target object's limb twisting degree is low, that is, it can be determined that the target object's limb aesthetics is low, and at this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized cropping method.
[0403] In another example, when threshold D1 is different from threshold D2, when it is determined that angle b is greater than or equal to threshold D1, the electronic device can determine that the target object's limb twisting degree is high, that is, it can be determined that the target object's limb aesthetics is high. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When it is determined that angle b is less than threshold D2, the electronic device can determine that the target object's limb twisting degree is low, that is, it can be determined that the target object's limb aesthetics is low. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized cropping method. When it is determined that angle b is greater than or equal to threshold D2, and angle b is less than threshold D1, the electronic device can determine that the target object's limb twisting degree is moderate, that is, it can be determined that the target object's limb aesthetics is moderate.
[0404] It should be understood that when it is determined that the limb aesthetics of the target object is moderate, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method. The specific content of the default cropping method can refer to the relevant content of the default cropping method in the aforementioned determination of the target cropping method corresponding to the original image according to the limb dynamics of the target object, and will not be repeated here.
[0405] In other embodiments, the electronic device can determine the limb aesthetics of the target object according to the limb dynamics and limb extension of the target object. That is, after acquiring the original image including the target object, the electronic device can determine the limb dynamics and limb extension of the target object according to the original image, and can determine the limb aesthetics of the target object according to the limb dynamics and limb extension of the target object, so that the limb aesthetics of the target object can be determined by comprehensively considering the limb dynamics and limb extension, which can improve the accuracy of determining the limb aesthetics, thereby improving the accuracy of determining the target cropping method and improving the aesthetics of the cropped image.
[0406] In one possible implementation, when it is determined that the target object's limb dynamics are high and the target object's limb stretch is high, the electronic device can determine that the target object's limb aesthetics are high, that is, the target cropping method corresponding to the original image can be determined as a limb-priority cropping method.
[0407] When it is determined that the target object's limb dynamics are low and the target object's limb stretch is low, the electronic device can determine that the target object's limb aesthetics are low, that is, it can determine that the target cropping method corresponding to the original image is a face-priority cropping method.
[0408] When it is determined that the target object's limb dynamics is high and the target object's limb extension is low, or when it is determined that the target object's limb dynamics is low and the target object's limb extension is high, or when it is determined that the target object's limb dynamics is moderate, or when it is determined that the target object's limb extension is moderate, the electronic device can determine that the target object's limb aesthetics is moderate, that is, it can determine that the target cropping method corresponding to the original image is the default cropping method.
[0409] In other embodiments, the electronic device can determine the limb aesthetics of the target object based on the limb dynamics and limb torsion of the target object. That is, after acquiring the original image including the target object, the electronic device can determine the limb dynamics and limb torsion of the target object based on the original image, and can determine the limb aesthetics of the target object based on the limb dynamics and limb torsion of the target object. By comprehensively considering the limb dynamics and limb torsion to determine the limb aesthetics of the target object, the accuracy of determining the limb aesthetics can be improved, thereby improving the accuracy of determining the target cropping method and improving the aesthetics of the cropped image.
[0410] In one possible implementation, when it is determined that the target object's limb dynamics are high and the target object's limb torsion is high, the electronic device can determine that the target object's limb aesthetics are high, that is, it can determine that the target cropping method corresponding to the original image is a limb-priority cropping method.
[0411] When it is determined that the target object's limb dynamics are low and the target object's limb torsion is low, the electronic device can determine that the target object's limb aesthetics are low, that is, it can determine that the target cropping method corresponding to the original image is a face-priority cropping method.
[0412] When it is determined that the target object's limb dynamics is high and the target object's limb torsion is low, or when it is determined that the target object's limb dynamics is low and the target object's limb torsion is high, or when it is determined that the target object's limb dynamics is moderate, or when it is determined that the target object's limb torsion is moderate, the electronic device can determine that the target object's limb aesthetics is moderate, that is, it can determine that the target cropping method corresponding to the original image is the default cropping method.
[0413] In other embodiments, the electronic device can determine the limb aesthetics of the target object according to the limb extension and limb torsion of the target object. That is, after acquiring the original image including the target object, the electronic device can determine the limb extension and limb torsion of the target object according to the original image, and can determine the limb aesthetics of the target object according to the limb extension and limb torsion of the target object, so as to comprehensively consider the limb extension and limb torsion to determine the limb aesthetics of the target object, which can improve the accuracy of determining the limb aesthetics, thereby improving the accuracy of determining the target cropping method and improving the aesthetics of the cropped image.
[0414] In one possible implementation, when it is determined that the target object's limb stretch is high and the target object's limb twist is high, the electronic device can determine that the target object's limb aesthetics is high, that is, it can determine that the target cropping method corresponding to the original image is a limb-priority cropping method.
[0415] When it is determined that the target object's limb stretch is low and the target object's limb twist is low, the electronic device can determine that the target object's limb beauty is low, that is, it can determine that the target cropping method corresponding to the original image is a face-priority cropping method.
[0416] When it is determined that the target object's limb stretch is high and the target object's limb twisting is low, or when it is determined that the target object's limb stretch is low and the target object's limb twisting is high, or when it is determined that the target object's limb stretch is moderate, or when it is determined that the target object's limb twisting is moderate, the electronic device can determine that the target object's limb aesthetics is moderate, that is, it can determine that the target cropping method corresponding to the original image is the default cropping method.
[0417] See also Fig.11 , Fig.11 The application scenario provided by the embodiment of the present application is shown Figure 1 This application scenario is illustrated by taking the limb extension as the width difference and the limb twisting as the angle b as an example. Fig.11 The horizontal axis is the degree of limb twisting, and the vertical axis is the degree of limb extension.
[0418] like Fig.11 As shown, by analyzing a large number of sample images, it is found that when the target object's limb extension and limb twisting are located in area 1110, it can be considered that the target object's limb aesthetics is high, that is, the target object's limb extension is high, and the target object's limb twisting is high.
[0419] When the limb extension and limb twist of the target object are in area 1120, it can be considered that the limb aesthetics of the target object is low, that is, the limb extension of the target object is low, and the limb twist of the target object is low.
[0420] When the target object's limb extension and limb torsion are neither located in area 1110 nor in area 1120, it can be considered that the target object's limb aesthetics is moderate, that is, the target object's limb extension can be considered to be high, and the target object's limb torsion can be considered to be low; or, the target object's limb extension can be considered to be low, and the target object's limb torsion can be considered to be high; or, the target object's limb extension can be considered to be moderate; or, the target object's limb torsion can be considered to be moderate.
[0421] That is Fig.11 It can be seen that the threshold value B1 corresponding to the limb extension degree can be 13, and the threshold value B2 can be 7. The threshold value D1 corresponding to the limb twist degree can be 7, and the threshold value D2 can be 4.
[0422] That is, when it is determined that the target object's limb extension is greater than or equal to 13, and the target object's limb twisting is greater than or equal to 7, the electronic device can determine that the target object's limb extension is high, and can determine that the target object's limb twisting is high, that is, it can be determined that the target object's limb aesthetics is high. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a limb-priority cropping method.
[0423] When it is determined that the target object's limb extension is less than 7 and the target object's limb twist is less than 4, the electronic device can determine that the target object's limb extension is low and the target object's limb twist is low, that is, the target object's limb aesthetics is low. At this time, the electronic device can determine that the target cropping method corresponding to the original image is a face-priority cropping method.
[0424] When it is determined that the target object's limb extension is greater than or equal to 13, and the target object's limb twist is less than 4, the electronic device can determine that the target object's limb extension is high, and can determine that the target object's limb twist is low, that is, it can be determined that the target object's limb aesthetics is moderate. At this time, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method.
[0425] When it is determined that the target object's limb extension is less than 7, and the target object's limb twist is greater than or equal to 7, the electronic device can determine that the target object's limb extension is low, and can determine that the target object's limb twist is high, that is, it can be determined that the target object's limb aesthetics is moderate. At this time, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method.
[0426] When it is determined that the target object's limb stretch is greater than or equal to 7, and the target object's limb stretch is less than 13, or when it is determined that the target object's limb twist is greater than or equal to 4, and the target object's limb twist is less than 7, the electronic device can determine that the target object's limb beauty is moderate. At this time, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method.
[0427] In other embodiments, the electronic device can determine the limb aesthetics of the target object according to the limb dynamics, limb extension and limb torsion of the target object. That is, after acquiring the original image including the target object, the electronic device can determine the limb dynamics, limb extension and limb torsion of the target object according to the original image, and can determine the limb aesthetics of the target object according to the limb dynamics, limb extension and limb torsion of the target object. By comprehensively considering the limb dynamics, limb extension and limb torsion, the limb aesthetics of the target object is determined, which can improve the accuracy of determining the limb aesthetics, thereby improving the accuracy of determining the target cropping method and improving the aesthetics of the cropped image.
[0428] In one possible implementation, when it is determined that the target object's limb dynamics, limb extension, and limb torsion are all high, that is, when it is determined that the target object's limb dynamics are high, it is determined that the target object's limb extension is high, and it is determined that the target object's limb torsion is high, the electronic device can determine that the target object's limb aesthetics is high, that is, it can determine that the target cropping method corresponding to the original image is a limb-priority cropping method.
[0429] When it is determined that the target object's limb dynamics, limb extension, and limb torsion are all low, that is, when it is determined that the target object's limb dynamics are low, it is determined that the target object's limb extension is low, and it is determined that the target object's limb torsion is low, the electronic device can determine that the target object's limb aesthetics is low, that is, it can determine that the target cropping method corresponding to the original image is a face-priority cropping method.
[0430] When it is determined that one or two of the target object's limb dynamics, limb extension and limb torsion are high, or when it is determined that at least one of the target object's limb dynamics, limb extension and limb torsion is moderate, the electronic device can determine that the target object's limb aesthetics is moderate, that is, it can determine that the target cropping method corresponding to the original image is the default cropping method.
[0431] 2. The electronic device determines the facial beauty of the target object, and determines the original Target cropping method corresponding to the initial image ;
[0432] See also Fig.12 , Fig.12The flowchart of determining the target cropping method corresponding to the original image according to the facial beauty of the target object provided by the embodiment of the present application is shown. For example, the facial beauty may include the expression beauty.
[0433] like Fig.12 As shown, after acquiring the original image including the target object, the electronic device can determine the facial beauty of the target object based on the original image. When it is determined that the facial beauty of the target object is high, for example, when it is determined that the facial expression of the target object is tense, the electronic device can determine that the target cropping method corresponding to the original image is a face-priority cropping method. When it is determined that the facial beauty of the target object is low, for example, when it is determined that the facial expression of the target object is dull, the electronic device can determine that the target cropping method corresponding to the original image is a limb-priority cropping method.
[0434] That is, when cropping the original image, if it is determined that the target object's facial expression is tense, the electronic device can crop the original image in a cropping manner that highlights the facial expression, so that the cropped image can retain the target object's more beautiful facial expression, which can improve the beauty of the cropped image and enhance the user experience. When the target object's facial expression is dull, the electronic device can crop the original image in a cropping manner that prioritizes retaining limbs, which can reduce the proportion of the less beautiful face in the cropped image, improve the beauty of the cropped image, and enhance the user experience.
[0435] In a possible implementation, the electronic device can determine the facial beauty of the target object based on the target object's expression arousal (arousal, A) and expression pleasantness (pleasantness, P). That is, after acquiring an original image including the target object, the electronic device can determine the target object's expression arousal A and expression pleasantness P based on the original image, and can determine the target object's facial beauty based on the target object's expression arousal A and expression pleasantness P.
[0436] In some embodiments, when the absolute value of the expression arousal degree A is less than a certain threshold value (hereinafter referred to as threshold value E), and the absolute value of the expression pleasure degree P is less than a certain threshold value (hereinafter referred to as threshold value F), the electronic device can determine that the facial beauty of the target object is low, that is, it can be determined that the facial expression of the target object is dull. When the absolute value of the expression arousal degree A is greater than or equal to the threshold value E, or the absolute value of the expression pleasure degree P is greater than or equal to the threshold value F, the electronic device can determine that the facial beauty of the target object is high, that is, it can be determined that the facial expression of the target object has tension.
[0437] It should be understood that threshold E and threshold F can be specifically determined according to the actual scenario, and the embodiments of the present application do not impose any limitations on this.
[0438] It should be noted that the expression arousal degree A can be used to measure the degree (or intensity) of emotion. The expression pleasure degree P can be used to measure the positivity of emotion. Among them, the determination method of the expression arousal degree A and the expression pleasure degree P can be specifically determined according to the actual scene, and the embodiment of the present application does not limit this.
[0439] For example, after acquiring the original image including the target object, the electronic device can directly determine the target object's facial arousal degree A and facial pleasure degree P based on the original image. The electronic device can directly determine the target object's facial arousal degree A and facial pleasure degree P based on the original image in any existing manner.
[0440] For example, after acquiring an original image including a target object, the electronic device can determine the expression category of the target object based on the original image, and can determine the expression arousal degree A and the expression pleasure degree P of the target object based on the correspondence between the expression category of the target object and the expression arousal degree A and the expression pleasure degree P.
[0441] It should be understood that the method for determining the expression category can be specifically determined according to the actual scenario, and the embodiments of the present application do not impose any restrictions on this. The correspondence between the expression category and the expression arousal degree A and the expression pleasure degree P can be specifically determined according to the actual scenario, and the embodiments of the present application do not impose any restrictions on this.
[0442] For example, see Fig.13 , Fig.13 An example diagram showing the correspondence between an expression category and expression arousal and expression pleasure.
[0443] Fig.13 The horizontal axis is the expression pleasure P, and the vertical axis is the expression arousal A.
[0444] like Fig.13 As shown, when the expression category is excitement, like / love, happiness, pride, curiosity, approval, anger / anger, fear, sadness, pain, surprise or flattery, the absolute value of the expression arousal A corresponding to the expression category is greater than or equal to the threshold E, or the absolute value of the expression pleasure P of the expression category is greater than or equal to the threshold F. When the expression category is satisfaction, calmness, laziness, shame, boredom, boredom, speechlessness, helplessness or fatigue, the absolute value of the expression arousal A corresponding to the expression category is greater than or equal to the threshold E, or the absolute value of the expression pleasure P of the expression category is greater than or equal to the threshold F.
[0445] That is, when the target object's facial expression category is determined to be excitement, like / love, happiness, pride, curiosity, approval, anger / anger, fear, sadness, pain, surprise or flattery, the electronic device can determine that the absolute value of the facial arousal degree A corresponding to the facial expression category is greater than or equal to the threshold E, or can determine that the absolute value of the facial pleasure degree P of the facial expression category is greater than or equal to the threshold F. At this time, the electronic device can determine that the target object's facial expression has tension, that is, it can be determined that the target object's facial beauty is high. Therefore, the electronic device can determine that the target cropping method corresponding to the original image is a face-priority cropping method.
[0446] When the target object's expression category is determined to be satisfied, calm, lazy, ashamed, annoyed, bored, speechless, helpless or tired, the electronic device can determine that the absolute value of the expression arousal degree A corresponding to the expression category is greater than or equal to the threshold E, or can determine that the absolute value of the expression pleasure degree P of the expression category is greater than or equal to the threshold F. At this time, the electronic device can determine that the expression of the target object is relatively plain, that is, it can be determined that the facial beauty of the target object is low. Therefore, the electronic device can determine that the target cropping method corresponding to the original image is a limb-first cropping method.
[0447] In some embodiments, when it is determined that the original image does not include the facial image of the target object, for example, when the original image is an image including the back of the target object, the electronic device can directly determine that the facial beauty of the target object is low, that is, it can determine that the target cropping method corresponding to the original image is a limb-priority cropping method.
[0448] 3. The electronic device determines the target object's limb beauty and facial beauty, and Aesthetics and facial beauty,determine the target cropping method corresponding to the original image;
[0449] See also Fig.14 , Fig.14 A schematic diagram of a process for determining a target cropping method corresponding to an original image according to the limb beauty and facial beauty of a target object provided in an embodiment of the present application is shown.
[0450] like Fig.14 As shown, after acquiring the original image including the target object, the electronic device can determine the limb aesthetics of the target object based on the original image. When it is determined that the limb aesthetics of the target object is low, the electronic device can determine that the target cropping method corresponding to the original image is a face-first cropping method, so as to reduce the proportion of the limbs with poor aesthetics in the cropped image and improve the aesthetics of the cropped image.
[0451] When it is determined that the target object's limbs are more aesthetically pleasing, the electronic device can determine the target object's facial aesthetics. When it is determined that the target object's facial aesthetics are more aesthetically pleasing, the electronic device can determine that the target cropping method corresponding to the original image is a face-priority cropping method, so that the cropped image can retain the target object's more aesthetically pleasing facial expression, and can improve the aesthetics of the cropped image. When it is determined that the target object's facial aesthetics are less aesthetically pleasing, the electronic device can determine that the target cropping method corresponding to the original image is a limb-priority cropping method, so that the cropped image can retain the target object's more aesthetically pleasing limbs, can reduce the proportion of the face with less aesthetics in the cropped image, and can improve the aesthetics of the cropped image.
[0452] In one example, if Fig.14 As shown, after acquiring the original image including the target object, the electronic device can detect whether the original image includes a facial image. When no facial image is detected in the original image, for example, when the original image is an image including the back of the target object, the electronic device can directly determine that the target cropping method corresponding to the original image is a limb-first cropping method. In other words, when the electronic device does not detect a facial image in the original image, the electronic device can directly crop the original image using a limb-first cropping method.
[0453] It should be noted that Fig.14 The first determination of the target object's limb aesthetics, and then the determination of the target object's facial aesthetics is only an exemplary explanation, and should not be understood as a limitation on the embodiments of the present application. The embodiments of the present application do not limit the order of determining the target object's limb aesthetics and facial aesthetics, and the target object's limb aesthetics and facial aesthetics may be determined simultaneously, or the target object's limb aesthetics may be determined first, and then the target object's facial aesthetics may be determined, or the target object's facial aesthetics may be determined first, and then the target object's limb aesthetics may be determined. Among them, the specific content of determining the target object's limb aesthetics and facial aesthetics can refer to the aforementioned related content of determining the target object's limb aesthetics and facial aesthetics, which will not be repeated here.
[0454] In the embodiment of the present application, after determining the target cropping mode corresponding to the original image, the electronic device can crop the original image according to the target cropping mode to obtain a cropped image. The process of the electronic device cropping the original image according to the target cropping mode to obtain a cropped image is described in detail below.
[0455] In some embodiments, after acquiring an original image including a target object, the electronic device may determine the facial orientation of the target object based on the original image. After determining the target cropping method corresponding to the original image, the electronic device may crop the original image based on the facial orientation of the target object and the target cropping method to obtain a cropped image.
[0456] Exemplarily, the electronic device may determine the target position of the target object in the cropped image according to the facial orientation of the target object, and may crop the original image according to the target position of the target object in the cropped image and the target cropping method to obtain a cropped image in which the target object is located at the target position. It should be understood that the facial orientation of the target object may include front, side, and back. Among them, the front may refer to the original image including the front of the face of the target object. The side may refer to the original image including the side of the face of the target object. The back may refer to the original image not including the face of the target object.
[0457] See also Fig.15 , Fig.15 FIG. 1 is a flow chart of another image cropping method provided by an embodiment of the present application. Figure 6 The example of determining the target cropping method corresponding to the original image according to the beauty of the limbs is used to exemplify the cropping of the original image according to the target cropping method.
[0458] like Fig.15 As shown, after determining the target cropping method according to the limb beauty, the electronic device can determine the target position of the target object in the cropped image according to the facial orientation of the target object, and can crop the original image according to the target position of the target object in the cropped image and the target cropping method. Figure 6 The content shown is related to determining the target cutting method based on the aesthetics of the limbs.
[0459] In a possible implementation, when the face of the target object is facing forward or backward, the electronic device can determine that the target position of the target object in the cropped image is the middle position. At this time, the electronic device can crop the original image according to the middle position of the target object in the cropped image and the target cropping method to obtain the cropped image. That is, when the original image is cropped according to the target cropping method, the original image can be cropped in a manner that the target object is located in the middle position of the cropped image.
[0460] It should be understood that the target position of the target object in the cropped image may refer to the position of the center point of the target object on the horizontal coordinate. That is, the target position of the target object in the cropped image as the middle position may mean that the horizontal coordinate of the center point of the target object is the same as the horizontal coordinate of the center point of the cropped image.
[0461] See also Fig.16 , Fig.16 The application scenario provided by the embodiment of the present application is shown Figure 2 This application scenario is illustrated by taking the target cropping method as a limb-first cropping method as an example.
[0462] Electronic equipment according to Fig.16 In the original image shown in (a), it can be determined that the face orientation of the target object is positive. Therefore, when cropping the original image, the electronic device can determine that the target position of the target object in the cropped image is the middle position according to the face orientation of the target object (ie, positive).
[0463] For example, when it is determined that the original aspect ratio of the original image is greater than a preset aspect ratio (such as the preset aspect ratio P1), the electronic device may crop the original image with the target object located in the middle of the cropped image when cropping the original image according to the limb-first cropping method. Fig.16 The cropped image shown in (b).
[0464] For example, when it is determined that the original aspect ratio of the original image is less than a preset aspect ratio (e.g., preset aspect ratio P2), the electronic device can scale up the original image according to the preset aspect ratio P2. If the aspect ratio of the enlarged original image is greater than the preset aspect ratio P2, the electronic device can crop the enlarged original image with the target object located in the middle of the cropped image when cropping the enlarged original image according to the limb-first cropping method. For example, it can be obtained Fig.16 The cropped image shown in (c) in .
[0465] In another possible implementation, when the face orientation of the target object is sideways, the electronic device can determine the offset distance of the target object according to a preset aspect ratio, and can determine the offset direction of the target object according to the face orientation of the target object. The preset aspect ratio, for example, can be the aspect ratio of the screen of the electronic device, or the aspect ratio of a certain software avatar frame, etc. Subsequently, the electronic device can determine the target position of the target object in the cropped image according to the offset direction and offset distance of the target object. The aspect ratio can be the ratio of the length (i.e., the length in the horizontal direction) to the width (i.e., the width in the vertical direction). The offset distance can refer to the distance of the target position of the target object in the cropped image relative to the middle position of the cropped image.
[0466] In one example, when the face of the target object is facing left, the electronic device may determine that the offset direction of the target object is right. That is, when it is determined that the face of the target object is facing left, the electronic device may determine that the target position of the target object in the cropped image may be biased to the right side of the cropped image.
[0467] In another example, when the face of the target object is facing rightward, the electronic device may determine that the offset direction of the target object is leftward. When it is determined that the face of the target object is facing rightward, the electronic device may determine that the target position of the target object in the cropped image may be biased to the left side of the cropped image.
[0468] Exemplarily, the electronic device may determine the offset rate corresponding to the target object based on the relationship between the preset aspect ratio and the offset rate, and may determine the offset distance of the target object based on the preset aspect ratio and the offset rate corresponding to the target object. The offset rate corresponding to the target object may refer to the ratio of the offset distance corresponding to the target object to half of the length corresponding to the preset aspect ratio. That is, offset rate = offset distance: (length corresponding to the preset aspect ratio / 2). For example, when the preset aspect ratio is the aspect ratio of the screen of the electronic device, the length corresponding to the preset aspect ratio may be the length of the screen of the electronic device. For example, when the preset aspect ratio is the aspect ratio of a certain software avatar frame, the length corresponding to the preset aspect ratio may be the length of the software avatar frame.
[0469] In one example, the relationship between the preset aspect ratio (x) and the offset ratio (y) may be y=0.1307ln(x)+0.2543.
[0470] Optionally, the relationship between the preset aspect ratio (x) and the offset ratio (y) may be represented by a curve.
[0471] See also Fig.17 , Fig.17 A schematic diagram showing the relationship between the preset aspect ratio and the offset rate corresponding to the target object provided in an embodiment of the present application is shown. Fig.17 The horizontal axis is the preset aspect ratio, and the vertical axis is the offset rate.
[0472] like Fig.17 As shown, when the preset aspect ratio is 0.793:1, the electronic device can determine that the offset rate corresponding to the target object is 0.21, that is, the offset distance of the target object can be determined to be (the length corresponding to the preset aspect ratio / 2)*0.21. When the preset aspect ratio is 4:3, the electronic device can determine that the offset rate corresponding to the target object is 0.3, that is, the offset distance of the target object can be determined to be (the length corresponding to the preset aspect ratio / 2)*0.3. When the preset aspect ratio is 7:3, the electronic device can determine that the offset rate corresponding to the target object is 0.35, that is, the offset distance of the target object can be determined to be (the length corresponding to the preset aspect ratio / 2)*0.35. When the preset aspect ratio is 10:3, the electronic device can determine that the offset rate corresponding to the target object is 0.41, that is, the offset distance of the target object can be determined to be (the length corresponding to the preset aspect ratio / 2)*0.41.
[0473] See also Fig.18 , Fig.18 The application scenario provided by the embodiment of the present application is shown Figure 3 This application scenario is illustrated by taking the target cropping method as a limb-first cropping method as an example.
[0474] Electronic equipment according to Fig.18 In the original image shown in (a) of FIG. 1 , it can be determined that the face orientation of the target object is toward the left. Therefore, when cropping the original image, the electronic device can determine that the offset direction of the target object is toward the right according to the face orientation of the target object (ie, toward the left).
[0475] For example, when the original image needs to be cropped into a cropped image with a preset aspect ratio P1, the electronic device can determine the offset rate corresponding to the target object according to the preset aspect ratio P1, and can determine the offset distance of the target object according to the preset aspect ratio P1 and the offset rate corresponding to the target object. Subsequently, the electronic device can determine the target position of the target object in the cropped image according to the offset direction (i.e., to the right) and the offset distance of the target object. Therefore, when the original image is cropped according to the limb-first cropping method, the electronic device can crop the original image according to the target position of the target object in the cropped image. For example, the following can be obtained: Fig.18 The cropped image shown in (b).
[0476] For example, when the original image needs to be cropped into a cropped image with a preset aspect ratio P2, the electronic device can determine the offset rate corresponding to the target object according to the preset aspect ratio P2, and can determine the offset distance of the target object according to the preset aspect ratio P2 and the offset rate corresponding to the target object. Subsequently, the electronic device can determine the target position of the target object in the cropped image according to the offset direction (i.e., to the right) and the offset distance of the target object. When cropping the original image according to the limb-first cropping method, the electronic device can crop the original image according to the target position of the target object in the cropped image. For example, the following can be obtained: Fig.18 The cropped image shown in (c) in .
[0477] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0478] Corresponding to the image cropping method described in the above embodiment, the embodiment of the present application further provides an image cropping device, and each module of the device can correspond to each step of the image cropping method.
[0479] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0480] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0481] The present application also provides an electronic device, the electronic device comprising at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor, wherein when the processor executes the computer program, the electronic device implements the steps in any of the above-mentioned method embodiments. Exemplarily, the structure of the electronic device can be as follows: Figure 2 shown.
[0482] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a computer, the computer implements the steps in any of the above method embodiments.
[0483] An embodiment of the present application provides a computer program product. When the computer program product is executed on an electronic device, the electronic device implements the steps in any of the above method embodiments.
[0484] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include at least: any entity or device that can carry the computer program code to the device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0485] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0486] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0487] In the embodiments provided in the present application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0488] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0489] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. An image cropping method, characterized in that: include: Acquire an original image, wherein the original image includes a target object; Determining the limb beauty of the target object, and / or determining the facial beauty of the target object; Determining a target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty; The original image is cropped according to the target cropping method to obtain a cropped image, where the cropped image includes all or part of the target object.
2. The method according to claim 1, characterized in that Determining the limb aesthetics of the target object includes: Determining the limb dynamics of the target object, where the limb dynamics is used to characterize the motion state of the target object; The limb aesthetics of the target object is determined according to the limb dynamics.
3. The method according to claim 2, characterized in that Determining the limb dynamics of the target object includes: Acquire a first angle corresponding to the target object, where the first angle is an angle between a line between the top of the head and the midpoint of the pelvis of the target object and a vertical direction; The limb dynamics of the target object is determined according to the first angle.
4. The method according to claim 2 or 3, characterized in that: The step of determining the limb aesthetics of the target object according to the limb dynamics comprises: When the limb dynamics is greater than or equal to a first threshold, determining that the limb aesthetics of the target object meets a first condition; When the limb dynamics is less than a second threshold, it is determined that the limb aesthetics of the target object meets a second condition, and the first threshold is greater than or equal to the second threshold.
5. The method according to claim 2 or 3, characterized in that: The step of determining the limb aesthetics of the target object according to the limb dynamics comprises: Determine the limb stretch of the target object, where the limb stretch is used to characterize the stretch degree of the limb of the target object; The limb aesthetics of the target object is determined according to the limb dynamics and the limb stretch.
6. The method according to claim 5, characterized in that The step of determining the limb aesthetics of the target object according to the limb dynamics and the limb stretch includes: When the limb dynamics is greater than or equal to a first threshold, and the limb stretch is greater than or equal to a third threshold, it is determined that the limb aesthetics of the target object meets a first condition; When the limb dynamics is less than the second threshold, and the limb stretch is less than the fourth threshold, it is determined that the limb aesthetics of the target object meets the second condition; The first threshold is greater than or equal to the second threshold, and the third threshold is greater than or equal to the fourth threshold.
7. The method according to claim 2 or 3, characterized in that: The step of determining the limb aesthetics of the target object according to the limb dynamics comprises: Determining a limb torsion degree of the target object, wherein the limb torsion degree is used to characterize a degree of torsion of the limb of the target object; The limb aesthetics of the target object is determined according to the limb dynamics and the limb twisting degree.
8. The method according to claim 7, characterized in that The step of determining the limb aesthetics of the target object according to the limb dynamics and the limb torsion comprises: When the limb dynamics is greater than or equal to a first threshold, and the limb twisting is greater than or equal to a fifth threshold, it is determined that the limb aesthetics of the target object meets a first condition; When the limb dynamics is less than the second threshold, and the limb twisting is less than the sixth threshold, it is determined that the limb aesthetics of the target object meets the second condition; Among them, the first threshold is greater than or equal to the second threshold, and the fifth threshold is greater than or equal to the sixth threshold.
9. The method according to claim 2 or 3, characterized in that: The step of determining the limb aesthetics of the target object according to the limb dynamics comprises: The limb extension and limb twist of the target object are determined, and the limb aesthetics of the target object is determined according to the limb dynamics, the limb extension and the limb twist.
10. The method according to claim 1, characterized in that Determining the limb aesthetics of the target object includes: Determining the limb extension of the target object; The limb aesthetics of the target object is determined according to the limb stretch.
11. The method according to claim 10, characterized in that Determining the limb extension of the target object includes: Determine a first width and a second width, wherein the first width is a width of a first symmetrical joint point of the target object, and the second width is a width of a second symmetrical joint point of the target object; The limb extension degree of the target object is determined according to the first width and the second width.
12. The method according to claim 11, characterized in that The first symmetrical joint points include a group of joint points corresponding to the shoulder and / or a group of joint points corresponding to the pelvis, and the second symmetrical joint points include at least one of a group of joint points corresponding to the wrist, a group of joint points corresponding to the knee, and a group of joint points corresponding to the ankle.
13. The method according to claim 10, characterized in that Determining the limb extension of the target object includes: Determine a first horizontal coordinate and a second horizontal coordinate, wherein the first horizontal coordinate is the horizontal coordinate of a first target joint point of the target object, and the second horizontal coordinate is the horizontal coordinate of a second target joint point of the target object, and the first target joint point and the second target joint point are joint points on the same side of the target object; The limb extension degree of the target object is determined according to the first horizontal coordinate and the second horizontal coordinate.
14. The method according to claim 13, characterized in that The first target joint point includes a joint point corresponding to the shoulder and / or a joint point corresponding to the pelvis, and the second target joint point includes at least one of a joint point corresponding to the wrist, a joint point corresponding to the knee, and a joint point corresponding to the ankle.
15. The method according to any one of claims 10 to 14, characterized in that The step of determining the limb aesthetics of the target object according to the limb stretch comprises: When the limb stretch is greater than or equal to a third threshold, it is determined that the limb aesthetics of the target object meets a first condition; When the limb stretch is less than a fourth threshold, it is determined that the limb aesthetics of the target object meets the second condition, and the third threshold is greater than or equal to the fourth threshold.
16. The method according to any one of claims 10 to 15, characterized in that The step of determining the limb aesthetics of the target object according to the limb stretch comprises: The limb torsion degree of the target object is determined, and the limb aesthetics of the target object is determined according to the limb stretch degree and the limb torsion degree.
17. The method according to claim 16, characterized in that The step of determining the limb aesthetics of the target object according to the limb extension and the limb twisting comprises: When the limb extension is greater than or equal to the third threshold, and the limb twisting is greater than or equal to the fifth threshold, it is determined that the limb aesthetics of the target object meets the first condition; When the limb extension is less than the fourth threshold, and the limb twisting is less than the sixth threshold, it is determined that the limb aesthetics of the target object meets the second condition; Among them, the third threshold is greater than or equal to the fourth threshold, and the fifth threshold is greater than or equal to the sixth threshold.
18. The method according to claim 1, characterized in that Determining the limb aesthetics of the target object includes: determining a degree of limb twisting of the target subject; The limb aesthetics of the target object is determined according to the limb twisting degree.
19. The method according to claim 18, characterized in that Determining the limb torsion degree of the target object includes: Acquire a second angle corresponding to the target object, where the second angle is an angle between a first line and a second line, where the first line is a line corresponding to a third symmetric joint point of the target object, and the second line is a line corresponding to a fourth symmetric joint point of the target object; The limb twisting degree of the target object is determined according to the second angle.
20. The method according to claim 19, characterized in that The third symmetrical joint points include a group of joint points corresponding to the shoulders, and the fourth symmetrical joint points include a group of joint points corresponding to the pelvis.
21. The method according to any one of claims 18 to 20, characterized in that The step of determining the limb aesthetics of the target object according to the limb twisting degree comprises: When the limb twisting degree is greater than or equal to a fifth threshold, determining that the limb aesthetics of the target object meets a first condition; When the limb twisting degree is less than the sixth threshold, it is determined that the limb aesthetics of the target object meets the second condition, and the fifth threshold is greater than or equal to the sixth threshold.
22. The method according to claim 1, characterized in that Determining the facial aesthetics of the target object includes: The facial arousal degree and the facial pleasure degree of the target object are determined, and the facial beauty degree of the target object is determined according to the facial arousal degree and the facial pleasure degree.
23. The method according to claim 22, characterized in that The step of determining the facial beauty of the target object according to the expression arousal degree and the expression pleasure degree includes: When the expression arousal degree is greater than or equal to the seventh threshold, or the expression pleasure degree is greater than or equal to the eighth threshold, it is determined that the facial beauty satisfies the third condition; When the expression arousal degree is less than the seventh threshold, and the expression pleasure degree is less than the eighth threshold, it is determined that the facial beauty satisfies the fourth condition.
24. The method according to any one of claims 1 to 23, characterized in that The step of determining a target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty includes: When the limb aesthetics meets the first condition, determining the target cutting method to be the first cutting method, the first cutting method is a cutting method that prioritizes limbs; When the limb beauty meets the second condition, the target cropping method is determined to be the second cropping method, and the second cropping method is a face-first cropping method.
25. The method according to any one of claims 1 to 23, characterized in that The step of determining a target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty includes: When the facial beauty meets the third condition, determining the target cropping method to be the second cropping method, where the second cropping method is a face-priority cropping method; When the facial aesthetics meets the fourth condition, the target cropping method is determined to be the first cropping method, and the first cropping method is a limb-prioritized cropping method.
26. The method according to any one of claims 1 to 23, characterized in that The step of determining a target cropping method corresponding to the original image according to the limb beauty and / or the facial beauty includes: When the limb beauty meets the first condition and the facial beauty meets the fourth condition, determining the target cropping method to be the first cropping method, the first cropping method is a limb-prioritized cropping method; When the limb beauty meets the first condition and the facial beauty meets the third condition, or when the limb beauty meets the second condition, the target cropping method is determined to be the second cropping method, and the second cropping method is a face-priority cropping method.
27. The method according to any one of claims 1 to 26, characterized in that The step of cropping the original image according to the target cropping method to obtain a cropped image includes: Determining the facial orientation of the target object; According to the facial orientation of the target object, the target position of the target object in the cropped image is determined, and the original image is cropped according to the target position and the target cropping method to obtain the cropped image, wherein the position of the target object in the cropped image is the target position.
28. The method according to claim 27, characterized in that The step of determining a target position of the target object in the cropped image according to the facial orientation of the target object includes: When the face is facing forward or backward, the target position of the target object in the cropped image is determined to be a middle position.
29. The method according to claim 27, characterized in that The step of determining a target position of the target object in the cropped image according to the facial orientation of the target object includes: When the facial orientation is sideways, determining the offset distance of the target object according to a preset aspect ratio, the preset aspect ratio being the aspect ratio corresponding to the cropped image, and the offset distance being the distance between a target position of the target object in the cropped image and a middle position of the cropped image; A target position of the target object in the cropped image is determined according to the offset distance of the target object.
30. The method according to claim 29, characterized in that The step of determining a target position of the target object in the cropped image according to the offset distance of the target object includes: When the facial orientation is sideways, determining the offset direction of the target object according to the facial orientation; A target position of the target object in the cropped image is determined according to the offset distance and the offset direction of the target object.
31. An image cropping method, characterized in that: include: Acquire an original image, wherein the original image includes a target object; Determining the physical aesthetics of the target object; According to the limb beauty, determine the target cropping mode corresponding to the original image; wherein, when the limb beauty is high, the target cropping mode is a limb-prioritized cropping mode; when the limb beauty is low, the target cropping mode is a face-prioritized cropping mode; The original image is cropped according to the target cropping method to obtain a cropped image, wherein the cropped image includes all or part of the target object; wherein, when the target cropping method is a limb-priority cropping method, the cropped image includes all of the target object; and when the target cropping method is a face-priority cropping method, the cropped image includes part of the target object, wherein the part includes the face.
32. The method according to claim 31, characterized in that Determining the limb aesthetics of the target object includes: Determining the limb dynamics of the target object, where the limb dynamics is used to characterize the motion state of the target object; The limb aesthetics of the target object is determined according to the limb dynamics; when the limb dynamics is greater than or equal to a first threshold, the limb aesthetics is high; when the limb dynamics is less than a second threshold, the limb aesthetics is low, and the first threshold is greater than or equal to the second threshold.
33. The method according to claim 31, characterized in that Determining the limb aesthetics of the target object includes: Determine the limb stretch of the target object, where the limb stretch is used to characterize the stretch degree of the limb of the target object; The limb aesthetics of the target object is determined according to the limb stretch; when the limb stretch is greater than or equal to a third threshold, the limb aesthetics is high; when the limb stretch is less than a fourth threshold, the limb aesthetics is low, and the third threshold is greater than or equal to the fourth threshold.
34. The method according to claim 31, characterized in that Determining the limb aesthetics of the target object includes: Determining a limb torsion degree of the target object, wherein the limb torsion degree is used to characterize a degree of torsion of the limb of the target object; The limb aesthetics of the target object is determined according to the limb twisting degree; wherein, when the limb twisting degree is greater than or equal to a fifth threshold, the limb aesthetics is high; when the limb twisting degree is less than a sixth threshold, the limb aesthetics is low, and the fifth threshold is greater than or equal to the sixth threshold.
35. The method according to any one of claims 31 to 34, characterized in that The step of cropping the original image according to the target cropping method to obtain a cropped image includes: Determining the facial orientation of the target object; According to the facial orientation of the target object, the target position of the target object in the cropped image is determined, and the original image is cropped according to the target position and the target cropping method to obtain the cropped image, wherein the position of the target object in the cropped image is the target position.
36. The method according to claim 35, characterized in that The step of determining a target position of the target object in the cropped image according to the facial orientation of the target object includes: When the face is facing forward or backward, the target position of the target object in the cropped image is determined to be a middle position.
37. The method according to claim 35, characterized in that The step of determining a target position of the target object in the cropped image according to the facial orientation of the target object includes: When the facial orientation is sideways, determining the offset distance of the target object according to a preset aspect ratio, the preset aspect ratio being the aspect ratio corresponding to the cropped image, and the offset distance being the distance between a target position of the target object in the cropped image and a middle position of the cropped image; A target position of the target object in the cropped image is determined according to the offset distance of the target object.
38. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the electronic device implements the image cropping method according to any one of claims 1 to 37.
39. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the computer is caused to implement the image cropping method according to any one of claims 1 to 37.
40. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device is enabled to perform the image cropping method according to any one of claims 1 to 37.
Citation Information
Patent Citations
Method and device for cropping pictures
CN104484855A
Intelligent photo clipping method and device
CN107146198A
Human image processing method, device and system and readable storage medium
CN110147833A
Intelligent auto cropping of digital images
CN110612531A
Four-limb bone segmentation method and device, electronic device and readable storage medium
CN110689551A
Cited By
Image cropping method, electronic device, and computer-readable storage medium
EP4773080A1
Using two-dimensional images of a subject and target models to generate notifications identifying facial feature variation
US12705831B2
Using two-dimensional images of a subject and target models to generate notifications identifying facial feature variation
US20250322601A1
Image cropping method, electronic device, and computer-readable storage medium
WO2025256096A1
