

def setUp(self):
    img_1 = os.path.join(settings['tempdir'], '~test_interpolate_flow_test_case_1.jpg')
    img_2 = os.path.join(settings['tempdir'], '~test_interpolate_flow_test_case_2.jpg')
    mk_sample_image(img_1, 320, 240, 3)
    mk_sample_image(img_2, 320, 240, 3)
    fr_1 = cv2.imread(img_1)
    fr_2 = cv2.imread(img_2)
    fr_1_gr = cv2.cvtColor(fr_1, cv2.COLOR_BGR2GRAY)
    fr_2_gr = cv2.cvtColor(fr_2, cv2.COLOR_BGR2GRAY)
    (self.fu, self.fv) = ocl_farneback_optical_flow(fr_1_gr, fr_2_gr, 0.5, 3, 15, 3, 7, 1.5, False, 0)
    (self.bu, self.bv) = ocl_farneback_optical_flow(fr_1_gr, fr_2_gr, 0.5, 3, 15, 3, 7, 1.5, False, 0)
    self.fr_1_32 = ((np.float32(fr_1) * 1) / 255.0)
    self.fr_2_32 = ((np.float32(fr_2) * 1) / 255.0)
    self.ocl_inter_method = (lambda t: ocl_interpolate_flow(self.fr_1_32, self.fr_2_32, self.fu, self.fv, self.bu, self.bv, t))

dataset/ETHPy150Open dthpham/butterflow/tests/test_motion.py InterpolateFlowTestCase.setUp/original