General process:
1. Create a Gabor filter group
2. The mean on the original color graph into a gray image
3. The filter scale local contrast of image.
4. Block calculation gabor feature and combination
CodePudding user response:
# pragma once
# include
Using the namespace CV;
# define WIDTH/256/image WIDTH 256
# define HEIGHT/256/image HEIGHT 256
3.1416////# define M_PI PI
The class Gist
{
Public:
Typedef struct matList
{
Int size;
Mat * data;
} MatList.
Typedef struct gistParam
{
CvSize imageSize;
Int orientations;//8
Int scale;//4
Int * orientationsPerScale;//[8 8 8 8]
Int numberBlocks;//4
Int fc_prefilt;//4
Int boundaryExtension;//32
MatList gabor.
} GistParam;
Gist (void);
OrientationsPerScale Gist (CvSize imagesize, int * and an int scale, int numberBlocks=4, int fc_prefilt=4, int boundaryExtension=32).
~ Gist (void);
Mat padarray (Mat Mat, CvSize padsize=CvSize (5, 5), cstrings padval=_T (" symmetric "), cstrings direction=_T (" both "));
MatList createGabor (int * or, CvSize size);
Mat prefilt (Mat img, int fc=4).
Mat gistGabor Mat (img);
Mat downN (Mat img, int N);
Mat calImageGist (cstrings filename);
Mat calImageGist (IplImage * image);
Mat calImageListGist (vector fileList);
The static void fftshift (Mat data);//FFT shift
The static void fftshift (float * data, int w, int h);//FFT shift
The static Mat getReal (Mat complex_data);//get the plural matrix real
The static Mat getAbs (Mat complex_data);//get the plural matrix absolute value
The static void saveFeatureToFile (cstrings filename, Mat Mat);//store mat
Private:
GistParam param.
};
CodePudding user response:
http://download.csdn.net/detail/ying_xu/9413394CodePudding user response:
I realized the Gist of LMGIST version (that is, the matlab)
The following is the corresponding lot and post
Code: https://github.com/Kalafinaian/python-img_gist_feature
Blog: https://zhuanlan.zhihu.com/p/88