title: How can I convert a cv::Mat to a gray scale in OpenCv?
body: <p>How can I convert a cv::Mat to a gray scale?</p>
  
  <p>I am trying to run drawKeyPoints func from opencv, however I have been getting an Assertion Filed error. My guess is that it needs to receive a gray scale image rather than a color image in the parameter.</p>
  
  <pre><code>void SurfDetector(cv::Mat img){
  vector&lt;cv::KeyPoint&gt; keypoints;
  cv::Mat featureImage;
  
  cv::drawKeypoints(img, keypoints, featureImage, cv::Scalar(255,255,255) ,cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
  
  cv::namedWindow("Picture");
  cv::imshow("Picture", featureImage);
  </code></pre>
  
  <p>}</p>