0
$\begingroup$

I was reading this paper in Computer Vision (You do not have to visit it unless you want that). I came across this formula (Eq. 15 in the paper): enter image description here

Where:

  • T,M are 2D same size matrices.
  • sign is N -> [-1,0,+1] function.
  • N,i,j are known.

The question:

I could not understand the summation order. I should start from the inner sigma (The one which its variable is h). If I did so, all hs inside the sign function will be replaced with numbers. Then I started to solve the outer sigma (which has a variable k that starts from h+1 !!) and that were I stopped and did not know what to do!

Is there something wrong with equation? How should I compute it?

I suspected that the order of the two sigmas is wrong and should be reversed but when I do so, I am getting no sense results in term of Computer Vision result.

  • 0
    The order has no effect. Even if you change the order the final result would be same.2017-01-20
  • 0
    @WiCK3DPOiSON It is correct! it is just summation.. stupid me! I am in doubt now that the whole equation is not correct since I am applying it on very simple input and the result is too far from correctness (or I have messed up things while implementation)2017-01-20

1 Answers 1

1

There is nothing wrong with the $h$s being replaced by numbers. The pair of sums gives you all the terms with $j \le h \lt k \le j+N$, so you pick each pair of distinct numbers from $j$ to $j+N$ and check the sign of the corresponding $M$s. You can do the sums in the other order if you make the ranges right so you get all the terms. The way you have starts by selecting $k$ then lets $h$ range up from $j$ to $k-1$. For each $k$ you have $+1$ for all the $M_{ih}$ that are less and $-1$ for all the $M_{ih}$ that are greater, then you add up over $k$ in the outer sum. What this is computing is the number of $M$s that are in the right order according to their indices minus the number that are in reverse order.

Alternately we could choose $h$ first and then let $k$ range from $h+1$ to $j+N$. This would give $$T_{ij}=\sum_{h=j}^{j+N-1}\sum_{k=h+1}^{j+N}\operatorname{sign}(M_{ik}-M_{ih})$$