Get Document Vertex Coordinates

Returns the four vertex coordinates of the document in the image. If no document is present, returns the four vertex coordinates of the image. If some vertices of the document are outside the image, returns the intersection of the document boundary and image boundary.

Request URL

POST /v1/document/corners

Request Parameters

Parameter NameData TypeRequiredDescription
imagefileYesDocument image. Currently supports most formats like jpg, png, bmp, etc. Note that the data format of the request body should be FormData. File size should not exceed 10M, and image width and height should be between 50 and 10000 pixels.

Request Example

curl --location --request POST 'localhost:8000/api/document/corners' --header 'Content-Type: multipart/form-data; boundary=--------------------------994702659308423812684350' --form 'image=@/data/your-image.jpg'

Response Parameters

Parameter NameData TypeDescription
codeint0 indicates a normal return; other values refer to the error code description.
dataobject
existsboolIndicates if a document exists.
cornersarrayThe four vertex coordinates of the document. If no document is detected, corners will return the four vertext coordinates of the original input image.

Response Example

{
  "code": 0,
  "data": {
    "corners": [
      [
        283,
        6
      ],
      [
        283,
        4013
      ],
      [
        2633,
        6
      ],
      [
        2633,
        4013
      ]
    ],
    "exists": true
  }
}
secure-scanner.net 版权所有@2024 京ICP备2024096961号