Superpixel Benchmark
Superpixel benchmark, tools and algorithms.
Static Public Member Functions | List of all members
Transformation Class Reference

Utility class for image and ground truth transofmrations. More...

#include <transformation.h>

Static Public Member Functions

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. More...
 
static void applyGaussianSamplingErrors (const cv::Mat &image, float variance, cv::Mat &noisy_image)
 Add Gaussian sampling errors with given variance. More...
 
static void applySaltAndPepperNoise (const cv::Mat &image, float p, cv::Mat &noisy_image)
 Add salt and pepper noise. More...
 
static void applyPoissonNoise (const cv::Mat &image, cv::Mat &noisy_image)
 Add poisson noise. More...
 
static void applyBlur (const cv::Mat &image, int size, cv::Mat &blurred_image)
 Apply blur (box filter). More...
 
static void applyGaussianBlur (const cv::Mat &image, int size, float sigma_x, float sigma_y, cv::Mat &blurred_image)
 Apply Gaussian blurring. More...
 
static void applyMedianBlur (const cv::Mat &image, int size, cv::Mat &blurred_image)
 Apply median filter. More...
 
static void applyBilateralFilter (const cv::Mat &image, int size, float sigma_color, float sigma_space, cv::Mat &filtered_image)
 Apply bilateral filter. More...
 
static void applyMotionBlur (const cv::Mat &image, int size, float angle, cv::Mat &blurred_image)
 Apply motion blur. More...
 
template<typename T >
static void applyVerticalShear (const cv::Mat &image, int crop, float shear, cv::Mat &sheared_image)
 Apply vertical shear. More...
 
template<typename T >
static void applyHorizontalShear (const cv::Mat &image, int crop, float shear, cv::Mat &sheared_image)
 Apply horizontal shear. More...
 
template<typename T >
static void applyRotation (const cv::Mat &image, int crop, float angle, cv::Mat &rotated_image, int interpolation=cv::INTER_LINEAR)
 Apply rotation. More...
 
template<typename T >
static void applyTranslation (const cv::Mat &image, int crop, int translation_x, int translation_y, cv::Mat &translated_image)
 Apply translation. More...
 

Detailed Description

Utility class for image and ground truth transofmrations.

Copyright (c) 2016, David Stutz Contact: david.nosp@m..stu.nosp@m.tz@rw.nosp@m.th-a.nosp@m.achen.nosp@m..de, davidstutz.de All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author
David Stutz

Member Function Documentation

void Transformation::applyBilateralFilter ( const cv::Mat &  image,
int  size,
float  sigma_color,
float  sigma_space,
cv::Mat &  filtered_image 
)
static

Apply bilateral filter.

Parameters
[in]imageimage to apply bilateral filter to
[in]sizefilter size
[in]sigma_colorGaussian variance for color
[in]sigma_spaceGaussian variance for space
[out]filtered_imagefiltered image
void Transformation::applyBlur ( const cv::Mat &  image,
int  size,
cv::Mat &  blurred_image 
)
static

Apply blur (box filter).

Parameters
[in]imageimage to apply blur filter to
[in]sizesize of filter
[out]blurred_imageblrured image
void Transformation::applyGaussianAdditiveNoise ( const cv::Mat &  image,
float  variance,
cv::Mat &  noisy_image 
)
static

Add Gaussian additive noise to image with the given variance on all channels.

Parameters
[in]imageimage to add Gaussian additive noise to
[in]variancevariance of the Gaussian
[out]noisy_imagenoisy image

Copyright (c) 2016, David Stutz Contact: david.nosp@m..stu.nosp@m.tz@rw.nosp@m.th-a.nosp@m.achen.nosp@m..de, davidstutz.de All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

void Transformation::applyGaussianBlur ( const cv::Mat &  image,
int  size,
float  sigma_x,
float  sigma_y,
cv::Mat &  blurred_image 
)
static

Apply Gaussian blurring.

Parameters
[in]imageimage to apply Gaussian blur to
[in]sizesize of filter
[in]sigma_xvariance in x direction
[in]sigma_yvariance in y direction
[out]blurred_imageblurred image
void Transformation::applyGaussianSamplingErrors ( const cv::Mat &  image,
float  variance,
cv::Mat &  noisy_image 
)
static

Add Gaussian sampling errors with given variance.

Parameters
[in]imageimage to add Gaussian sampling errors to
[in]variancevariance of the Gaussian
[out]noisy_image
template<typename T >
template void Transformation::applyHorizontalShear< int > ( const cv::Mat &  image,
int  crop,
float  shear,
cv::Mat &  sheared_image 
)
static

Apply horizontal shear.

Parameters
[in]imageimage to apply shear to
[in]cropcrop image before shearing
[in]shearshear parameter
[out]sheared_imagesheared image
void Transformation::applyMedianBlur ( const cv::Mat &  image,
int  size,
cv::Mat &  blurred_image 
)
static

Apply median filter.

Parameters
[in]imageimage to apply median filter to
[in]sizesize of filter
[out]blurred_imageblurred image
void Transformation::applyMotionBlur ( const cv::Mat &  image,
int  size,
float  angle,
cv::Mat &  blurred_image 
)
static

Apply motion blur.

Parameters
[in]imageimage to apply motion blur to
[in]sizesize of filter
[in]angleangle of motion blur
[out]blrured_imageblurred image
void Transformation::applyPoissonNoise ( const cv::Mat &  image,
cv::Mat &  noisy_image 
)
static

Add poisson noise.

Parameters
[in]imageimage to add Poisson noise to
[out]noisy_imagenoisy image
template<typename T >
template void Transformation::applyRotation< float > ( const cv::Mat &  image,
int  crop,
float  angle,
cv::Mat &  rotated_image,
int  interpolation = cv::INTER_LINEAR 
)
static

Apply rotation.

Parameters
[in]imageimage ot apply rotation to
[in]cropcrop the image before rotating
[in]angleangle of rotation
[out]rotated_imagerotated image
void Transformation::applySaltAndPepperNoise ( const cv::Mat &  image,
float  p,
cv::Mat &  noisy_image 
)
static

Add salt and pepper noise.

Parameters
[in]imageimage to add salt and pepper noise to
[in]pprobability of salt or pepper
[out]noisy_imagenoisy image
template<typename T >
template void Transformation::applyTranslation< int > ( const cv::Mat &  image,
int  crop,
int  translation_x,
int  translation_y,
cv::Mat &  translated_image 
)
static

Apply translation.

Parameters
[in]imageimage to translate
[in]cropcrop image before translating
[in]translation_xtranslation in x direction
[in]translation_ytranslation in y direction
[out]translated_imagetranslated image
template<typename T >
template void Transformation::applyVerticalShear< int > ( const cv::Mat &  image,
int  crop,
float  shear,
cv::Mat &  sheared_image 
)
static

Apply vertical shear.

Parameters
[in]imageimage to apply shear to
[in]cropcrop image before shearing
[in]shearshear parameter
[out]sheared_imagesheared image

The documentation for this class was generated from the following files: