It works!

The cv::Mat::Create crash was obviously just because I was not freeing the cv::Mat* image memory