Ejemplo n.º 1
0
    def test_loader_errors(self):
        # check that images with no dark images raise ValueError
        with self.assertRaises(ValueError):
            images = {'temporal': {0: {0.1: ""}},
                      'spatial': {0: {0.1: ""}}}
            l = LoadImageData(images)
        # check that one image for temporal instead of 2 raise valueerror
        with self.assertRaises(ValueError):
            images = {'temporal': {0: {0.0: ""}},
                      'spatial': {0: {0.0: ""}}}
            l = LoadImageData(images)

        # Check that an image that does not exist raise an IOError
        with self.assertRaises(IOError):
            images = {'temporal': {0: {0.0: ["."], 0.1: ["."]}},
                      'spatial': {0: {0.0: ["."], 0.1: ["."]}}}
            l = LoadImageData(images)
Ejemplo n.º 2
0
 def _init(self):
     # Create dataset to load
     dataset = DatasetGenerator(height=self._height,
                                width=self._width,
                                bit_depth=self._bit_depth,
                                L=self._L,
                                steps=self._steps)
     descriptor_path = dataset.descriptor_path
     # create the parser
     parser = ParseEmvaDescriptorFile(descriptor_path)
     # create loader
     loader = LoadImageData(parser.images)
     return dataset, parser, loader
Ejemplo n.º 3
0
def _init(pixel_area=0, **kwargs):
    # create dataset
    dataset = DatasetGenerator(**kwargs)
    # parse dataset
    parser = ParseEmvaDescriptorFile(dataset.descriptor_path)
    # load image data
    loader = LoadImageData(parser.images)
    # create data
    data = Data1288(loader.data)
    # Make results object
    px = pixel_area
    if pixel_area == 0:
        px = dataset.cam.pixel_area
    results = Results1288(data.data, pixel_area=px)
    return dataset, parser, loader, data, results
Ejemplo n.º 4
0
 def _init(self):
     # create dataset
     dataset = DatasetGenerator(height=self._height,
                                width=self._width,
                                bit_depth=self._bit_depth,
                                L=self._L,
                                steps=self._steps,
                                radiance_min=self._radiance_min,
                                exposure_max=self._exposure_max)
     # parse dataset
     parser = ParseEmvaDescriptorFile(dataset.descriptor_path)
     # load images
     loader = LoadImageData(parser.images)
     # create data
     data = Data1288(loader.data)
     return dataset, parser, loader, data
Ejemplo n.º 5
0
 def __init__(self, fname):
     parser = ParseEmvaDescriptorFile(fname)
     imgs = LoadImageData(parser.images)
     dat = Data1288(imgs.data)
     self._results = Results1288(dat.data)