0

I have been looking through the different data types in OpenCV, and came across the Scalar data type. However, I couldn't figure out why this data type exists?

Specifically:

  • Isn't scalar by its mathematical definition just a one-dimensional quantity with a magnitude?
  • What types of operations is it supposed to be used for (vs. a 4-dimensional vector)?
  • If conj() returns (w, -x, -y, -z) which are the values of the respective elements of the scalar, what do the x, y, and z actually represent? Imaginary numbers?
ArKi
  • 681
  • 1
  • 10
  • 22
  • 1
    Scalar is used often as input parameter (for example for drawing functions) to provide color information without the need to know the data type and channel number of the image. – Micka Jan 17 '16 at 08:51
  • `conj` seems to be there as a nod towards using Scalar to hold a complex number or quaternion - which isn't really its main purpose. – Alan Stokes Jan 17 '16 at 08:52

0 Answers0