# Eliminate Foreground Fragments

For many images, valid characters consist of grey values that are well above or well below the foreground threshold (see the previous section) used to distinguish potential character pixels from background pixels. Pixels that barely pass the threshold for character pixels can often be interpreted as image noise and be removed from further consideration.

After using a foreground threshold to distinguish potential character pixels from background pixels, the OCRMax tool further processes the image by using a fragment contrast threshold to remove non-character fragments from consideration.

The default value for the fragment contrast threshold works well for most test cases. If the contrast in the characters in strings can vary between images, especially where some valid characters can appear to be faint, lowering the fragment contrast threshold can prevent the tool from eliminating valid characters from consideration.

Use the CharacterFragmentContrastThreshold to specify a different fractional percentage.

If, during the process of separating individual characters from each other, the tool attempts to include non-character pixels in its analysis, try modifying the character fragment contrast threshold. You may need to experiment with your test images to determine the best value.