In this paper, a method for the automatic detection of dairy cow lying behaviour in free-stall barns is proposed. A computer visionbased system (CVBS) composed of a video-recording system and a cow lying behaviour detector based on the Viola Jones algorithm was developed. The CVBS performance was tested in a head-to-head free stall barn. Two classifiers were implemented in the software component of the CVBS to obtain the cow lying behaviour detector. The CVBS was validated by comparing its detection results with those generated from visual recognition. This comparison allowed the following accuracy indices to be calculated: the branching factor (BF), the miss factor (MF), the sensitivity, and the quality percentage (QP). The MF value of approximately 0.09 showed that the CVBS missed one cow every 11 well detected cows. Conversely, the BF value of approximately 0.08 indicated that one false positive was detected every 13 well detected cows. The high value of approximately 0.92 obtained for the sensitivity index and that obtained for QP of about 0.85 revealed the ability of the proposed system to detect cows lying in the stalls.