Ask Your Question

Revision history [back]

This is possibly what you can do:

// This is pseudo-code, ofcourse you will need to change variable names with actual values or existing variables in your setup
// Region of interest - created manually or retrieved from somewhere
Rect bounding_box(x, y, width, heigth);
// Make a local copy of the region - do this to ensure you do not change the original image yet
Mat sub_region = original_image(bounding_box).clone();
// Perform something on this subregion --> for example apply Gaussian filter
GaussianBlur(sub_region, sub_region, Size(5,5), 0.0, 0.0, BORDER_DEFAULT );
// Copy the result back if you want it in your original image
sub_region.copyTo( original_image(bounding_box) );