title: Checking if a pixel is black in a grayscale image (OpenCV)
body: <p>I need to figure out if any given pixel is black or white on a gray-scale image that I put through a thresholding algorithm before that. The image becomes basically blobs of black on a white background.</p>
  
  <pre><code>Mat falsetest;
  
  ...
  
  cv::cvtColor(detected_edges, falsetest, CV_BGR2GRAY);    
  threshold(falsetest, falsetest,128, 255,THRESH_BINARY);
  
  ...
  
  printf("x:%d y:%d %d\n",x,y,falsetest.at&lt;uchar&gt;(x,y));
  </code></pre>
  
  <p>I expected the results to be either 0 or 255, however, that is not the case. The output for different pixels looks something like this:</p>
  
  <pre><code>x:1259 y:175 111
  x:1243 y:189 184
  x:1229 y:969 203
  x:293 y:619 255
  x:1123 y:339 183
  </code></pre>
  
  <p>Am I trying to do this in a wrong way, or does it seem that the error lies elsewhere?</p>