title: Convolution in OpenCV C++
body: <p>I want to take convolution in opencv with cpp  my code gives the error that is below</p>
  <p><strong>error C2040: 'H' : 'int [1][2]' differs in levels of indirection from 'cv::Mat'</strong></p>
  <p>I want to take conv between H= [1,-1] and image   ||  V=[1;-1] and image</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;opencv2\opencv.hpp&gt;
  
  using namespace std;
  using namespace cv;
  
  void main(){
  
      Mat image =imread(&quot;C:\\Users\\merve\\Desktop\\images3.jpg&quot;,CV_LOAD_IMAGE_COLOR);
  
      int h,w;
  
  
  
      Size s=image.size();
      h = s.height;
      w = s.width;
  
      int i,j;
      Mat H_gradient;
      
      int H [1][2] = {1,-1};
      int V [2][1] = {{1},{-1}};
  
  
      filter2D( image, H_gradient, -1 , H, Point( -1, -1 ), 0, BORDER_DEFAULT );
  
      namedWindow( &quot;filter2D Demo&quot;, CV_WINDOW_AUTOSIZE );
      imshow( &quot;filter2D Demo&quot;, H_gradient );
  
          
      
  
      
      waitKey(0);
  
  
  
  
  
  }
  </code></pre>