added bg subtraction and color thresholding