Beispiel #1
0
    def load(self):
        """
        Syncs, parses, converts and returns the *Jiang et al. (2013)*
        *Camera Spectral Sensitivity Database* dataset content.

        Returns
        -------
        OrderedDict
            *Jiang et al. (2013)* *Camera Spectral Sensitivity Database*
            dataset content.

        Examples
        --------
        >>> from colour_datasets.utilities import suppress_stdout
        >>> dataset = Jiang2013DatasetLoader()
        >>> with suppress_stdout():
        ...     dataset.load()
        >>> len(dataset.content.keys())
        28
        """

        super(Jiang2013DatasetLoader, self).sync()

        shape = SpectralShape(400, 720, 10)

        self._content = OrderedDict()
        database_path = os.path.join(self.record.repository, 'dataset',
                                     'camspec_database.txt')
        with codecs.open(database_path, encoding='utf-8') as database_file:
            lines = filter(None, (line.strip()
                                  for line in database_file.readlines()))
            camera = None
            for line in lines:
                if re.match('[a-zA-Z]+', line):
                    camera = line
                    self._content[camera] = []
                    continue

                self._content[camera].extend(
                    [float(value) for value in line.split('\t')])

        for camera, values in self._content.items():
            self._content[camera] = RGB_SpectralSensitivities(np.transpose(
                as_float_array(values).reshape([3, 33])),
                                                              shape.range(),
                                                              name=camera)

        return self._content
Beispiel #2
0
            590.0: 0.78289512474646505000,
            600.0: 0.73946953007191796000,
            610.0: 0.66718640174985699000,
            620.0: 0.62043627806816704000,
            630.0: 0.61116087876956704000,
            640.0: 0.55173556195710605000,
            650.0: 0.46538831744516401000,
            660.0: 0.07961907836720690000,
            670.0: 0.00059244446107236802,
            680.0: 0.00468563680483140980
        }
    }
}

DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES = CaseInsensitiveMapping({
    'Nikon 5100 (NPL)':
    RGB_SpectralSensitivities(
        'Nikon 5100 (NPL)',
        DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA['Nikon 5100 (NPL)']),
    'Sigma SDMerill (NPL)':
    RGB_SpectralSensitivities(
        'Sigma SDMerill (NPL)',
        DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA['Sigma SDMerill (NPL)'])
})
"""
*DSLR* cameras *RGB* spectral sensitivities.

DSL_CAMERAS_RGB_SPECTRAL_SENSITIVITIES : CaseInsensitiveMapping
    **{Nikon 5100 (NPL), Sigma SDMerill (NPL)}**
"""
Beispiel #3
0
            0.07961907836720690000),
        670.0: (
            0.00630978795372749960,
            0.00414367215817645990,
            0.00059244446107236802),
        680.0: (
            0.00528874383171553000,
            0.00183198958165669010,
            0.00468563680483140980)
    }
}  # yapf: disable

DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES = CaseInsensitiveMapping({
    'Nikon 5100 (NPL)':
        RGB_SpectralSensitivities(
            DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA['Nikon 5100 (NPL)'],
            name='Nikon 5100 (NPL)'),
    'Sigma SDMerill (NPL)':
        RGB_SpectralSensitivities(
            DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES_DATA[
                'Sigma SDMerill (NPL)'],
            name='Sigma SDMerill (NPL)')
})
"""
*DSLR* cameras *RGB* spectral sensitivities.

References
----------
:cite:`Darrodi2015a`

DSLR_CAMERAS_RGB_SPECTRAL_SENSITIVITIES : CaseInsensitiveMapping