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

后端 未结 4 1814
无人及你
无人及你 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:27

    phi = ij*pi/4; % ij = 0, 1, 2, 3
    theta = 3;
    sigma = 0.65*theta;
    filterSize = 7;   % 7:2:37
    
    G = zeros(filterSize);
    
    
    for i=(0:filterSize-1)/filterSize
        for j=(0:filterSize-1)/filterSize
            xprime= j*cos(phi);
            yprime= i*sin(phi);
            K = exp(2*pi*theta*sqrt(-1)*(xprime+ yprime));
            G(round((i+1)*filterSize),round((j+1)*filterSize)) =...
               exp(-(i^2+j^2)/(sigma^2))*K;
        end
    end
    

提交回复
热议问题