Reputation: 335
In OpenCV, I can add two matrices of the same type using the +
operator, like so:
cv::Mat mat3 = mat1 + mat2;
When I try to add two matrices of different types in this way, I get an error at runtime, which says that "When the input arrays in add/subtract/multiply/divide functions have different types, the output array type must be explicitly specified".
How should I go about specifying the output type for operations like this, when applying them to matrices of different types?
Upvotes: 4
Views: 2870