Skip to content

Instantly share code, notes, and snippets.

@VasanthKumarB
Last active November 2, 2022 01:46
Show Gist options
  • Save VasanthKumarB/588944f47e6a1664b43e to your computer and use it in GitHub Desktop.
Save VasanthKumarB/588944f47e6a1664b43e to your computer and use it in GitHub Desktop.
MSER opencv C++ example
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "opencv2/features2d/features2d.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, char *argv[])
{
Mat img = imread(argv[1], 1);
Ptr<MSER> ms = MSER::create();
vector<vector<Point> > regions;
vector<cv::Rect> mser_bbox;
ms->detectRegions(img, regions, mser_bbox);
for (int i = 0; i < regions.size(); i++)
{
rectangle(img, mser_bbox[i], CV_RGB(0, 255, 0));
}
imshow("mser", img);
waitKey(0);
return 0;
}
@yassinerhaz
Copy link

thank you !

@fo2sh44
Copy link

fo2sh44 commented Mar 12, 2018

how can i extract MSER features to use it in any matching technique

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment