Specify Output Type of Arithmetic Operation in OpenCV
In OpenCV, I can add two matrices of the same type using an operator +
like:
cv::Mat mat3 = mat1 + mat2;
When I try to add two matrices of different types this way, I get a runtime error that says "When the input arrays in the add / subtract / multiply / divide functions are of different types, the type of the output array must be explicitly specified."
How should I specify the type of inference for operations like this when applying them to matrices of different types?
+3
source to share
2 answers