Characterization of the boundaries of thin films of TiO2 by atomic force microscopy and optical methods