fixed bugs at Linux and compatibility with OpenCV master