Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Contour perspective warp

I want to automate a process, text is recognized from a specific card type.

image description

I will first explain what I dit so far. First I converted the image to a grayscale one:

image description

Then I applied Canny:

image description

By the result of this, it was easy to find the largest contour:

image description

So far so good. The problem is: I have a shape here which fits in rectangle. However, the perspective is not top-down. Which implies that it is not possible to use boundingRect. Basically I'm in need of an algorithm to find the orientation of this contour.

I have no idea how to do this. Is there something I am missing? How would you do this?

Contour perspective warp

I want to automate a process, process where text is recognized from a specific card type.type:

image description

I will first explain what I dit so far. First I converted the image to a grayscale one:

image description

Then I applied Canny:

image description

By the result of this, it was easy to find the largest contour:

image description

So far so good. The problem is: I have a shape here which fits in rectangle. However, the perspective is not top-down. Which implies that it is not possible to use boundingRect. Basically I'm in need of an algorithm to find the orientation of this contour.

I have no idea how to do this. Is there something I am missing? How would you do this?

Contour perspective warp

I want to automate a process where text is recognized from a specific card type:

image description

I will first explain what I dit so far. First I converted the image to a grayscale one:

image description

Then I applied Canny:

image description

By the result of this, it was easy to find the largest contour:

image description

So far so good. The problem is: I have a shape here which fits in rectangle. However, the perspective is not top-down. Which implies that it is not possible to use boundingRect. Basically I'm in need of an algorithm to find the orientation of this contour.

I have no idea how to do this. Is there something I am missing? How would you do this?

Edit: Note that the above photo is not a good example, let me add another test case:

image description