title: Using Mat::at(i,j) in opencv for a 2-D Mat object
body: <p>I am using Ubuntu 12.04 and OpenCV 2</p>
  
  <p>I have written the following code : </p>
  
  <pre><code>IplImage* img =0;
  img = cvLoadImage("nature.jpg");
  if(img != 0)
  {
      Mat Img_mat(img);
      std::vector&lt;Mat&gt; RGB;
      split(Img_mat, RGB);
  
      int data = (RGB[0]).at&lt;int&gt;(i,j)); /*Where i, j are inside the bounds of the matrix size .. i have checked this*/ 
  }
  </code></pre>
  
  <p>The problem is I am getting negative values and very large values in the data variable. I think I have made some mistake somewhere. Can you please point it out.<br>
  I have been reading the documentation (I have not finished it fully.. it is quite large. ) But from what I have read, this should work. But it isnt. What is going wrong here?</p>