Performs a simple linear conversion of given array between the old and new ranges.
Parameters: |
|
---|---|
Returns: | |
Return type: | ndarray |
Examples
>>> a = np.linspace(0, 1, 10)
>>> linear_conversion(a, np.array([0, 1]), np.array([1, 10]))
array([ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.])
Implements supports for vivification of the underlying dict like data-structure, magical!
Returns: | |
---|---|
Return type: | defaultdict |
Examples
>>> vivified = vivification()
>>> vivified['my']['attribute'] = 1
>>> vivified['my']
defaultdict(<function vivification at 0x...>, {u'attribute': 1})
>>> vivified['my']['attribute']
1
Converts given vivified data-structure to dictionary.
Parameters: | vivified (defaultdict) – Vivified data-structure. |
---|---|
Returns: | |
Return type: | dict |
Examples
>>> vivified = vivification()
>>> vivified['my']['attribute'] = 1
>>> vivified_to_dict(vivified)
{u'my': {u'attribute': 1}}
Returns if given path exists.
Parameters: | path (unicode) – Path to check the existence. |
---|---|
Returns: | |
Return type: | bool |
Examples
>>> path_exists(__file__)
True
>>> path_exists('')
False
Filters given directory for files matching given extensions.
Parameters: |
|
---|---|
Returns: | Filtered files. |
Return type: | list |
Parses given exif data output from exiftool.
Parameters: | data (unicode) – Exif data. |
---|---|
Returns: | Parsed exif data. |
Return type: | list |
Returns given image exif image tags.
Parameters: | image (unicode) – Image file. |
---|---|
Returns: | Exif tags. |
Return type: | defaultdict |
Copies given source image file exif tag to given image target.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Updates given images siblings images pairs exif tags.
Parameters: | images (list) – Image files to update. |
---|---|
Returns: | Definition success. |
Return type: | bool |
Deletes all given image exif tags.
Parameters: | image (unicode) – Image file. |
---|---|
Returns: | Definition success. |
Return type: | bool |
Returns given image exif tag value.
Parameters: |
|
---|---|
Returns: | Tag value. |
Return type: | unicode |
Sets given image exif tag value.
Parameters: |
|
---|---|
Returns: | Definition success. |
Return type: | bool |
Computes the exposure value from given image FNumber, Exposure Time and ISO values.
Parameters: |
|
---|---|
Returns: | Image exposure value. |
Return type: | ndarray |
Examples
>>> exposure_value(8, 1, 100)
6.0
Adjusts given array exposure using given \(EV\) exposure value.
Parameters: |
|
---|---|
Returns: | Exposure adjusted array. |
Return type: | ndarray |
Examples
>>> adjust_exposure(np.array([0.25, 0.5, 0.75, 1]), 1)
array([ 0.5, 1. , 1.5, 2. ])
Computes the average luminance from given image FNumber, Exposure Time and ISO values.
Parameters: |
|
---|---|
Returns: | Image average luminance. |
Return type: | ndarray |
References
[1] | Wikipedia. (n.d.). EV as a measure of luminance and illuminance. Retrieved November 14, 2015, from https://en.wikipedia.org/wiki/Exposure_value#EV_as_a_measure_of_luminance_and_illuminance |
Examples
>>> average_luminance(8, 1, 100)
0.125
Bases: colour_hdri.utilities.image.Metadata
Defines the base object for storing exif metadata relevant to HDRI / radiance image generation.
Parameters: |
|
---|
Bases: object
Defines the base object for storing an image along its path, pixel data and metadata needed for HDRI / radiance images generation.
Parameters: |
|
---|
Property for self.__data private attribute.
Returns: | self.__data. |
---|---|
Return type: | unicode |
Property for self.__metadata private attribute.
Returns: | self.__metadata. |
---|---|
Return type: | unicode |
Property for self.__path private attribute.
Returns: | self.__path. |
---|---|
Return type: | unicode |
Reads image pixel data at Image.path attribute.
Returns: | Image pixel data. |
---|---|
Return type: | ndarray |
Reads image relevant exif metadata at Image.path attribute.
Returns: | Image relevant exif metadata. |
---|---|
Return type: | Metadata |
Bases: _abcoll.MutableSequence
Defines a convenient stack storing a sequence of images for HDRI / radiance images generation.
Reimplements the MutableSequence.__delitem__() method.
Parameters: | index (int) – Item index. |
---|
Reimplements the MutableSequence.__getattr__() method.
Parameters: | attribute (unicode) – Attribute to retrieve the value. |
---|---|
Returns: | Attribute value. |
Return type: | object |
Reimplements the MutableSequence.__getitem__() method.
Parameters: | index (int) – Item index. |
---|---|
Returns: | Item at given index. |
Return type: | Image |
Reimplements the MutableSequence.__len__() method.
Reimplements the MutableSequence.__getattr__() method.
Parameters: |
|
---|
Reimplements the MutableSequence.__setitem__() method.
Parameters: |
|
---|
Returns a ImageStack instance with given image files.
Parameters: | image_files (array_like) – Image files. |
---|---|
Returns: | |
Return type: | ImageStack |
Reimplements the MutableSequence.insert() method.
Parameters: |
|
---|