# From Iris Image to Embedded Code: System of Methods
## 3 Eye Segmentation Methods
### Center Detection  
The algorithm finds the coordinates \((x_{C},y_{C})=\vec{c}\) of eye center in the image \(b(\vec{x})\), and does not need to estimate pupil or iris size. There is also no need to find the center position precisely, it is sufficient to locate it somewhere inside the pupil. Thus, pixels of both pupil and iris borders are used in [PERSON]'s procedure. Furthermore, the algorithm has low computational complexity since only two parameters are estimated and a two-dimensional Hough accumulator is used.  
The algorithm runs the following five steps.  
Step 1. Gradient calculation.  
Consider rectilinear coordinate system \(Oxy\) in the image with the center in the left bottom corner and axes \(Ox\) and \(Oy\) directed along its borders. Denote brightness \(b(\vec{x})\) in image point \(\vec{x}\). Brightness gradient \(\vec{\
abla}b(\vec{x})=\vec{g}(\vec{x})\) is estimated by standard Sobel masks [29]. Step 2. Outlining voting pixels.  
We need edge pixels to vote. These are selected with the help of a gradient value threshold. Cumulative distribution of brightness gradient values in pixels over the image is  
Figure 2: Workflow of iris segmentation methods.  
calculated, and set \(\Omega_{1}\) of pixels with brightness gradient in the upper 5% of this distribution are selected:  
\[\begin{split} H(G)=\left|\{\vec{z}:\|\vec{g}(\vec{z})\|\leqslant G \}\right|\,,\\ \Omega_{1}=\left\{\vec{x}:H(\|\vec{g}(\vec{x})\|)\geqslant(1-\tau_ {\mathrm{s}})N\right\}\,,\end{split} \tag{1}\]  
where \(|S|\) is power (count of elements) of set \(S\), \(N\) is total number of image pixels, \(\tau_{\mathrm{s}}=0.05\) is the share of points being selected.  
Step 3. Voting to accumulator.  
Hough methods use _accumulator_ function, which is defined over a parameter space. We detect the eye center, which is some point in the image, and its parameters are its coordinates in the image. Thus, the parameter space is 2D vector \(\vec{x}\) and the accumulator is \(A(\vec{x})\) with the same size as the source image.  
Ray from some given point \(\vec{x}\in\Omega_{1}\) in anti-gradient direction \(-\vec{\
abla}b(\vec{x})\) is the locus of all possible dark circles with border passing through this point. A set of such rays, drawn in the accumulator, traced from each pixel coordinated selected at step 2 will produce clotting at the center of any roundish dark object. The more circle-like this object is, the more expressed will be its central clotting.  
Step 4. Accumulator blurring.  
The accumulator \(A(\vec{x})\) is subject to a low-pass filter, to suppressed noise such as singular sporadic rays produced by non-circular edges in the image. Denote the result as \(A_{B}(\vec{x})\).  
Step 5. Maximum location.  
Maximum position  
\[\vec{c}=arg\max_{\vec{x}}A_{B}(\vec{x}) \tag{2}\]  
in blurred accumulator corresponds to the center of the best round-shaped object in the image. It is the most probable eye center. However, local maxima exist in any image due to noise. In order to decide whether there is a noticeable circular object, one can compare the value of local maxima against the values produced by noise. Since \(\tau_{\mathrm{s}}\) pixels of the image are voting and for each point voting procedure draws a segment of approximately \(0.5W\) pixels, where \(W\) is a linear size of the image, the average brightness level is near \(0.5\tau_{\mathrm{s}}W\). Selecting desirable signal to noise ratio \(P_{SNR}\), one can write the condition of accepting the located maximum (2) for eye center:  
\[Q_{C}=\max_{\vec{x}}A_{B}(\vec{x})>\frac{1}{2}P_{SNR}\tau_{\mathrm{s}}W\,. \tag{3}\]  
If condition (3) does not hold, the decision is made that there is no eye in the image \(b(\vec{x})\).