libcrn
3.9.5
A document image processing library
|
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... | |
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.
Definition at line 45 of file CRNImageFormats.h.
Computes the bottom profile.
Computes the bottom profile
Definition at line 557 of file CRNImageBW.cpp.
|
noexcept |
Returns the number of black pixels.
[in] | img | the source image Returns the number of black pixels |
Definition at line 764 of file CRNImageBW.cpp.
|
noexcept |
Returns the number of white pixels.
[in] | img | the 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
ExceptionDimension | matrices are of different sizes |
ExceptionInvalidArgument | matrices have even size |
[in] | img | the source image |
[in] | m1 | 1st pass matrix. Negative numbers are ignored. |
[in] | m2 | 2nd pass matrix. Negative numbers are ignored. |
Definition at line 852 of file CRNImageBW.cpp.
Computes the horizontal projection.
Computes the horizontal projection
Definition at line 574 of file CRNImageBW.cpp.
Computes the left profile.
Computes the left profile
Definition at line 506 of file CRNImageBW.cpp.
|
noexcept |
Gets the mean horizontal black run.
Gets the mean horizontal black run
[in] | img | the source image |
Definition at line 659 of file CRNImageBW.cpp.
|
noexcept |
Gets the mean vertical black run.
Gets the mean vertical black run
[in] | img | the source image |
Definition at line 728 of file CRNImageBW.cpp.
|
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.
[in] | img | the source image |
[in] | blackrun | The mean black run. If -1, then computes it. default = -1. |
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
ExceptionDomain | min_neighbors size is greater or equal to 8 |
[in] | img | the image to modify |
[in] | min_neighbors | if (#black neighbors <= parameter) then remove black pixel |
Definition at line 797 of file CRNImageBW.cpp.
Computes the right profile.
Computes the right profile
Definition at line 523 of file CRNImageBW.cpp.
Computes the top profile.
Computes the top profile
Definition at line 540 of file CRNImageBW.cpp.
Computes the vertical projection.
Computes the vertical projection
Definition at line 591 of file CRNImageBW.cpp.