How to create 64 Gabor features at each scale and orientation in the spatial and frequency domain

后端 未结 4 1807
无人及你
无人及你 2021-01-02 22:53

Normally, a Gabor filter, as its name suggests, is used to filter an image and extract everything that it is oriented in the same direction of the filtering.

4条回答
  •  既然无缘
    2021-01-02 23:18

    In the frequency domain:

    sigma_u=1/2*pi*sigmaq;
    sigma_v=1/2*pi*sigmaq;
    u0=2*pi*cos(theta)*lambda(k);
    v0=2*pi*sin(theta)*lambda(k);
    
    for u = -filtSizeL:filtSizeR
                for v = -filtSizeL:filtSizeR
    
                    if ( sqrt(u^2+v^2)>filtSize/2 )
                        E = 0;
                    else
                        v_theta = u*cos(theta) - v*sin(theta);
                        u_theta = u*sin(theta) + v*cos(theta);
    
                      E=(1/2*pi*sigma_u*sigma_v)*((exp((-1/2)*(((u_theta-u0)^2/sigma_u^2))+((v_theta-v0)^2/sigma_v^2))) + (exp((-1/2)*(((u_theta+u0)^2/sigma_u^2))+((v_theta+v0)^2/sigma_v^2))));
    
                    end
                    f(v+center,u+center) = E;
                end
            end
    

提交回复
热议问题