Schmid滤波器

Schmid也是一种类Gabor图像滤波器,在这篇文章[1]中有具体推导和介绍。

一种更简洁的表达公式是:


其中,r为核半径,Z为归一化参数,τ和σ是比较重要的参数,在ReID提取TextFeature中,经常使用如下一系列参数:

(2,1), (4,1), (4,2), (6,1), (6,2), (6,3), (8,1), (8,2), (8,3), (10,1), (10,2), (10,3), (10,4)

此外,还结合前面的Gabor滤波器,γ,θ,λ,σ的参数分别使用:(0.3,0,4,2), (0.3,0,8,2), (0.4,0,4,1), (0.4,0,4,1), (0.3,π/2,4,2), (0.3,π/2,8,2), (0.4,π/2 ,4,1), (0.4,π/2,4,1)

以下是11个滤波核的示意图:


生成Schmid核函数代码:

[cpp]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. Mat getSchmidFilter(float tao, float sigma){  
  2.     float r = sigma/(4.0f*tao);  
  3.     float sigma2 = sigma*sigma;  
  4.     //int half_filter_size = int(r+0.5);  
  5.     int half_filter_size = 10;  
  6.     int filter_size = 2*half_filter_size+1;  
  7.     Mat schmid = Mat::zeros(filter_size,filter_size,CV_32F);  
  8.     float filter_sum = 0.0f;  
  9.     for(int i=0;i<filter_size;i++){  
  10.         float* s = schmid.ptr<float>(i);  
  11.         for(int j=0;j<filter_size;j++){  
  12.             float x = i-half_filter_size;  
  13.             float y = j-half_filter_size;  
  14.             r = sqrt(x*x+y*y);  
  15.             float tmp = 2*PI*tao*r/sigma;  
  16.             float tmp2 = r*r/(2.0f*sigma2);  
  17.             s[j] = cos(tmp)*exp(-tmp2);  
  18.             filter_sum += s[j];  
  19.         }  
  20.     }  
  21.     //cout<<filter_size<<" "<<filter_sum<<endl;  
  22.     //cout<<schmid<<endl;  
  23.     if(abs(filter_sum-0.0f)<1e-6){  
  24.         return schmid;  
  25.     }  
  26.     for(int i=0;i<filter_size;i++){  
  27.         float* s = schmid.ptr<float>(i);  
  28.         for(int j=0;j<filter_size;j++){  
  29.             s[j]/=filter_sum;  
  30.         }  
  31.     }  
  32.     return schmid;  
  33. }  

对图像进行卷积滤波效果如图:



参考文献:

[1] Schmid, Cordelia. "Constructing models for content-based image retrieval."Computer Vision and Pattern Recognition, 2001. CVPR 2001. Proceedings of the 2001 IEEE Computer Society Conference on. Vol. 2. IEEE, 2001.

[2] Gray, Douglas, and Hai Tao. "Viewpoint invariant pedestrian recognition with an ensemble of localized features." Computer Vision–ECCV 2008. Springer Berlin Heidelberg, 2008. 262-275.


(转载请注明作者和出处:http://blog.csdn.net/xiaowei_cqu 未经允许请勿用于商业用途)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值