ida_lib.operations package¶
Submodules¶
ida_lib.operations.geometry_ops_functional module¶
-
ida_lib.operations.geometry_ops_functional.affine_compose_data(data: dict, matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7630>) → dict¶ Parameters: - data – dict of elements to be transformed
- matrix – matrix of transformation
Returns: transformed data
-
ida_lib.operations.geometry_ops_functional.affine_coordinates_matrix(matrix_coordinates: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7748>, matrix_transformation: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7780>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b77f0>¶
-
ida_lib.operations.geometry_ops_functional.affine_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7d68>, matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7cc0>, interpolation: str = 'bilinear', padding_mode: str = 'zeros') → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7c88>¶
-
ida_lib.operations.geometry_ops_functional.config_scale_matrix(scale_factor, center, matrix)¶
-
ida_lib.operations.geometry_ops_functional.get_rotation_matrix(center: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7be0>, degrees: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7b70>)¶
-
ida_lib.operations.geometry_ops_functional.get_scale_matrix(center: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6208>, scale_factor: Union[float, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6198>])¶
-
ida_lib.operations.geometry_ops_functional.get_shear_matrix(shear_factor: tuple) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121390>¶
-
ida_lib.operations.geometry_ops_functional.get_squared_scale_matrix(center: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6160>, scale_factor: Union[float, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6128>])¶
-
ida_lib.operations.geometry_ops_functional.get_squared_shear_matrix(shear_factor: tuple) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121400>¶
-
ida_lib.operations.geometry_ops_functional.get_translation_matrix(translation: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121240>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121278>¶
-
ida_lib.operations.geometry_ops_functional.hflip_compose_data(data: dict) → dict¶ Parameters: data – dict of elements to be transformed Returns: transformed data
-
ida_lib.operations.geometry_ops_functional.hflip_coordinates_matrix(matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7ef0>, width: int) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7dd8>¶
-
ida_lib.operations.geometry_ops_functional.hflip_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b74a8>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b75f8>¶
-
ida_lib.operations.geometry_ops_functional.own_affine(tensor: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121588>, matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71215f8>, interpolation: str = 'bilinear', padding_mode: str = 'border') → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121630>¶ Apply an affine transformation to the image.
Parameters: - tensor – The image tensor to be warped.
- matrix – The 2x3 affine transformation matrix.
- interpolation – interpolation mode to calculate output values ‘bilinear’ | ‘nearest’. Default: ‘bilinear’.
- padding_mode – padding mode for outside grid values ‘zeros’ | ‘border’ | ‘reflection’. Default: ‘zeros’.
Returns: The warped image.
-
ida_lib.operations.geometry_ops_functional.prepare_data(func)¶ Decorator that prepares the input data to apply the geometric transformation. For this purpose, it concatenates all the two-dimensional elements of the input data in the same tensor on which a single transformation is applied. If the input data contains point coordinates, they are grouped in a matrix as homogeneous coordinates, over which a single matrix multiplication is performed.
Parameters: func – geometric function to be applied to the data Returns: processed data
-
ida_lib.operations.geometry_ops_functional.rotate_compose_data(data: dict, degrees: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e60f0>, center: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6080>)¶ Parameters: - data – dict of elements to be transformed
- degrees – counterclockwise degrees of rotation
- center – center of rotation. Default, center of the image
Returns: transformed data
-
ida_lib.operations.geometry_ops_functional.rotate_coordinates_matrix(matrix_coordinates: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6ba8>, matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6be0>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6f28>¶
-
ida_lib.operations.geometry_ops_functional.rotate_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6b70>, degrees: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6a58>, center: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6a90>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6b38>¶ mode
-
ida_lib.operations.geometry_ops_functional.scale_compose_data(data: dict, scale_factor: Union[float, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121128>], center: Optional[<sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121160>] = None) → dict¶ Parameters: - data – dict of elements to be transformed
- scale_factor – factor of scaling
- center – center of scaling. By default its taken the center of the image
Returns: transformed data
-
ida_lib.operations.geometry_ops_functional.scale_coordinates_matrix(matrix_coordinates: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121080>, matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71210b8>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71210f0>¶
-
ida_lib.operations.geometry_ops_functional.scale_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6f60>, scale_factor: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6f98>, center: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70e6fd0>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121048>¶
-
ida_lib.operations.geometry_ops_functional.shear_compose_data(data: dict, shear_factor: tuple) → dict¶ Parameters: - data – dict of elements to be transformed
- shear_factor – pixels of shearing
Returns: transformed data
-
ida_lib.operations.geometry_ops_functional.shear_coordinates_matrix(matrix_coordinates: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71214e0>, matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121518>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121550>¶
-
ida_lib.operations.geometry_ops_functional.shear_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121438>, shear_factor: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121470>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71214a8>¶
-
ida_lib.operations.geometry_ops_functional.translate_compose_data(data: dict, translation: Union[int, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121358>]) → dict¶ Parameters: - data – dict of elements to be transformed
- translation – number of pixels to translate
Returns: transformed data
-
ida_lib.operations.geometry_ops_functional.translate_coordinates_matrix(matrix_coordinates: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71212b0>, translation: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71212e8>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121320>¶
-
ida_lib.operations.geometry_ops_functional.translate_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121198>, translation: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c71211d0>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7121208>¶
-
ida_lib.operations.geometry_ops_functional.vflip_compose_data(data: dict) → dict¶ Parameters: data – dict of elements to be transformed Returns: transformed data
-
ida_lib.operations.geometry_ops_functional.vflip_coordinates_matrix(matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7048>, height: int) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7a58>¶
-
ida_lib.operations.geometry_ops_functional.vflip_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c74b6780>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c77b7c50>¶
ida_lib.operations.pixel_ops_functional module¶
-
ida_lib.operations.pixel_ops_functional.apply_blur(img, blur_size=(5, 5))¶
-
ida_lib.operations.pixel_ops_functional.apply_gaussian_blur(img, blur_size=(5, 5))¶ Parameters: - img – input image to be transformed
- blur_size – number of surrounding pixels affecting each output pixel. (pixels on axis X, pixels on axis y)
Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.apply_gaussian_noise(image, var=20)¶
-
ida_lib.operations.pixel_ops_functional.apply_lut_by_pixel_function(function, image: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70b1e48>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70b1f60>¶ Applies the input operation to the image using a LUT
Parameters: - function – Mathematical function that represents the operation to carry out in each pixel of the image
- image – input image
Returns:
-
ida_lib.operations.pixel_ops_functional.apply_poisson_noise(image)¶
-
ida_lib.operations.pixel_ops_functional.apply_salt_and_pepper_noise(image, amount=0.05, s_vs_p=0.5)¶
-
ida_lib.operations.pixel_ops_functional.apply_spekle_noise(image, mean=0, var=0.01)¶
-
ida_lib.operations.pixel_ops_functional.blur(img: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f3a5c0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f3a5f8>], blur_size) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f3a630>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f3ad68>]¶ Parameters: - img – input image to be transformed
- blur_size – number of surrounding pixels affecting each output pixel. (pixels on axis X, pixels on axis y)
Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.change_brightness(image: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f54d30>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f54780>], brightness: int) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f546d8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7045f28>]¶ Change the brightness of the input image.
Parameters: - image – input image to be normalized
- brightness – desired amount of brightness for the image 0 - no brightness 1 - same 2 - max brightness
Returns: transformed image
-
ida_lib.operations.pixel_ops_functional.change_contrast(image: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f14a58>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f14cf8>], contrast) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f14e48>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8ac18>]¶ :param image : input image to be transformed :param contrast: modification factor to be applied to the image contrast
- 0 - total contrast removal
- 1 - dont modify
- >1 - augment contrast
Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.change_gamma(image: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8add8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8a438>], gamma: float) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8a1d0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8aa20>]¶ Parameters: - image – input image to be transformed
- gamma – desired factor gamma * gamma = 0 -> removes image luminance (black output image) * gamma = 1 -> remains unchanged * gamma > 1 -> increases luminance
Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.gaussian_blur(img: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c70229e8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7022630>], blur_size) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7022a90>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7022ac8>]¶ Parameters: - img – input image to be transformed
- blur_size – number of surrounding pixels affecting each output pixel. (pixels on axis X, pixels on axis y)
Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.gaussian_noise(image: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8aeb8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8ae80>], var=20) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8ae10>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8a2e8>]¶ Parameters: - image – input image to be transformed
- var – var of the gaussian distribution of noise
Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.get_brightness_function(brightness: int)¶ Parameters: brightness – brightness factor Returns: Return the lambda function of the brightness operation
-
ida_lib.operations.pixel_ops_functional.get_contrast_function(contrast: float)¶ Parameters: contrast – modification factor to be applied to the image contrast Returns: Return the lambda function of the contrast operation
-
ida_lib.operations.pixel_ops_functional.get_gamma_function(gamma)¶ Parameters: gamma – desired factor gamma Returns: Returns the lambda function of the gamma adjust operation
-
ida_lib.operations.pixel_ops_functional.histogram_equalization(img: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9e8d0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9e898>]) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f2bbe0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f2bc88>]¶ Parameters: img – input image to be transformed Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.normalize_image(img: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6fdb898>, norm_type: int = <sphinx.ext.autodoc.importer._MockObject object>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6fdb470>¶ Normalize the input image
Parameters: Returns: normalized image
-
ida_lib.operations.pixel_ops_functional.poisson_noise(image: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9ec88>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9ecc0>]) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9ed30>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9eb00>]¶ Parameters: image – input image to be transformed Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.prepare_data_for_opencv(func)¶ Decorator that prepares the input data to apply the transformation that only affects the image (color). :param func: color function to be applied to the data :return: processed data
-
ida_lib.operations.pixel_ops_functional.salt_and_pepper_noise(image: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8a9e8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8aa90>], amount, s_vs_p) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8a940>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f8ab70>]¶ Parameters: - image – input image to be transformed
- amount – percentage of image’s pixels to be occupied by noise
- s_vs_p – percentage of salt respect total noise. Default same salt (white pixel) as pepper (black pixels)
Returns: returns the transformed image
-
ida_lib.operations.pixel_ops_functional.spekle_noise(image: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9e5f8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9ea90>], mean=0, var=0.01) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9ea58>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6f9e9e8>]¶ Parameters: - image – input image to be transformed
- mean – mean of noise distribution
- var – variance of noise distribution
Returns: returns the transformed image
ida_lib.operations.transforms module¶
-
ida_lib.operations.transforms.hflip(data: dict, visualize: bool = False) → dict¶ - Horizontally flip the input data.
Parameters: - data – dict of elements to be transformed
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.vflip(data: dict, visualize: bool = False) → dict¶ - Vertically flip the input data.
Parameters: - data – dict of elements to be transformed
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.affine(data: dict, matrix: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c121d0>, visualize: bool = False) → dict¶ - Applies affine transformation to the data
:param data dict of elements to be transformed :param matrix: matrix of transformation :param visualize: if true it activates the display tool to debug the transformation :return: transformed data
-
ida_lib.operations.transforms.rotate(data: dict, degrees: float, visualize: bool = False, center: Union[None, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12fd0>] = None) → dict¶ - Rotate each element of the input data by the indicated degrees counterclockwise
Parameters: - data – dict of elements to be transformed
- degrees – degrees of rotation
- center – center of rotation. If center is None, it is taken the center of the image to apply the rotation
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.shear(data: dict, shear_factor: tuple, visualize: bool = False) → dict¶ - Shear input data by the input shear factor
Parameters: - data – dict of elements to be transformed
- shear_factor – pixels to shear
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.scale(data: dict, scale_factor, visualize: bool = False, center: Union[None, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12f98>] = None) → dict¶ - Scale each element of the input data by the input factor.
Parameters: - data – dict of elements to be transformed
- scale_factor – factor of scaling to be applied * scale_factor < 1 -> output image is smaller than input one * scale_factor = 1 -> output image is is the same as the input image * scale_factor = 2 -> each original pixel occupies 2 pixels in the output image
- center – center of scaling. If center is None, it is taken the center of the image to apply the scale
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.translate(data: dict, translation: tuple, visualize: bool = False) → dict¶ - Translate input by the input translation.
Parameters: - data – dict of elements to be transformed
- translation – number of pixels to be translated
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.change_gamma(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12080>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c125c0>], gamma, visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12588>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12518>]¶ - Adjust image’s gamma (luminance correction) . if the input data is a dictionary, only those corresponding
to an image are altered
Parameters: - data – dict of elements to be transformed
- gamma –
desired gamma factor (luminance of image)
- gamma = 0 -> removes image luminance (black output image)
- gamma = 1 -> remains unchanged
- gamma > 1 -> increases luminance
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.change_contrast(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12f28>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12390>], contrast: float, visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12400>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12550>]¶ - Change the image contrast. if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- contrast – desired contrast factor to the data * contrast = 0 -> removes image contrast (white output image) * contrast = 1 -> remains unchanged * contrast > 1 -> increases contrast
:param visualize : if true it activates the display tool to debug the transformation :return: transformed data
-
ida_lib.operations.transforms.change_brightness(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12dd8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12128>], bright=1, visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c120f0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12160>]¶ - Change the image brightness. if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- bright –
desired brightness amount for the data
- brightness = 0 -> removes image brightness (black output image)
- brightness = 1 -> remains unchanged
- brightness > 1 -> increases brightness
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.equalize_histogram(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12978>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c125f8>], visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12d68>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12da0>]¶ - Equalize image histogram. if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.inject_gaussian_noise(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12cf8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12c88>], var=0.5, visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12c50>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12c18>]¶ - Inject gaussian noise. If the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- var – variance of the noise distribution
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.inject_poisson_noise(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12b00>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12ac8>], visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12a90>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12a58>]¶ Inject poisson noise. if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.inject_spekle_noise(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12a20>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c129e8>], mean=0, var=0.01, visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c129b0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c120b8>]¶ Inject poisson noise. if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- mean – mean of noise distribution
- var – variance of noise distribution
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.inject_salt_and_pepper_noise(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12be0>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12ba8>], amount=0.05, s_vs_p=0.5, visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12b70>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c12b38>]¶ Inject salt and pepper noise if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- amount – percentage of image’s pixels to be occupied by noise
:param s_vs_p : noise type distribution. Default same salt (white pixel) as pepper (black pixels) :param visualize: if true it activates the display tool to debug the transformation :return: transformed data
-
ida_lib.operations.transforms.blur(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02f28>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02ef0>], blur_size=(5, 5), visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02eb8>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02e80>]¶ Blur image. if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- blur_size – number of surrounding pixels affecting each output pixel. (pixels on axis X, pixels on axis y)
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
-
ida_lib.operations.transforms.gaussian_blur(data: Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02c18>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02860>], blur_size=(5, 5), visualize: bool = False) → Union[dict, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02c50>, <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c6c02f60>]¶ Blurring an image by a Gaussian function. if the input data is a dictionary, only those corresponding to an image are altered
Parameters: - data – dict of elements to be transformed
- blur_size – number of surrounding pixels affecting each output pixel. (pixels on axis X, pixels on axis y)
- visualize – if true it activates the display tool to debug the transformation
Returns: transformed data
ida_lib.operations.utils module¶
-
ida_lib.operations.utils.add_new_axis(arr: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7153c18>)¶
-
ida_lib.operations.utils.arrays_equal(arr1, arr2)¶
-
ida_lib.operations.utils.data_to_numpy(data)¶
-
ida_lib.operations.utils.dtype_to_torch_type(im_type: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7153c50>)¶ Maps the numpy type to the equivalent torch.type
Parameters: im_type – numpy type Returns: torch.type
-
ida_lib.operations.utils.element_to_dict_csv_format(item, name)¶
-
ida_lib.operations.utils.generate_dict(item, label)¶
-
ida_lib.operations.utils.get_data_types(data)¶
-
ida_lib.operations.utils.get_principal_type(data: dict)¶
-
ida_lib.operations.utils.get_torch_image_center(data)¶
-
ida_lib.operations.utils.homogeneous_points_to_list(keypoints)¶
-
ida_lib.operations.utils.homogeneous_points_to_matrix(keypoints)¶
-
ida_lib.operations.utils.is_a_normalized_image(image)¶
-
ida_lib.operations.utils.is_numpy_data(data)¶
-
ida_lib.operations.utils.keypoints_to_homogeneous_and_concatenate(keypoints, resize_factor=None)¶
-
ida_lib.operations.utils.keypoints_to_homogeneous_functional(keypoints)¶
-
ida_lib.operations.utils.map_value(x, in_min, in_max, out_min, out_max)¶
-
ida_lib.operations.utils.mask_change_to_01_functional(mask)¶
-
ida_lib.operations.utils.remove_digits(label: str)¶
-
ida_lib.operations.utils.round_torch(arr: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe3c7153be0>, n_digits: int = 3)¶
-
ida_lib.operations.utils.save_im(tensor, title)¶