MSER rewrite