Example #1
0
 def setUp(self):
     # create data descriptor file for parser
     self.d_generator = DatasetGenerator(bit_depth=self._bit_depth,
                                         height=self._height,
                                         width=self._width,
                                         L=self._L,
                                         version=self._version,
                                         steps=self._steps)
Example #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
Example #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
Example #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
Example #5
0
    def setUp(self):
        # create dataset
        self.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
        self.parser = ParseEmvaDescriptorFile(self.dataset.descriptor_path)
        # load images
        self.loader = LoadImageData(self.parser.images)
        # create data
        self.data = Data1288(self.loader.data)
        # create operation point dict
        self.op = info_op()
Example #6
0
from emva1288 import process
from emva1288 import report
from emva1288.camera.dataset_generator import DatasetGenerator
import os

# # Load one test to add it as operation point
# dir_ = '/home/work/1288/datasets/'
# fname = 'EMVA1288_ReferenceSet_003_Simulation_12Bit/EMVA1288_Data.txt'
# fname = os.path.join(dir_, fname)

dataset_generator = DatasetGenerator(width=640,
                                     height=480,
                                     K=0.1,
                                     blackoffset=29.4,
                                     bit_depth=12,
                                     steps=50,
                                     exposure_fixed=1000000,
                                     dark_current_ref=30)

fname = dataset_generator.descriptor_path

parser = process.ParseEmvaDescriptorFile(fname)
imgs = process.LoadImageData(parser.images)
dat = process.Data1288(imgs.data)

# Description of the setup
setup = report.info_setup()
setup['Standard version'] = 3.1

# Basic information
basic = report.info_basic()
"""
Calling one by one the classes that compose the reference implementation
process a descriptor file, print the results and plot the graphics
"""

from emva1288 import process
from emva1288.camera.dataset_generator import DatasetGenerator

# dir_ = '/home/work/1288/datasets/'
# fname = 'EMVA1288_ReferenceSet_003_Simulation_12Bit/EMVA1288_Data.txt'

dataset_generator = DatasetGenerator(width=100,
                                     height=50,
                                     bit_depth=8,
                                     dark_current_ref=30)

# Parse the descriptor file
# parser = process.ParseEmvaDescriptorFile(os.path.join(dir_, fname))
parser = process.ParseEmvaDescriptorFile(dataset_generator.descriptor_path)

# Load images
imgs = process.LoadImageData(parser.images)

# Extract data from images
dat = process.Data1288(imgs.data)

# Compute the results
res = process.Results1288(dat.data)
res.print_results()

# Plot the graphics