C++ port: add changes to HybridBinarizer