Compute the two-dimensional DFT Compute the two-dimensional DFT [4x4] for the following 4x4 image $ 
 \begin{matrix}
  0.5 &amp; 0.5 &amp; 0.5 &amp; 0.5 \\
  0.5 &amp; 0.5 &amp; 0.5 &amp; 0.5\\
  0.5 &amp; 0.5 &amp; 0.5 &amp; 0.5\\
   0.5 &amp; 0.5 &amp; 0.5 &amp; 0.5
 \end{matrix}
 $

I know that DFT is separable by dimensions – one
can calculate 4 vertical transforms first, then 4 horizontal ones

For each row we get [2 0 0 0] in the first and third row
and zero elsewhere. 

For each column we get [1 0 1 0] in the first and third column
and zero elsewhere. 

How from this two one-dimensional dfts obtain two-dimensional one?
No you are not doing the separation correctly :

The horizontal 1D-DFT of the rows of input will be:

$ H_1 = \begin{matrix}
  2 &amp; 0 &amp; 0 &amp; 0 \\
  2 &amp; 0 &amp; 0 &amp; 0 \\
  2 &amp; 0 &amp; 0 &amp; 0 \\
  2 &amp; 0 &amp; 0 &amp; 0 \\
 \end{matrix}
 $

and the vertical 1D-DFT of the columns of $H_1$ will be:

$ 
 H_2 = \begin{matrix}
  8 &amp; 0 &amp; 0 &amp; 0 \\
  0 &amp; 0 &amp; 0 &amp; 0\\
  0 &amp; 0 &amp; 0 &amp; 0\\
   0 &amp; 0 &amp; 0 &amp; 0\\
 \end{matrix}
 $

which is equivalent to the 2D-DFT of the original input.