4
$\begingroup$

This is a problem when I'm reading a paper.

Equation:

$min\{\sum_p(S_p-I_p)^2+\beta((\partial_xS_p-h_p)^2+(\partial_yS_p-v_p)^2) \} $

where $S,I,h,v$ are all $M*N$ matrices and p stands for every element in the Matrix. $I,h,v$ are known.

The paper just mentioned "we diagonalize derivative operators after Fast Fourier Transform for speedup" and get the solution

$S=\mathscr{F}^{-1}\left(\frac{\mathscr{F}(I)+\beta(\mathscr{F}(\partial_x)^*\mathscr{F}(h)+\mathscr{F}(\partial_y)^*\mathscr{F}(v))}{\mathscr{F}(1)+\beta(\mathscr{F}(\partial_x)^*\mathscr{F}(\partial_x)+\mathscr{F}(\partial_y)^*\mathscr{F}(\partial_y)}\right)$

where $\mathscr{F}(1)$ stands for FFT of delta function. Plus, multiplication and division are all component-wise. "*" means conjugation.

I've looked up some books but still can't get how this happen. I don't find any connection between DFT and minimization or quadratic function.

Here's the paper, equation is on page 4.

$\endgroup$
1
  • $\begingroup$ siggraph papers are notoriously hard to reproduce. It will be very hard to get results as good as you see in that publication. $\endgroup$
    – dranxo
    Commented Nov 18, 2011 at 7:57

2 Answers 2

5
$\begingroup$

You need to minimize the objective function

$$f:S \mapsto \| S-I\|_2^2+\beta(\| \partial_xS-h\|^2_2+\|\partial_yS-v\|_2^2) $$

where $\| \cdot \|_2$ is the "entrywise" $\ell^2$ norm. This is done as usual: the global minimum $S$ must be a critical point and then the derivative must be zero at $S$. The differential of the objective function is given by

$$Df(S)(M) = 2\langle S-I,M\rangle + \beta\left( 2 \langle\partial_x S -h,\partial_x M\rangle + 2 \langle\partial_y S - v,\partial_y M \rangle \right)$$

where $\langle A,B \rangle = \sum_p A_p B_p$ (the "entrywise" inner product). Now, that for any $M$ the last expression vanishes implies that

$$ S-I + \beta( \partial_x^T \partial_x S-\partial_x^Th + \partial_y^T \partial_y S -\partial_y^Tv) =0.$$

($\cdot^T$ is the adjoint operator). Now you can take the DFT on both sides,

$$ \mathscr{F}(S) - \mathscr{F}(I) + \beta \left( \mathscr{F}(\partial_x^T\partial_x S) - \mathscr{F}(\partial_x^Th)+ \mathscr{F}(\partial_y^T\partial_y S) - \mathscr{F} (\partial_y^Tv)\right)=0,$$ and then use the fact that the DFT diagonalizes the gradient $\mathscr{F}(\partial_. S) = \mathscr{F}(\partial_\cdot ) \mathscr{F} (S)$ and some algebra to find that $$ (\mathscr{F}(1) + \beta (\mathscr{F}(\partial_x)^*\mathscr{F}(\partial_x) + \mathscr{F}(\partial_y)^*\mathscr{F}(\partial_y) ))\mathscr{F}(S)= \mathscr{F}(I) + \beta \left( \mathscr{F}(\partial_x)^*\mathscr{F}(h) + \mathscr{F}(\partial_x)^*\mathscr{F} (v)\right)$$ and solving for $S$ this gives the formula asked. (Remark: We could have written the objective function directly in terms of $\mathscr{F}(S)$ using Parseval and then optimize).

As for the speedup part, we would have to invert a very large ($NM \times NM$) matrix representing the operator $$ 1 + \beta( \partial_x^T \partial_x + \partial_y^T \partial_y )$$ if we do it directly in image space.

$\endgroup$
7
  • $\begingroup$ Thanks! I think that's what I'm looking for! But what does "the fact that the DFT diagonalizes the gradient" mean? I've read it somewhere but don't get it. Anywhere I can find some detail? $\endgroup$
    – user19132
    Commented Nov 10, 2011 at 4:29
  • $\begingroup$ @Co "DFT diagonalizes the gradient" - means Fourier transform of d/dx is diagonal operator - this means that if you consider F * d/dx * F^{-1} - this will be diagonal matrix. Formula F * d/dx * F^{-1} is usually abbreviated as F(d/dx). (For mathematician such an abbreviation is natural - induced action of operators on matrices). $\endgroup$ Commented Nov 10, 2011 at 6:10
  • $\begingroup$ @Alex Thank you! F is the DFT Matrix right? Can you give me some books or something I can find some proof of it? $\endgroup$
    – user19132
    Commented Nov 10, 2011 at 7:54
  • $\begingroup$ @Co Yes. F - stands for DFT matrix. The fact that x F f(t) = F d/t f(t) which is the same as x =F^{-1} d/dt F is simple basic fact which is described in any textbook on Fourier analysis. In discrete version it is related to the fact that F^{-1} DiagMatr F = Circulant. I am sorry I have not any text book at hand to point out the pages. But I think looking on Wikipedia you can find it relevant textbooks. $\endgroup$ Commented Nov 10, 2011 at 8:13
  • $\begingroup$ @Alex I learned DFT from <Digital Image Processing> by Gonzalez, seems it omits some important theories. I will refer to some other book. Anyway, thank you:-) $\endgroup$
    – user19132
    Commented Nov 10, 2011 at 8:45
