The apparatus and method invented are operating upon a digital image
signal obtained from an image sensor. The sensor is covered with
different colored filters and is only able to record the color
transmitted through each specific filter into the photosite or pixel.
This type of sensor is known as a color filter array or CFA sensor. The
different colored filters are arranged in a predefined pattern across the
sensor. To obtain a full color image the missing color information is
estimated by a set of weighed values obtained by an inverted gradient
function. The set of weighted values is found from the neighboring pixels
in the four compass directions, north, east, west and south or is found
horizontally and vertically. The surrounding pixels are corrected by the
chrominance channel to better fit the center pixel in the luminance
channel, prior to using the gradient functions. The chrominance channel
is interpolated in a similar manner and is also corrected to better fit
the center pixel before the inverted gradient functions are applied.