fix memory issue in the context of cv::Ptr<>

ownership was not properly set --> double delete