I use MSER algorithm with opencv and find some rectangle parts then I want to blur that inside rectangle. my renctangles are vector like (x, y, width, height) but using dilate or erode need inputarray src. how can i transform vector to inputarray src?
here is my code.
vector< vector< Point> > contours;
vector< Rect> bboxes;
Rect MserROI;
Ptr< MSER> mser = MSER::create(21, (int)(0.00002*textImg.cols*textImg.rows), (int)(0.05*textImg.cols*textImg.rows), 1, 0.7);
mser->detectRegions(textImg, contours, bboxes);
for (int i = 0; i < bboxes.size(); i++)
{
cout << bboxes[i] << '\n';
rectangle(inImg, bboxes[i], CV_RGB(0, 0, 0));
MserROI = bboxes[i];
dilate(MserROI, Mser_dil, Mat(), Point(-1, -1), 2) //error
}