获取图像中物体的坐标
发布图像正文和英文评论,最多可收到 6 组指定对象的坐标。您可以请求点坐标,也可以请求矩形坐标。图像单边最大尺寸为 500 像素。大于 500 像素的图像将在 Worker 界面进行缩放。
点 "points " "rectangles "任务示例
任务对象
属性 | 类型 | 必须使用 | 用途 |
---|---|---|---|
type | 字符串 | 是 | ImageToCoordinatesTask 指定任务类型。 |
body | 字符串 | 是 | 文件主体以 base64 方式编码。一定要在没有换行符的情况下发送文件主体。不要包括“data:image/png”或类似的标记,仅使用纯净的 base64 格式! |
comment | 字符串 | 否 | 对任务的评论,仅使用英文字符。例如"Select objects in specified order "或 "select all cars"。 |
mode | 字符串 | 否 | 任务模式,可以是 "points "或 "rectangles"。默认为 "points"。 |
websiteURL | 字符串 | 否 | 自愿使用的参数,用于在支出统计数据中区分图片人机验证谜题来源。 |
请求示例
Python
Javascript
PHP
bash
#pip3 install anticaptchaofficial
from anticaptchaofficial.imagetocoordinates import *
solver = imagetocoordinates()
solver.set_verbose(1)
solver.set_key("YOUR_KEY")
solver.set_mode("points")
solver.set_comment("Select objects in specified order")
coordinates = solver.solve_and_return_solution("coordinates.png")
if coordinates != 0:
print("coordinates: ", coordinates)
else:
print("task finished with error "+solver.error_code)
任务破解结果对象
属性 | 类型 | 用途 |
---|---|---|
coordinates | 字符串 | 坐标数组。点 "模式下为(x,y)集。对于 "矩形 "模式,坐标为(x1,y1,x2,y2),从左上角到右下角。坐标从左上角开始。 |
回应示例
{
"errorId":0,
"status":"ready",
"solution":
{
"coordinates":[
[17,48,54,83],
[76,93,140,164]
]
},
"cost":"0.000700",
"ip":"46.98.54.221",
"createTime":1472205564,
"endTime":1472205570,
"solveCount":"0"
}