March 2019
Intermediate to advanced
538 pages
13h 38m
English
The Scalar object type is a template class derived from Vec with four elements. The Scalar type is widely used in OpenCV to pass and read pixel values.
To access Vec and Scalar values, we use the [] operator, which can be initialized from another scalar, vector, or value by value, as in the following sample:
Scalar s0(0);Scalar s1(0.0, 1.0, 2.0, 3.0);Scalar s2(s1);