First time here? Check out the FAQ!
answered 2019-11-16 04:31:36 -0600
The more efficient approach is not to copy a Mat back into an OutputArray output, but to get a reference to the (previously sized) matrix and populate it:
OutputArray output
cv::Mat& A = output.getMatRef();