How to calculate Haralick Texture Features in openCV?
I calculated the same in MATLAB but unable to find any code in openCV.
hi check the following link
http://www.fp.ucalgary.ca/mhallbey/tutorial.htm
GLCM in opencv2 (Gray-Level Co-occurrence Matrices)
The legacy function GLCM does not perform yet in opencv2. I use the following code:
#import
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);
The legacy function cvCreateGLCM takes the older IplImage* as its input, so you need to convert your cv::Mat image first.
Try this:
// your input image
// create a legacy image
IplImage pGray = grayIm;
// call function
CvGLCM* glcm = cvCreateGLCM(&pGray, 1, NULL, 4, CV_GLCM_OPTIMIZATION_LUT);
****(http://stackoverflow.com/questions/24875929/glcm-in-opencv2-gray-level-co-occurrence-matrices)
Thanks Chethan.
I have selected brain tumor images ...but now found that already lots of research done n this topic.
03 March 2021 5,774 3 View
dear community, my model is based feature extraction from non stationary signals using discrete Wavelet Transform and then using statistical features then machine learning classifiers in order to...
03 March 2021 6,994 5 View
I'm involved in a study of odor control technologies for municipal wastewater treatment plant. One of the control options involves a chemical 2-stage (acid/alkaline) packed bed scrubber. The...
03 March 2021 3,661 2 View
Do you have some recommendations approaches on Image processing and classification of plant diseases using TensorFlow/Keras?
02 March 2021 1,493 4 View
Working on chandrayaan-2 DFSAR data, there are three datasets available: 1) Slant range image data product: The slant range complex image file. Each pixel is represented by two 4-byte floating...
02 March 2021 8,481 3 View
I would like to research on MR images (0.5T and 3T). Can you please suggest some websites that I can download dataset including both 0.5T and 3T MR images? Thank you.
02 March 2021 7,735 3 View
Dear Researchers I am trying to perform a PIL simulation using STM32F4 Discovery board and comunication serial USB TO TTL. During simulation I receive the following timeout error: An error...
01 March 2021 2,327 1 View
The following code (see 1st 2 images attached) is used to produce PID controller values that are designed to control the system (G). The code finds the PID controller values (noted as k) by using...
28 February 2021 6,560 14 View
I have input and output data set for "ANFIS modeling in MATLAB", and I am getting some negative predicted values of output in testing. However, the predicted values of output in training are...
28 February 2021 3,459 3 View
I'm in the process of doing a meta-analysis and have encountered some problems with the RCT data. One of my outcom is muscle strength. In one study, I have three different measurements of muscle...
25 February 2021 7,603 3 View