I am using OpenCV 2.4.11,Win 7, VS2012. I searched the internet for glcm of an image. I found these links link1 and link2 and find out concept of glcm but my problem is remain and when run this code
IplImage* inputIm = cvLoadImage(filename);
IplImage* grayIm = cvCreateImage(cvSize(inputIm->width, inputIm->height), IPL_DEPTH_8U,1);
cvCvtColor(inputIm, grayIm, CV_RGB2GRAY);
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 = &a;
double s = 1; double *sd = &s;
cvGetGLCMDescriptorStatistics(glcm, CV_GLCMDESC_ENERGY, ave, sd);
std::cout << *ave << " " << *sd;
It give me this error
Note that I can write a function to do that, but limited because of memory leakage. Can anyone help me? regards