Image cropping method, electronic device, and computer-readable storage medium
By obtaining the physical aesthetics and facial aesthetics of the target object and determining the cropping method, the problem that image cropping cannot highlight beauty in the prior art is solved, and the beauty of cropped images is improved and user experience improvement is achieved.
Patent Information
- Application Number
- CN202410767538.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2044-06-13
AI Technical Summary
In the prior art, electronic devices cannot highlight the beauty of the image when cropping images, resulting in poor user experience.
By obtaining the physical aesthetics and/or facial aesthetics of the target object, determine the target cropping method, and crop the original image according to this method, prioritizing the beauty of the body or facial, to obtain the cropped image.
Improves the beauty of cropped images and enhances the user experience.
Smart Images

Figure CN118674733B_ABST
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 an automatic image cropping function, which means that they can automatically crop images according to a default cropping method. For example, when setting a screen saver or lock screen image, a user can upload a personalized image. After the electronic device obtains the personalized image, it can automatically crop it to a specified size according to the default cropping method and apply the cropped image to the screen saver or lock screen. This default cropping method for all images results in the cropped image failing to highlight the image's inherent beauty, 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 cropped images and enhance 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, where the original image includes a target object;
[0006] Determining the limb aesthetics of the target object, and / or determining the facial aesthetics of the target object;
[0007] determining a target cropping method corresponding to the original image according to the limb aesthetics and / or the facial aesthetics;
[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 an original image including a target object, the electronic device can determine the target object's limb aesthetics and / or facial aesthetics. Subsequently, the electronic device can determine a target cropping method that can highlight the target object's posture aesthetics and / or facial aesthetics based on the target object's limb aesthetics and / or facial aesthetics. The electronic device can then crop the original image according to the target cropping method to obtain a cropped image. This cropped image retains the original image's posture aesthetics and / or facial aesthetics, thereby enhancing the aesthetics of the cropped image and improving 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 a limb-prioritized factor when cropping an image, i.e., a factor prioritizing the preservation of the limbs. The face-prioritized cropping mode may refer to a limb-prioritized factor when cropping an image, i.e., a factor prioritizing the highlighting of facial features.
[0011] That is, when the target cropping mode is determined to be a limb-prioritized cropping mode, the electronic device may prioritize preserving the integrity of the limbs when cropping the original image according to the target cropping mode, for example, the original image may be cropped into a full-body portrait. When the target cropping mode is determined to be a face-prioritized cropping mode, the electronic device may prioritize highlighting facial features when cropping the original image according to the target cropping mode, for example, the original image may be cropped into a half-body portrait with prominent facial features.
[0012] In some embodiments, determining the limb aesthetics of the target object may include:
[0013] determining a limb dynamics of the target object, wherein the limb dynamics is used to characterize a 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 in a static state.
[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 to be a limb-priority 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 to be a face-priority 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 to be a default cropping method.
[0017] It should be understood that in the embodiments of the present application, "high limb aesthetics" and "high limb aesthetics" can be the same concept, and "low limb aesthetics" and "low limb aesthetics" can be the same concept. The default cropping method can be specifically determined based on the actual scenario. For example, the default cropping method can be determined based on the actual scenario to be a face-priority cropping method. For example, the default cropping method can be determined based on the actual scenario to be such that the center of the target object's face is located in the upper 1 / 3 of the cropped image. That is, the cropped image can be divided into thirds from top to bottom, and the center of the target object's face can be located in the upper 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 connecting the top of the target object's head and the midpoint of its pelvis 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 target object's limb dynamics based on a first angle (i.e., angle a) between a line connecting the top of the target object's head and the midpoint of its pelvis and the vertical direction. For example, angle a can be determined as the target object's limb dynamics. When the target object is in motion, angle a is generally larger, and the faster the motion speed, the larger 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 aesthetic appearance of the limbs, and the second condition may refer to a low aesthetic appearance of the limbs.
[0026] In the image cropping method provided by this implementation, when the target object is in motion, angle a will be greater than or equal to a first threshold value (i.e., threshold value A1). When the target object is in a stationary state, angle a will be less than a 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] Determining the limb stretch of the target subject, where the limb stretch is used to represent the degree of stretch of the limb of the target subject;
[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. By comprehensively considering the target object's limb dynamics and limb stretch, the target object's limb aesthetics can be determined, 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.
[0031] In one example, determining the limb aesthetics of the target object based on 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 a second threshold, and the limb stretch is less than a 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 threshold value C1. The fourth threshold value may be threshold value B2 or threshold value C2. Threshold values B1 and B2, as well as threshold values C1 and C2, may be specific values or ranges of values. Threshold values B1 and B2 may be the same or different, and threshold value B1 is greater than or equal to threshold value B2. Threshold values C1 and 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 target object's limb aesthetics 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 target object's limb aesthetics is low. Otherwise, the electronic device can determine that the target object's limb aesthetics 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 represent 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.
[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. By comprehensively considering the target object's limb dynamics and limb torsion, the target object's limb aesthetics can be determined, 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 based on 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 torsion 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 a second threshold, and the limb torsion is less than a sixth threshold, it is determined that the limb aesthetics of the target object meets a second condition;
[0044] 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 may be threshold D1. The sixth threshold may be threshold D2. Threshold D1 and threshold D2 may be specific values or value ranges. Threshold D1 and threshold D2 may be the same or different, and threshold D1 is greater than or equal to threshold 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 target object's limb aesthetics 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 target object's limb aesthetics is low. Otherwise, the electronic device can determine that the target object's limb aesthetics 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 based on 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. This 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.
[0050] In other embodiments, determining the limb aesthetics of the target object may include:
[0051] determining a limb extension degree of the target subject;
[0052] The limb aesthetics of the target object is determined according to the limb stretch.
[0053] It should be noted that when the limbs have a high degree of stretch, that is, when the limbs are more stretched, the limbs are generally considered to have a higher aesthetic value. When the limbs have a low degree of stretch, that is, when the limbs are less stretched, the limbs are generally considered to have a lower aesthetic value. In other words, the aesthetic value of limbs with a high degree of stretch is generally higher than that of limbs with a low degree of stretch.
[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 aesthetics is 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 stretch 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 to be 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 aesthetics is moderate, that is, the target cropping method corresponding to the original image can be determined to be 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 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 extension of the target object based on the width of each of the at least two sets of symmetrical joint points. The higher the limb extension of the target object, the greater the difference in width between the at least two sets of symmetrical joint points (i.e., the width difference); and the lower the limb extension of the target object, the smaller the width difference.
[0060] It should be understood that each set of symmetrical joints may refer to laterally symmetrical joints. That is, each set of symmetrical joints may include two joints, and these two joints are laterally symmetrical joints. The width of each set of symmetrical joints may refer to the length of the line connecting the two joints in the set.
[0061] In another example, determining the limb extension of the target object may include:
[0062] Determining a first abscissa and a second abscissa, where the first abscissa is the abscissa of a first target joint point of the target object, and the second abscissa is the abscissa of a second target joint point of the target object, where 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, determining 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 the second condition, and the third threshold is greater than or equal to the fourth threshold.
[0069] In the image cropping method provided by this implementation, when it is determined that the limb stretch is greater than or equal to a third threshold (i.e., threshold B1 or threshold C1), the electronic device can determine that the target object's limb aesthetics is high. When it is determined that the limb stretch is less than a fourth threshold (i.e., threshold B2 or threshold C2), the electronic device can determine that the target object's limb aesthetics 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 target object's limb aesthetics 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 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. By comprehensively considering the target object's limb stretch and limb torsion, the target object's limb aesthetics can be determined, 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 based on the limb extension and the limb twist may include:
[0074] When the limb extension is greater than or equal to a third 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 the first condition;
[0075] When the limb extension is less than a fourth threshold value, and the limb twisting is less than a sixth threshold value, it is determined that the limb aesthetics of the target object meets the second condition;
[0076] 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 target object's limb aesthetics 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 target object's limb aesthetics is low. Otherwise, the electronic device can determine that the target object's limb aesthetics is moderate.
[0078] In 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 aesthetics of the limb of the target object is determined according to the limb twisting degree.
[0081] It should be noted that when the degree of limb torsion is high, that is, the degree of limb twisting is high, the limb is generally considered to have high aesthetics. When the degree of limb torsion is low, that is, the degree of limb twisting is low, the limb is generally considered to have low aesthetics. In other words, the aesthetics of limbs with high degrees of twisting are generally higher than those with low degrees 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 to be 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 to be 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 to be a default cropping method.
[0083] In one example, determining the limb torsion degree of the target object may include:
[0084] Obtaining 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 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;
[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 target object's limb torsion based on a second angle (i.e., angle b) between a line connecting a set of joint points corresponding to the shoulder and a line connecting a set of joint points corresponding to the pelvis. For example, angle b can be determined as the target object's limb torsion. When the target object's limb torsion is large, angle b is generally large. When the target object's limb torsion is small, angle b is generally small.
[0088] In a possible implementation, determining the limb aesthetics of the target object according to the limb torsion 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 this implementation, when it is determined that the limb torsion degree is greater than or equal to a fifth threshold value (i.e., threshold value D1), the electronic device may determine that the target object's limb aesthetics are high. When it is determined that the limb torsion degree is less than a sixth threshold value (i.e., threshold value D2), the electronic device may determine that the target object's limb aesthetics are low. When it is determined that the limb torsion degree is greater than or equal to the sixth threshold value and less than the fifth threshold value, the electronic device may determine that the target object's limb aesthetics are moderate.
[0092] In some embodiments, determining the facial aesthetics 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 of the target object is determined based on the facial arousal degree and the facial pleasure degree.
[0094] It should be understood that facial beauty can include expression beauty. Expression arousal can be used to measure the degree (or intensity) of emotion. Expression pleasure can be used to measure the positivity of emotion. In other words, the electronic device can 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 facial arousal degree and the facial pleasure degree may include:
[0096] When the facial expression arousal degree is greater than or equal to a seventh threshold, or the facial expression pleasure degree is greater than or equal to an eighth threshold, determining that the facial beauty meets a third condition;
[0097] When the facial expression arousal degree is less than the seventh threshold and the facial expression pleasure degree is less than the eighth threshold, it is determined that the facial beauty meets 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 this implementation, when it is determined that the absolute value of the expression arousal is less than the seventh threshold (i.e., threshold E), and the absolute value of the expression pleasure is less than the eighth threshold (i.e., threshold 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 E, or the absolute value of the expression pleasure is greater than or equal to threshold 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 is tense.
[0100] In some embodiments, determining the target cropping method corresponding to the original image based on the limb aesthetics and / or the facial aesthetics 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-priority 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 based on the limb aesthetics. When the limb aesthetics meets the first condition, i.e., the limb aesthetics is high, the electronic device can determine the target cropping method to be a limb-prioritized cropping method. When the limb aesthetics meets the second condition, i.e., the limb aesthetics is low, the electronic device can determine the target cropping method to be a face-prioritized cropping method. When the limb aesthetics does not meet the first condition and does not meet the second condition, i.e., the limb aesthetics is moderate, the electronic device can determine the target cropping method to be the default cropping method.
[0104] In other embodiments, determining the target cropping method corresponding to the original image based on the limb aesthetics and / or the facial aesthetics 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 based on the facial aesthetics. When the facial aesthetics meets the third condition, i.e., the facial aesthetics is high, the electronic device can determine the target cropping method to be a face-prioritized cropping method. When the facial aesthetics meets the fourth condition, i.e., the facial aesthetics is low, the electronic device can determine the target cropping method to be a limb-prioritized cropping method. When the facial aesthetics does not meet the third condition and does not meet the fourth condition, i.e., the facial aesthetics is moderate, the electronic device can determine the target cropping method to be the default cropping method.
[0108] In other embodiments, determining the target cropping method corresponding to the original image based on the limb aesthetics and / or the facial aesthetics 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 cropping method that prioritizes limbs;
[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 based on the limb beauty and the facial beauty. 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-priority 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-priority 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-priority 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 a 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. The front orientation may refer to the original image including the front of the target object's face. The side orientation may refer to the original image including the side of the target object's face. The back orientation may refer to the original image not including the target object's face.
[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 based on 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, 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 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, 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 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;
[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 length (ie, length in the horizontal direction) to width (ie, 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 center 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. Therefore, 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 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 an 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 to determine the target position of the target object in the cropped image based on the offset distance and offset direction of the target object. Therefore, 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] For example, when the target object's facial orientation is toward the left, the electronic device may determine that the target object's offset direction is toward the right. That is, when it is determined that the target object's facial orientation is toward the left, the electronic device may determine that the target object's target position in the cropped image may be offset toward the right side of the cropped image. When the target object's facial orientation is toward the right, the electronic device may determine that the target object's offset direction is toward the left. When it is determined that the target object's facial orientation is toward the right, the electronic device may determine that the target object's target position in the cropped image may be offset toward 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, where the original image includes a target object;
[0132] Determining the limb aesthetics of the target subject;
[0133] Determining 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-prioritized cropping mode; and when the limb aesthetics 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 an original image including a target object, the electronic device can determine the aesthetics of the target object's limbs. When the target object's limbs are determined to be highly aesthetically pleasing, the electronic device can crop the original image using a cropping method that prioritizes preserving the limbs, so that the cropped image retains the target object's more aesthetically pleasing limbs, thereby improving the aesthetics of the cropped image and enhancing the user experience. When the target object's limbs are determined to be less aesthetically pleasing, the electronic device can crop the original image using a cropping method that emphasizes facial features, thereby reducing the proportion of the less aesthetically pleasing limbs in the cropped image, thereby improving the aesthetics of the cropped image and enhancing the user experience.
[0136] It should be noted that high and low limb aesthetics are relative concepts. These two criteria can be determined by setting a threshold. For example, when limb aesthetics is above a certain threshold, it can be considered high; when limb aesthetics is below a certain threshold, it can be considered low. The threshold can be a single value or a range of values.
[0137] For example, when limb aesthetics is represented by limb dynamics, and angle a is used to represent limb dynamics, when angle a is greater than or equal to threshold A1, the limb aesthetics can be considered high; when angle a is less than threshold A2, the limb aesthetics can be considered low; and when angle a is greater than or equal to threshold A2 and less than threshold A1, the limb aesthetics can be considered moderate. It should be understood that when the limb aesthetics is moderate, the electronic device can determine that the target cropping method corresponding to the original image is the default cropping method. The default cropping method can be determined based on the actual scenario.
[0138] In some embodiments, determining the limb aesthetics of the target object may include:
[0139] determining a limb dynamics of the target object, wherein the limb dynamics is used to characterize a motion state of the target object;
[0140] The limb aesthetics of the target object is determined based on 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 other embodiments, determining the limb aesthetics of the target object may include:
[0142] Determining the limb stretch of the target subject, where the limb stretch is used to represent the degree of stretch of the limb of the target subject;
[0143] 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.
[0144] In 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 represent a degree of torsion of the limb of the target object;
[0146] 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.
[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 be referred to the relevant description in the first aspect above and 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 can also be referred to the relevant description in the first aspect above and 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 a 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, 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, 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 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;
[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 content of determining the target position of the target object in the cropped image based on the facial orientation of the target object, and cropping the original image based on the target position and target cropping method can be referred to the relevant description of the first aspect above, and will not be repeated here. In addition, the electronic device can also determine the target cropping method corresponding to the original image based on the aesthetics of the limbs and the facial beauty. The specific content of determining the target cropping method corresponding to the original image based on the aesthetics of the limbs and the facial beauty of the electronic device can be referred to the relevant description of the first aspect above, and 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, configured to acquire an original image, wherein the original image includes a target object;
[0159] an aesthetics determination module, configured to determine the aesthetics of the limbs of the target object and / or the aesthetics of the face of the target object;
[0160] a cropping mode determining module, configured to determine 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, where 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 further 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 its pelvis and the vertical direction; and determine the limb dynamics of the target object based on the first angle.
[0164] In one possible implementation, the aesthetics determination module is further 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 limb of the target object; and the limb aesthetics of the target object is determined 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 to determine the limb aesthetics of the target object 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 configured 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 other embodiments, the aesthetics determination module is further configured 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, where 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 shoulders 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 wrists, a group of joint points corresponding to the knees, and a group of joint points corresponding to the ankles.
[0173] In another example, the aesthetics determination module is also used to determine a first horizontal coordinate and a second horizontal coordinate, where the first horizontal coordinate is the horizontal coordinate of the first target joint point of the target object, and the second horizontal coordinate is the horizontal coordinate of the 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; based on the first horizontal coordinate and the second horizontal coordinate, the limb stretch of the target object is determined.
[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 one possible implementation, the aesthetics determination module is further 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 when the limb stretch is less than a fourth threshold, and the third threshold is greater than or equal to the fourth threshold.
[0176] In another possible implementation, the aesthetics determination module is further configured to determine a degree of torsion of a limb of the target object, and determine the limb aesthetics of the target object based on the limb stretch and the limb torsion.
[0177] In one example, the aesthetics determination module is further used to determine that the limb aesthetics of the target object meets a 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 a 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 other embodiments, the aesthetics determination module is further configured to determine a degree of torsion of the target object's limbs; and determine the aesthetics of the target object's limbs based on the degree of torsion.
[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 the third symmetrical joint point of the target object, and the second line is a line corresponding to the 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 one possible implementation, the aesthetics determination module is further 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 when the limb torsion degree is less than a sixth threshold, and the fifth threshold is greater than or equal to the sixth threshold.
[0182] In some embodiments, the beauty determination module is further used to determine the facial arousal and facial pleasure of the target object, and determine the facial beauty of the target object based on the facial arousal and facial pleasure.
[0183] In one possible implementation, the beauty determination module is also used to determine that the facial beauty meets the third condition 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; when the expression arousal degree is less than the seventh threshold and the expression pleasure degree is less than the eighth threshold, determine that the facial beauty meets the fourth condition.
[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, the target cropping method is determined to be 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 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.
[0188] In a possible implementation, the image cropping module is further configured to determine that the 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, when the facial orientation is sideways, an offset distance of the target object based on a preset aspect ratio, where 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 based on 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, configured to acquire an original image, wherein the original image includes a target object;
[0193] An aesthetics determination module, configured to determine the aesthetics of the limbs of the target object;
[0194] a cropping mode determination module, configured 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-prioritized cropping mode; and when the limb aesthetics is low, the target cropping mode is a face-prioritized 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-prioritized cropping method, the cropped image includes the entire target object; when the target cropping method is a face-prioritized cropping method, the cropped image includes a 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 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; 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 other embodiments, 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; 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 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.
[0200] In a possible implementation, the image cropping module is further configured to determine that the target position of the target object in the cropped image is a middle position when the facial orientation is forward or backward.
[0201] In one possible implementation, the image cropping module is further used to determine, when the facial orientation is sideways, an offset distance of the target object based on a preset aspect ratio, where 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 based on 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 runnable on the processor. When the processor executes the computer program, the electronic device implements the image cropping method described in any one of the first or second aspects above.
[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, which, when executed on an electronic device, enables the electronic device to execute the image cropping method described in any one of the first or second aspects above.
[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 This is an example of a cropped image;
[0207] Figure 2 is a schematic structural diagram 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 the software architecture to which the image cropping method provided in the embodiment of the present application is applicable;
[0209] Figure 4 This is a flow chart 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 This is a flow chart of determining a target cropping method corresponding to an original image according to the limb aesthetics of a target object, as provided in 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] Figure 9 This is a schematic diagram of a unilateral joint point provided in an embodiment of the present application;
[0215] Figure 10 is a schematic diagram of angle b provided in an embodiment of the present application;
[0216] Figure 11 This is an example of an application scenario provided by the embodiment of the present application. Figure 1 ;
[0217] Figure 12 This is a flow chart of determining a target cropping method corresponding to an original image according to the facial aesthetics of a target object, as provided in an embodiment of the present application;
[0218] Figure 13 This is an example diagram of the correspondence between expression categories and expression arousal and expression pleasure;
[0219] Figure 14This is a flow chart of determining a target cropping method corresponding to an original image based on the limb beauty and facial beauty of a target object, as provided in an embodiment of the present application;
[0220] Figure 15 This is a flowchart of another image cropping method provided in an embodiment of the present application;
[0221] Figure 16 This is an example of an application scenario provided by the embodiment of the present application. Figure 2 ;
[0222] Figure 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] Figure 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, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0225] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0226] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" 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 "upon determination" or "in response to determining" or "upon detection of [described condition or event]" 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" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[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 merely examples. Not all steps are required, nor are all information or messages required. These steps may be added or removed as needed during use. The same step or steps or messages with the same function in different embodiments of the present application may be referenced and learned from each other.
[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. Ordinary technicians in this field will know 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 an automatic image cropping function, which means that 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. This default cropping method for all images will result in the cropped image failing to highlight the image's inherent beauty, 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, the electronic device can automatically crop the original image according to the default cropping method (such as the face-first cropping method) to obtain a cropped image, referred to as a cropped image for short. For example, Figure 1 The cropped image shown in (b) in the figure. This means that the electronic device, using the default cropping method, crops the original image, which had a relatively beautiful posture, into a half-body portrait. This causes the cropped image to lose the original image's beauty and results in a poor user experience. In other cases, the original image may have a restrained pose, but the full-body portrait is retained, lacking impact and resulting in a poor user experience.
[0235] To address the above-mentioned issues, embodiments of the present application provide an image cropping method, an electronic device, and a computer-readable storage medium. In this method, when performing image cropping, the electronic device can obtain an original image containing a target object and can determine the target object's limb aesthetics and / or the target object's facial aesthetics 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 target object's limb aesthetics and / or facial aesthetics, and thus can crop the original image 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, enhance 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, etc., which have 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 this application. Figure 2 , Figure 2 A 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 should be understood that the structures illustrated in the embodiments of the present application do 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, or may combine or separate certain components, or arrange the components differently. The illustrated components 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 processing unit (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). 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] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.
[0243] In some embodiments, the processor 210 may include one or more interfaces. The interfaces 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.
[0244] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple I2C bus lines. The processor 210 may be coupled to the touch sensor 260C, the camera 270, and the like via different I2C bus interfaces. For example, the processor 210 may be coupled to the touch sensor 260C via the I2C interface, enabling communication between the processor 210 and the touch sensor 260C via the I2C bus interface, thereby enabling touch functionality 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 to 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 through software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 to 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 USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 230 can be used to transfer data between the electronic device 200 and peripheral devices. The interface can also be used to connect other electronic devices, such as AR devices.
[0248] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely an illustrative 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 a different interface connection method from the above embodiment, 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 electronic device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0251] The mobile communication module 240 can provide solutions for wireless communications including 2G / 3G / 4G / 5G 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 transmitted into a medium- or 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 being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor displays images or videos via 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 provided 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, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 250 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0254] In some embodiments, antenna 1 of electronic device 200 is coupled to mobile communication module 240, and antenna 2 is coupled to wireless communication module 250, so that electronic device 200 can communicate with a 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. 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] Electronic device 200 implements display functionality through a GPU, display screen 280, and an application processor. The GPU is a microprocessor for image processing that connects display screen 280 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.
[0256] Display screen 280 is used to display images, videos, and the like. 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 200 may include one or N display screens 280, where N is a positive integer greater than one.
[0257] The electronic device 200 can implement a shooting function through an ISP, a camera 270, a video codec, a GPU, a display screen 280, and an application processor.
[0258] The ISP processes data fed back by camera 270. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within 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 light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 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. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 200 selects 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 video. Electronic device 200 may support one or more video codecs. This allows electronic device 200 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0262] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 200, such as image recognition, face recognition, speech recognition, and text comprehension.
[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 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on 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] Pressure sensor 260A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 260A can be located on display screen 280. There are many types of pressure sensors 260A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 260A, the capacitance between the electrodes changes. Electronic device 200 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 280, electronic device 200 detects the touch intensity based on pressure sensor 260A. Electronic device 200 can also calculate the touch location based on the detection signal from pressure sensor 260A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.
[0266] The gyroscope 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 gyroscope sensor 260B. The gyroscope sensor 260B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope 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 gyroscope sensor 260B can also be used for navigation and somatosensory game scenes.
[0267] Touch sensor 260C, also known as a "touch-sensitive device," can be disposed on display screen 280. Touch sensor 260C and display screen 280 form a touch screen, also known as a "touch screen." Touch sensor 260C is configured to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 280. In other embodiments, touch sensor 260C can also be disposed on the surface of electronic device 200, at a location different from that of display screen 280.
[0268] The software system of the electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. For example, the software system of the electronic device 200 can 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 illustrate 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] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, 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 applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0273] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[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 size, determine whether there is a status bar, lock the screen, take screenshots, 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 those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might 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 answering, 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 allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0281] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
[0282] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0283] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0284] The system library can 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 fusion of 2D and 3D layers for multiple applications.
[0286] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. 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 includes 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 that automatically crops an image. 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 target object's limb beauty and / or determines the target object's facial beauty.
[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 target object's limb aesthetics and / or facial aesthetics. Subsequently, the electronic device can determine a target cropping method that can highlight the target object's posture aesthetics and / or facial aesthetics based on the target object's limb aesthetics and / or facial aesthetics, and can crop the original image according to the target cropping method to obtain a cropped image. This allows the cropped image to retain the original image's posture aesthetics and / or facial aesthetics, thereby improving the aesthetics of the cropped image and enhancing 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 use the image cropping method provided in the embodiment of the present application to crop the original image. 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. In this case, 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 patch the original image according to the preset aspect ratio. If the aspect ratio of the original image after enlargement or patching is greater than the preset aspect ratio, the electronic device may determine that the original image needs to be cropped. In this case, the electronic device may crop the original image after enlargement or patching 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 customized by the user. For example, in a scenario where an original image is set as a screen saver or lock screen image, the electronic device may determine the preset aspect ratio based on the aspect ratio of the electronic device's screen. For example, the preset aspect ratio may be the aspect ratio of the electronic device's screen, etc. The following description will be given using the example of the preset aspect ratio being the aspect ratio of the electronic device's screen.
[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 resulting cropped image to the screen saver or lock screen. Exemplarily, the user may also use the solution provided in the embodiments of the present application when setting an avatar.
[0302] It should be noted that the image cropping method provided in the embodiments of the present application can be used to crop an image that includes a target object. That is, after acquiring an 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 embodiments 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 based on the actual scenario, and the embodiments of the present application are not limited thereto. In addition, the specific manner in which the electronic device determines whether the original image includes the target object can be determined based on the actual scenario, and the embodiments of the present application are not limited thereto. For example, the electronic device can perform target detection on the original image using 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. A portrait may refer to an image of a person. That is, the image cropping method provided in the embodiments of the present application can be used to crop an image that includes a portrait. For example, after acquiring an 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 embodiments 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 human portrait, and the determination can be made based on actual scenarios. For example, the electronic device can determine whether the original image includes a human portrait using a face detection network. For example, the electronic device can determine whether the original image includes a human portrait using a body 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 a sculpture, a picture, etc.
[0307] In some embodiments, 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 a limb-prioritized factor when cropping an image, i.e., a factor prioritizing the preservation of the limbs. The face-prioritized cropping mode may refer to a face-prioritized factor when cropping an image, i.e., a factor prioritizing the highlighting of facial features.
[0308] That is, when the target cropping mode is determined to be a limb-prioritized cropping mode, the electronic device may prioritize preserving the integrity of the limbs when cropping the original image according to the target cropping mode, for example, the original image may be cropped into a full-body portrait. When the target cropping mode is determined to be a face-prioritized cropping mode, the electronic device may prioritize highlighting facial features when cropping the original image according to the target cropping mode, for example, the original image may be cropped into a half-body portrait 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, the electronic device may prioritize preserving the integrity of the limbs of the target object. For example, the electronic device may crop the original image to Figure 5 The full-body image shown in (b) is used to preserve all limbs of the target object.
[0311] When using face-priority cropping Figure 5 When the original image shown in (a) is cropped, 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 (a). 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 based on the limb beauty and / or facial beauty of each target object, and can determine the target cropping method corresponding to the original image based on the limb beauty and / or facial beauty of target object T, so as to crop the original image according to the target cropping method. That is, when the original image includes multiple target objects, the electronic device can crop the original image based on 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. The facial beauty can be used to indicate the beauty of facial expressions.
[0315] In other embodiments, the solution provided by the embodiments of the present application can be used in the case of only one target object, and other types of cropping methods can be used in the case of multiple target objects, such as a cropping method that highlights a group portrait.
[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 aesthetics of the target object's limbs and, based on the aesthetics of the target object's limbs, determine a target cropping method corresponding to the original image. Alternatively, the electronic device can determine the aesthetics of the target object's face and, based on the aesthetics of the target object's face, determine a target cropping method corresponding to the original image. Alternatively, the electronic device can determine both the aesthetics of the target object's limbs and the facial aesthetics and, based on the aesthetics of the target object's limbs and the facial aesthetics, determine a target cropping method corresponding to the original image.
[0318] The following will be explained separately: 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 target object's limb beauty, and determines the original The target cropping method corresponding to the initial image.
[0320] After acquiring an original image including a target object, the electronic device may determine the aesthetics of the target object's limbs based on the original image. If the aesthetics of the target object's limbs are determined to be high, the electronic device may determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. If the aesthetics of the target object's limbs are determined to be low, the electronic device may determine that the target cropping method corresponding to the original image is a face-prioritized cropping method.
[0321] That is, when cropping an original image, if it is determined that the target subject's limbs are aesthetically pleasing, the electronic device can crop the original image using a cropping method that prioritizes preserving the limbs. This allows the cropped image to retain the target subject's more aesthetically pleasing limbs, thereby improving the aesthetics of the cropped image and enhancing the user experience. If it is determined that the target subject's limbs are less aesthetically pleasing, the electronic device can crop the original image using a cropping method that emphasizes facial features, thereby reducing the proportion of the less aesthetically pleasing limbs in the cropped image, thereby improving the aesthetics of the cropped image and enhancing 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 flow chart of 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 an original image including a 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 includes 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-prioritized 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 the limb-prioritized cropping method.
[0325] When a facial image is detected in the original image, the electronic device may determine the target subject's limb aesthetics based on the original image. If the target subject's limb aesthetics are determined to be high, the electronic device may determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. If the target subject's limb aesthetics are determined to be low, the electronic device may determine that the target cropping method corresponding to the original image is a face-prioritized 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, and the specific method can be determined according to the actual scenario, such as a general algorithm for facial recognition or other artificial intelligence algorithms.
[0327] The following is an example in which the original image contains the face image of the target object.
[0328] In an embodiment of the present application, an electronic device can determine the aesthetic quality of a target subject's limbs based on at least one of the target subject's limb dynamics, limb extension, and limb torsion. The limb dynamics can be used to characterize the target subject's motion state, for example, the target subject's motion speed. Limb extension can be used to characterize the degree of extension of the target subject's limbs. Limb torsion can be used to characterize the degree of torsion of the target subject's limbs.
[0329] In some embodiments, the electronic device may determine the target object's limb aesthetics based on the target object's limb dynamics. That is, after acquiring an original image including the target object, the electronic device may determine the target object's limb dynamics based on the original image, and may determine the target object's limb aesthetics based on the limb dynamics.
[0330] It should be noted that research has found that people prefer images that include movement to static images. In other words, people generally believe that limbs in motion are more beautiful than those in stillness.
[0331] In one example, when it is determined that the target object's limbs are highly dynamic, for example, when it is determined that the target object's movement speed is relatively fast, the electronic device may determine that the target object's limbs are highly aesthetically pleasing, and thus may determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When it is determined that the target object's limbs are less dynamic, for example, when it is determined that the target object's movement speed is relatively low (for example, when it is stationary), the electronic device may determine that the target object's limbs are less aesthetically pleasing, and thus may determine that the target cropping method corresponding to the original image is a face-prioritized cropping method.
[0332] In a possible implementation, the electronic device may determine the limb dynamics of the target object based on the angle between the 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, the angle a may be the angle between a line 701 connecting the top of the head and the midpoint of the pelvis and a straight line 702 in the vertical direction.
[0335] For example, 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. The conversion relationship R1 between angle a and limb dynamics can be determined based on the actual scenario, 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, the larger the angle a. 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 value A1 and threshold value A2 may be the same or different. Threshold value A1 and threshold value A2 may be specific values or value ranges. Among them, the specific value of threshold value A1 and the specific value of threshold value A2 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 value A1 and threshold value A2 may be determined based on the angle a when the target object and / or other objects are in motion, such as threshold value A1 may be determined to be any angle such as 10 degrees, 15 degrees or 20 degrees, and threshold value A2 may be determined to be any angle such as 0 degrees, 3 degrees, 5 degrees or 10 degrees.
[0338] Optionally, the electronic device may determine the target object's limb aesthetics 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 thresholds A1 and A2 are the same, if angle a is determined to be greater than or equal to threshold A1, the electronic device can determine that the target object's limbs are highly dynamic, i.e., the target object's limbs are highly aesthetically pleasing. In this case, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When angle a is determined to be less than threshold A2, the electronic device can determine that the target object's limbs are less dynamic, i.e., the target object's limbs are less aesthetically pleasing. In this case, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized 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-priority 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-priority 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 mean between higher and lower.
[0341] 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. That is, when it is determined that the limb aesthetics of the target object 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 scenario, 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 center of the face 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 center of the face of the target object can be located at the top 1 / 3.
[0342] In other embodiments, the electronic device may determine the target object's limb aesthetics based on the target object's limb stretch. That is, after acquiring an original image including the target object, the electronic device may determine the target object's limb stretch based on the original image, and may determine the target object's limb aesthetics based on the target object's limb stretch.
[0343] In one example, when it is determined that the target object's limbs are highly flexible, the electronic device may determine that the target object's limbs are highly aesthetically pleasing, i.e., the target cropping method corresponding to the original image may be determined to be a limb-prioritized cropping method. When it is determined that the target object's limbs are less flexible, the electronic device may determine that the target object's limbs are less aesthetically pleasing, i.e., the target cropping method corresponding to the original image may be determined to be a face-prioritized cropping method.
[0344] In one possible implementation, the electronic device can determine the target object's limb extension based on the width of each of at least two sets of symmetrical joints. That is, after acquiring an original image including the target object, the electronic device can determine the target object's at least two sets of symmetrical joints and the width of each set of symmetrical joints. Subsequently, the electronic device can determine the target object's limb extension based on the width of each set of symmetrical joints.
[0345] It should be understood that each set of symmetrical joints may refer to laterally symmetrical joints. That is, each set of symmetrical joints may include two joints, and these two joints are laterally symmetrical joints. The width of each set of symmetrical joints may refer to the length of the line connecting the two joints in the set.
[0346] It should be noted that the present invention does not impose any specific restrictions on the method for determining the width of the symmetrical joint point, and the method can be determined according to the actual scenario. For example, an image coordinate system can be established with the upper left vertex or 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 to determine the width of the symmetrical joint point based on the coordinates of the symmetrical joint point in the image coordinate system.
[0347] In one example, the 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 can vary within a smaller range, and the symmetrical joint point N may be a symmetrical joint point whose width can 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 the 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 the 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 the 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 an 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 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 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 set of joint points corresponding to the shoulders, and the symmetrical joint points N include a set of joint points corresponding to the wrists, after acquiring an 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 based on the original image (hereinafter referred to as width M1). Additionally, 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 based on the original image (hereinafter referred to as width N1). Subsequently, the electronic device can determine the target object's limb extension based on widths M1 and 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) based on 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 based on the original image. Subsequently, the electronic device can determine the limb stretch of the target object based on the widths M1, M2, and N1.
[0354] like Figure 8As 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, a group of joint points corresponding to the knees, and a group of joint points corresponding to the ankles, after acquiring an original image including the target object, the electronic device can determine, based on the original image, 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. In addition, the electronic device can also determine, based on the original image, 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). Subsequently, the electronic device can determine the limb stretch of the target object based on widths M1, M2, N1, N2, and 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, and the symmetrical joint points can be determined according to the actual scenario.
[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 differences of the target object, so as to determine the aesthetics of the target object's limbs according to the width differences 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 can 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 certain threshold (hereinafter referred to as threshold B1) and / or whether the width difference of the target object is less than a certain threshold (hereinafter referred to as threshold B2).
[0360] It should be noted that threshold value B1 and threshold value B2 may be the same or different. Threshold value B1 and threshold value B2 may be specific values or value ranges. The specific value of threshold value B1 and the specific value of threshold value B2 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 value B1 and threshold value 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 degree of stretch 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 degree of stretch of the limbs of the target object and / or other objects is low.
[0361] In one example, when threshold B1 and threshold B2 are the same, if the target object's width difference is determined to be greater than or equal to threshold B1, the electronic device may determine that the target object's limb stretch is high, i.e., the target object's limb aesthetics are high. In this case, the electronic device may determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When the target object's width difference is determined to be less than threshold B2, the electronic device may determine that the target object's limb stretch is low, i.e., the target object's limb aesthetics are low. In this case, the electronic device may determine that the target cropping method corresponding to the original image is a face-prioritized 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-priority 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-priority cropping method. When it is determined that the width difference of the target object is greater than or equal to threshold B2, and when 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 the target object's limb aesthetics are determined to be moderate, the electronic device may determine the target cropping method corresponding to the original image as the default cropping method. The specific details of the default cropping method can be found in the aforementioned section "Determining the Target Cropping Method Corresponding to the Original Image Based on the Dynamics of the Target Object's Limbs," and will not be further elaborated 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 based on 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 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 variability based on an average of the differences between the widths. For example, the electronic device may determine the differences between the widths of any two groups of symmetrical joint points, and may determine an average value based on all the differences to determine the average value as the width variability.
[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 based on the variance or standard deviation of the widths. For example, the electronic device may determine the widths of each group of symmetrical joint points, and may determine the variance or standard deviation of the widths based on the widths of each group of symmetrical joint points, to determine the variance or standard deviation of the widths 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 can be the same or different, and the threshold B2 in different scenarios can be the same or different. That is, the threshold B1 in the scenario where the width difference is determined based on the difference between the widths, the threshold B1 in the scenario where the width difference is determined based on the average value of the difference between the widths, and the threshold B1 in the scenario where the width difference is determined based on the variance or standard deviation of the widths can be the same or different. Similarly, the threshold B2 in the scenario where the width difference is determined based on the difference between the widths, the threshold B2 in the scenario where the width difference is determined based on the average value of the difference between the widths, and the threshold B2 in the scenario where the width difference is determined based on the variance or standard deviation of the widths can be the same or different.
[0368] In one example, the electronic device may 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 widths of at least two groups of symmetrical joints, for each group of symmetrical joints, after determining the width of the group of symmetrical joints, the electronic device may normalize the width of the group of symmetrical joints based on the binocular distance of the target object. Subsequently, the electronic device may determine the limb stretch of the target object based on the normalized widths of each group of symmetrical joints, 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 thereby improve the accuracy of target cropping determination.
[0369] It should be understood that for each set of symmetrical joints, the electronic device can normalize the width of the set of symmetrical joints according to X=L / e, where X is the width of the set of symmetrical joints after normalization, L is the width of the set of symmetrical joints before normalization, and e is the interocular distance of the target object.
[0370] In another possible implementation, the electronic device can determine the target object's limb extension based on the horizontal coordinates of at least two joints on a single side. Specifically, after acquiring an original image of the target object, the electronic device can determine at least two joints located on the same side of the target object based on the original image, and can also determine the horizontal coordinates of each joint. Subsequently, the electronic device can determine the target object's limb extension based on the horizontal coordinates of each joint.
[0371] Optionally, when it is determined that the target object has fewer than two groups of symmetrical joint points, the electronic device may determine the target object's limb extension based on the horizontal coordinates of at least two joint points on one side. Specifically, when it is determined from the original image that the target object has fewer than two groups of symmetrical joint points, for example, when it is determined that the target object has only one group of symmetrical joint points or no symmetrical joint points, the electronic device may determine the target object's limb extension based on 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 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 a single side may include a joint point Q and a joint point W. The joint point Q may be a joint point whose horizontal coordinate can vary within a relatively small range. The joint point W may be a joint point whose horizontal coordinate can vary within a relatively large range. The single side may be the left side of the target object, i.e., the joint point Q and the joint point W may be joint points on the left side of the target object. Alternatively, the single side may be the right side of the target object, i.e., the joint point Q and the joint point W may be joint points on the right side of the target object.
[0375] For example, 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] For example, 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 an 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 coordinates of the joint point Q and the horizontal coordinates of the joint point W. Subsequently, the electronic device can determine the limb extension of the target object based on the horizontal coordinates of the joint point Q and the horizontal coordinates of the joint point W.
[0378] For example, see Figure 9 , Figure 9 A schematic diagram of a unilateral joint point provided in an embodiment of the present application is shown.
[0379] like Figure 9 As shown, when joint points Q include joint point 910 corresponding to the left shoulder and joint point 911 corresponding to the leftmost side of the pelvis, and joint points W include joint point 920 corresponding to the left wrist, joint point 921 corresponding to the left knee, and joint point 922 corresponding to the left ankle, after acquiring an original image of the target object, the electronic device can determine the horizontal coordinates of joint point 910 corresponding to the left shoulder and joint point 911 corresponding to the leftmost side of the pelvis based on the original image. Furthermore, the electronic device can also determine the horizontal coordinates of joint point 920 corresponding to the left wrist, joint point 921 corresponding to the left knee, and joint point 922 corresponding to the left ankle based on the original image. Subsequently, the electronic device can determine the target object's limb extension based on the horizontal coordinates of joint point 910 corresponding to the left shoulder, joint point 911 corresponding to the leftmost side of the pelvis, joint point 920 corresponding to the left wrist, joint point 921 corresponding to the left knee, and 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 based on the horizontal coordinate difference on one side of the target object, so as to determine the limb beauty of the target object based on the horizontal coordinate difference on one side of the target object.
[0382] For example, the electronic device can 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) can be set in the electronic device, and the electronic device can 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] For example, 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 certain 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 certain 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 numerical ranges. The specific value of the threshold C1 and the specific value of the threshold C2 may be determined based on 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 degree of stretch 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 degree of stretch of the limbs of the target object and / or other objects is low.
[0385] In one example, when threshold C1 and threshold C2 are the same, if the target object's horizontal coordinate difference is determined to be greater than or equal to threshold C1, the electronic device can determine that the target object's limb stretch is high, i.e., the target object's limb aesthetics are high. In this case, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When the target object's horizontal coordinate difference is determined to be less than threshold C2, the electronic device can determine that the target object's limb stretch is low, i.e., the target object's limb aesthetics are low. In this case, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized 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-priority 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-priority cropping method. When it is determined that the horizontal coordinate difference of the target object is greater than or equal to threshold C2, and when 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 the target object's limb aesthetics are determined to be moderate, the electronic device may determine the target cropping method corresponding to the original image as the default cropping method. The specific details of the default cropping method can be found in the aforementioned section "Determining the Target Cropping Method Corresponding to the Original Image Based on the Dynamics of the Target Object's Limbs," and will not be further elaborated here.
[0388] In one example, when the at least two joint points on a single side include two joint points, the electronic device may determine the horizontal coordinate difference based on 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 determine the difference as the horizontal coordinate difference.
[0389] 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 abscissa difference based on an average of the differences between the abscissas. For example, the electronic device may determine the difference between the abscissas of any two joint points and determine an average value based on all the differences to determine the average value as the abscissa 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 abscissa variability based on the variance or standard deviation of the abscissa. For example, the electronic device may determine the abscissa of each joint point, determine the variance or standard deviation of the abscissa based on the abscissa of each joint point, and determine the variance or standard deviation of the abscissa as the abscissa variability.
[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 can be the same or different, and the threshold C2 in different scenarios can 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 can 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 can be the same or different.
[0392] In other embodiments, the electronic device may determine the target object's limb aesthetics based on the target object's limb torsion. Specifically, after acquiring an original image including the target object, the electronic device may determine the target object's limb torsion based on the original image, and may determine the target object's limb aesthetics based on the target object's limb torsion.
[0393] It should be noted that when the degree of limb torsion is high, that is, the degree of limb twisting is high, the limb is generally considered to have high aesthetics. When the degree of limb torsion is low, that is, the degree of limb twisting is low, the limb is generally considered to have low aesthetics. In other words, the aesthetics of limbs with high degrees of twisting are generally higher than those with low degrees 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 are high, i.e., the target cropping method corresponding to the original image may be determined to be a limb-prioritized 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 are low, i.e., the target cropping method corresponding to the original image may be determined to be a face-prioritized cropping method.
[0395] In a possible implementation, the electronic device may determine the limb torsion degree of the target object based on the angle between the line where the shoulders are located and the line where the pelvis is located (hereinafter referred to as angle b).
[0396] For example, see Figure 10 , Figure 10 A schematic diagram of the angle b provided in an embodiment of the present application is shown.
[0397] like Figure 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] For example, 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 the 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 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 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 target subject's limb is high, angle b is generally large. When the degree of twisting of the target subject's limb is low, angle b is generally small. That is, when the degree of twisting of the target subject's limb is high, angle b will be large; when the degree of twisting of the target subject's limb is low, angle b will be small.
[0400] In one example, the electronic device can determine the aesthetics of the target object's limbs based on whether the target object's limb twisting degree is greater than or equal to a certain threshold (hereinafter referred to as threshold D1) and / or based on whether the target object's limb twisting degree is less than a certain 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 ranges of values. 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 thresholds D1 and D2 are the same, if angle b is determined to be greater than or equal to threshold D1, the electronic device may determine that the target object's limb torsion is high, i.e., the target object's limb aesthetics are high. In this case, the electronic device may determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method. When angle b is determined to be less than threshold D2, the electronic device may determine that the target object's limb torsion is low, i.e., the target object's limb aesthetics are low. In this case, the electronic device may 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 torsion 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 torsion 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 when it is determined that angle b is less than threshold D1, the electronic device can determine that the target object's limb torsion is moderate, that is, it can be determined that the target object's limb aesthetics is moderate.
[0404] It should be understood that when the target object's limb aesthetics are determined to be moderate, the electronic device may determine the target cropping method corresponding to the original image as the default cropping method. The specific details of the default cropping method can be found in the aforementioned section "Determining the Target Cropping Method Corresponding to the Original Image Based on the Dynamics of the Target Object's Limbs," and will not be further elaborated here.
[0405] In other embodiments, the electronic device can determine the limb aesthetics of the target object based on the limb dynamics and limb extension of the target object. That is, after acquiring an original image including the target object, the electronic device can determine the limb dynamics and limb extension of the target object based on the original image, and can also determine the limb aesthetics of the target object based on the limb dynamics and limb extension. By comprehensively considering the limb dynamics and limb extension to determine the limb aesthetics of the target object, the accuracy of the limb aesthetics determination can be improved, thereby improving the accuracy of the target cropping method determination and improving the aesthetic quality 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, it can determine that the target cropping method corresponding to the original image is 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 beauty is 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 stretch is low, or when it is determined that the target object's limb dynamics is low and the target object's limb stretch 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 stretch 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. Specifically, after acquiring an 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 also determine the limb aesthetics of the target object based on the limb dynamics and limb torsion. 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 enhancing the aesthetic quality 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 based on the limb extension and torsion of the target object. Specifically, after acquiring an original image including the target object, the electronic device can determine the limb extension and torsion of the target object based on the original image, and can also determine the limb aesthetics of the target object based on the limb extension and torsion of the target object. By comprehensively considering the limb extension and 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 enhancing the aesthetic quality 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 beauty 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 twist is low, or when it is determined that the target object's limb stretch is low and the target object's limb twist 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 twist 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 Figure 11 , Figure 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. Figure 11 The horizontal axis is the degree of limb twisting, and the vertical axis is the degree of limb extension.
[0418] like Figure 11 As shown, by analyzing a large number of sample images, it is found that when the limb stretch and limb twist of the target object are located in area 1110, it can be considered that the limb aesthetics of the target object is high, that is, the limb stretch of the target object can be considered to be high, and the limb twist of the target object can be considered to be 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 stretch and limb torsion are neither located in area 1110 nor in area 1120, the target object's limb aesthetics can be considered moderate, that is, the target object's limb stretch can be considered high, and the target object's limb torsion can be considered low; or, the target object's limb stretch can be considered low, and the target object's limb torsion can be considered high; or, the target object's limb stretch can be considered moderate; or, the target object's limb torsion can be considered moderate.
[0421] That is, Figure 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 subject's limb extension is greater than or equal to 13 and the target subject's limb twist is greater than or equal to 7, the electronic device can determine that the target subject's limb extension and twist are high, that is, the target subject's limb aesthetics are high. In this case, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method.
[0423] If the target subject's limb extension is less than 7 and the target subject's limb twist is less than 4, the electronic device may determine that the target subject's limb extension and twist are low, i.e., the target subject's limb aesthetics are low. In this case, the electronic device may determine that the target cropping method corresponding to the original image is a face-priority cropping method.
[0424] If the target subject's limb extension is greater than or equal to 13 and the target subject's limb twist is less than 4, the electronic device may determine that the target subject's limb extension is high and the target subject's limb twist is low, i.e., the target subject's limb aesthetics are moderate. In this case, the electronic device may determine that the target cropping method corresponding to the original image is the default cropping method.
[0425] If the target subject's limb extension is less than 7 and the target subject's limb twist is greater than or equal to 7, the electronic device may determine that the target subject's limb extension is low and the target subject's limb twist is high, that is, the target subject's limb aesthetics are moderate. In this case, the electronic device may determine that the target cropping method corresponding to the original image is the default cropping method.
[0426] When it is determined that the target subject's limb extension is greater than or equal to 7 and less than 13, or when it is determined that the target subject's limb twist is greater than or equal to 4 and less than 7, the electronic device may determine that the target subject's limb aesthetics are moderate. In this case, the electronic device may 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 based on the limb dynamics, limb extension, and limb torsion of the target object. That is, after acquiring an original image including the target object, the electronic device can determine the limb dynamics, limb extension, and limb torsion of the target object based on the original image, and can also determine the limb aesthetics of the target object based on the limb dynamics, limb extension, and limb torsion of the target object. By comprehensively considering the limb dynamics, limb extension, and limb torsion to determine the limb aesthetics of the target object, the accuracy of the limb aesthetics determination can be improved, thereby improving the accuracy of the target cropping method determination and enhancing the aesthetic quality of the cropped image.
[0428] In one possible implementation, when it is determined that the target object's limb dynamics, limb stretch, and limb torsion are all high, that is, when it is determined that the target object's limb dynamics are high, the target object's limb stretch is 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.
[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, the target object's limb extension is low, and 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 stretch and limb torsion are high, or when it is determined that at least one of the target object's limb dynamics, limb stretch 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 Figure 12 , Figure 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 can include the expression beauty.
[0433] like Figure 12 As shown, after acquiring an original image including a target object, the electronic device may determine the target object's facial aesthetics based on the original image. When the target object's facial aesthetics is determined to be high, for example, when the target object's facial expression is determined to be tense, the electronic device may determine that the target cropping method corresponding to the original image is a face-prioritized cropping method. When the target object's facial aesthetics is determined to be low, for example, when the target object's facial expression is determined to be dull, the electronic device may determine that the target cropping method corresponding to the original image is a limb-prioritized cropping method.
[0434] That is, when cropping the original image, if the target subject's facial expression is determined to be tense, the electronic device can crop the original image using a method that emphasizes the facial expression, allowing the cropped image to retain the target subject's more attractive facial expression, thereby enhancing the aesthetics of the cropped image and improving the user experience. If the target subject's facial expression is neutral, the electronic device can crop the original image using a method that prioritizes the preservation of limbs, thereby reducing the proportion of the less attractive facial features in the cropped image, enhancing the aesthetics of the cropped image and improving the user experience.
[0435] In one possible implementation, the electronic device may determine the facial aesthetics of the target object based on the target object's facial arousal (A) and pleasantness (P). That is, after acquiring an original image including the target object, the electronic device may determine the target object's facial arousal A and pleasantness P based on the original image, and may also determine the target object's facial aesthetics based on the target object's facial arousal A and 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 is tense.
[0437] It should be understood that the threshold E and the 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 degree of facial arousal A can be used to measure the degree (or intensity) of an emotion. The degree of facial pleasure P can be used to measure the positivity of an emotion. The method for determining the degree of facial arousal A and the degree of facial pleasure P can be determined based on the actual scenario, and the embodiments of this application do not impose any restrictions on this.
[0439] For example, after acquiring an original image including a target object, the electronic device may directly determine the target object's facial arousal level A and facial pleasure level P based on the original image. The electronic device may directly determine the target object's facial arousal level A and facial pleasure level P based on the original image using any existing method.
[0440] For example, after obtaining 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 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 expression pleasure degree P.
[0441] It should be understood that the method for determining the expression category can be determined specifically based on the actual scenario, and the embodiments of this 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 determined specifically based on the actual scenario, and the embodiments of this application do not impose any restrictions on this.
[0442] For example, see Figure 13 , Figure 13 An example diagram showing the correspondence between expression categories and expression arousal and expression pleasure.
[0443] Figure 13 The horizontal axis is the expression pleasure P, and the vertical axis is the expression arousal A.
[0444] like Figure 13 As shown, when the expression category is excitement, like / love, happiness, pride, curiosity, approval, anger / furious, 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 / rage, fear, sadness, pain, surprise, or flattery, the electronic device can determine that the absolute value of the facial arousal level 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 level 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 facial expression is determined to be content, calm, lazy, ashamed, annoyed, bored, speechless, helpless, or tired, the electronic device can determine that the absolute value of the facial arousal level A corresponding to the facial expression level is greater than or equal to a threshold value E, or that the absolute value of the facial pleasure level P corresponding to the facial expression level is greater than or equal to a threshold value F. In this case, the electronic device can determine that the target object's facial expression is relatively dull, i.e., that the target object's facial aesthetics are low. Therefore, the electronic device can determine that the target cropping method corresponding to the original image is a limb-prioritized 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 Figure 14 , Figure 14 A flow chart of 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 Figure 14 As shown, after acquiring an original image including a target object, the electronic device can determine the aesthetics of the target object's limbs based on the original image. If it is determined that the target object's limbs have low aesthetics, the electronic device can determine that the target cropping method corresponding to the original image is a face-prioritized cropping method, thereby reducing the proportion of the less aesthetically pleasing limbs in the cropped image and improving the aesthetics of the cropped image.
[0451] When it is determined that the target object's limbs are aesthetically pleasing, the electronic device may determine the target object's facial aesthetics. When it is determined that the target object's facial aesthetics are aesthetically pleasing, the electronic device may determine the target cropping method corresponding to the original image to be a face-prioritized cropping method, so that the cropped image can retain the target object's more aesthetically pleasing facial expressions, thereby improving the aesthetics of the cropped image. When it is determined that the target object's facial aesthetics are less aesthetically pleasing, the electronic device may determine the target cropping method corresponding to the original image to be a limb-prioritized cropping method, so that the cropped image can retain the target object's more aesthetically pleasing limbs, thereby reducing the proportion of the less aesthetically pleasing face in the cropped image, thereby improving the aesthetics of the cropped image.
[0452] In one example, if Figure 14 As shown, after acquiring an original image including a 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 includes 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-prioritized 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 the limb-prioritized cropping method.
[0453] It should be noted that Figure 14 The first step of determining the target object's limb aesthetics and then determining the target object's facial aesthetics is merely an illustrative explanation and should not be construed as limiting 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. 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, or the target object's facial aesthetics may be determined first and then the target object's limb aesthetics. The specific content of determining the target object's limb aesthetics and facial aesthetics can refer to the aforementioned content related to 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 method corresponding to the original image, the electronic device can crop the original image according to the target cropping method to obtain a cropped image. The following describes in detail the process of the electronic device cropping the original image according to the target cropping method to obtain the cropped image.
[0455] In some embodiments, after acquiring an original image including a target object, the electronic device may determine the target object's facial orientation based on the original image. After determining a target cropping method corresponding to the original image, the electronic device may crop the original image based on the target object's facial orientation 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 based on the facial orientation of the target object, and may crop the original image based on the target position and target cropping method of the target object in the cropped image 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, front may mean that the original image includes the front of the target object's face. Side may mean that the original image includes the side of the target object's face. Back may mean that the original image does not include the target object's face.
[0457] See also Figure 15 , Figure 15 A schematic diagram of another image cropping method provided in an embodiment of the present application is shown. 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 how to crop the original image according to the target cropping method.
[0458] like Figure 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 one possible implementation, when the target object's face is facing forward or backward, the electronic device may determine that the target object's target position in the cropped image is at the center. In this case, the electronic device may crop the original image based on the target object's center position in the cropped image and the target cropping method to obtain the cropped image. That is, when cropping the original image based on the target cropping method, the original image may be cropped so that the target object is located at the center 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 Figure 16 , Figure 16 The application scenario provided by the embodiment of the present application is shown Figure 2 This application scenario is illustrated by taking the limb-first cropping method as an example.
[0462] Electronic equipment according to Figure 16 In the original image shown in (a) of FIG, the target object's face orientation can be determined to be forward. Therefore, when cropping the original image, the electronic device can determine that the target object's target position in the cropped image is the middle position based on the target object's face orientation (i.e., forward).
[0463] For example, when it is determined that the original aspect ratio of the original image is greater than a preset aspect ratio (e.g., 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. Figure 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 may perform proportional magnification processing on 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 may 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 Figure 16 The cropped image shown in (c) in .
[0465] In another possible implementation, when the face of the target object is facing 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 can be, for example, 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 based on the offset direction and offset distance of the target object. The aspect ratio can be the ratio of length (i.e., length in the horizontal direction) to width (i.e., width in the vertical direction). The offset distance can refer to the distance between the target position of the target object in the cropped image and the middle position of the cropped image.
[0466] In one example, when the target object's face is facing leftward, the electronic device may determine that the target object's offset direction is rightward. That is, when it is determined that the target object's face is facing leftward, the electronic device may determine that the target position of the target object in the cropped image may be offset to the right side of the cropped image.
[0467] In another example, when the target object's face is facing right, the electronic device may determine that the offset direction of the target object is left. When it is determined that the target object's face is facing right, the electronic device may determine that the target position of the target object in the cropped image may be offset to the left side of the cropped image.
[0468] Exemplarily, the electronic device can determine the offset rate corresponding to the target object based on the relationship between the preset aspect ratio and the offset rate, and can 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 Figure 17 , Figure 17 A schematic diagram showing the relationship between the preset aspect ratio and the offset rate corresponding to the target object provided by the embodiment of the present application is shown. Figure 17 The horizontal axis is the preset aspect ratio, and the vertical axis is the offset rate.
[0472] like Figure 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 as (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 as (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 as (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 as (the length corresponding to the preset aspect ratio / 2)*0.41.
[0473] See also Figure 18 , Figure 18 The application scenario provided by the embodiment of the present application is shown Figure 3 This application scenario is illustrated by taking the limb-first cropping method as an example.
[0474] Electronic equipment according to Figure 18 In the original image shown in (a) of FIG, it can be determined that the face of the target object is facing left. Therefore, when cropping the original image, the electronic device can determine that the offset direction of the target object is rightward based on the face orientation of the target object (i.e., facing 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 based on the preset aspect ratio P1, and can determine the offset distance of the target object based on 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 based on 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-priority cropping method, the electronic device can crop the original image with the target position of the target object in the cropped image. For example, the following can be obtained: Figure 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 based on the preset aspect ratio P2, and can determine the offset distance of the target object based on 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 based on the offset direction (i.e., to the right) and the offset distance of the target object. When the original image is cropped according to the limb-priority 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: Figure 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 this application.
[0478] Corresponding to the image cropping method described in the above embodiment, an embodiment of the present application further provides an image cropping device, and each module of the device can correspondingly implement 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 this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0480] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and 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 into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into 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, and will not be repeated here.
[0481] The embodiment of 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 of any of the above-mentioned method embodiments. For example, 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 is enabled to implement the steps of any of the above-mentioned method embodiments.
[0483] 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 implements the steps of 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. The computer program can be stored in a computer-readable storage medium, and the computer program, when executed by the processor, can implement the steps of the above-mentioned various method embodiments. Wherein, 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 magnetic disk or an optical disk.
[0485] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0486] Those skilled 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 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 merely a logical function division. In actual implementation, there may be other division methods, 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 separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0489] The above-described embodiments 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. An image cropping method, characterized in that: include: Acquire an original image, where the original image includes a target object; Determining the limb aesthetics of the target object, and / or determining the facial aesthetics of the target object; determining a target cropping method corresponding to the original image according to the limb aesthetics and / or the facial aesthetics; 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 prioritizes preserving the integrity of the limbs; and when the target cropping method is a face-priority cropping method, the cropped image prioritizes highlighting facial features.
2. The method according to claim 1, characterized in that Determining the limb aesthetics of the target object includes: determining a limb dynamics of the target object, wherein the limb dynamics is used to characterize a 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 connecting the top of the target object's head and the midpoint of its pelvis 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, characterized in that The determining of the limb aesthetics of the target object according to the limb dynamics includes: 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, characterized in that The determining of the limb aesthetics of the target object according to the limb dynamics includes: Determining the limb stretch of the target subject, where the limb stretch is used to represent the degree of stretch of the limb of the target subject; 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 determining of the limb aesthetics of the target object according to the limb dynamics and the limb stretch comprises: 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 a second threshold, and the limb stretch is less than a 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, characterized in that The determining of the limb aesthetics of the target object according to the limb dynamics includes: determining a limb torsion degree of the target object, wherein the limb torsion degree is used to represent 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.
8. The method according to claim 7, characterized in that The determining of 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 torsion 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 a second threshold, and the limb torsion is less than a sixth threshold, it is determined that the limb aesthetics of the target object meets a second condition; 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, characterized in that The determining of the limb aesthetics of the target object according to the limb dynamics includes: The limb extension and limb twist of the target object are determined, and the limb aesthetics of the target object is determined based on 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 a limb extension degree of the target subject; 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 stretch 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 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 shoulders 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 wrists, a group of joint points corresponding to the knees, and a group of joint points corresponding to the ankles.
13. The method according to claim 10, characterized in that Determining the limb stretch of the target object includes: Determining a first abscissa and a second abscissa, where the first abscissa is the abscissa of a first target joint point of the target object, and the second abscissa is the abscissa of a second target joint point of the target object, where 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 claim 10, 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, determining 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 claim 10, 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 and the limb torsion degree.
17. The method according to claim 16, characterized in that The determining of the limb aesthetics of the target object according to the limb extension and the limb twisting includes: When the limb extension is greater than or equal to a third 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 the first condition; When the limb extension is less than a fourth threshold value, and the limb twisting is less than a sixth threshold value, it is determined that the limb aesthetics of the target object meets the second condition; 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, wherein Determining the limb aesthetics of the target object includes: determining a degree of limb twisting of the target subject; The aesthetics of the limb 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: Obtaining 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 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; 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 claim 18, wherein The step of determining the limb aesthetics of the target object according to the limb torsion degree includes: 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, wherein 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 of the target object is determined based on the facial arousal degree and the facial pleasure degree.
23. The method according to claim 22, characterized in that The determining of the facial beauty of the target object according to the facial arousal degree and the facial pleasure degree includes: When the facial expression arousal degree is greater than or equal to a seventh threshold, or the facial expression pleasure degree is greater than or equal to an eighth threshold, determining that the facial beauty meets a third condition; When the facial expression arousal degree is less than the seventh threshold and the facial expression pleasure degree is less than the eighth threshold, it is determined that the facial beauty meets the fourth condition.
24. The method according to any one of claims 1 to 23, characterized in that The determining of a target cropping method corresponding to the original image according to the limb aesthetics and / or the facial aesthetics 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-priority cropping method.
25. The method according to any one of claims 1 to 23, characterized in that The determining of a target cropping method corresponding to the original image according to the limb aesthetics and / or the facial aesthetics 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 determining of a target cropping method corresponding to the original image according to the limb aesthetics and / or the facial aesthetics 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 cropping method that prioritizes limbs; 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 claim 1, wherein The step of cropping the original image according to the target cropping method to obtain a cropped image includes: determining a 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 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; 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, wherein The determining, according to the offset distance of the target object, a target position of the target object in the cropped image includes: When the facial orientation is sideways, determining an 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, where the original image includes a target object; Determining the limb aesthetics of the target subject; Determining 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-prioritized cropping mode; and when the limb aesthetics 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 a limb dynamics of the target object, wherein the limb dynamics is used to characterize a motion state of the target object; The limb aesthetics of the target object is determined based on 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, wherein Determining the limb aesthetics of the target object includes: Determining the limb stretch of the target subject, where the limb stretch is used to represent the degree of stretch of the limb of the target subject; 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.
34. The method according to claim 31, wherein 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 represent a degree of torsion of the limb of the target object; 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.
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 a 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, wherein 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 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; 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, wherein: 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 is run 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
Human image processing method, device and system and readable storage medium
CN110147833A
Intelligent auto cropping of digital images
CN110612531A
Image display method, electronic device thereof, and medium
WO2023116792A1