Curve shape text and its coordinate issue - GCP python

Viewed 47

I am facing issue with google cloud vision api response. there is no issue with proper text image. the problem is with curved shape text written image. i attached for reference. when i try to detect text from image that words are shuffling and its not coming properly.

the json i am getting through response is having different coordinate and i could not arrange it properly as shown in the image.

"boundingPoly": {
    "vertices": [
      {
        "x": 395,
        "y": 21
      },
      {
        "x": 421,
        "y": 18
      },
      {
        "x": 423,
        "y": 39
      },
      {
        "x": 398,
        "y": 42
      }
    ]
  },
  "description": "on"
},
{
  "boundingPoly": {
    "vertices": [
      {
        "x": 442,
        "y": 16
      },
      {
        "x": 482,
        "y": 11
      },
      {
        "x": 484,
        "y": 31
      },
      {
        "x": 444,
        "y": 36
      }
    ]
  },
  "description": "the"
},
{
  "boundingPoly": {
    "vertices": [
      {
        "x": 263,
        "y": 22
      },
      {
        "x": 297,
        "y": 18
      },
      {
        "x": 300,
        "y": 45
      },
      {
        "x": 266,
        "y": 49
      }
    ]
  },
  "description": "all"
},
{
  "boundingPoly": {
    "vertices": [
      {
        "x": 316,
        "y": 15
      },
      {
        "x": 382,
        "y": 7
      },
      {
        "x": 385,
        "y": 35
      },
      {
        "x": 319,
        "y": 43
      }
    ]
  },
  "description": "items"
},
{
  "boundingPoly": {
    "vertices": [
      {
        "x": 330,
        "y": 57
      },
      {
        "x": 399,
        "y": 61
      },
      {
        "x": 397,
        "y": 99
      },
      {
        "x": 328,
        "y": 95
      }
    ]
  },
  "description": "have"
},
{
  "boundingPoly": {
    "vertices": [
      {
        "x": 420,
        "y": 63
      },
      {
        "x": 501,
        "y": 68
      },
      {
        "x": 499,
        "y": 105
      },
      {
        "x": 418,
        "y": 100
      }
    ]
  },
  "description": "impact"
},

the json is very lengthy so i added very few

i have tried here - >google vision api demo

refence image1

google vision api demo api result

the expected result should be same as the image shown

i am struggling with this past few days. all your support and help will be appreciated.

0 Answers
Related