Efficient Algorithms For Correlation Pattern Recognition