Detects visually optimal cropping regions in an image at a specified aspect ratio by using AI model capabilities.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
imm:DetectImageCropping |
none |
*Project
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectName |
string |
Yes |
The project name. |
immtest |
| SourceURI |
string |
No |
The OSS URI of the image. The OSS URI follows the format oss://${Bucket}/${Object}, where |
oss://imm-test/testcases/facetest.jpg |
| AspectRatios |
string |
No |
The list of cropping aspect ratios. You can specify up to 5 ratios. Each ratio must meet the following requirements:
Note
The following cases cause an error: |
["1:1"] |
| CredentialConfig | CredentialConfig |
No |
Leave this parameter empty unless otherwise required. The China authorization configuration. This parameter is optional. For more information, see Use chained authorization to access resources of other entities. |
|
| InclusionHints |
array |
No |
The list of semantic text descriptions for objects that you want the cropping result to include. Each element is free-form text, such as "signboard" or "dish". Note
Usage limits of the InclusionHints parameter:
|
["sign"] |
|
string |
No |
The semantic text description of an object that you want the cropping result to include. |
sign |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The image cropping result. |
||
| Croppings |
array |
The array of image cropping information. |
|
| CroppingSuggestion |
The detailed cropping information of the image. |
||
| RequestId |
string |
The request ID. |
91AC8C98-0F36-49D2-8290-742E24D***** |
| MatchedInclusionHints |
array |
The list of objects included in the cropping region, corresponding to the InclusionHints input parameter. This field is empty if no objects are included. |
|
|
string |
The object included in the cropping region. |
sign |
Examples
Success response
JSON format
{
"Croppings": [
{
"AspectRatio": "2:3",
"Confidence": 0.742,
"Boundary": {
"Width": 200,
"Height": 300,
"Left": 10,
"Top": 30,
"Polygon": [
{
"X": 10,
"Y": 10
}
]
}
}
],
"RequestId": "91AC8C98-0F36-49D2-8290-742E24D*****",
"MatchedInclusionHints": [
"sign"
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.