Pre-processing techniques for processing an image to improve the
distinctiveness of an information pattern captured in the image before
the information pattern is analyzed in a decoding process. The brightness
of an image first is normalized by dividing the image into blocks of
areas, such as pixels. A brightness distribution value then is determined
for each area of the image by fitting the brightness of its surrounding
blocks using bilinear interpolation and extrapolation, and a normalized
brightness value for each area can then be obtained by dividing the
original brightness value by the brightness distribution value. Next,
masks are created to distinguish the information pattern from content
captured in the image. The masks may be generated based upon contrast
differences between the brightness of pixels representing the information
pattern, the brightness of pixels representing content, and the
brightness of pixels representing the background of the writing medium.