# char2img

## PURPOSE

Convert ascii text to a binary image using pre-computed templates.

## SYNOPSIS

function masks = char2img( strings, h, pad )

## DESCRIPTION

     Convert ascii text to a binary image using pre-computed templates.

     Input strings can only contain standard characters (ascii character
     32-126). First time char2img() is ever called with a given height h,
     txt2img() is used to create a template for each ascii character. All
     subsequent calls to to char2img() with the given height are very fast as
     the pre-computed templates are used and no display/screen capture is
     needed.

     USAGE
      masks = char2img( strings, h, [pad] )

     INPUTS
      strings  - {1xn} text string or cell array of text strings to convert
      h        - font height in pixels
      pad      - [0] amount of extra padding between chars

     OUTPUTS
      masks    - {1xn} binary image masks of height h for each string

     EXAMPLE
      mask=char2img('hello world',50); im(mask{1})
      mask=char2img(num2str(pi),35); im(mask{1})

     See also TXT2IMG

     Piotr's Image&Video Toolbox      Version 2.65
     Copyright 2012 Piotr Dollar.  [pdollar-at-caltech.edu]
     Please email me if you find bugs, or have suggestions or questions!
     Licensed under the Simplified BSD License [see external/bsd.txt]