Actually the same syntax works:
Mat im = cv::imread("...");
Mat im_capped = cv::max(im, 0);
Or if you want to give it a matrix of zeros of the same size:
Mat thresh(im.size(), im.type(), Scalar::all(0));
Mat im_capped = cv::max(im, thresh);
According to docs :

source
share