title: GLCM in opencv2 (Gray-Level Co-occurrence Matrices)
body: <p>The legacy function GLCM does not perform yet in opencv2. I use the following code:</p>
  
  <pre><code>#import &lt;opencv2/legacy.hpp&gt;
  
  cv::Mat inputIm = [in_image CVMat];
  cv::Mat grayIm = [in_image CVGrayscaleMat];
  
  // cv::cvtColor(inputIm, grayIm, cv::COLOR_RGB2GRAY);
  
  // here I get an error: "no matching function..." !!!
  CvGLCM* glcm = cvCreateGLCM(grayIm, 1, NULL, 4, CV_GLCM_OPTIMIZATION_LUT);
  
  cvCreateGLCMDescriptors(glcm, CV_GLCMDESC_OPTIMIZATION_ALLOWDOUBLENEST);
  double d = cvGetGLCMDescriptor(glcm, 0, CV_GLCMDESC_HOMOGENITY );
  double a = 1; double *ave = &amp;a;
  double s = 1; double *sd = &amp;s;
  cvGetGLCMDescriptorStatistics(glcm, CV_GLCMDESC_ENERGY, ave, sd);
  
  NSLog(@"ave = %f sd = %f", *ave, *sd);
  </code></pre>
  
  <p>I tried already to use the namespace cv::CvGLCM* glcm = cv::cvCreateGLCM(grayIm,....  -- but no change :/</p>
  
  <p>Any help on this is very much appreciated !</p>