POST extract_text

Given a list of images or of image URLs, extract the associated text data.

Resource URL

https://wineengine.tineye.com/<company>/rest/extract_text/

Notes

The text data returned for each image will include the text lines and their location information so that you can highlight them in your images.

The locations returned by WineEngine will always refer to the input image and are provided as bounding boxes described using four corners.

Please note that if your image has solid color borders, those might be cropped out by WineEngine. In that case the locations returned will only refer to the cropped version of the image.

Parameters

In addition to the Common parameters there are:

Image

Key

Description

image

An image file object whose text data will be extracted.

Images

Key

Description

images[0]

An image file object whose text data will be extracted.

images[n] (optional)

An image file object whose text data will be extracted.

URL

Key

Description

url

A URL of an image file whose text data will be extracted.

URLs

Key

Description

urls[0]

A URL of an image file whose text data will be extracted.

urls[n] (optional)

A URL of an image file whose text data will be extracted.

Request examples

Images

curl https://wineengine.tineye.com/<company>/rest/extract_text/   \
     -F "image=@image1.jpg"

or

curl https://wineengine.tineye.com/<company>/rest/extract_text/   \
     -F "images[0]=@image1.jpg"                                   \
     -F "images[1]=@image2.jpg"

URLs

curl https://wineengine.tineye.com/<company>/rest/extract_text/   \
     -F "url=http://example.com/image1.jpg"

or

curl https://wineengine.tineye.com/<company>/rest/extract_text/   \
     -F "urls[0]=http://example.com/image1.jpg"                   \
     -F "urls[1]=http://example.com/image2.jpg"

Response examples

JSON

{
    "method": "extract_text",
    "status": "ok",
    "error": [],
    "result": [
        {
            "filepath": "image1.jpg",
            "text_lines": [
                "LOUIS JADOT",
                "2015",
                "FONDEE EN 1859",
                "BOURGOGNE",
                "PINOT NOIR"
           ]
        },
        {
            "filepath": "image2.jpg",
            "text_lines": [
                "Beronia",
                "RIOJA",
                "DENOMINACIÓN DE ORIGEN CALIFICADA",
                "Product of Spain",
                "TEMPRANILLO",
                "2013",
                "BOTTLED BY/MIS ENBOUTEILLE PAR",
                "Bodegas Beronia",
                "OLLAURI-ESPAÑA",
                "RE.5229-LO"
            ]
        }
    ],
    "stats": {
        "time_resize": 51.12,
        "time_detect_label": 185.08,
        "time_extract_text": 151.91,
        "time_total": 388.12
    }
}

XML

<?xml version="1.0" encoding="utf-8"?>
<data>
    <method>extract_text</method>
    <status>ok</status>
    <error/>
    <result>
        <item>
            <filepath>image1.jpg</filepath>
            <text_lines>
                <item>LOUIS JADOT</item>
                <item>2015</item>
                <item>FONDEE EN 1859</item>
                <item>BOURGOGNE</item>
                <item>PINOT NOIR</item>
            </text_lines>
        </item>
        <item>
            <filepath>image2.jpg</filepath>
            <text_lines>
                <item>Beronia</item>
                <item>RIOJA</item>
                <item>DENOMINACIÓN DE ORIGEN CALIFICADA</item>
                <item>Product of Spain</item>
                <item>TEMPRANILLO</item>
                <item>2013</item>
                <item>BOTTLED BY/MIS ENBOUTEILLE PAR</item>
                <item>Bodegas Beronia</item>
                <item>OLLAURI-ESPAÑA</item>
                <item>RE.5229-LO</item>
            </text_lines>
        </item>
    </result>
    <stats>
        <time_resize>51.12<time_resize>
        <time_detect_label>185.08</time_detect_label>
        <time_extract_text>151.91</time_extract_text>
        <time_total>388.12</time_total>
    </stats>
</data>