colour.RGB_colourspace_volume_MonteCarlo¶
-
colour.
RGB_colourspace_volume_MonteCarlo
(colourspace, samples=10000000.0, limits=array([[ 0., 100.], [-150., 150.], [-150., 150.]]), illuminant_Lab=array([ 0.3127, 0.329 ]), chromatic_adaptation_method='CAT02', random_generator=<function random_triplet_generator>, random_state=None)[source]¶ Performs given RGB colourspace volume computation using Monte Carlo method and multiprocessing.
Parameters: - colourspace (RGB_Colourspace) – RGB colourspace to compute the volume of.
- samples (numeric, optional) – Samples count.
- limits (array_like, optional) – Lab colourspace volume.
- illuminant_Lab (array_like, optional) – Lab colourspace illuminant chromaticity coordinates.
- chromatic_adaptation_method (unicode, optional) – {‘CAT02’, ‘XYZ Scaling’, ‘Von Kries’, ‘Bradford’, ‘Sharp’, ‘Fairchild’, ‘CMCCAT97’, ‘CMCCAT2000’, ‘CAT02_BRILL_CAT’, ‘Bianco’, ‘Bianco PC’}, Chromatic adaptation method.
- random_generator (generator, optional) – Random triplet generator providing the random samples within the Lab colourspace volume.
- random_state (RandomState, optional) – Mersenne Twister pseudo-random number generator to use in the random number generator.
Returns: RGB colourspace volume.
Return type: Notes
- The doctest is assuming that
np.random.RandomState()
definition will return the same sequence no matter which OS or Python version is used. There is however no formal promise about the prng sequence reproducibility of either Python or Numpy implementations: Laurent. (2012). Reproducibility of python pseudo-random numbers across systems and versions? Retrieved January 20, 2015, from http://stackoverflow.com/questions/8786084/reproducibility-of-python-pseudo-random-numbers-across-systems-and-versions
Examples
>>> from colour.models import sRGB_COLOURSPACE as sRGB >>> from colour.utilities import disable_multiprocessing >>> prng = np.random.RandomState(2) >>> with disable_multiprocessing(): ... RGB_colourspace_volume_MonteCarlo(sRGB, 10e3, random_state=prng) ... # doctest: +ELLIPSIS 8...