I am trying to use MSER algorithm in OpenCV 3.0.0 beta to extract text regions from an image. At the end I need a binary mask with the detected MSER regions, but the algorit
I found the solution! Just loop over all the points and draw them!
void mserExtractor (const Mat& image, Mat& mserOutMask){
Ptr mserExtractor = MSER::create();
vector> mserContours;
vector mserKeypoint;
vector mserBbox;
mserExtractor->detectRegions(image, mserContours, mserBbox);
for (vector v : mserContours){
for (cv::Point p : v){
mserOutMask.at(p.y, p.x) = 255;
}
}
}