Unable to Understand 3 math equations regarding OPTICAL FLOW vectors

47 Views Asked by At

I am from CS background. I am trying to implement the below paper in Python. I am finding it difficult to understand and implement 3 mathematical equations :

4.37 , 4.38 , 4.39

from

The William Harvey Code: Mathematical Analysis of Optical Flow Computation for Cardiac Motion

-

For optical flow vectors$$ \tag{4.37} \mathbf{u}_{ijk} = (u(i,j,k), v(i,j,k), w(i,j,k))^T $$

4.37 : I couldn't understand why a vector u is having vectors v and w included in it.

$$ \tag{4.38} \mathbf{P}\text{vec}(\mathbf{u}_{111}, \mathbf{u}_{112}, \ldots, \mathbf{u}_{MmM}) = \text{vec}\left( \begin{array}{c} \mathbf{u}_{111}^T \\ \mathbf{u}_{112}^T \\ \vdots \\ \mathbf{u}_{MMM}^T \end{array} \right) $$

4.38 : I couldn't understand the notation used in permutation matrix P in equation 4.38

4.39 : Why is 4.36 a point-wise equation? what is a vector function x?

LINK TO GO TO THE PAPER FROM SPRINGER LINK

screenshots of the equations

My Final goal of the mini project is to implement:

4.44 : To implement the equation Au = Bu + c

4.43 : Provides the formulae to implement A,B,c

This image screenshot provides the equations 4.44 and 4.43

I am new to math.stackexchange.com . Kindly forgive me if my questioning skills are not upto the mark. Someone,kindly explain those equations and help me in making progess.

(from many days I have been struggling to understand this paper. Reason: C.S background.)

Thank You

1

There are 1 best solutions below

0
On BEST ANSWER

I have no understanding of optical flow, all of the following comes from looking at the screenshots provided. I can't answer all of your questions, I try as much as I can.

About equation 4.37:

The paper seems to use the notation that a fat letter like $\bf u$ stands for a vector or matrix, while a 'normal' letter like $v$ stands for a single real value. What equation 4.37 says is that you have many vectors $\bf u$, which are distinguished by 3 indices $i,j$ and $k$. That means for each suitable choice of indices $i,j,k$, the symbol ${\bf u}_{i,j,k}$ is a 3-dimensional vector. So maybe for example

$${\bf u}_{1,1,1} = \begin{pmatrix} 1.1 \\ 2.0 \\ -3.5 \end{pmatrix}, {\bf u}_{1,1,2} = \begin{pmatrix} 4.3 \\ -2.0 \\ 0.0 \end{pmatrix},\text{ a.s.o} $$

Now how should we refer to the 3 components of the vector ${\bf u}_{i,j,k}$? Normally one would use indices, but I guess the authors thought adding another index was confusing, so they used letters instead. This is just a slightly rewritten equation 4.37: $${\bf u}_{i,j,k} = \begin{pmatrix} u(i,j,k) \\ v(i,j,k) \\ w(i,j,k) \end{pmatrix}. $$

"$u(i,j,k)$" is just one single value, from my examples we have $$u(1,1,1)=1.1, u(1,1,2)=4.3,\ldots$$ The same is true for $v(i,j,k)$ and $w(i,j,k)$: $$v(1,1,1)=2.0, v(1,1,2)=-2.0,\ldots, w(1,1,1)=-3.5, w(1,1,2)=0.0,\ldots $$

What I think tripped you is that they used the letter "u" twice, once for the whole vector ${\bf u}_{i,j,k}$ and another time as the first component of it $u(i,j,k)$.

About equation 4.3.8:

First note that there is a small error in the equation, the indices for the last ${\bf u}$ on the left hand side are $MmM$, while it goes until $MMM$ on the right hand side. Looking at what follows, no $m$ is seen again, so I assume $MMM$ would be right on both sides.

That permutation matrix $\bf P$ is a $M^3\times3$ matrix (it has $M^3$ rows and 3 columns). Each row contains one ${\bf u}_{i,j,k}$ transposed. Since ${\bf u}_{i,j,k}$ contains 3 elements, that makes the 3 columns. From my example above, the top of $\bf P$ looks like this:

$$ {\bf P} = \begin{pmatrix} 1.1 & 2.0 & -3.5 \\ 4.3 & -2.0 & 0.0 \\ \vdots & \vdots & \vdots \end{pmatrix} $$

About equation(s) 4.36:

4.36 is many equations at once, it is a seperate equation for each set of indices $i,j$ and $k$. From the previous section it seems that each index can take $M$ values, so we get $M^3$ separate equations.

My assumption (again, I didn't look at the paper) is that $i,j,k$ are indices that describe the location of a point in 3 dimensions, some quantization of physical space. Then equation 4.36 for a given set of indices describes some flow related physical property that is true at that given point. That's why it's called a point-wise equation, it contains information for a given point.

Nevertheless, each such point-wise equation is still a vector equation, as the ${\bf u}_{i,j,k}$ and ${\bf s}_{i,j,k}$ it deals with are 3-dimensional vectors, the ${\bf S}_{i,j,k}$ is a $3\times3$ matrix. In the end, you are looking for $M^3$ vector values ${\bf u}_{i,j,k}$, which each is itself a 3-dimensional vector, so $3M^3$ unknown values to be determined.

Now all of this boils down to solving a big system of linear equations. For that usually you want to put all the unknowns to be determined into one vector and create a big matrix equation. As of now, the unknowns are 'distributed' 3 at a time into the vectors ${\bf u}_{i,j,k}$, as I tried to explain above.

So what equation 4.39 does is to provide a way to 'dump' info that is until now located i $M^3$ vectors of length 3 into one vector of lenght $3M^3$.

For example, the vector ${\bf u}$ so defined would, in my example above, look like

$$ {\bf u} = \begin{pmatrix} 1.1 \\ 2.0 \\ -3.5 \\ 4.3 \\ -2.0 \\ 0.0 \\ \vdots \end{pmatrix} $$ and would contain $3M^3$ numbers. Again they use the same letter as before, and this time I can't see a typographical difference between the "old" ${\bf u}$ and the "new" one.

This gives them the ability to cram the $M^3$ equations that were 4.36 into just one big matrix equation that is 4.40, and that was the whole goal of the operation!

The ${\bf s}$ in 4.40 is obtained from the ${\bf s}$ in 4.36 just as I described for ${\bf u}$ above via 4.39.

The ${\bf S}$ in 4.40 is a big $3M^3\times 3M^3$-matrix obtained from the $3\times3$ version from 4.36 by putting ${\bf S}_{111}$ into the 'big' ${\bf S}$ from indices $111$ to $333$, then putting ${\bf S}_{112}$ from indices $444$ to $666$, a.s.o, filling everything else with zeros.

Now, the point where I stop to understand the math of the paper is at equation 4.41, where they define the "new" ${\bf L}$ in some way I don't understand, without even referencing the "old" ${\bf L}$ from 4.36. Maybe that equation makes more sense to you when you look a the definition of that $L$.

So this is how much I can help you, if anything I wrote is unclear, feel free to ask!