Directional Cubic Convolution Interpolation (DCCI) is an edge-directed image scaling algorithm created by Dengwen Zhou and Xiaoliu Shen.[1]
By taking into account the edges in an image, this scaling algorithm reduces artifacts common to other image scaling algorithms. For example, staircase artifacts on diagonal lines and curves are eliminated.
The algorithm resizes an image to 2x its original dimensions, minus 1.[2]
Evaluation of diagonal pixels is done on the original image data in a 4×4 region, with the new pixel that is being calculated in the center, in the gap between the original pixels. This can also be thought of as the 7×7 region in the enlarged image centered on the new pixel to calculate, and the original pixels have already been copied.
The algorithm decides one of three cases:
Edge in up-right direction — interpolates along down-right direction.
Edge in down-right direction — interpolates along up-right direction.
Smooth area — interpolates in both directions, then multiples the values by weights.
Calculating diagonal edge strength
Let d1 be the sum of edges in the up-right direction, and d2 be the sum of edges in the down-right direction.
To calculate d1, take the sum of abs(P(X, Y) - P(X - 1, Y + 1)), in the region of X = 1 to 3, and Y = 0 to 2.
To calculate d2, take the sum of abs(P(X, Y) - P(X + 1, Y + 1)), in the region of X = 0 to 2, and Y = 0 to 2.
If (1 + d1) / (1 + d2) > 1.15, then there is an edge in the up-right direction. If (1 + d2) / (1 + d1) > 1.15, then there is an edge in the down-right direction.
Otherwise, one is in a smooth area. To avoid division and floating-point operations, this can also be expressed as 100 * (1 + d1) > 115 * (1 + d2), and 100 * (1 + d2) > 115 * (1 + d1).
In the smooth area, edge strength from up-right will contribute to the down-right sampled pixel, and edge strength from down-right will contribute to the up-right sampled pixel.
Evaluating the remaining pixels is done on the scaled image data in a 7×7 region, with the new pixel that is being calculated in the center. These calculations either depend on the original pixels of the image or on a diagonal pixel calculated in the previous step.
The algorithm decides one of three cases:
Edge in horizontal direction — interpolates along vertical direction.
Edge in vertical direction — interpolates along horizontal direction.
Smooth area — interpolates in both directions, then multiples the values by weights.
Let d1 be the sum of edges in the horizontal direction, and d2 be the sum of edges in the vertical direction.
Consider a 7×7 diamond-shaped region centered on the pixel to calculate, using only pixel values from the original, and pixel values added from the diagonal direction.
To calculate d1, take the sum of the absolute differences of the horizontal edges, sampling these pixel values:
In the smooth area, horizontal edge strength will contribute to the weight for the vertically sampled pixel, and vertical edge strength will contribute to the weight for the horizontally sampled pixel.
The algorithm does not define what to do when sampling boundary areas outside of the image. Possible things to do include replicating the boundary pixel, wrapping pixels from the other side of the image, wrapping the same side of the image in reverse, or using a particular border color value.
Color images
Color images are not specified by the algorithm, however, one can sum all RGB component differences when calculating edge strength, and use all RGB components when interpolating the pixels. Or one could split to YCbCr, process only the luma component and stretch the chroma using a different algorithm.