ComplexImageTask Recognition
Request parameters
type
<string>requiredComplexImageTask
class
<string>requiredrecognition
imagesBase64
<array>requiredImages array in base64 encoding. Example: [ “/9j/4AAQSkZJRgABAQEAAAAAAAD…”]
metadata.Task
<string>requiredPossible values: oocl_rotate_new
and others
Task name (in English).
oocl_rotate_new
Create task oocl_rotate_new
In the request we pass two images: background and circle.
https://api.capmonster.cloud/createTask
Request
{
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"{background_base64}",
"{circle_base64}"
],
"metadata": {
"Task": "oocl_rotate_new"
}
}
}
Background example (background_base64):
Circle example (circle_base64):
Response
{
"errorId":0,
"taskId":407533072
}
Get task result oocl_rotate_new
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response Degrees by which the circle should be rotated clockwise.
{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution": {
"answer":[130.90909]
},
"metadata": {
"AnswerType":"NumericArray"
}
}
oocl_rotate_double_new
Create task oocl_rotate_double_new
In the request we pass three images: background, ring, circle.
https://api.capmonster.cloud/createTask
Request
{
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"{background_base64}",
"{ring_base64}",
"{circle_base64}"
],
"metadata": {
"Task": "oocl_rotate_double_new"
}
}
}
Background (background_base64):
Ring (ring_base64):
Circle (circle_base64):
Response
{
"errorId":0,
"taskId":407533072
}
Get task result oocl_rotate_double_new
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response Degrees by which the ring should be turned counterclockwise and the circle clockwise.
{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution": {
"answer":[130.90909]
},
"metadata": {
"AnswerType":"NumericArray"
}
}
betpunch_3x3_rotate
Create task betpunch_3x3_rotate
In the request we pass nine images. The images must be passed in the following order:
https://api.capmonster.cloud/createTask
Request
{
"clientKey": "API_KEY",
"task": {
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"{image_1_Base64}",
"{image_2_Base64}",
"{image_3_Base64}",
"{image_4_Base64}",
"{image_5_Base64}",
"{image_6_Base64}",
"{image_7_Base64}",
"{image_8_Base64}",
"{image_9_Base64}",
],
"metadata": {
"Task": "betpunch_3x3_rotate"
}
}
}
Response
{
"errorId":0,
"taskId":407533072
}
Get task result betpunch_3x3_rotate
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 407533072
}
Response "answer":[X,X,X,X,X,X,X,X,X], where X is an integer value from 1 to 4 for each image. 4 - means that the image does not need to be rotated; 1-3 - the number of counterclockwise rotations of the image.
{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution":
{
"answer":[4,4,4,4,4,3,1,2,2],
"metadata":{"AnswerType":"NumericArray"}
}
}
bls
Create task bls
In the request, we send 9 images in base64 format. We also pass the sought value TaskArgument in the metadata.
https://api.capmonster.cloud/createTask
Request
{
"clientKey":{{API_key}},
"task":
{
"type": "ComplexImageTask",
"class": "recognition",
"imagesBase64": [
"image1_to_base64",
"image2_to_base64",
"image3_to_base64",
"image4_to_base64",
"image5_to_base64",
"image6_to_base64",
"image7_to_base64",
"image8_to_base64",
"image9_to_base64"
],
"metadata": {
"Task": "bls_3x3",
"TaskArgument": "123"
}
}
}
Example task:
Send images converted to base64:
For this example: "TaskArgument": "546"
Response
{
"errorId":0,
"taskId":143998457
}
Get task result bls
https://api.capmonster.cloud/getTaskResult
Request
{
"clientKey":"API_KEY",
"taskId": 143998457
}
Response An array of values with elements true or false, depending on whether the number in the image is the sought argument or not.
{
"errorId":0,
"status":"ready",
"errorCode":null,
"errorDescription":null,
"solution": {
"answer":[true,true,false,false,true,false,false,true,true],
"metadata": {
"AnswerType":"Grid"
}
}
}