Skip to content
Snippets Groups Projects
algoMulti.tex 1.17 KiB
\begin{algorithm}[h]
  \SetAlgoLined
  \SetKwInOut{Input}{input}
  \SetKwInOut{Output}{output}

  \SetKwData{lm}{LocMax}
  \SetKwData{nullset}{$\emptyset$}
  \SetKwData{ortho}{$\vec{AB}_\perp$}
  \SetKwData{eps}{$2~\varepsilon_{ini}$}
  \SetKwData{pta}{$A$}
  \SetKwData{ptb}{$B$}
  \SetKwData{Result}{Result}

  \SetKwArray{mask}{$\mathcal{M}$}
  \SetKwArray{bseg}{BlurredSegment}
  \SetKwArray{bslist}{ListOfBS}
  
  \SetKwFunction{locmax}{ComputeAndSortGradientLocalMax}
  \SetKwFunction{sortgradmax}{SortByGradientMagnitude}
  \SetKwFunction{updatemask}{UpdateOccupancyMask}
  \SetKwFunction{taille}{Size}
  \SetKwFunction{cardinal}{Card}

  \SetKwData{Begin}{Start}
  \SetKwData{End}{End}
  
  \Input{Stroke points \pta, \ptb, occupancy mask \mask}
  \Output{\textit{\bslist} $\rightarrow$ list of detected blurred segments}
  \BlankLine
  \bslist $\leftarrow$ \nullset\;
  \lm $\leftarrow$ \locmax (\pta, \ptb)\;
  \BlankLine
  \For{$i \leftarrow 0$ \KwTo \taille(\lm)}{
    \bseg $\leftarrow$ detect (\lm[i], \ortho, \eps, \mask)\;
    \updatemask (\mask, \bseg)\;
    \bslist $\leftarrow$ \bseg\;
  }
  
  \caption{MultiDetect: finds all the selected blurred segments.}
\end{algorithm}