Can I invert this simple nonlinear equation?

239 Views Asked by At

Suppose $y = x * B(x)$, where $x$ is a 2d array of positive nonzero real numbers, $*$ denotes pointwise multiplication, and $B(x)$ is a blurred version of $x$, that is, $B(x)=x \otimes p$, where $p$ is also a 2d array of real nonzero numbers and $\otimes$ denotes convolution. Is there a simple way to find $x$ given $y$ and $p$?

1

There are 1 best solutions below

0
On

I have a half-assed iterative solution, which seems to work, but I have no justification for the method. I assume there's a better way to do this, but for now, this is what I've got:

import numpy as np
from scipy.ndimage import gaussian_filter

def blur(x):
    return gaussian_filter(x, 5)

def measure(x):
    return x * blur(x)

def improve(estimate, measurement):
    expected_measurement = measure(estimate)
    residuals = measurement - expected_measurement
    hopefully_improved_estimate = residuals + estimate
    return hopefully_improved_estimate

(Python code; x, measurement, and estimate are 2D numpy arrays. Take measurement as your starting estimate, and run a few tens of iterations of new_estimate = improve(old_estimate, measurement))