# A Circle Center Location Algorithm Based on Sample Density and Adaptive Thresholding
## 1 Introduction
A method for detecting particles in intracellular images and estimating their radii by using the circle fitting algorithm is proposed. The edge points of a detected particle are distinguished by the intensity difference between the particle and the background. The edge points are extracted and fitted by a circle by a voting technique [14]. The multiple circle detection problem was considered on the basis of given data point set. The incremental algorithm for searching for an approximate globally optimal k-partition was proposed. The algorithm locates either a globally optimal k-partition or a locally optimal k-partition close to the global one [15]. Currently, there are three commonly used algorithms for circle center localization: template matching, Hough transform, and circle fitting. (1) Template matching: The template matching algorithm requires selecting a region of interest containing circular features as a template. A sliding window is then used to traverse the entire image. During each sliding process, the similarity between the current window and the circular feature template image is calculated. Once the traversal is complete, the position of the corresponding circle image with the highest similarity is determined, completing the localization. This algorithm requires traversing the entire image, resulting in a large computational cost and time consumption. Additionally, the creation of the template has certain requirements, which is considered as a pre-condition, and may not be feasible in some cases. (2) Hough transform: The basic idea of the standard Hough transform algorithm is to transfer the image space into parameter space through a spatial domain transformation. Then, using a parameter form that satisfies most of the boundary points to vote in the parameter space, the information required is determined by the local maximum in the accumulator space. In most cases, the circular parameter space is three-dimensional, and the accumulation of parameters in three-dimensional space incurs significant spatial and temporal costs [1]. Therefore, this method has not been widely applied in practice. Despite its advantages of high accuracy and strong anti-interference capabilities, the three-dimensional parameter space required for this method results in significant time consumption and space complexity, making it unsuitable for practical applications. To speed up the circle detection using the Hough transform, scholars have proposedvarious improved Hough transform methods for circle detection. However, these improved methods often sacrifice detection accuracy and anti-interference capabilities. (3) Circle fitting: Most circle fitting algorithms utilize the least squares polynomial curve fitting method. They minimize the sum of squared distances between the data points and the fitted circle, solving an optimization problem that minimizes an objective function to obtain the best parameters for the fitted circle. However, since polynomial fitting is linear, it is prone to underfit when the feature space is large. Therefore, for nonlinear features such as irregular edges, gradient descent is needed for optimization, which can significantly affect accuracy. This algorithm requires fitting a regular circular contour before matching the circle center for localization. These two operations may amplify the error in circle center coordinates. In this paper, we propose a new circle center localization algorithm based on sample density and adaptive thresholding. After initial image pre-processing steps, such as denoising, threshold segmentation, and mathematical morphology, the region where the circle is located is identified. Within this region, the algorithm extracts the contour of the circle, obtaining the pixels on the circle contour. To reduce the computational complexity of the Hough transform and improve the accuracy of curve fitting, we introduce the Center Localization Based on Sample Density and Adaptive Threshold (CLSDAT) algorithm based on the concept of sample density and adaptive thresholding.