Menu

Obtain coordinates of objects in an image

Post an image body and a comment in English and receive up to 6 sets of coordinates of given objects. You can request point coordinates as well as rectangle coordinates. Maximum image size on one side is 500 pixels. Images larger than that will be downscaled on the worker's interface.

Image-to-Coordinates captcha example, select objects on the picture
Image-to-Coordinates captcha example, draw a rectangle above objects
An example of "points" and "rectangles" tasks

Task object

PropertyTypeRequiredPurpose
typeStringYesImageToCoordinatesTask
Defines the type of task.
bodyStringYesFile body encoded in base64. Make sure to send it without line breaks. Do not include 'data:image/png,' or similar tags, only clean base64!
commentStringNoComments for the task in English characters only. Example: "Select objects in specified order" or "select all cars".
modeStringNoTask mode, can be "points" or "rectangles". The default is "points".
websiteURLStringNoOptional parameter to distinguish source of image captchas in spending statistics.

Request example

Python
Javascript
Go
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)

Task solution object

PropertyTypePurpose
coordinatesStringArray of set of coordinates. For "points" mode it is (x,y) set. For "rectangles" it is (x1,y1,x2,y2), starting from top-left to bottom-right. Coordinates start in the top-left corner.

Response example

{
    "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"
}