<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\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{taille}{Size}
  \SetKwFunction{cardinal}{Card}

  \SetKwData{Begin}{Start}
  \SetKwData{End}{End}
  
  \Input{Stroke points \pta, \ptb}
  \Input{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)\;
    \For{$j \leftarrow 0$ \KwTo \cardinal (\bseg)}{
      \mask $\leftarrow$ \bseg[j]\;
  }
    \bslist $\leftarrow$ \bseg\;
  }
  
  \caption{MultiDetect: finds all blurred segments from input selection.}
\end{algorithm}
</pre></body></html>