A system that includes a three-dimensional (3D) camera configured to capture a 3D image of a rearview of a dairy livestock in a stall, a memory, and a processor. The processor is configured to obtain the 3D image, identify one or more regions within the 3D image comprising depth values greater than a depth value threshold, and apply the thigh gap detection rule set to the one or more regions to identify a thigh gap region. The processor is further configured to demarcate an access region within the thigh gap region and demarcate a tail detection region. The processor is further configured to partition the 3D image within the tail detection region to generate a plurality of image depth planes, examine each of the plurality of image depth planes, and determine position information for the tail of the dairy livestock in response to identifying the tail of the dairy livestock.