Minimizing mean squared error

2.1k Views Asked by At

I want to find a $d$ that minimizes the value of the expression below. I think the first step is to find the derivative w.r.t. $d$ (is that correct? If not, what is the first step?). If so, I'm having trouble finding that derivative given this form (because of the summation and the function $I_l$ and $I_r$ (which just means, the image at that point)). Can someone please explain where to even start with finding the derivative.

My ultimate goal would be to use MATLAB to find the value of $d$ that would minimize this but even any ideas on how to start would be very useful.

$$\frac{1}{(2W+1)^2}\sum_{-W\le j\le W}\sum_{-W\le i\le W}\large{\left(I_l(y+j, x+i)-I_r(y+j,x+i+d)\right)^2}$$

1

There are 1 best solutions below

0
On

$$\begin{align} & \hspace{-2em}\frac{\partial}{\partial d} \left[ \frac{1}{(2W + 1)^2} \sum_{\substack{-W \le i \le W \\ -W \le j \le W}} \big( I_l(y + j, x + i) - I_r(y + j, x + i + d) \big)^2 \right] \\ &= \frac{1}{(2W + 1)^2} \sum_{\substack{-W \le i \le W \\ -W \le j \le W}} \frac{\partial}{\partial d} \left[ \big( I_l(y + j, x + i) - I_r(y + j, x + i + d) \big)^2 \right] \\ &= \frac{1}{(2W + 1)^2} \sum_{\substack{-W \le i \le W \\ -W \le j \le W}} -2 \big( I_l(y + j, x + i) - I_r(y + j, x + i + d) \big) \cdot \frac{\partial I_r}{\partial d} \end{align}$$

Critical points occur where this last expression is $0$ (or fails to exist because of an asymptote), but you need to know $I_r$.