1. An algorithm for producing from an input original image a diagonal direction label image ( 4 ) and a nondiagonal direction label image ( 5 ), comprising of selecting a 3×3 neighborhood ( 6 ) with the pixel of interest in the center; in each said neighborhood the absolute value of the errors between the center pixel and the interpolated values in the horizontal, vertical and two diagonal directions is calculated and used to initially label all the center pixels to produce the initial diagonal direction label image and initial nondiagonal direction label image; using a median filter, or other impulsive noise removal algorithm on the initial diagonal direction label image and initial nondiagonal direction label image to produce the diagonal direction label image ( 4 ) and nondiagonal direction label image ( 5 ).