Menu

किसी इमेज में ऑब्जेक्ट्स के कोआर्डिनेट्स प्राप्त करें

किसी इमेज का प्रमुख भाग, अंग्रेज़ी में कोई टिप्पणी पोस्ट कर प्रस्तुत ऑब्जेक्ट्स के कोआर्डिनेट्स के 6 सेट तक प्राप्त करें। आप पॉइंट कोआर्डिनेट्स के साथ-साथ रेक्टेंगल कोआर्डिनेट्स का अनुरोध भी कर सकते हैं। एक तरफ़ की इमेज का अधिकतम आकार 500 पिक्सेल है। इससे बड़ी इमेज को कर्मचारी के इंटरफ़ेस पर छोटा कर दिया जाएगा।

Image-to-Coordinates captcha example, select objects on the picture
Image-to-Coordinates captcha example, draw a rectangle above objects
"points" और "rectangles" टास्कों का एक उदाहरण
Python
Node.js
Go
PHP
bash

Python में कोआर्डिनेट्स की इमेज को कैसे हल करें

#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)

Node.js में कोआर्डिनेट्स की इमेज को कैसे हल करें

//npm install @antiadmin/anticaptchaofficial
//https://github.com/anti-captcha/anticaptcha-npm

const ac = require("@antiadmin/anticaptchaofficial");
const fs = require('fs');

const captcha = fs.readFileSync('captcha.png', { encoding: 'base64' });

ac.setAPIKey('YOUR_API_KEY_HERE');

//Specify softId to earn 10% commission with your app.
//Get your softId here: https://anti-captcha.com/clients/tools/devcenter
ac.setSoftId(0);

ac.solveImageToCoordinates(captcha, "Select all objects in specified order", "points")
    .then(coordinates => console.log('image coordinates:', coordinates))
    .catch(error => console.log('test received error '+error));

Go में कोआर्डिनेट्स की इमेज को कैसे हल करें

// Install with:
// go get github.com/anti-captcha/anticaptcha-go

package main

import (
    "encoding/base64"
    "fmt"
    "github.com/anti-captcha/anticaptcha-go"
    "log"
)

func main() {
    // Create API client and set the API Key
    ac := anticaptcha.NewClient("API_KEY_HERE")

    // set to 'false' to turn off debug output
    ac.IsVerbose = true

    // Specify softId to earn 10% commission with your app.
    // Get your softId here: https://anti-captcha.com/clients/tools/devcenter
    //ac.SoftId = 1187

    // Make sure the API key funds balance is positive
    balance, err := ac.GetBalance()
    if err != nil {
        log.Fatal(err)
        // Exit program to make sure you don't DDoS API with requests, while having empty balance
        return
    }
    fmt.Println("Balance:", balance)

    // Solve image-to-coordinates captcha
    imageData, err := ac.ReadImageFile("coordinates.jpg")
    if err != nil {
        log.Fatal(err)
    }
    solution, err := ac.SolveImageToCoordinates(base64.StdEncoding.EncodeToString(imageData), anticaptcha.ImageToCoordinates{
        Comment: "Select object in the specified order",
        Mode:    "points",
    })
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println("Objects X,Y coordinates:", solution)
}

PHP में कोआर्डिनेट्स की इमेज को कैसे हल करें

//git clone https://github.com/anti-captcha/anticaptcha-php.git

include("../anticaptcha.php");
include("../imagetocoordinates.php");

$api = new ImageToCoordinates();
$api->setVerboseMode(true);

//your anti-captcha.com account key
$api->setKey(readline("You API key: "));

//setting file
$api->setFile("captcha.jpg");
$api->setComment("Select all elephants");
$api->setMode("rectangles");

//Specify softId to earn 10% commission with your app.
//Get your softId here: https://anti-captcha.com/clients/tools/devcenter
$api->setSoftId(0);

if (!$api->createTask()) {
    $api->debout("API v2 send failed - ".$api->getErrorMessage(), "red");
    return false;
}

$taskId = $api->getTaskId();


if (!$api->waitForResult()) {
    $api->debout("could not solve captcha", "red");
    $api->debout($api->getErrorMessage());
} else {
    $coordinates    =   $api->getTaskSolution();
    echo "\nresult:\n";
    print_r($coordinates);
    //check result, then if results is wrong:
    $api->reportIncorrectImageCaptcha();
}

bash में कोआर्डिनेट्स की इमेज को कैसे हल करें

curl -i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST -d '{
    "clientKey":"YOUR_API_KEY_HERE",
    "task":
        {
            "type":"ImageToCoordinatesTask",
            "body":"BASE64_BODY_HERE__NO_NEWLINES__NO_EXTRA_TAGS__ONLY_CLEAN_BASE64",
            "comment":"Select all elephants",
            "mode":"rectangles"
        },
    "softId": 0
}' https://api.anti-captcha.com/createTask

टास्क ऑब्जेक्ट

प्रॉपर्टी टाइप आवश्यक लक्ष्य
type स्ट्रिंग हाँ ImageToCoordinatesTask
यह इस बात को परिभाषित करता है कि टास्क किस प्रकार की है।
body स्ट्रिंग हाँ फ़ाइल बॉडी base64 में एन्कोडेड है। कृपया इसे बिना किसी लाइन ब्रेक के ही भेजें। 'data:image/png’ या उससे मिलते-जुलते टैग इसमें शामिल ना करें, केवल clean base64 ही करें!
comment स्ट्रिंग नहीं टास्क के लिए टिप्पणियाँ सिर्फ़ अंग्रेज़ी अक्षरों में। उदाहरण: "निर्दिष्ट ऑर्डर में ऑब्जेक्टों का चयन करें" या फिर "सभी गाड़ियों का चयन करें"।
mode स्ट्रिंग नहीं टास्क मोड, "points" या "rectangles" हो सकता है। डिफ़ॉल्ट "points" है.
websiteURL स्ट्रिंग नहीं खर्चे वाले आँकड़ों में इमेज captchas के स्रोत का फ़र्क करने वाला वैकल्पिक पैरामीटर।

टास्क सॉल्यूशन ऑब्जेक्ट

प्रॉपर्टी टाइप लक्ष्य
coordinates स्ट्रिंग कोआर्डिनेट्स के सेट का ऐरे। "points" मोड के लिए यह (x,y) पर सेट होता है। "rectangles" के लिए यह (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"
}