Superpixel Benchmark
Superpixel benchmark, tools and algorithms.
transformation.h
Go to the documentation of this file.
1 
32 #ifndef TRANSFORMATIONS_H
33 #define TRANSFORMATIONS_H
34 
35 #include <opencv2/opencv.hpp>
36 
41 public:
47  static void applyGaussianAdditiveNoise(const cv::Mat &image, float variance,
48  cv::Mat &noisy_image);
49 
55  static void applyGaussianSamplingErrors(const cv::Mat &image, float variance,
56  cv::Mat &noisy_image);
57 
63  static void applySaltAndPepperNoise(const cv::Mat &image, float p, cv::Mat &noisy_image);
64 
69  static void applyPoissonNoise(const cv::Mat &image, cv::Mat &noisy_image);
70 
76  static void applyBlur(const cv::Mat &image, int size, cv::Mat &blurred_image);
77 
85  static void applyGaussianBlur(const cv::Mat &image, int size, float sigma_x,
86  float sigma_y, cv::Mat &blurred_image);
87 
93  static void applyMedianBlur(const cv::Mat &image, int size,
94  cv::Mat &blurred_image);
95 
103  static void applyBilateralFilter(const cv::Mat &image, int size, float sigma_color,
104  float sigma_space, cv::Mat &filtered_image);
105 
112  static void applyMotionBlur(const cv::Mat &image, int size,
113  float angle, cv::Mat &blurred_image);
114 
121  template<typename T>
122  static void applyVerticalShear(const cv::Mat &image, int crop,
123  float shear, cv::Mat &sheared_image);
124 
131  template<typename T>
132  static void applyHorizontalShear(const cv::Mat &image, int crop,
133  float shear, cv::Mat &sheared_image);
134 
141  template<typename T>
142  static void applyRotation(const cv::Mat &image, int crop, float angle,
143  cv::Mat &rotated_image, int interpolation = cv::INTER_LINEAR);
144 
152  template<typename T>
153  static void applyTranslation(const cv::Mat &image, int crop,
154  int translation_x, int translation_y, cv::Mat &translated_image);
155 };
156 
157 #endif /* TRANSFORMATIONS_H */
158 
static void applyBlur(const cv::Mat &image, int size, cv::Mat &blurred_image)
Apply blur (box filter).
Definition: transformation.cpp:180
static void applyRotation(const cv::Mat &image, int crop, float angle, cv::Mat &rotated_image, int interpolation=cv::INTER_LINEAR)
Apply rotation.
Definition: transformation.cpp:312
static void applyGaussianAdditiveNoise(const cv::Mat &image, float variance, cv::Mat &noisy_image)
Add Gaussian additive noise to image with the given variance on all channels.
Definition: transformation.cpp:40
Utility class for image and ground truth transofmrations.
Definition: transformation.h:40
static void applyVerticalShear(const cv::Mat &image, int crop, float shear, cv::Mat &sheared_image)
Apply vertical shear.
Definition: transformation.cpp:266
static void applySaltAndPepperNoise(const cv::Mat &image, float p, cv::Mat &noisy_image)
Add salt and pepper noise.
Definition: transformation.cpp:113
static void applyPoissonNoise(const cv::Mat &image, cv::Mat &noisy_image)
Add poisson noise.
Definition: transformation.cpp:150
static void applyMotionBlur(const cv::Mat &image, int size, float angle, cv::Mat &blurred_image)
Apply motion blur.
Definition: transformation.cpp:225
static void applyMedianBlur(const cv::Mat &image, int size, cv::Mat &blurred_image)
Apply median filter.
Definition: transformation.cpp:204
static void applyTranslation(const cv::Mat &image, int crop, int translation_x, int translation_y, cv::Mat &translated_image)
Apply translation.
Definition: transformation.cpp:345
static void applyGaussianSamplingErrors(const cv::Mat &image, float variance, cv::Mat &noisy_image)
Add Gaussian sampling errors with given variance.
Definition: transformation.cpp:69
static void applyGaussianBlur(const cv::Mat &image, int size, float sigma_x, float sigma_y, cv::Mat &blurred_image)
Apply Gaussian blurring.
Definition: transformation.cpp:191
static void applyHorizontalShear(const cv::Mat &image, int crop, float shear, cv::Mat &sheared_image)
Apply horizontal shear.
Definition: transformation.cpp:289
static void applyBilateralFilter(const cv::Mat &image, int size, float sigma_color, float sigma_space, cv::Mat &filtered_image)
Apply bilateral filter.
Definition: transformation.cpp:215