Output type must be specified in absdiff, but no argument to do so

The call cv::absdiff(mean, frame_in, diff); gives the error error: (-5:Bad argument) When the input arrays in add/subtract/multiply/divide functions have different types, the output array type must be explicitly specified in function 'arithm_op' ,where mean is CV_32FC3 and frame_in is the input frame, so CV_8UC3.

However, there is no definition in core/core.hppof absdiff that provides a way to specify the output type. I’ve tried copying frame_in to a CV_32FC3 mat as well as specifying the type of diff, all to no avail.

I assume I’m missing something, but am at a loss to figure out what.

that’s true. the error stems from a function called internally.
however, mean and frame_in must have exactly the same size, depth & channels here (and no need to do anything with diff, just leave empty).

if there are still doubts, please show, how those Mat’s are constructed.

That does it. My problem was trying to use a copy constructor to convert to CV_32FC3, when the correct approach is to do something like frame_in.convertTo(frame_in_32, CV_32FC3);

Thanks for the quick response!