OpenANN  1.1.0
An open source library for artificial neural networks.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
Distorter Class Reference

Creates distorted images. More...

#include <Distorter.h>

Public Member Functions

 Distorter (double sigma=5.0, double alpha=36.0/255.0, double beta=15.0, double gammaX=15.0, double gammaY=15.0)
 
void createDistortionMap (int rows, int cols)
 
void applyDistortions (Eigen::MatrixXd &instances, int rows, int cols)
 
void applyDistortion (Eigen::VectorXd &instance, int rows, int cols)
 

Public Attributes

double sigma
 elastic distortion More...
 
double alpha
 elastic scaling More...
 
double beta
 maximal absolute rotation More...
 
double gammaX
 maximal horizontal scaling (percent) More...
 
double gammaY
 maximal vertical scaling (percent) More...
 
int gaussianKernelSize
 has to be odd More...
 
Eigen::MatrixXd gaussianKernel
 
Eigen::MatrixXd distortionH
 
Eigen::MatrixXd distortionV
 

Detailed Description

Creates distorted images.

Available distortions are:

To apply elastic distortions, the original image is distorted with random displacements and then convolved with a Gaussian kernel of width $ \sigma \in [ 5, 6] $. Then the values are rescaled by the factor $ \alpha \in [36/255, 36/255] $. Afterwards the image will be rotated by $ \beta \in [7.5, 15] $ degrees and scaled horizontally by the factor $ \gamma_x \in [15, 20] $ and vertically by $ \gamma_y \in [15, 20] $.

Source: http://www.codeproject.com/Articles/16650/Neural-Network-for-Recognition-of-Handwritten-Digi

Constructor & Destructor Documentation

Distorter::Distorter ( double  sigma = 5.0,
double  alpha = 36.0/255.0,
double  beta = 15.0,
double  gammaX = 15.0,
double  gammaY = 15.0 
)
inline

Member Function Documentation

void Distorter::applyDistortion ( Eigen::VectorXd &  instance,
int  rows,
int  cols 
)
inline
void Distorter::applyDistortions ( Eigen::MatrixXd &  instances,
int  rows,
int  cols 
)
inline
void Distorter::createDistortionMap ( int  rows,
int  cols 
)
inline

Member Data Documentation

double Distorter::alpha

elastic scaling

double Distorter::beta

maximal absolute rotation

Eigen::MatrixXd Distorter::distortionH
Eigen::MatrixXd Distorter::distortionV
double Distorter::gammaX

maximal horizontal scaling (percent)

double Distorter::gammaY

maximal vertical scaling (percent)

Eigen::MatrixXd Distorter::gaussianKernel
int Distorter::gaussianKernelSize

has to be odd

double Distorter::sigma

elastic distortion


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