Perfect Window Memoization : A Theoretical Model of an Optimization Technique for Image Processing Algorithms