libcrn
3.9.5
A document image processing library
|
Gradient image in polar form. More...
#include <CRNImageGradient.h>
Public Member Functions | |
ImageGradient (const ImageGradient &)=default | |
ImageGradient (ImageGradient &&)=default | |
ImageGradient & | operator= (const ImageGradient &)=default |
ImageGradient & | operator= (ImageGradient &&)=default |
virtual | ~ImageGradient () override |
unsigned int | GetMinModule () const noexcept |
Returns the module significance threshold. More... | |
void | SetMinModule (unsigned int m) |
Sets the module significance threshold. More... | |
unsigned int | AutoMinModule (const ImageGray &img) |
Computes the module significance threshold. More... | |
bool | IsSignificant (size_t i) const |
Tests if a pixel has a significant gradient. More... | |
bool | IsSignificant (size_t x, size_t y) const |
Tests if a pixel has a significant gradient. More... | |
ImageGray | MakeImageGray () const |
Converts to a gray image. More... | |
ImageRGB | MakeImageRGB (bool thres=false) const |
Converts to a rgb image. More... | |
ImageGray | MakeCurvature () const |
Creates an image representing the curvature of the gradients. More... | |
ImageBW | MakeMask () const |
Create a mask of the gradients' module. More... | |
double | GetHRun () const noexcept |
Estimates the mean character width. More... | |
double | GetVRun () const noexcept |
Estimates the mean character height. More... | |
![]() | |
Image (size_t w, size_t h, pixel_type val=pixel_type(0)) | |
Constructor. More... | |
Image () | |
Default constructor. More... | |
Image (size_t w, size_t h, const pixel_type *data) | |
Constructor from data. More... | |
Image (const Image &img)=default | |
Copy constructor. More... | |
Image (const Image< Y > &img) | |
Copy constructor. More... | |
Image (const Image< typename BoolNotBool< pixel::Polar2D< unsigned int, Angle< ByteAngle > > >::type > &img) | |
Copy constructor. More... | |
Image (const Image< Y > &img, const Rect &bbox) | |
Crop constructor. More... | |
Image (const Image< typename BoolNotBool< pixel::Polar2D< unsigned int, Angle< ByteAngle > > >::type > &img, const Rect &bbox) | |
Crop constructor. More... | |
Image (Image &&img)=default | |
Move constructor. More... | |
virtual | ~Image () override=default |
Destructor. More... | |
Image & | operator= (const Image &img)=default |
Copy operator. More... | |
Image & | operator= (const Image< Y > &img) |
Copy operator. More... | |
Image & | operator= (const Image< typename BoolNotBool< pixel::Polar2D< unsigned int, Angle< ByteAngle > > >::type > &img) |
Copy operator. More... | |
Image & | operator= (Image &&img)=default |
Move operator. More... | |
void | Assign (const Image< Y > &img) |
Force copy operator (pixel cast) More... | |
virtual std::unique_ptr < ImageBase > | Clone () const override |
void | Swap (Image &other) |
Swaps two images. More... | |
virtual void | SavePNG (const Path &fname) const override |
Saves as PNG file. More... | |
virtual void | SaveJPEG (const Path &fname, unsigned int qual) const override |
Saves as JPEG file. More... | |
MAT | ToMatrix () const |
Converts to matrix. More... | |
std::vector< pixel_type >::iterator | begin () |
std::vector< pixel_type > ::const_iterator | begin () const |
std::vector< pixel_type >::iterator | end () |
std::vector< pixel_type > ::const_iterator | end () const |
std::vector< pixel_type > ::const_iterator | cbegin () const |
std::vector< pixel_type > ::const_iterator | cend () const |
std::vector< pixel_type >::pointer | GetPixels () noexcept |
Gets a pointer to the pixels. More... | |
std::vector< pixel_type > ::const_pointer | GetPixels () const noexcept |
Gets a const pointer to the pixels. More... | |
std::vector< pixel_type > ::reference | At (size_t x, size_t y) noexcept |
Returns a reference to a pixel. More... | |
std::vector< pixel_type > ::reference | At (size_t offset) noexcept |
Returns a reference to a pixel. More... | |
std::vector< pixel_type > ::const_reference | At (size_t x, size_t y) const noexcept |
Returns a reference to a pixel. More... | |
std::vector< pixel_type > ::const_reference | At (size_t offset) const noexcept |
Returns a reference to a pixel. More... | |
bool | operator== (const Image &other) const |
Tests equality. More... | |
bool | operator!= (const Image &other) const |
Tests equality. More... | |
Image & | operator+= (const Image &img) |
Adds another image. More... | |
Image & | operator-= (const Image &img) |
Subtracts another image. More... | |
Image & | operator*= (double f) |
Multiplies all pixels. More... | |
Image & | operator*= (const Image &img) |
Multiplies with another image's pixels. More... | |
Image & | operator/= (const Image &img) |
Divides by another image's pixels. More... | |
void | Negative () |
Negative. More... | |
void | Complement (pixel_type maxval=std::numeric_limits< pixel_type >::max()) |
Complement. More... | |
void | Blit (const Image< Y > &src, const Rect &srczone, size_t dx, size_t dy) |
Copies a part of an image. More... | |
void | FloodFill (size_t x, size_t y, const pixel_type &val, crn::DistanceType dist=crn::DistanceType::D4) |
Flood fills a portion of the image. More... | |
void | ScanFill (size_t x, size_t y, const pixel_type &val, crn::DistanceType dist=crn::DistanceType::D4) |
Fills a portion of the image. More... | |
void | DrawRect (const Rect &r, pixel_type color, bool filled=false) |
Draws a rectangle using a specified color. More... | |
void | DrawLine (size_t x1, size_t y1, size_t x2, size_t y2, pixel_type color) |
Draws a line using a specified color. More... | |
virtual void | ScaleToSize (size_t w, size_t h) override |
Scales the image. More... | |
void | Flip (const Orientation &ori) |
Flips the image. More... | |
void | Dilate (const MatrixInt &strel, CMP cmp=std::less< pixel_type >{}) |
Morphological dilatation. More... | |
void | Erode (const MatrixInt &strel, CMP cmp=std::less< pixel_type >{}) |
Morphological erosion. More... | |
void | FastDilate (size_t halfwin, size_t index=0, CMP cmp=std::less< pixel_type >{}) |
Morphological dilatation. More... | |
void | FastErode (size_t halfwin, size_t index=0, CMP cmp=std::less< pixel_type >{}) |
Morphological erosion. More... | |
void | Convolve (const MatrixDouble &mat) |
Convolution. More... | |
void | GaussianBlur (double sigma) |
Gaussian blur. More... | |
![]() | |
virtual | ~ImageBase () |
ImageBase (size_t w, size_t h) | |
ImageBase (const ImageBase &)=default | |
ImageBase (ImageBase &&)=default | |
ImageBase & | operator= (const ImageBase &)=default |
ImageBase & | operator= (ImageBase &&)=default |
size_t | GetWidth () const noexcept |
size_t | GetHeight () const noexcept |
Rect | GetBBox () const noexcept |
size_t | Size () const noexcept |
Additional Inherited Members | |
![]() | |
using | pixel_type = pixel::Polar2D< unsigned int, Angle< ByteAngle > > |
![]() | |
std::vector< pixel_type > | pixels |
![]() | |
size_t | width |
size_t | height |
Gradient image in polar form.
This class is for gradient images, in polar form
Definition at line 39 of file CRNImageGradient.h.
|
default |
|
default |
|
inlineoverridevirtual |
Definition at line 67 of file CRNImageGradient.h.
unsigned int ImageGradient::AutoMinModule | ( | const ImageGray & | img | ) |
Computes the module significance threshold.
Computes the module significance threshold
[in] | img | an image representing the same view |
Definition at line 34 of file CRNImageGradient.cpp.
|
noexcept |
Estimates the mean character width.
Estimates the mean character width
Definition at line 264 of file CRNImageGradient.cpp.
|
inlinenoexcept |
Returns the module significance threshold.
Definition at line 70 of file CRNImageGradient.h.
|
noexcept |
Estimates the mean character height.
Estimates the mean character width
Definition at line 406 of file CRNImageGradient.cpp.
|
inline |
Tests if a pixel has a significant gradient.
[in] | offset | the offset of the pixel |
Definition at line 81 of file CRNImageGradient.h.
|
inline |
Tests if a pixel has a significant gradient.
[in] | x | the abscissa of the pixel |
[in] | y | the ordinate of the pixel |
Definition at line 88 of file CRNImageGradient.h.
ImageGray ImageGradient::MakeCurvature | ( | ) | const |
Creates an image representing the curvature of the gradients.
Creates an image representing the curvature of the gradients.
A null curvature is assigned to pixels with a gradient module lower than the threshold.
Definition at line 117 of file CRNImageGradient.cpp.
ImageGray ImageGradient::MakeImageGray | ( | ) | const |
Converts to a gray image.
Converts to a gray image
Definition at line 67 of file CRNImageGradient.cpp.
Converts to a rgb image.
Converts to a rgb image
[in] | thres | shall we threshold the output? |
Definition at line 85 of file CRNImageGradient.cpp.
ImageBW ImageGradient::MakeMask | ( | ) | const |
Create a mask of the gradients' module.
Definition at line 249 of file CRNImageGradient.cpp.
|
default |
|
default |
|
inline |
Sets the module significance threshold.
Definition at line 72 of file CRNImageGradient.h.