modified farneback sample to use T-API