Beispiel #1
0
 def test_transform(self, file):
     image = get_test_image(file)
     scale_factor = ruler_scale_factor(image, distance=0.5)
     self.assertAlmostEqual(self.scale_factor_base, scale_factor, delta=0.2)
Beispiel #2
0
 def test_measurement(self, file, separation):
     image = get_test_image('ruler', 'measured', file)
     if len(image.shape) != 3:
         pdb.set_trace()
     scale_factor = ruler_scale_factor(image, distance=0.5)
     self.assertAlmostEqual(separation, 0.5 / scale_factor, delta=1)
Beispiel #3
0
 def setUpClass(cls):
     image_base = get_test_image('ruler', 'distorted', 'test.JPG')
     cls.scale_factor_base = ruler_scale_factor(image_base, distance=0.5)