A method for detecting an edge and generating an interpolated edge pixel
at a target pixel position between two lines of an interlace scan image
first determines gradient intensities in the horizontal and vertical
directions and then calculates the angle of the edge by comparing the
gradient intensities. The interpolated pixel value is calculated from
samples in the interlace scan image that lie along the identified angle
and are proximate to the target pixel position. The method represents the
gradient strengths and the difference between them as bit strings;
locates the most significant non-zero bit in the larger gradient value;
divides the value of the corresponding bit position in the difference
string, and a predetermined number of following positions, by increasing
powers of 2; sums the results; subtracts the sum from 1.0 and uses the
inverse tangent function to calculate the angle of the edge.