How do you use the legacy GLCM?

asked 2014-08-05 15:01:18 -0500

cln1073 gravatar image

updated 2014-08-05 15:06:59 -0500

I am having trouble using and finding documentation about the OpenCV deprecated GLCM algorithm. Links from previous questions in the forum are no longer working.

void CalculateGLCM(cv::Mat grayIm) {
    // Convert Mat to IplImage 
    IplImage pGray = grayIm;
    // Create GLCM
    CvGLCM* glcm = cvCreateGLCM(&pGray, 1, NULL, 4, CV_GLCM_OPTIMIZATION_LUT);
    // Obtain Entropy and IDM values
    cvCreateGLCMDescriptors(glcm, CV_GLCMDESC_OPTIMIZATION_ALLOWDOUBLENEST);
    double d_entropy = cvGetGLCMDescriptor(glcm, 0, CV_GLCMDESC_ENTROPY);
    double d_idm = cvGetGLCMDescriptor(glcm, 0, CV_GLCMDESC_HOMOGENITY);
}

Am I doing something obviously wrong? Or is there an alternative algorithm in OpenCV? My goal is to obtain Entropy and IDM (Homogenity) using this specific algorithm. Any help is much appreciated.

-Chris

edit retag flag offensive close merge delete