Font Padding
The characters you define within the bounding box can be any size and may or may not touch the bounding box itself. Most fonts leave a space around the character called padding. Each character can have unique padding but it is common to use the same padding for consistency of appearance. See Font padding.
The following are some general guidelines for padding.
- In general use less padding rather than more. Larger padding results in a slower read operation since there are more pixels to process.
- Although characters before padding may have different height, you should pad the top and/or bottom so that the bounding boxes of all padded characters have the same height. Also, adjust the padding so that when all the character bounding boxes are aligned vertically, all of the characters have a common baseline.
- The side padding for the width dimension depends on the shape of the characters. A good rule is to use the side padding to balance the amount of background and foreground information. Keep in mind that too much padding will degrade the read performance. You may wish to determine the side padding value empirically.
- If you are converting a proportional width font to fixed width font by padding along the width dimension, keep in mind that too much padding will degrade the read performance. Also, keep in mind that acuRead may fail if the inter-character spacing is too large.
These guidelines work best in applications where you are designing the printed fonts as well as designing the OCR system. Here more padding simply spaces out the characters and increases the number of pixels that must be processed.
However, be aware that in applications where you are reading character strings printed by equipment you do not control, you need to tailor the padding to the fonts you will read. Too much padding can cause acuRead to fail rather than just increasing compute time. Choose padding so that the inter-character spacing remains roughly constant throughout the string, while providing each character with some side padding, at least 1-3 pixels on each side with more padding for larger characters.