Abstract:High-precision spot localization algorithms are critical for ensuring the accuracy of laser triangulation displacement sensors. To address the impact of unstable laser spot imaging caused by lighting environment variations on sensor precision, a spot localization algorithm based on arctangent edge modeling is proposed. The method first employs bidirectional differential processing to extract envelope signals from initial spot data, effectively eliminating interference such as background noise, speckle noise, and spike noise. An arctangent edge model is then formulated through symmetrical shift processing of the arctangent function, generating a fitting function that aligns with spot waveform characteristics. To enhance fitting accuracy, physically meaningful initial parameter calculation formulas are derived, establishing relationships between fitting parameters and spot features. A gradient algorithm is used to extract physical characteristics from envelope waveforms, forming a feature set from which initial fitting parameters are calculated. Finally, the Levenberg-Marquardt method is applied for least squares fitting to determine optimal parameters, achieving sub-pixel-level spot centroid localization. Verified through laser triangulation sensor experiments the algorithm shows reduced single-point measurement repeatability errors to 0.04 pixels and full-scale nonlinearity errors to 0.02% across various imaging conditions, including submerged, normal, and overexposed scenarios. By mathematically modeling spot intensity distribution, this algorithm lowers sensor requirements for harsh imaging environments and reduces dependence on laser adjustment algorithms. Its real-time processing capability with single-frame handling, moderate complexity, and suitability for integrated development of high-speed, high-precision laser triangulation sensors make it an ideal solution.