Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Scan your ticket with a flatbed scanner and use black background. 1.1. If you cannot scan, make sure the ticket is flat and take a picture. You can flatten the ticket by putting it under a flat glass, but then you need to make sure there are no reflections (shoot at an angle and see 3.1)
  2. Threshold your image to get the region of your ticket.
  3. Use findContours, then find minAreaRectangle and straighten your ticket by: 3.1. Get 4 corner points and warpPerspective your ticket to a predefined size 3.2. If you scan you can simply counter rotate your ticket by your RotatedRect.angle
  4. Having a straight ticked of known size, set ROIs to afore measured regions of interest and pass them to tesseract.
  1. Scan your ticket with a flatbed scanner and use black background. 1.1. If you cannot scan, make sure the ticket is flat and take a picture. You can flatten the ticket by putting it under a flat glass, but then you need to make sure there are no reflections (shoot at an angle and see 3.1)
  2. Threshold your image to get the region of your ticket.
  3. Use findContours, then find minAreaRectangle and straighten your ticket by: by:

3.1. Get 4 corner points and warpPerspective your ticket to a predefined size 3.2. If you scan you can simply counter rotate your ticket by your RotatedRect.angle

  • RotatedRect.angle, however if you put your ticket carefully, it should be straight enough, so you can skip the entire point no 3. 4. Having a straight ticked of known size, set ROIs to afore measured regions of interest and pass them to tesseract.
    1. Scan your ticket with a flatbed scanner and use black background. 1.1. If you cannot scan, make sure the ticket is flat and take a picture. You can flatten the ticket by putting it under a flat glass, but then you need to make sure there are no reflections (shoot at an angle and see 3.1)
    2. Threshold your image to get the region of your ticket.
    3. Use findContours, then find minAreaRectangle and straighten your ticket by:

    3.1. Get 4 corner points and warpPerspective your ticket to a predefined size size.

    3.2. If you scan you can simply counter rotate your ticket by your RotatedRect.angle, however if you put your ticket carefully, it should be straight enough, so you can skip the entire point no 3. 4. 3.

    1. Having a straight ticked of known size, set ROIs to afore measured regions of interest and pass them to tesseract.

    1. Scan your ticket with a flatbed scanner and use black background. 1.1. If you cannot scan, make sure the ticket is flat and take a picture. You can flatten the ticket by putting it under a flat glass, but then you need to make sure there are no reflections (shoot at an angle and see 3.1)
    2. Threshold your image to get the region of your ticket.
    3. Use findContours, then find minAreaRectangle and straighten your ticket by:

    3.1. Get 4 corner points and warpPerspective your ticket to a predefined size.

    3.2. If you scan you can simply counter rotate your ticket by your RotatedRect.angle, however if you put your ticket carefully, it should be straight enough, so you can skip the entire point no 3.

    1. Having a straight ticked of known size, set ROIs to afore measured regions of interest and pass them to tesseract.

    1. Scan your ticket with a flatbed scanner and use black background. background.

    1.1. If you cannot scan, make sure the ticket is flat and take a picture. You can flatten the ticket by putting it under a flat glass, but then you need to make sure there are no reflections (shoot at an angle and see 3.1)

  • 3.1) 2. Threshold your image to get the region of your ticket.
  • ticket. 3. Use findContours, then find minAreaRectangle and straighten your ticket by:

    3.1. Get 4 corner points and warpPerspective your ticket to a predefined size.

    3.2. If you scan you can simply counter rotate your ticket by your RotatedRect.angle, however if you put your ticket carefully, it should be straight enough, so you can skip the entire point no 3.

    1. Having a straight ticked of known size, set ROIs to afore measured regions of interest and pass them to tesseract.

    1. 1 Scan your ticket with a flatbed scanner and use black background.

    1.1. 1.1 If you cannot scan, make sure the ticket is flat and take a picture. You can flatten the ticket by putting it under a flat glass, but then you need to make sure there are no reflections (shoot at an angle and see 3.1) 2. 3.1)

    2 Threshold your image to get the region of your ticket. 3. ticket.

    3 Use findContours, then find minAreaRectangle and straighten your ticket by:

    3.1. Get 4 corner points and warpPerspective your ticket to a predefined size.

    3.2. If you scan you can simply counter rotate your ticket by your RotatedRect.angle, however if you put your ticket carefully, it should be straight enough, so you can skip the entire point no 3.

    1. 4 Having a straight ticked ticket of known size, set ROIs to afore measured regions of interest and pass them to tesseract.

    1 Scan your ticket with a flatbed scanner and use black background.

    1.1 If you cannot scan, make sure the ticket is flat and take a picture. You can flatten the ticket by putting it under a flat glass, but then you need to make sure there are no reflections (shoot at an angle and see 3.1)

    2 Threshold your image to get the region of your ticket.

    3 Use findContours, then find minAreaRectangle of the largest contour and straighten your ticket by:

    3.1. Get 4 corner points and warpPerspective your ticket to a predefined size.

    3.2. If you scan you can simply counter rotate your ticket by your RotatedRect.angle, however if you put your ticket carefully, it should be straight enough, so you can skip the entire point no 3.

    4 Having a straight ticket of known size, set ROIs to afore measured regions of interest and pass them to tesseract.