Detects a visually optimal cropping box in an image for a specified aspect ratio.
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 URI must be in the format |
oss://imm-test/testcases/facetest.jpg |
| AspectRatios |
string |
No |
A list of aspect ratios for cropping. You can specify up to five ratios. The following requirements apply to each aspect ratio:
Note
An error occurs in the following cases: |
["1:1"] |
| CredentialConfig | CredentialConfig |
No |
Leave this parameter empty unless you have specific authorization requirements. Specifies the configuration for chained authorization. This parameter is optional. For more information, see Use chained authorization to access resources of other entities. |
|
| InclusionHints |
array |
No |
A list of semantic text descriptions for objects that you want the cropping result to include. Each element is free-form text, such as "sign" or "dish". Note
The |
["sign"] |
|
string |
No |
A 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 results. |
||
| Croppings |
array |
An array of suggested crops. |
|
| CroppingSuggestion |
The details of a suggested crop. |
||
| RequestId |
string |
The request ID. |
91AC8C98-0F36-49D2-8290-742E24D***** |
| MatchedInclusionHints |
array |
A list of hints from the |
|
|
string |
A hint matched in the cropping box. |
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.