# Formula for 2D Image Filter for Scratch Detection

In section 4.1 (Preprocessing), they gave us a formula of the kernel,

$$H(u, v) = \frac{1}{1+0.414 \times \left(\sqrt{\frac{u^*}{D_h}+\frac{v^*}{D_v}}\right)^{2n}}$$

Where, \begin{split} t_x & = \mathrm{center} \times \cos(\theta) \\ t_y & = \mathrm{center} \times \sin(\theta) \\ u^* & = \cos(\theta) \times (u+t_x) + \sin(\theta)\times(u+t_y)\\ v^* & = -\sin(\theta) \times (u+t_x) + \cos(\theta)\times(u+t_y)\\ \end{split}

The formula doesn’t look correct to me.

1. Why would someone apply $\mathrm{sqrt}()$ and subsequently apply a power of $2n$ as it makes the $\mathrm{sqrt}()$ operation redundant?
2. $H(u,v)$ transfer function looks like a high-pass filter rather than a band-pass filter.
3. Shouldn’t $\mathrm{center}$ be $\mathrm{center}_x$, and $\mathrm{center}_y?$
4. Shouldn’t $(u+t_y)$ be $(v+t_y)$?
• Without doing any checking, I'd guess that both $u^*$ and $v^*$ equations are missing a $v$ term.
– Peter K.
Jul 17 '16 at 13:28
• Yes it is "wrong". The 1/(1+(a fraction)^2*n) is very much reminiscent of the Butterworth response and the $cos,sin$ business is just a rotation. So, that should be $u$ to the $cos$ term and $v$ to the $sin$ term.
– A_A
Jul 18 '16 at 9:58
• @A_A, tx = centerX * cos; ty = centerY * sin; u* = cos . (u + tx) + sin . (v + ty); v* = -sin . (u + tx) + cos . (v + ty); ... ... ... ... ... Is this the correct one?
– user18425
Jul 19 '16 at 5:31
• the question needs some help with $\LaTeX$. Jul 21 '17 at 5:59
• Reference 15 in that paper is this paper. I think they're trying to say that the equation you quote is the same as equation (1) in that paper... which I very much doubt: $F(r,\theta) = [e^{r^2\sigma_1^2} - e^{r^2\sigma_2^2}] 2 \pi i r \cos(\theta)$.
– Peter K.
Jul 21 '17 at 15:19