I think this will work and is quite simple:
- Cut out the bill from your image (use thresholding and/or mask based on the green color)
- Find the contour of your bill
- Find the minAreaRect for your contour (bill)
- Get the angle straight from the resulting RotatedRect and use it to create a rotation matrix with getRotationMatrix2D
- Use warpAffine to rotate your image