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 am new to Micromechanics and having similar problem with understanding the implementation of the formula's. I would appreciate if anyone can guide me on how to go about getting a scalar value...
30 July 2024 968 0 View
Hello, colleagues. Recently, I have been working on a metal processing simulation with my UMAT in Abaqus. I have outlined the corresponding simulation, but I keep encountering issues that cause...
30 July 2024 7,061 1 View
Please, what is the memory consumption of the Matlab function quad tree decomposition procedure [S = qtdecomp(I)] with respect to the input set I?
27 July 2024 5,455 2 View
Hello, I am a research scholar currently working on a project involving image segmentation, and I am interested in using differential evolution for this purpose . I would greatly appreciate it if...
25 July 2024 9,923 1 View
In running two-dimensional gel electrophoresis on bacterial protein, some spots that appear to match a protein sequence have a significantly more acidic isoelectric point than the calculated pI....
24 July 2024 8,075 3 View
Hello!!! I want to implement the Swerling characteristics functions (CF) directly in MATLAB without using its Fourier integral pairs...the Swerling CFs are actually Laplace Transform of the signal...
23 July 2024 4,923 1 View
// interested in the difference between floating events and short circuits.
22 July 2024 6,565 0 View
Currently I need to calculate detection probabilities (PD) from radar cross section (RCS) data. Beta distribution parameters for this RCS data are calculated and will be used in Swerling0...
22 July 2024 865 0 View
Actually, I'm having trouble implementing the plot of the flutter region for the whirl prop system with 2 DOF (Influences of structural damping and propeller—pivot point distance on whirl flutter...
21 July 2024 5,043 2 View
Is it reasonable to exclude all trials with a blink or saccade in the 150 ms before stimulus onset? As an alternative, would it be better to exclude blinks (after extending them by about 100 ms...
19 July 2024 3,838 0 View