Esempio n. 1
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)
Esempio n. 2
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)
Esempio n. 3
0
from vision.ruler_detection.find_scale import ruler_scale_factor
from vision.tests import get_test_image, get_test_path, get_test_folder_images

image = get_test_image(
    'ruler', 'measured',
    'BMNHE_1045431_13499_7ebc4ab5363564654efa82aadc3ac056c4fe88ec.JPG')

pixel_distance = 37.23
real_world_distance = pixel_distance * ruler_scale_factor(image, distance=0.5)
Esempio n. 4
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)
Esempio n. 5
0
from vision.ruler_detection.find_scale import ruler_scale_factor
from vision.tests import get_test_image, get_test_path, get_test_folder_images

image = get_test_image('ruler',
                       'measured',
                       'BMNHE_1045431_13499_7ebc4ab5363564654efa82aadc3ac056c4fe88ec.JPG')

pixel_distance = 37.23
real_world_distance = pixel_distance * ruler_scale_factor(image, distance=0.5)