Extrapolating 2D image pixels using second order derivative

37 Views Asked by At

I intend to use image pixel data prediction to improve image compression. This means that I need predict image pixels based on previous rows and columns. I cannot use the next rows and columns for the computation.

Let's say I have information of the pixel above and left and left-above

data[i - 1, j - 1] , data[i - 1, j]
data[i, j - 1]     , ?

Then, how to approximate the current pixel data[i, j] ?

One way to achieve this is to accumulate the average of the values and average of the horizontal and vertical derivatives:

A = data[i - 1, j - 1]
B = data[i - 1, j]
C = data[i, j - 1]
D = data[i, j]

[A|B]
[C|D=?]

$$D \approx \frac{B+C}2 + \frac{(B-A) + (C-A)}2 = B + C - A$$

Therefore,

predicted_data[i, j] = data[i - 1, j] + data[i, j - 1] - data[i - 1, j - 1]

And this conforms with Paeth method used in PNG images before compression.

So far not problem.

The problem arises from when I have a larger matrices of $3\times3$ with the last element as an unknown value to be predicted.

data[i - 2, j - 2] , data[i - 2, j - 1] , data[i - 2, j]
data[i - 1, j - 2] , data[i - 1, j - 1] , data[i - 1, j]
data[i, j - 2]     , data[i, j - 1]     , data[i, j] = ?

Now, how can I extend this formulation to the second order curves for data prediction of data[i, j] ?

Is this extrapolation have any name that I can search in google and is there any research done on this topic?