libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Functions
Bitonal images
+ Collaboration diagram for Bitonal images:

Typedefs

using crn::ImageBW = Image< pixel::BW >
 Black and white image class. More...
 

Functions

Histogram crn::LeftProfile (const ImageBW &img)
 Computes the left profile. More...
 
Histogram crn::RightProfile (const ImageBW &img)
 Computes the right profile. More...
 
Histogram crn::TopProfile (const ImageBW &img)
 Computes the top profile. More...
 
Histogram crn::BottomProfile (const ImageBW &img)
 Computes the bottom profile. More...
 
Histogram crn::HorizontalProjection (const ImageBW &img)
 Computes the horizontal projection. More...
 
Histogram crn::VerticalProjection (const ImageBW &img)
 Computes the vertical projection. More...
 
Histogram crn::VerticalSlantedProjection (const ImageBW &img, const Angle< Radian > &theta)
 Computes the vertical projection after rotation. More...
 
double crn::MeanBlackRun (const ImageBW &img) noexcept
 Gets the mean horizontal black run. More...
 
double crn::MeanWhiteRun (const ImageBW &img, int blackrun=-1) noexcept
 Gets the mean horizontal white run. More...
 
double crn::MeanBlackVRun (const ImageBW &img) noexcept
 Gets the mean vertical black run. More...
 
size_t crn::CountBlackPixels (const ImageBW &img) noexcept
 Returns the number of black pixels. More...
 
size_t crn::CountWhitePixels (const ImageBW &img) noexcept
 Returns the number of white pixels. More...
 
size_t crn::Regularize (ImageBW &img, size_t min_neighbors=0)
 Removes isolated pixels and smooths edges. More...
 
ImageIntGray crn::DistanceTransform (const ImageBW &img, const MatrixInt &m1, const MatrixInt &m2)
 Creates an image containing the distance transform. More...
 

Detailed Description

Typedef Documentation

using crn::ImageBW = typedef Image<pixel::BW>

Black and white image class.

This class is for black and white images. Values in pixels' vector represent luminosity values.

Author
Yann LEYDIER
Date
August 2007
Version
0.4

Definition at line 45 of file CRNImageFormats.h.

Function Documentation

Histogram crn::BottomProfile ( const ImageBW img)

Computes the bottom profile.

Computes the bottom profile

Returns
an histogram containing the profile

Definition at line 557 of file CRNImageBW.cpp.

size_t crn::CountBlackPixels ( const ImageBW img)
noexcept

Returns the number of black pixels.

Parameters
[in]imgthe source image Returns the number of black pixels

Definition at line 764 of file CRNImageBW.cpp.

size_t crn::CountWhitePixels ( const ImageBW img)
noexcept

Returns the number of white pixels.

Parameters
[in]imgthe source image Returns the number of white pixels

Definition at line 778 of file CRNImageBW.cpp.

ImageIntGray crn::DistanceTransform ( const ImageBW img,
const MatrixInt m1,
const MatrixInt m2 
)

Creates an image containing the distance transform.

Creates an image containing the distance transform

Exceptions
ExceptionDimensionmatrices are of different sizes
ExceptionInvalidArgumentmatrices have even size
Parameters
[in]imgthe source image
[in]m11st pass matrix. Negative numbers are ignored.
[in]m22nd pass matrix. Negative numbers are ignored.
Returns
a new image containing the distance transform

Definition at line 852 of file CRNImageBW.cpp.

Histogram crn::HorizontalProjection ( const ImageBW img)

Computes the horizontal projection.

Computes the horizontal projection

Returns
an histogram containing the projection

Definition at line 574 of file CRNImageBW.cpp.

Histogram crn::LeftProfile ( const ImageBW img)

Computes the left profile.

Computes the left profile

Returns
an histogram containing the profile

Definition at line 506 of file CRNImageBW.cpp.

double crn::MeanBlackRun ( const ImageBW img)
noexcept

Gets the mean horizontal black run.

Gets the mean horizontal black run

Parameters
[in]imgthe source image
Returns
The mean black run

Definition at line 659 of file CRNImageBW.cpp.

double crn::MeanBlackVRun ( const ImageBW img)
noexcept

Gets the mean vertical black run.

Gets the mean vertical black run

Parameters
[in]imgthe source image
Returns
The mean black run

Definition at line 728 of file CRNImageBW.cpp.

double crn::MeanWhiteRun ( const ImageBW img,
int  blackrun = -1 
)
noexcept

Gets the mean horizontal white run.

Gets the mean horizontal white run. This functions uses the mean black run in order to filter the page runs and only keep the intra-word runs.

Parameters
[in]imgthe source image
[in]blackrunThe mean black run. If -1, then computes it. default = -1.
Returns
The mean white run

Definition at line 690 of file CRNImageBW.cpp.

size_t crn::Regularize ( ImageBW img,
size_t  min_neighbors = 0 
)

Removes isolated pixels and smooths edges.

Removes isolated pixels

Exceptions
ExceptionDomainmin_neighbors size is greater or equal to 8
Parameters
[in]imgthe image to modify
[in]min_neighborsif (#black neighbors <= parameter) then remove black pixel
Returns
the number of deleted pixels

Definition at line 797 of file CRNImageBW.cpp.

Histogram crn::RightProfile ( const ImageBW img)

Computes the right profile.

Computes the right profile

Returns
an histogram containing the profile

Definition at line 523 of file CRNImageBW.cpp.

Histogram crn::TopProfile ( const ImageBW img)

Computes the top profile.

Computes the top profile

Returns
an histogram containing the profile

Definition at line 540 of file CRNImageBW.cpp.

Histogram crn::VerticalProjection ( const ImageBW img)

Computes the vertical projection.

Computes the vertical projection

Returns
an histogram containing the projection

Definition at line 591 of file CRNImageBW.cpp.

Histogram crn::VerticalSlantedProjection ( const ImageBW img,
const Angle< Radian > &  theta 
)

Computes the vertical projection after rotation.

Computes the vertical projection after rotation

Returns
an histogram containing the projection

Definition at line 608 of file CRNImageBW.cpp.