Digital image processing and pattern recognition