2

I tried using the code given as an answer on this link: How to find the corners of a Rect object in openCV?

I must acknowledge that this code works very well except some of the parts as you can see below:

I tried feeding the image [source image]enter image description here

and got a weird result back [resulting image]: enter image description here

As you can see, the resulting image is tilted 90 degrees clockwise and also the text is mirrored.

Can anyone please help me out in this and suggest what changes should I make in the above code in order to get the correct output.

Thanks in advance.

Community
  • 1
  • 1
Manpreet
  • 570
  • 5
  • 20

1 Answers1

4

I figured out the issue with the program. It was due to the ordering of the coordinates. The coordinates of the original image were not according to the coordinates I was using for the resulting image.

The changed the order of the co-ordinates in the original image as Bottom-left, Top-left, Top-right and Bottom-right. I set this because I was taking the same ordering for my resulting image.

Hope it helps.enter image description here

Please let me know if anything is not clear.

Osama Yawar
  • 361
  • 2
  • 6
  • 19
Manpreet
  • 570
  • 5
  • 20
  • Thanks for the solution. I was going crazy when I also got the same issue. You hit the right spot. Thanks again for saving my time. – Osama Yawar Nov 08 '14 at 23:10