22 #ifndef CRNIMAGEGRADIENT_HEADER
23 #define CRNIMAGEGRADIENT_HEADER
88 inline bool IsSignificant(
size_t x,
size_t y)
const {
return At(x, y).rho >= thresh; }
100 double GetHRun() const noexcept;
102 double GetVRun() const noexcept;
Abstract class for images.
virtual ~ImageGradient() override
std::vector< pixel_type >::reference At(size_t x, size_t y) noexcept
Returns a reference to a pixel.
ImageBW MakeMask() const
Create a mask of the gradients' module.
bool IsSignificant(size_t x, size_t y) const
Tests if a pixel has a significant gradient.
ImageGradient(const ImageGradient &)=default
double GetHRun() const noexcept
Estimates the mean character width.
ImageGray MakeCurvature() const
Creates an image representing the curvature of the gradients.
ImageGray MakeImageGray() const
Converts to a gray image.
ImageRGB MakeImageRGB(bool thres=false) const
Converts to a rgb image.
void SetMinModule(unsigned int m)
Sets the module significance threshold.
Gradient image in polar form.
bool IsSignificant(size_t i) const
Tests if a pixel has a significant gradient.
ImageGradient & operator=(const ImageGradient &)=default
unsigned int GetMinModule() const noexcept
Returns the module significance threshold.
Image()
Default constructor.
unsigned int AutoMinModule(const ImageGray &img)
Computes the module significance threshold.
CRN_ALIAS_SMART_PTR(ImageBW)
pixel::Polar2D< unsigned int, Angle< ByteAngle > > pixel_type
double GetVRun() const noexcept
Estimates the mean character height.