I am trying to create a kind of pseudocode in Latex resembling the one shown below
.
What I tried is:
Convert R to a binary region using the threshold $\theta_{0}$\
Assume N is the sum of the number of non-zero pixels within $F_{l}$ and $F_{r}$.\
If N is larger than a predefined threshold $\beta$, then\
\begin{center} $\theta_{0} = \theta_{0} + \Delta\theta$\\ Repeat the procedure from step 1 \end{center}Else
\begin{center} $\theta = \theta_{0}$ \end{center}End
Its not turning out like I want though. Can anyone please suggest how to fix this?