Changed image threshold and absolute differencing to only consider pixels brighter than background. Clustering is more robust now, but the code runs at 40ms instead of 15ms now.