The aim of our work is to investigate whether the optical flow algorithm applied to video recordings can be used to detect movement during sleep in pediatric patients with epilepsy. The optical flow algorithm allocates intensities to pixels proportional to their involvement in movement of an object. The average of a percentage of the highest movement vectors was plotted as a function of time (R(t)). The used dataset contains video data acquired at the University Hospital of Leuven consisting of normal sleep movement and seizure movement. We investigated R(t), to make a distinction between movement and non-movement. We used the acquisition parameters (320 x 240 at 12.5 fps), derived from a previous study (Cuppens et al., Proceedings of the 4th European congress of the international federation for medical and biological engineering (MBEC 2008), ECIFBME 2008, Antwerp, Belgium, IFMBE Proceedings, vol 22, pp 784-789, 2008). Two experiments were concluded, one with global thresholds of R(t) in all datasets and one with a variable threshold in each dataset. The latter is obtained by inspecting a non-movement epoch and calculating the mean and standard deviations of R(t) over time. The variable threshold on R(t) was then obtained for each dataset by adding to the mean a fixed multiple of the standard deviation. Optimal thresholds were derived based on a three-fold cross-validation. The best result was achieved when using a variable threshold, which resulted in a sensitivity of one in all the test sets and a PPV of 1, 0.821, and 1, respectively, for the three test sets.