Any ideas how to use JSON from requests.post to make a cv2 rectangle?

How would I go about turning this into a rectangle in cv2? Also, if there’s a way to save the image with overlay from ocr.space, that would work too.

Example return. This is the top line of one of my images:
{
“LineText”: “New Jersey”,
“MaxHeight”: 76.0,
“MinTop”: 48.0,
“Words”: [
{
“Height”: 56.0,
“Left”: 188.0,
“Top”: 48.0,
“Width”: 216.0,
“WordText”: “New”
},
{
“Height”: 76.0,
“Left”: 416.0,
“Top”: 48.0,
“Width”: 320.0,
“WordText”: “Jersey”
}
]
}

Do you need source code on how to draw the overlay? You can look at the Copyfish source code, it uses the OCR API, too.

Any chance you could link it? I can’t seem to find source code anywhere.

Sorry, forgot. Here: https://github.com/A9T9/Copyfish => https://github.com/A9T9/Copyfish/blob/master/scripts/overlay.js

Probably a dumb question, but is there no way to do this in Python?

Sorry I cant help you with it.