Ignore:
Timestamp:
Jul 30, 2014, 8:38:17 PM (10 years ago)
Author:
sommeria
Message:

float tracking updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/series/float_tracking.m

    r784 r804  
    7878    end
    7979    % parameters specific to the function 'particle_tracking'
    80 %     Par.Nblock=[];%size of image subblocks for background determination, =[]: no sublock
    81 %     Par.ThreshLum=-2000;% luminosity threshold for particle detection, < 0 for black particles, >0 for white particles
    82 %   ParamOut.ActionInput=Par;
     80        Par.Nblock=10;%size of image subblocks for background determination, =[]: no sublock
     81    Par.ThreshLum=210;% luminosity threshold for particle detection, < 0 for black particles, >0 for white particles
     82  ParamOut.ActionInput=Par;
    8383    return
    8484end
     
    9292    checkrun=0;
    9393end
     94hseries=findobj(allchild(0),'Tag','series');
     95RUNHandle=findobj(hseries,'Tag','RUN');%handle of RUN button in GUI series
     96WaitbarHandle=findobj(hseries,'Tag','Waitbar');%handle of waitbar in GUI series
    9497
    9598%% define the directory for result file
     
    138141%filter for particle center of mass(luminosity)
    139142%Nblock=Param.ActionInput.Nblock;
    140 %ThreshLum=Param.ActionInput.ThreshLum;% luminosity threshold for particle detection, < 0 for black particles, >0 for white particles
    141 AbsThreshold=30; %threshold below which a pixel is considered belonging to a float
     143ThreshLum=Param.ActionInput.ThreshLum;% luminosity threshold for particle detection, < 0 for black particles, >0 for white particles
     144%AbsThreshold=30; %threshold below which a pixel is considered belonging to a float
    142145SizePart=4;
    143146%
     
    164167for ifile=1:nbfield
    165168    if checkrun
    166         if strcmp(get(Param.RUNHandle,'BusyAction'),'queue')
    167             update_waitbar(Param.WaitbarHandle,ifile/nbfield)
    168         else
    169             break% leave the loop if the STOP button is activated on the GUI series
     169                update_waitbar(WaitbarHandle,ifile/nbfield)
     170        if ~isempty(RUNHandle) &&ishandle(RUNHandle) && ~strcmp(get(RUNHandle,'BusyAction'),'queue')
     171            disp('program stopped by user')
     172            return
    170173        end
    171174    end
     
    186189    Mask(:,end-SizePart:end)=0; 
    187190    if ifile ==1
    188         [Js,Is]=find(A<AbsThreshold & Mask==1);%indices (I,J) of dark pixels
     191        if ThreshLum>0 %brigth particles
     192        [Js,Is]=find(A>ThreshLum & Mask==1);%indices (I,J) of dark pixels
     193        else %black particle
     194               [Js,Is]=find(A<ThreshLum & Mask==1);%indices (I,J) of dark pixels
     195        end
    189196    else
    190197        Is=round(Xtime(ifile-1,:));
Note: See TracChangeset for help on using the changeset viewer.