没有做过
看看这个http://www.bearcave.com/misl/misl_tech/wavelets/packet/download.html
看看这个http://www.bearcave.com/misl/misl_tech/wavelets/packet/download.html
解决方案 »
- 想实现一个这样的功能(MessageBox(...)), 请给一点支持.
- 关于使用HOOK替换按键的问题
- 对话框程序运行后任务栏没有标题名
- CVS windows的客户端查看历史(web log)太麻烦了,实在看不清。谁有好的办法
- 请问用VC6.0通过ADO访问ACCESS数据库,如何在SQL语句中使用占位符?
- 将单文档切分为三个视图,为什么其中一个视图没与文档关联,却也能获得文档的指针?
- 请问:在SDI中怎么添加控件
- 紧急求助各位大虾帮忙,多谢!
- vc编译通过,但是调试不行(无法进行调试),我该怎么办?怎么知道错在什么地方?
- 在IDL把接口写在library里和写在外边有什么区别?看例子
- 在MFC中用正则表达式对窗体进行有效性验证
- 关于VC++的编译小问题
你去google搜索下这个 有收获 绝对
void GaborFeature(float *feature, Matrix *img, int side,double Ul,double Uh,int scale,int orientation,int flag)
{
int h, w, xs, ys, r1, r2, r3, r4, hei, wid, s, n, base;
Matrix *IMG, *IMG_imag, *Gr, *Gi, *Tmp_1, *Tmp_2, *F_1, *F_2, *G_real, *G_imag, *F_real, *F_imag, *F;
double m, v;
hei = img->height;
wid = img->width;
xs = (int) pow(2.0, ceil(log2((double) img->height)));
ys = (int) pow(2.0, ceil(log2((double) img->width))); CreateMatrix(&IMG, xs, ys);
for (h=0;h<hei;h++)
for (w=0;w<wid;w++)
IMG->data[h][w] = img->data[h][w]; CreateMatrix(&F_real, xs, ys);
CreateMatrix(&F_imag, xs, ys);
CreateMatrix(&IMG_imag, xs, ys); Mat_FFT2(F_real, F_imag, IMG, IMG_imag);/* ----------- compute the Gabor filtered output ------------- */ CreateMatrix(&Gr, 2*side+1, 2*side+1);
CreateMatrix(&Gi, 2*side+1, 2*side+1);
CreateMatrix(&Tmp_1, xs, ys);
CreateMatrix(&Tmp_2, xs, ys);
CreateMatrix(&F_1, xs, ys);
CreateMatrix(&F_2, xs, ys);
CreateMatrix(&G_real, xs, ys);
CreateMatrix(&G_imag, xs, ys);
CreateMatrix(&F, hei, wid); base = scale*orientation; for (s=0;s<scale;s++) {
for (n=0;n<orientation;n++) {
Gabor(Gr, Gi, s+1, n+1, Ul, Uh, scale, orientation, flag);
Mat_Copy(F_1, Gr, 0, 0, 0, 0, 2*side, 2*side);
Mat_Copy(F_2, Gi, 0, 0, 0, 0, 2*side, 2*side);
Mat_FFT2(G_real, G_imag, F_1, F_2); Mat_Product(Tmp_1, G_real, F_real);
Mat_Product(Tmp_2, G_imag, F_imag);
Mat_Substract(IMG, Tmp_1, Tmp_2); Mat_Product(Tmp_1, G_real, F_imag);
Mat_Product(Tmp_2, G_imag, F_real);
Mat_Sum(IMG_imag, Tmp_1, Tmp_2); Mat_IFFT2(Tmp_1, Tmp_2, IMG, IMG_imag);
Mat_Shift(IMG, Tmp_1, side);
Mat_Shift(IMG_imag, Tmp_2, side); m = 0;
for (h=0;h<hei;h++)
for (w=0;w<wid;w++) {
F->data[h][w] = sqrt(pow(IMG->data[h][w], 2.0)+pow(IMG_imag->data[h][w], 2.0));
m += F->data[h][w];
} m /= (double) (hei*wid);
feature[s*orientation+n] = (float) m; v = 0;
for (h=0;h<hei;h++)
for (w=0;w<wid;w++)
v += (F->data[h][w]-m)*(F->data[h][w]-m); v /= (double) (hei*wid);
feature[base+s*orientation+n] = (float) sqrt(v);//提取特征
}
} FreeMatrix(Gr);
FreeMatrix(Gi);
FreeMatrix(Tmp_1);
FreeMatrix(Tmp_2);
FreeMatrix(F_1);
FreeMatrix(F_2);
FreeMatrix(G_real);
FreeMatrix(G_imag);
FreeMatrix(F_real);
FreeMatrix(F_imag);
FreeMatrix(IMG);
FreeMatrix(IMG_imag);
FreeMatrix(F);
}
不过用Gabor做纹理提取实际是上比较麻烦的,因为参数太多