opencvmser

In OpenCV 3.3.1, how to use pass2Only option of MSER


OpenCV version 3.3.1 has an implementation of MSER algorithm, and one possible option is setPass2Only, but it's not specify in the documentation what is it for: https://docs.opencv.org/trunk/d3/d28/classcv_1_1MSER.html#aba564613ffdcd6a89ef0e381c4b02c48 I don't understand exactly how is the implementation of the algorithm, but what I understand from what I see, is that one could use that option to run just the "brighter to darker" part of the algorithm, but if this is like this, how is it if I want to run "darker to brighter" only?


Solution

  • The MSER algorithm consists of 2 steps:

    You can see in the OpenCV source code that pass2only parameters allows to execute only one step, namely MSER-.

    If you want to execute only the MSER+ step

    1. invert the input image
    2. run the MSER- step on the inverted image