title: Helping using the dilate function OpenCV
body: <p>In the following code I want to use the <code>dilate</code> function but I don't know how to cast a <code>Mat</code> class into a <code>InputArray</code> and <code>OutputArray</code>. Can you help me?</p>
  
  <p>Using this prototype function:</p>
  
  <pre><code>void dilate(InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar&amp; borderValue=morphologyDefaultBorderValue() )
  </code></pre>
  
  <p>Here's my code:</p>
  
  <pre><code>#include "opencv2/opencv.hpp"
  
  using namespace cv;
  
  int main(int, char**)
  {
      Mat edges;
  
      VideoCapture cap(0); // open the default camera
      if(!cap.isOpened())  // check if we succeeded
          return -1;
  
  
      for(;;)
      {
  
          Mat frame;
          cap &gt;&gt; frame; // get a new frame from camera
          cvtColor(frame, edges, CV_BGR2GRAY);
          GaussianBlur(edges, edges, Size(7,7), 1.5, 1.5);
          //dilate(edges,edges,NULL);
          Canny(edges, edges, 0, 30, 3);
          imshow("edges", frame);
          if(waitKey(30) &gt;= 0) break;
      }
      // the camera will be deinitialized automatically in VideoCapture destructor
      return 0;
  }
  </code></pre>