Changeset 387 for trunk/src/filter_tps.m


Ignore:
Timestamp:
Apr 4, 2012, 3:31:30 PM (12 years ago)
Author:
sommeria
Message:

several bugs corrected: mask, color image...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/filter_tps.m

    r382 r387  
    7373            % if too few selected vectors, increase the subrange for next iteration
    7474        elseif numel(ind_sel)<SubDomain/4 && ~isequal( ind_sel,ind_sel_previous);
    75             SubRange(:,1,isub)=SubRange(:,1,isub)-Siz/4;
    76             SubRange(:,2,isub)=SubRange(:,2,isub)+Siz/4;
     75            SubRange(:,1,isub)=SubRange(:,1,isub)-Siz'/4;
     76            SubRange(:,2,isub)=SubRange(:,2,isub)+Siz'/4;
    7777%             SubRangy(isub,1)=SubRangy(isub,1)-Siz(2)/4;
    7878%             SubRangy(isub,2)=SubRangy(isub,2)+Siz(2)/4;
     
    8989            ind_ind_sel=find(FF(ind_sel)==0); % select the indices of ind_sel corresponding to the remaining vectors
    9090            end
    91             % no value exceeds threshold, the result is recorded
     91            % if no value exceeds threshold, the result is recorded
    9292            if isequal(numel(ind_ind_sel),numel(ind_sel))
    9393                U_smooth(ind_sel)=U_smooth(ind_sel)+U_smooth_sub;
    9494                V_smooth(ind_sel)=V_smooth(ind_sel)+V_smooth_sub;
    9595                NbSites(isub)=numel(ind_sel);
    96 %                 Indices_tps(1:NbSites(isub),isub)=ind_sel;
    9796                Coord_tps(1:NbSites(isub),:,isub)=Coord(ind_sel,:);
    98 %                 Y_tps(1:NbSites(isub),:,isub)=Coord(ind_sel,2);
    9997                U_tps(1:NbSites(isub)+3,isub)=U_tps_sub;
    10098                V_tps(1:NbSites(isub)+3,isub)=V_tps_sub;         
    10199                nb_select(ind_sel)=nb_select(ind_sel)+1;
    102                  display('good')
     100                display('good')
    103101                break
    104                 % too few selected vectors, increase the subrange for next iteration
     102            % if too few selected vectors, increase the subrange for next iteration
    105103            elseif numel(ind_ind_sel)<SubDomain/4 && ~isequal( ind_sel,ind_sel_previous);
    106                 SubRange(:,1,isub)=SubRange(:,1,isub)-Siz/4;
    107                 SubRange(:,2,isub)=SubRange(:,2,isub)+Siz/4;
    108 %                 SubRange(2,isub,1)=SubRangy(2,isub,1)-Siz(2)/4;
    109 %                 SubRange(2,isub,2)=SubRangy(2,isub,2)+Siz(2)/4;
    110 %                 display('fewsmooth')
    111                 % interpolation-smoothing is done again with the selected vectors
     104                SubRange(:,1,isub)=SubRange(:,1,isub)-Siz'/4;
     105                SubRange(:,2,isub)=SubRange(:,2,isub)+Siz'/4;
     106            % else interpolation-smoothing is done again with the selected vectors
    112107            else
    113                 [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel)),U(ind_sel(ind_ind_sel)),rho);
    114                 [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel)),V(ind_sel(ind_ind_sel)),rho);
     108                [U_smooth_sub,U_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),U(ind_sel(ind_ind_sel)),rho);
     109                [V_smooth_sub,V_tps_sub]=tps_coeff(Coord(ind_sel(ind_ind_sel),:),V(ind_sel(ind_ind_sel)),rho);
    115110                U_smooth(ind_sel(ind_ind_sel))=U_smooth(ind_sel(ind_ind_sel))+U_smooth_sub;
    116111                V_smooth(ind_sel(ind_ind_sel))=V_smooth(ind_sel(ind_ind_sel))+V_smooth_sub;
Note: See TracChangeset for help on using the changeset viewer.