Document Intelligence - Model error: Polygon must be convex, points must be in clockwise order.

DANIEL, Jack (RKBRG) 0 Reputation points
2024-08-09T18:35:15.51+00:00

I have not come across this error before and cannot locate the field within the document that is causing the error. There are over 100 fields within this document. Is there a way to locate the field that is not convex or its points are anticlockwise?

Any help would be greatly appreciated.

Thanks

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,971 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 10,175 Reputation points
    2024-08-09T20:07:02.2366667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    To locate the problem, you can follow these steps:

    • Use the Document Intelligence API to analyze the document and get the bounding polygons for each detected element. This can be done by using the AnalyzeResult from the Document Intelligence client library.
    • Review the bounding polygons for each detected element. Ensure that each polygon is a convex quadrilateral and that the points are listed in a clockwise order.
    • For each polygon, check if it is convex. A polygon is convex if all its interior angles are less than 180 degrees and it does not self-intersect. Additionally, ensure that the points are ordered clockwise.
    • If you have access to the raw output, you can manually inspect the coordinates of the polygons to identify any anomalies. Look for polygons that are not quadrilaterals or have points that do not follow the expected order.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.