title: OpenCv Erosion with specific structure element
body: <p>I would like to erode an image with a specific structure element. Default element shapes provided by opencv are ellipse , rectange and cross-shaped.</p>
  
  <pre><code>int erosion_type = MORPH_RECT;
  Mat element = getStructuringElement(erosion_type,Size(seSize,seSize),
           Point(seSize/2,seSize/2)); 
  erode(mat,result,element);
  </code></pre>
  
  <p>What I want is something different. I'd like to erode the image with a specific rectangle like this: </p>
  
  <pre><code>00000
  00000
  11111
  00000
  00000
  </code></pre>
  
  <p>I tried the following code that alters the structure element data after creating it but it doesn't seem to work. Assuming that the sturcture element is CV_8UC1 and of 5 * 5 shape </p>
  
  <pre><code>for(int i = 0 ; i &lt; 25 ; i++)
  {
      if(i&gt;10 &amp; i &lt; 15)
      data[i] = 0;
      else
      data[i] = 255;
  }
  </code></pre>