Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In OpenCV 3.3.1, how to use pass2Only option of MSER

Tags:

opencv

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?

like image 476
facug91 Avatar asked Nov 25 '25 17:11

facug91


1 Answers

The MSER algorithm consists of 2 steps:

  • MSER+ : darker to brighter
  • MSER- : brighter to darker.

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
like image 182
Miki Avatar answered Nov 28 '25 16:11

Miki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!