title: How to get both the real and imaginary parts of a gabor kernel matrix in OpenCV
body: <p>I want to apply the Gabor filter to an image of paper fibres. I was using the getGaborKernel function, but this returns only the real part of the kernel. I need both the complex and real parts to be returned, possibly as a pair of values for the whole kernel. </p>
  
  <p>I found somewhat of a solution for this, which required changing the gabor.cpp file in opencv like:</p>
  
  <pre><code>double v = scale*std::exp(ex*xr*xr + ey*yr*yr)*cos(cscale*xr + psi);
  </code></pre>
  
  <p>and adding</p>
  
  <pre><code>double v2 = scale*std::exp(ex*xr*xr + ey*yr*yr)*sin(cscale*xr + psi);
  </code></pre>
  
  <p>However, this still generates 2 different kernels ( if we take v and v2). Hence I wanted to know if there was a way to combine these 2 and return a combined kernel.</p>