Skip to main content

Scanning text from an image file with the React Native OCR Module

Running OCR on arbitrary images

You can run OCR on arbitrary image files (JPG or PNG) provided as file URIs:

Perform OCR
loading...

OCR results

The OCR result contains the recognized plain text as well as the bounding boxes and text results of recognized blocks (paragraphs), lines and words:

{
"recognizedText": "Lorem ipsum dolor sit amet, consectetur\nadipiscing elit. Cdopkx gbydo drsc dohd.",
"pages": [{
"_type": "Page",
"text": "Lorem ipsum dolor sit amet, consectetur\nadipiscing elit. Cdopkx gbydo drsc dohd.",
"confidence": 0.9996336102485657,
"roi": [{"x": 88, "y": 80}, {"x": 1016, "y": 80}, {"x": 1016, "y": 208}, {"x": 88, "y": 208}],
"blocks": [{
"_type": "Block",
"text": "Lorem ipsum dolor sit amet, consectetur\nadipiscing elit. Cdopkx gbydo drsc dohd.",
"confidence": 0.9996336102485657,
"roi": [{"x": 88, "y": 80}, {"x": 1016, "y": 80}, {"x": 1016, "y": 208}, {"x": 88, "y": 208}],
"lines": [{
"_type": "Line",
"text": "Lorem ipsum dolor sit amet, consectetur",
"confidence": 0.9998694062232971,
"roi": [{"x": 88, "y": 80}, {"x": 1012, "y": 80}, {"x": 1012, "y": 124}, {"x": 88, "y": 124}],
"words": [{
"_type": "Word",
"text": "Lorem",
"confidence": 0.9999752044677734,
"roi": [{"x": 96.75828552246094, "y": 80}, {"x": 219.37440490722656, "y": 80}, {"x": 219.37440490722656, "y": 124}, {"x": 96.75828552246094, "y": 124}],
"glyphs": [{
"_type": "Glyph",
"text": "L",
"confidence": 0.9999958276748657,
"roi": [{"x": 96.75829315185547, "y": 80}, {"x": 114.2748794555664, "y": 80}, {"x": 114.2748794555664, "y": 124}, {"x": 96.75829315185547, "y": 124}]
}, {
"_type": "Glyph",
"text": "o",
"confidence": 0.9999903440475464,
"roi": [{"x": 109.89573669433594, "y": 80}, {"x": 140.5497589111328, "y": 80}, {"x": 140.5497589111328, "y": 124}, {"x": 109.89573669433594, "y": 124}]
}, {
"_type": "Glyph",
"text": "r",
"confidence": 0.99998939037323,
"roi": [{"x": 136.1706085205078, "y": 80}, {"x": 162.44549560546875, "y": 80}, {"x": 162.44549560546875, "y": 124}, {"x": 136.1706085205078, "y": 124}]
}, {
"_type": "Glyph",
"text": "e",
"confidence": 0.9999228715896606,
"roi": [{"x": 162.44549560546875, "y": 80}, {"x": 188.7203826904297, "y": 80}, {"x": 188.7203826904297, "y": 124}, {"x": 162.44549560546875, "y": 124}]
}, {
"_type": "Glyph",
"text": "m",
"confidence": 0.9999774694442749,
"roi": [{"x": 184.3412322998047, "y": 80}, {"x": 219.37440490722656, "y": 80}, {"x": 219.37440490722656, "y": 124}, {"x": 184.3412322998047, "y": 124}]
}]
},
{
"_type": "Word",
"text": "ipsum",
"confidence": 0.9993802309036255,
"roi": [{"x": 245.64927673339844, "y": 80}, {"x": 368.265380859375, "y": 80}, {"x": 368.265380859375, "y": 124}, {"x": 245.6492919921875, "y": 124}],
"glyphs": [{
"_type": "Glyph",
"text": "i",
"confidence": 0.9975591897964478,
"roi": [{"x": 245.6492919921875, "y": 80}, {"x": 258.7867431640625, "y": 80}, {"x": 258.7867431640625, "y": 124}, {"x": 245.6492919921875, "y": 124}]
}, {
"_type": "Glyph",
"text": "p",
"confidence": 0.9996521472930908,
"roi": [{"x": 258.7867431640625, "y": 80}, {"x": 280.6824645996094, "y": 80}, {"x": 280.6824645996094, "y": 124}, {"x": 258.7867431640625, "y": 124}]
}, {
"_type": "Glyph",
"text": "s",
"confidence": 0.9999656677246094,
"roi": [{"x": 280.6824645996094, "y": 80}, {"x": 306.95733642578125, "y": 80}, {"x": 306.95733642578125, "y": 124}, {"x": 280.6824645996094, "y": 124}]
}, {
"_type": "Glyph",
"text": "u",
"confidence": 0.9997465014457703,
"roi": [{"x": 306.95733642578125, "y": 80}, {"x": 333.23223876953125, "y": 80}, {"x": 333.23223876953125, "y": 124}, {"x": 306.95733642578125, "y": 124}]
}, {
"_type": "Glyph",
"text": "m",
"confidence": 0.9999798536300659,
"roi": [{"x": 333.23223876953125, "y": 80}, {"x": 368.2654113769531, "y": 80}, {"x": 368.2654113769531, "y": 124}, {"x": 333.23223876953125, "y": 124}]
}]
}]
// ...
}]
// ...
}]
}]
}

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license