title: How to convert 3-channel IplImage to 8-bit?
body: <p>I need to convert a 3-channel image to 1-channel in order to use Hough circle transform. The image is a GBR captured from camera of my laptop:</p>
  
  <pre><code>// Laptop integrated camera (Dell inspiron 5010):
  CvCapture* camera = cvCreateCameraCapture(0);
  // ...
  IplImage* image=cvQueryFrame(camera);
  // Error:
  CvSeq* results = cvHoughCircles( image, storage, CV_HOUGH_GRADIENT, 2, image-&gt;width/10);
  // ...
  </code></pre>