title: Access Mat binary images elements in OpenCV
body: <p>I tried the following code to print all the white pixels of this binary image without success:</p>
  
  <pre><code>Mat grayImage;
  Mat rgb_Image;
  int Max_value = 255;
  int Global_Threshold = 155;
  
  rgb_Image = imread( "../Tests/Object/Object.jpg", CV_LOAD_IMAGE_COLOR);   // Read the file
  
  if(! rgb_Image.data )  // Check for invalid input
  {
          cout &lt;&lt;  "Could not open or find the image" &lt;&lt; endl ;
          return -1;
  }
  
  //Convert to Grayscale.
  cvtColor(rgb_Image, grayImage, CV_BGR2GRAY);
  
  //Binarize the image with a fixed threshold.
  threshold( grayImage, binImage, Global_Threshold, Max_Value, 0);
  
  //Printing white pixels
  for(int i = 0; i &lt; 640; i++)
  {
      for(int j = 0; j &lt; 480; j++)
      {
          if(255 == binImage.at&lt;float&gt;(i,j))
          {
              cout &lt;&lt; binImage.at&lt;float&gt;(i,j) &lt;&lt; endl;
          }
      }
  }
  </code></pre>
  
  <p>If I print the values that are not zeroes I get strange values but not 255.</p>
  
  <p>Thanks,</p>