title: OpenCV filtering part of an image
body: <p>I'm using the C++ openCV api, and I would like to selectively blur only certain pixels in an image. What is the best way to do this? I was attempting to do it via submatrices, but haven't been able to get it to work.</p>
  
  <pre><code>//5 is the 'radius' i'm blurring (~1/2 kernel width)
  cv::Rect srcRect;
  srcRect.x = x - 5;
  srcRect.y = y - 5;
  srcRect.width = 2*5 + 1;
  srcRect.height = 2*5 + 1;
  
  cv::Rect dstRect;
  dstRect.x = x;
  dstRect.y = y;
  dstRect.width = 1;
  dstRect.height = 1;
  
  cv::Mat src = srcImage(srcRect);
  cv::Mat dst = dstImage(dstRect);
  
  cv::blur(src, dst, cv::Size(5,5));
  </code></pre>
  
  <p>With the above code, nothing changes.</p>
  
  <p>When i set both of the rectangles to srcRect, the sub images are blurred, but the entire dst is blurred then, instead of just the single pixel.</p>
  
  <p>Any ideas?</p>