Black Image with ofxCv Calibration undistort()

I’m trying to implement camera lens undistort following the example-calibration of ofxCv. The example works just fine, I get the calibration.yml file and the result in the example app looks good. But when I implement it in my own app, the image I get is just all black. I’m passing a cv::Mat with CV_8U into undistort() if that is relevant. If I draw() the Mat (after toOf()) it looks just fine - just after undistort() it gets black - no error, warning, nothing just blackness… can anyone give me a hint?

I figured it out, the solution is described here: https://github.com/kylemcdonald/ofxCv/issues/176 it’s because Calibration.cpp expects a pre-allocated Mat. Instead it would be better if it was possible to just pass a reference of the Mat to undistort() - see the link