Ask Your Question

Revision history [back]

I found the answer. I made 3 changes:

  1. I initialized a local cv::Mat that is passed into the function with the desired size.
  2. The function was calling cv::Mat{rows, cols, type} but the instance wasn't initialized as expected. Changing to cv:Mat(rows, cols, type) fixed that. (Maybe my compiler options are not set correctly)
  3. I changed the update logic to *(cvMat.ptr<uchar>(y, x) + c) = value; to be safer.