@@ -34,7 +34,7 @@ class GaussianBlur(_NaturalPerturb): | |||||
ksize (int): Size of gaussian kernel, this value must be non-negnative. | ksize (int): Size of gaussian kernel, this value must be non-negnative. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> ksize = 5 | >>> ksize = 5 | ||||
@@ -74,11 +74,11 @@ class MotionBlur(_NaturalPerturb): | |||||
Args: | Args: | ||||
degree (int): Degree of blur. This value must be positive. Suggested value range in [1, 15]. | degree (int): Degree of blur. This value must be positive. Suggested value range in [1, 15]. | ||||
angle: (union[float, int]): Direction of motion blur. Angle=0 means up and down motion blur. Angle is | |||||
angle (union[float, int]): Direction of motion blur. Angle=0 means up and down motion blur. Angle is | |||||
counterclockwise. | counterclockwise. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> angle = 0 | >>> angle = 0 | ||||
@@ -132,7 +132,7 @@ class GradientBlur(_NaturalPerturb): | |||||
center (bool): Blurred or clear at the center of a specified point. | center (bool): Blurred or clear at the center of a specified point. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('xx.png') | >>> img = cv2.imread('xx.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> number = 5 | >>> number = 5 | ||||
@@ -35,7 +35,7 @@ class UniformNoise(_NaturalPerturb): | |||||
[0.001, 0.15]. | [0.001, 0.15]. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> factor = 0.1 | >>> factor = 0.1 | ||||
@@ -80,7 +80,7 @@ class GaussianNoise(_NaturalPerturb): | |||||
[0.001, 0.15]. | [0.001, 0.15]. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> factor = 0.1 | >>> factor = 0.1 | ||||
@@ -124,7 +124,7 @@ class SaltAndPepperNoise(_NaturalPerturb): | |||||
[0.001, 0.15]. | [0.001, 0.15]. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> factor = 0.1 | >>> factor = 0.1 | ||||
@@ -28,16 +28,16 @@ TAG = 'Image Luminance' | |||||
class Contrast(_NaturalPerturb): | class Contrast(_NaturalPerturb): | ||||
""" | |||||
r""" | |||||
Contrast of an image. | Contrast of an image. | ||||
Args: | Args: | ||||
alpha (Union[float, int]): Control the contrast of an image. :math:`out_image = in_image*alpha+beta`. | |||||
alpha (Union[float, int]): Control the contrast of an image. :math:`out\_image = in\_image*alpha+beta`. | |||||
Suggested value range in [0.2, 2]. | Suggested value range in [0.2, 2]. | ||||
beta (Union[float, int]): Delta added to alpha. Default: 0. | beta (Union[float, int]): Delta added to alpha. Default: 0. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> alpha = 0.1 | >>> alpha = 0.1 | ||||
@@ -37,7 +37,7 @@ class Translate(_NaturalPerturb): | |||||
in [-0.1, 0.1]. | in [-0.1, 0.1]. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> x_bias = 0.1 | >>> x_bias = 0.1 | ||||
@@ -84,7 +84,7 @@ class Scale(_NaturalPerturb): | |||||
abs(factor_y - factor_x) < 0.5. | abs(factor_y - factor_x) < 0.5. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> factor_x = 0.7 | >>> factor_x = 0.7 | ||||
@@ -131,7 +131,7 @@ class Shear(_NaturalPerturb): | |||||
direction (str): Direction of deformation. Optional value is 'vertical' or 'horizontal'. | direction (str): Direction of deformation. Optional value is 'vertical' or 'horizontal'. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> factor = 0.2 | >>> factor = 0.2 | ||||
@@ -186,7 +186,7 @@ class Rotate(_NaturalPerturb): | |||||
angle (Union[float, int]): Degrees of counter clockwise. Suggested value range in [-60, 60]. | angle (Union[float, int]): Degrees of counter clockwise. Suggested value range in [-60, 60]. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> angle = 20 | >>> angle = 20 | ||||
@@ -240,7 +240,7 @@ class Perspective(_NaturalPerturb): | |||||
dst_pos (list): The point coordinates of the 4 points in ori_pos after perspective transformation. | dst_pos (list): The point coordinates of the 4 points in ori_pos after perspective transformation. | ||||
auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | auto_param (bool): Auto selected parameters. Selected parameters will preserve semantics of image. | ||||
Example: | |||||
Examples: | |||||
>>> img = cv2.imread('1.png') | >>> img = cv2.imread('1.png') | ||||
>>> img = np.array(img) | >>> img = np.array(img) | ||||
>>> ori_pos = [[0, 0], [0, 800], [800, 0], [800, 800]] | >>> ori_pos = [[0, 0], [0, 800], [800, 0], [800, 800]] | ||||