Using function to calculate thresh hold
Taking video input now