title: Gray level slicing using OpenCv
body: <p>I am developing an application in C# to transform COLOR image into gray level image slicing. I have used the following code to convert colour image to gray scale. </p>
  
  <pre><code>public void grayscale()
      {
          gray = Cv.CreateImage(src.Size, BitDepth.U8, 1);
          Cv.CvtColor(src, gray, ColorConversion.RgbToGray);
          Cv.SaveImage("3.jpg", gray);
      }
  </code></pre>
  
  <p>Now the problem is i want to determine the pixel value and set it to 0 or 255. I don't know how to get the pixel value of the gray scale image.
  Can you please help me.
  Thanks in advance.</p>