A system that includes a laser configured to generate a profile signal of at least a portion of a dairy livestock and a processor. The processor is configured to obtain the profile signal and detect one or more edge pair candidates in the profile signal, compare the complementary distance gradients of each of the one or more edge pair candidates to a minimum distance gradient length to be considered an edge pair, and identify an edge pair from among the one or more edge pair candidates as a teat candidate based on the comparison. The processor is further configured to determine position information for the teat candidate.