遗留功能 GLCM 尚未在 opencv2 中执行。我使用以下代码:
#import <opencv2/legacy.hpp>
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 = &a;
double s = 1; double *sd = &s;
cvGetGLCMDescriptorStatistics(glcm, CV_GLCMDESC_ENERGY, ave, sd);
NSLog(@"ave = %f sd = %f", *ave, *sd);
我已经尝试使用命名空间 cv::CvGLCM* glcm = cv::cvCreateGLCM(grayIm,.... - 但没有变化:/
非常感谢您对此的任何帮助!