title: Specify output type of arithmetic operation in OpenCV
body: <p>In OpenCV, I can add two matrices of the same type using the <code>+</code> operator, like so:</p>
  
  <p><code>cv::Mat mat3 = mat1 + mat2;</code></p>
  
  <p>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".</p>
  
  <p>How should I go about specifying the output type for operations like this, when applying them to matrices of different types?</p>