CharacterFeatures

Description

This structure contains information about character features, which will be used during usage Optical Character Recognition filters. It is used to create an OcrSvmModel.

Structure fields and default values (if defined) are described below:

  • bool Pixels - Grayscale level of all pixels.
  • bool NormalizedPixels - Levels should be normalized to maximum 1.0
  • bool Convexity - Character convexity value
  • bool Circularity - Character circularity
  • bool NumberOfHoles - Number of holes
  • bool AspectRatio - Aspect ratio of character
  • bool Width - Maximal width of character
  • bool Height - Maximal height of character
  • bool AreaRatio - Area of character
  • bool DiameterRatio - Normalized diameter of the character
  • bool Elongation - Aspect ratio of bounding ellipses diameters
  • bool Orientation - Orientation of character.
  • bool HorizontalProjection - Character projection on the Y axis.
  • bool VerticalProjection - Character projection on the X axis.
  • bool HoughCircles - Circles found in characteristic points of letters.
  • bool Zoning4x4 - Downsampled to 4x4 pixels image of character.
  • bool Moment_11 - M11 moment of character.
  • bool Moment_02 - M02 moment of character.
  • bool Moment_20 - M20 moment of character.
struct CharacterFeatures
{
	bool	Pixels;
	bool	NormalizedPixels;
	bool	Convexity;
	bool	Circularity;
	bool	NumberOfHoles;
	bool	AspectRatio;
	bool	Width;
	bool	Height;
	bool	AreaRatio;
	bool	DiameterRatio;
	bool	Elongation;
	bool	Orientation;
	bool	HorizontalProjection;
	bool	VerticalProjection;
	bool	HoughCircles;
	bool	Zoning4x4;
	bool	Moment_11;
	bool	Moment_02;
	bool	Moment_20;


	bool Pixels() const					{ return Pixels;				};
	bool NormalizedPixels() const		{ return NormalizedPixels;		};
	bool Convexity() const				{ return Convexity;				};
	bool Circularity() const			{ return Circularity;			};
	bool NumberOfHoles() const			{ return NumberOfHoles;			};
	bool AspectRatio() const			{ return AspectRatio;			};
	bool Width() const					{ return Width;					};
	bool Height() const					{ return Height;				};
	bool AreaRatio() const				{ return AreaRatio;				};
	bool DiameterRatio() const			{ return DiameterRatio;			};
	bool Elongation() const				{ return Elongation;			};
	bool Orientation() const			{ return Orientation;			};
	bool HorizontalProjection() const	{ return HorizontalProjection;	};
	bool VerticalProjection() const		{ return VerticalProjection;	};
	bool HoughCircles() const			{ return HoughCircles;			};
	bool Zoning4x4() const				{ return Zoning4x4;				};
	bool Moment_11() const				{ return Moment_11;				};
	bool Moment_02() const				{ return Moment_02;				};
	bool Moment_20() const				{ return Moment_20;				};

	bool operator == ( const avl::CharacterFeatures& rhs ) const
	{
		return Pixels == rhs.Pixels && 
			NormalizedPixels == rhs.NormalizedPixels && 
			Convexity == rhs.Convexity && 
			Circularity == rhs.Circularity && 
			NumberOfHoles == rhs.NumberOfHoles && 
			AspectRatio == rhs.AspectRatio && 
			Width == rhs.Width && 
			Height == rhs.Height && 
			AreaRatio == rhs.AreaRatio && 
			DiameterRatio == rhs.DiameterRatio && 
			Elongation == rhs.Elongation && 
			Orientation == rhs.Orientation && 
			HorizontalProjection == rhs.HorizontalProjection && 
			VerticalProjection == rhs.VerticalProjection && 
			HoughCircles == rhs.HoughCircles && 
			Zoning4x4 == rhs.Zoning4x4 && 
			Moment_11 == rhs.Moment_11 && 
			Moment_02 == rhs.Moment_02 && 
			Moment_20 == rhs.Moment_20;
	}

	bool operator != ( const avl::CharacterFeatures& rhs ) const
	{
		return !(operator==(rhs));
	}

};

See also

TrainOcr_SVM, TrainOcr_SVM