Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think this will work and is quite simple:

  1. Cut out the bill from your image (use thresholding and/or mask based on the green color)
  2. Find the contour of your bill
  3. Find the minAreaRect for your contour (bill)
  4. Get the angle straight from the resulting RotatedRect and use it to create a rotation matrix with getRotationMatrix2D
  5. Use warpAffine to rotate your image