In the previous recipe, you learned how an image can be segmented into regions by gradually flooding it and creating watersheds. The Maximally Stable External Regions (MSER) algorithm uses the same immersion analogy in order to extract meaningful regions in an image. These regions will also be created by flooding the image level by level, but this time, we will be interested in the basins that remain relatively stable for a period of time during the immersion process. It will be observed that these regions correspond to some distinctive parts of the scene objects pictured in the image.
The basic class to compute the MSER of an image is cv::MSER
. This class is an abstract interface that inherits from the cv::Feature2D
class; in fact, all feature detectors in OpenCV inherit from this super-class. An instance of the cv::MSER
class can be created by using the create
method. Here, we initialize it by specifying a minimum and maximum size...