A Spatially Adaptive Statistical Method for the Binarization of Historical Manuscripts and Degraded Document Images