1

So I have a problem that requires me to get a perspective transform on a series of numbers. However, in order to get the four point transform, I need the correct points to send as parameters to the function. I couldn't find any methods that will solve this problem, and I've tried convex hull (returns more than four), minAreaRect (it returns a rectangle). This is the image I've been working with

  • You can try use Radon transform. It will be necessary to find two angles at which the difference between the maximum and minimum projection values is minimal. – Alex Alex Sep 28 '20 at 16:54
  • I couldn't understand the question relationship with the optical-character-recognition (`ocr`)? – Ahmet Sep 28 '20 at 20:03

1 Answers1

0

I don't have a lot of experience with OCR, but I would hope all the text segments live on the same perspective plane.

If so, how about using a simplified convex Hull (e.g. convexHull() then approxPolyDP) on one of seven connected components to get the points / compute perspective, then apply the same unwarp to an a scaled quad that encloses all the components ? (probably not perfect, but close)

Hopefully the snippets in this answer will help: 4 point poly around the image of an envelope

I really hope the same perspective transformation can be applied to each yellow text connected component.

George Profenza
  • 50,687
  • 19
  • 144
  • 218