Exemplo n.º 1
0
def get_pix_2_mm(file):
    im = images.read_img(file)
    # crop_result = images.crop_polygon(im)
    # p = crop_result.points
    # pixel_distance = sqrt((p[1, 0]-p[0, 0])**2 + (p[1, 1]-p[0, 1])**2)
    pixel_distance = 823
    mm_distance = 215
    print(f"pixel distance: {pixel_distance}")
    return mm_distance/pixel_distance
Exemplo n.º 2
0
 def test_circle_image(self):
     filepath = os.path.join(data_dir, "maxresdefault.jpg")
     im = images.read_img(filepath)
     images.OpeningGui(im)
Exemplo n.º 3
0
 def test(self):
     filepath = os.path.join(data_dir, "maxresdefault.jpg")
     im = images.read_img(filepath, True)
     images.ContoursGui(im)
Exemplo n.º 4
0
 def test(self):
     filepath = os.path.join(data_dir, "maxresdefault.jpg")
     im = images.read_img(filepath, True)
     images.AdaptiveThresholdGui(im)
Exemplo n.º 5
0
 def test_circle_grayscale_image(self):
     print('GRAY')
     filepath = os.path.join(data_dir, "maxresdefault.jpg")
     im = images.read_img(filepath, True)
     images.CircleGui(im, rmax=500)
     print('Finished')
Exemplo n.º 6
0
 def test(self):
     filepath = os.path.join(data_dir, "maxresdefault.jpg")
     im = images.read_img(filepath)
     im = images.rotate(im, 90)
     images.display(im)
Exemplo n.º 7
0
 def test_read_jpg(self):
     filepath = os.path.join(data_dir, "SampleImage.jpg")
     # filepath = pkg_resources.resource_filename(__name__, path)
     im = images.read_img(filepath)
     self.assertTrue(type(im) == np.ndarray)
     self.assertTrue(np.shape(im)[2] == 3)
Exemplo n.º 8
0
 def test_read_jpg_grayscale(self):
     filepath = os.path.join(data_dir, "SampleImage.jpg")
     im = images.read_img(filepath, grayscale=True)
     self.assertTrue(len(np.shape(im))==2)