A system that includes a laser configured to generate a profile signal of at least a portion of a dairy livestock, a memory operable to store a teat detection rule set, 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 one or more edge pairs from among the one or more edge pair candidates based on the comparison. The processor is further configured to apply the teat detection rule set to the one or more edge pairs to identify one or more teat candidates from among the one or more edge pairs and determine position information for the one or more teat candidates.