Possible Duplicate:
How to set ROI in OpenCV?
I’m trying to use a smoothing/blur filter on an image but only in a particular path /area of the source. (Using openCV currently)
How can that be done?
right now I’m doing something like
cv::GaussianBlur(im, newim, cv::Size(5,5),1.5);
But I would like to be doing
cv::GaussianBlur(im, newim, cv::Size(5,5),1.5,MyClosedPath);
I can also use any of the ios classes if it is easier to do. (Haven’t found a way for that yet either)
You can get a submatrix out of your original matrix eg:
where x,y, width, height are the position of your subimage.
Then perform your gaussian blur on the submatrix.
[edit]
If you want to blur complex shapes, one way would be to blur the full image, and then use mat.copyTo with the mask of your blurred parts: