Application of a lattice gas model for subpixel processing of low-resolution images of binary structures