19,472
社区成员




#pragma once
#include
using namespace cv;
#define WIDTH 256 //图像宽度 256
#define HEIGHT 256 //图像高度 256
//#define M_PI 3.1416 //π
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);
Gist(CvSize imagesize, int* orientationsPerScale, int scale, int numberBlocks = 4, int fc_prefilt = 4, int boundaryExtension = 32);
~Gist(void);
Mat padarray(Mat mat, CvSize padsize = cvSize(5, 5), CString padval = _T("symmetric"), CString 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(CString filename);
Mat calImageGist(IplImage* image);
Mat calImageListGist(vector fileList);
static void fftshift(Mat data); //fft移位
static void fftshift(float *data, int w, int h); //fft移位
static Mat getReal(Mat complex_data); //获取复数矩阵实部
static Mat getAbs(Mat complex_data); //获取复数矩阵绝对值
static void saveFeatureToFile(CString filename, Mat mat); //存储mat
private:
GistParam param;
};