Weighted Image Reconstruction

By Marc-Daniel DALEBA
Last updated: September 2026

1. Introduction

In this article, we will see how we can reconstruct an image using Accumulative Weighted Interpolation.
The full program is available here: https://github.com/blueberry077/Weighted-Image-Reconstruction

Image reconstruction with 100 initial points
(a) 100 initial points
Image reconstruction with 1000 initial points
(b) 1000 initial points
Image reconstruction with 10000 initial points
(c) 10000 initial points
Reconstructed using exponent \( p = 3 \). A higher power parameter was chosen because lower values caused the predominant green background in the test image to bleed excessively across distant pixels.

2. Interpolation Formulation

Given three points \( A \), \( B \) and \( C \), we can calculate the distance between each point from \( C \) using these relations:

\[ d_{A}=\left\| A-C \right\| \]
\[ d_{B}=\left\| B-C \right\| \]

If we normalize the distances and invert them to get the weights:

\[ w_{A} = \frac{d_{B}}{d_{A}+d_{B}} \]
\[ w_{B} = \frac{d_{A}}{d_{A}+d_{B}} \]

Then we can calculate \( P \) the weighted attributes shared from \( A \) and \( B \) to \( C \):

\[ P=w_{A}A+w_{B}B \]

Now say we have \( n \) points. We have:

\[ P_{0},P_{1},...,P_{n} \]

and a reference point \( C \), we can calculate every distance:

\[ d_{i}=\left\| P_{i}-C \right\| \]

Then use the inverted distances as weights:

\[ w_{i}=\frac{1/d_{i}^{p}}{\sum_{j=0}^{n}1/d_{j}^{p}} \text{ with }p\text{ as the exponent to control the influence.} \]

Which gives us the interpolated point \( P \)

\[ \bbox[8px, border: 1px solid black]{ P=\sum_{i=0}^{n}w_{i}\cdot P_{i} } \]

Here, \( P \) isn't our point \( C \), it is the weighted point resulting from the interpolation.

3. Notes

Apparently this exists as Inverse Distance Weighting (IDW). If you see this feel free to do whatever you want with this information.
I had fun learning LaTeX and figuring out a solution for a small prototype.