summaryrefslogtreecommitdiffstats
path: root/baseline/summarize-wss.py
Commit message (Expand)AuthorAge
* Add remaining scripts from Joshua's PRP experimentsfor-jbakita-prpJoshua Bakita2020-05-29
cgit.cgi/mc2-scripts-and-benchmarks.git/plain/SD-VBS/common/toolbox/toolbox_basic/filter/compute_filter_fft.m?h=rtas22&id=edfb01f94b56fcc3e3bc7098e233fcbbb862b462'>plain) (tree)



















































































                                                                                        
function [filter_output,filters] = compute_filter_fft(I,sig,r,sz,num_ori);
%
%
%

ori_incr=180/num_ori;
ori_offset=ori_incr/2; % helps with equalizing quantiz. error across filter set

as = ori_offset:ori_incr:180+ori_offset-ori_incr;

filter_output = [];
filters = [];

wsz = 2*round(sz(end)) + 1;
M1 = wsz;M2 = wsz;

%%%%% prepare FFT of image  %%%%%%%%%%%%%

[N1,N2]=size(I);
tmp=zeros(size(I)+[M1-1 M2-1]);
tmp(1:N1,1:N2)=I;
IF=fft2(tmp);


%%%%%%%%%% filtering stage %%%%%%%%%%%
if size(sig,2)== 1,

  for j = 1:length(as),
    fprintf('.');
    angle = as(j);

    g = mdoog2(sig,r,angle,round(sz));

    g = g - mean(reshape(g,prod(size(g)),1));

    g = g/sum(sum(abs(g)));

    filters(:,:,j) = g;

    gF  = fft2(g,N1+M1-1,N2+M2-1);
    IgF = IF.*gF;
    Ig  = real(ifft2(IgF));