title: writing array data into a text file in opencv
body: <p>I want to write the array data of one of the channel into a text file. How can I do it?</p>
  
  <p>I tried this</p>
  
  <pre><code>Mat img = imread("dog.jpg", 1);
  
  std::ofstream fout("myfile.txt");
  
  fout &lt;&lt; img.at&lt;Vec3b&gt;(i, j); 
  </code></pre>
  
  <p>but it is copying the data of all the 3 channels. I want to store the data of only one channel, let us say B[][]. Suppose I have already stored the data of all the channels separately in R[][],G[][],B[][] as shown. </p>
  
  <pre><code>Vec3b intensity = img.at&lt;Vec3b&gt;(i, j);
  
  B[j][i]=intensity[0];
  G[j][i] = intensity[1];
  R[j][i] = intensity[2];
  
  fout &lt;&lt; ??????????????????????;  //want to store data of Blue channel
  </code></pre>