0
$\begingroup$

FFT is used only to "speed-up". If no need to speed-up this formula looks like standard minimal least square answer.

Which works like this - assume you need to minimize in x : |Mx-v|^2 for some rectangular matrix M. The answer is well-known x= inverse(M*M^t)*M V. Remark: The matrix M * inverse(M*M^t) is called Moore-Penrose pseaudoinverse.

Now what is M in yours example ?

M = 1 + d/dx + d/y

So M*M^t - will be what stands in denominator, while Mv - this what stands in numerator.

If you want to speed-up - put "F" everywhere.

I am not sure my answer is clear. Please comment if you need more details.

$\endgroup$
5
  • $\begingroup$ I, for one, do not understand this answer. What do you mean "put F everywhere"? And why does that speed anything up? $\endgroup$
    – Igor Rivin
    Commented Nov 9, 2011 at 13:11
  • $\begingroup$ why M=1+dx+dy? M-P inverse is only used in ||Mx-v|| (||x+dx x + dy x -v||) right? So how can M be 1+dx+dy in this example? And how to use FFT to speed up anything in M-P inverse? The paper says the trivial way to solve this equation is to use gradient decent, which is very very slow, so they come with a way to speed it up. $\endgroup$
    – user19132
    Commented Nov 9, 2011 at 14:17
  • $\begingroup$ @Igor,Co Assume you need calculate Cv - just put F: F^{-1} * (F C F^{-1}) * F v . Why it speeds - calculation Cv takes n^2 operations. Assume FCF^{-1} is known to you - like in this example because C and it is diagonal like in this example since C= d/dx , under this assumption you need n-operations to calculate Diag * Cv . And nlogn to make FFT. So instead of original n^2 you get n log n. Is it clear ? Sorry need to run home. $\endgroup$ Commented Nov 9, 2011 at 14:40
  • $\begingroup$ @Co why M=1+dx+dy? Good question I am also not very clear but I guess it is due to fact that dx and dy actss on different variables - I think I can clarify it, but may be tomorrow... $\endgroup$ Commented Nov 9, 2011 at 14:42
  • $\begingroup$ Hi @AlexanderChervov! I'm working on a problem similar to this, except that my h=v=0 but, the derivative of my matrix S is multiplied point-wise with a weight matrix W_x and W_y. I can follow the same procedure to solve the optimization problem, but when I apply FFT, I got F*(dx)F(W_x o dx(S)) where o is point wise multiplication. How can I isolate S to have a closed form formula for S? in other words, what is the DFT of point wise multiplication? thank you in advance! $\endgroup$ Commented Apr 24, 2020 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .