converted watershed + pyrmeanshiftfilter to C++