title: What is the difference between Vec3b and Scalar in opencv?
body: <p>There are different types in opencv, Vec2b , Vec3b. Vec4i and so on, and there is the Scalar type. From what I understand, Vec3b and Scalar are both types for storing three numbers together. So, if I want to access a pixel (in RGB format) I am simply writing <code>image.at &lt;Vec3b&gt; (x,y)=Vec3b ( number, number, number)</code>, the same goes for Scalar, but what is their difference, is there even a difference at all?<br>
     I am asking this since I am having some weird experiences with using Vec3b and Scalar, when I am suing Scalar ( I am trying to convert some pixels into grayscale but leave the image in RGB format ) by doing this 
  <code>image.at&lt;Scalar&gt;(x,y)=Scalar( gray_image.at&lt;uchar&gt;(x,y), gray_image.at&lt;uchar&gt;(x,y), gray_image.at&lt;uchar&gt;(x,y));</code> ( I have the same image in grayscale called gray_image), but this appears to give some weird results, on the other hand when I am using Vec3b instead of Scalar I am getting normal results. Why is that happening?</p>