## 2 Materials and Methods
### Cell Recognition through Keypoints
Mathematically, for each descriptor \(d_{2i}\) in \(D_{2}\), the Euclidean distance is calculated as follows:  
\[\text{Euclidean Distance}(d_{1},d_{2i})=\sqrt{\sum_{j=1}^{n}(d_{1j}-d_{2 ij}) ^{2}} \tag{10}\]  
Subsequently, the \(k\) descriptors in \(D_{2}\) with the smallest Euclidean distances to \(d_{1}\) are selected. To express this procedure more formally and precisely, the set of the \(k\)-nearest neighbors of \(d_{1}\) in \(D_{2}=\{d_{2i}\mid\text{Euclidean distance}(d_{1},d_{2i})\) is minimal for the \(k\)-nearest neighbors \(|\). Thus, matches are determined by implementing nearest neighbor searches. To delimit the region of interest without applying a homographic transformation to the entire set of extracted segments, a structured methodological approach is adopted in the following steps:  
* Determination: The coordinates corresponding to points that form a homogeneous set are identified and recorded, ensuring that all selected points share similar defining characteristics. * Calculation of Distances between Keypoints: A quantitative analysis is performed to determine the distances between points within a homogeneous group, involving a comprehensive evaluation of the spatial proximity between elements belonging to the same category. * Identification of Maximum Distance: Among the calculated distances, the value corresponding to the greatest distance between points in the same group is extracted, allowing the identification of the maximum spatial limits within the analyzed set. * Establishment of the Geometric Center: From the obtained coordinates of each point, the geometric center of the set is calculated. This calculation provides a spatial reference point that synthesizes the average location of all elements in the group. Figure 8: The image shows the correspondence of keypoints between a segment of a foilocyte, which was scaled and rotated relative to the original, and a complete visualization of cervical cytology. This last image was taken with a 3\(\times\) magnification on a mobile device combined with a 10\(\times\) microscope objective. The sample was provided by SPHLM. As described in the previous steps, after identifying the set of points with matching descriptors, exhaustive collection of the coordinates of that group is advanced. These points are specifically correlated with the descriptions of the various fragments extracted from the analyzed sample. Therefore, the following procedure is structured: Considering a set of coordinates \(\{P_{1},P_{2},\ldots,P_{n}\}\) and a distance threshold denoted by \(\theta\), the Euclidean distance between any pair of points \(P_{i}\) and \(P_{j}\) is defined as \(d(P_{i},P_{j})\). Initially, a set called _cercanas_ is established as empty, and a list called _conjuntos_ also starts empty. Each point \(P_{i}\), with \(i\) varying from \(1\) to \(n\), is evidenced in (10). Once the process is completed, the set _cercanas_ includes all the coordinates that are close to each other. On the other hand, _conjuntos_ encompasses the groups of close coordinates, each identified by specific labels. Furthermore, the center, according to Equation (11), and the maximum distance, according to Equation (12), are determined. These parameters are essential for generating the homographic matrix corresponding to each set. \[x_{centro}=\frac{1}{n}\sum_{i=1}^{n}x_{i}y_{centro}=\frac{1}{n} \sum_{i=1}^{n}y_{i} \tag{11}\] \[\text{maximum distance}=\max(\sqrt{(x_{ji}-x_{ii})^{2}+(y_{ji}- y_{ii})^{2}}) \tag{12}\]  
By implementing the keypoint detection process in a set of cutouts with specific features for a low-grade lesion, as illustrated in Figure 9, robust detection is sought. This robustness is manifested in the ability of keypoints to maintain their reliability against variations in lighting and geometric transformations. The choice of SIFT as a method is justified by its known resistance to morphological changes, thus providing reliable detection in uncontrolled environments.