libcrn
3.9.5
A document image processing library
|
Modules | |
PDE | |
Misc images | |
Bitonal images | |
Gray images | |
RGB images | |
Pixel formats | |
Classes | |
class | crn::ImageBase |
Base class for images. More... | |
struct | crn::BoolNotBool< T > |
struct | crn::BoolNotBoolDummy |
struct | crn::BoolNotBool< bool > |
class | crn::Image< T > |
Abstract class for images. More... | |
class | crn::SummedAreaTable< T > |
A summed area table. More... | |
Macros | |
#define | FOREACHPIXEL(x, y, img) for (size_t y = 0; y < (img).GetHeight(); y++) for (size_t x = 0; x < (img).GetWidth(); x++) |
Convenience macro to sweep an image. More... | |
Typedefs | |
using | crn::SImage = std::shared_ptr< ImageBase > |
using | crn::SCImage = std::shared_ptr< const ImageBase > |
using | crn::WImage = std::weak_ptr< ImageBase > |
using | crn::WCImage = std::weak_ptr< const ImageBase > |
using | crn::UImage = std::unique_ptr< ImageBase > |
using | crn::UCImage = std::unique_ptr< const ImageBase > |
Functions | |
UImage | crn::NewImageFromFile (const Path &fname) |
Loads an image from a file. More... | |
BoolNotBoolDummy | crn::operator+ (const BoolNotBoolDummy &, const BoolNotBoolDummy &) |
BoolNotBoolDummy | crn::operator- (const BoolNotBoolDummy &, const BoolNotBoolDummy &) |
BoolNotBoolDummy | crn::operator* (const BoolNotBoolDummy &, const BoolNotBoolDummy &) |
BoolNotBoolDummy | crn::operator/ (const BoolNotBoolDummy &, const BoolNotBoolDummy &) |
template<typename T > | |
bool | crn::IsBitonal (const Image< T > &img) |
Is the image binary (black & white)? More... | |
template<typename T , typename CMP = std::less<T>> | |
std::pair< T, T > | crn::MinMax (const Image< T > &img, CMP cmp=CMP{}) |
Returns min and max pixel values. More... | |
template<typename T > | |
Rect | crn::AutoCrop (const Image< T > &img, const T &bgval) |
Estimates the ideal crop for the image. More... | |
template<typename T > | |
Image< T > | crn::MakeAutoCrop (const Image< T > &img, const T &bgval) |
Creates a new image as the ideal crop for the image. More... | |
template<typename T , typename Y > | |
Point2DInt | crn::CrossCorrelation (const Image< T > &img1, const Image< Y > &img2, T fill1=T(0), Y fill2=Y(0)) |
Best match between two images. More... | |
template<typename IMG , typename T > | |
IMG | crn::Downgrade (const Image< T > &img) |
Converts the image to a type that has a smaller pixel range. More... | |
template<typename T > | |
SummedAreaTable< SumType< T > > | crn::MakeSummedAreaTable (const Image< T > &img) |
Creates a summed area table of the image. More... | |
template<typename T > | |
Image< T > | crn::MakeRotation (const Image< T > &img, const Angle< Degree > &angle, const T &bgColor) |
Creates a rotated version of the image. More... | |
template<typename T > | |
Image< T > | crn::Make90Rotation (const Image< T > &img) |
Creates a rotated version of the image. More... | |
template<typename T > | |
Image< T > | crn::Make180Rotation (const Image< T > &img) |
Creates a rotated version of the image. More... | |
template<typename T > | |
Image< T > | crn::Make270Rotation (const Image< T > &img) |
Creates a rotated version of the image. More... | |
template<typename T > | |
auto | crn::Size (const Image< T > &img) noexcept(noexcept(img.Size())) -> decltype(img.Size()) |
template<typename T1 , typename T2 > | |
crn::Image< crn::SumType < typename std::common_type < T1, T2 >::type > > | operator+ (const crn::Image< T1 > &i1, const crn::Image< T2 > &i2) |
template<typename T1 , typename T2 > | |
crn::Image< crn::DiffType < typename std::common_type < T1, T2 >::type > > | operator- (const crn::Image< T1 > &i1, const crn::Image< T2 > &i2) |
template<typename T1 , typename T2 > | |
crn::Image< crn::SumType < typename std::common_type < T1, T2 >::type > > | operator* (const crn::Image< T1 > &i1, const crn::Image< T2 > &i2) |
template<typename T > | |
crn::Image< crn::SumType < typename std::common_type< T, double >::type > > | operator* (double d, const crn::Image< T > &i) |
template<typename T > | |
crn::Image< crn::SumType < typename std::common_type< T, double >::type > > | operator* (const crn::Image< T > &i, double d) |
template<typename T1 , typename T2 > | |
crn::Image< crn::SumType < typename std::common_type < T1, T2 >::type > > | operator/ (const crn::Image< T1 > &i1, const crn::Image< T2 > &i2) |
template<typename T > | |
cv::Mat | crn::WrapCVMat (crn::Image< T > &img) |
Wraps an image to an OpenCV matrix. More... | |
#define FOREACHPIXEL | ( | x, | |
y, | |||
img | |||
) | for (size_t y = 0; y < (img).GetHeight(); y++) for (size_t x = 0; x < (img).GetWidth(); x++) |
Convenience macro to sweep an image.
Definition at line 37 of file CRNImage.h.
using crn::SCImage = typedef std::shared_ptr<const ImageBase> |
Definition at line 102 of file CRNImage.h.
using crn::SImage = typedef std::shared_ptr<ImageBase> |
Definition at line 101 of file CRNImage.h.
using crn::UCImage = typedef std::unique_ptr<const ImageBase> |
Definition at line 106 of file CRNImage.h.
using crn::UImage = typedef std::unique_ptr<ImageBase> |
Definition at line 105 of file CRNImage.h.
using crn::WCImage = typedef std::weak_ptr<const ImageBase> |
Definition at line 104 of file CRNImage.h.
using crn::WImage = typedef std::weak_ptr<ImageBase> |
Definition at line 103 of file CRNImage.h.
Rect crn::AutoCrop | ( | const Image< T > & | img, |
const T & | bgval | ||
) |
Estimates the ideal crop for the image.
Estimates the ideal crop for the image
[in] | img | an image |
[in] | bgval | the color value of the background |
Definition at line 1459 of file CRNImage.hpp.
Point2DInt crn::CrossCorrelation | ( | const Image< T > & | img1, |
const Image< Y > & | img2, | ||
T | fill1, | ||
Y | fill2 | ||
) |
Best match between two images.
Best match between two images
[in] | img1 | first image |
[in] | img2 | other image |
[in] | fill1 | the fill color for the first image (to grow to power of 2 dimensions) |
[in] | fill2 | the fill color for the second image (to grow to power of 2 dimensions) |
Definition at line 1550 of file CRNImage.hpp.
IMG crn::Downgrade | ( | const Image< T > & | img | ) |
Converts the image to a type that has a smaller pixel range.
Converts the image to a type that has a smaller pixel range
[in] | img | the source image |
Definition at line 364 of file CRNImage.h.
bool crn::IsBitonal | ( | const Image< T > & | img | ) |
Is the image binary (black & white)?
Is the image binary (black & white)?
[in] | img | an image |
Definition at line 1431 of file CRNImage.hpp.
Image< T > crn::Make180Rotation | ( | const Image< T > & | img | ) |
Creates a rotated version of the image.
Creates a rotated version of the image
[in] | img | the image to rotate |
Definition at line 1869 of file CRNImage.hpp.
Image< T > crn::Make270Rotation | ( | const Image< T > & | img | ) |
Creates a rotated version of the image.
Creates a rotated version of the image
[in] | img | the image to rotate |
Definition at line 1882 of file CRNImage.hpp.
Image< T > crn::Make90Rotation | ( | const Image< T > & | img | ) |
Creates a rotated version of the image.
Creates a rotated version of the image
[in] | img | the image to rotate |
Definition at line 1857 of file CRNImage.hpp.
Image< T > crn::MakeAutoCrop | ( | const Image< T > & | img, |
const T & | bgval | ||
) |
Creates a new image as the ideal crop for the image.
Creates a new image as the ideal crop for the image
[in] | img | an image |
[in] | bgval | the color value of the background |
Definition at line 1535 of file CRNImage.hpp.
Image< T > crn::MakeRotation | ( | const Image< T > & | img, |
const Angle< Degree > & | angle, | ||
const T & | bgColor | ||
) |
Creates a rotated version of the image.
Creates a rotated version of the image
[in] | img | the image to rotate |
[in] | angle | the rotation angle |
[in] | bgColor | the fill color |
Definition at line 1813 of file CRNImage.hpp.
SummedAreaTable< SumType< T > > crn::MakeSummedAreaTable | ( | const Image< T > & | img | ) |
Creates a summed area table of the image.
Definition at line 1613 of file CRNImage.hpp.
std::pair< T, T > crn::MinMax | ( | const Image< T > & | img, |
CMP | cmp | ||
) |
Returns min and max pixel values.
[in] | img | an image |
Definition at line 1447 of file CRNImage.hpp.
Loads an image from a file.
ExceptionInvalidArgument | null file name |
ExceptionIO | no decoder found |
[in] | fname | full path to the image file |
Definition at line 609 of file CRNImage.cpp.
|
inline |
Definition at line 125 of file CRNImage.h.
crn::Image<crn::SumType<typename std::common_type<T1, T2>::type> > operator* | ( | const crn::Image< T1 > & | i1, |
const crn::Image< T2 > & | i2 | ||
) |
Definition at line 1385 of file CRNImage.hpp.
crn::Image<crn::SumType<typename std::common_type<T, double>::type> > operator* | ( | double | d, |
const crn::Image< T > & | i | ||
) |
Definition at line 1396 of file CRNImage.hpp.
crn::Image<crn::SumType<typename std::common_type<T, double>::type> > operator* | ( | const crn::Image< T > & | i, |
double | d | ||
) |
Definition at line 1405 of file CRNImage.hpp.
|
inline |
Definition at line 123 of file CRNImage.h.
crn::Image<crn::SumType<typename std::common_type<T1, T2>::type> > operator+ | ( | const crn::Image< T1 > & | i1, |
const crn::Image< T2 > & | i2 | ||
) |
Definition at line 1363 of file CRNImage.hpp.
|
inline |
Definition at line 124 of file CRNImage.h.
crn::Image<crn::DiffType<typename std::common_type<T1, T2>::type> > operator- | ( | const crn::Image< T1 > & | i1, |
const crn::Image< T2 > & | i2 | ||
) |
Definition at line 1374 of file CRNImage.hpp.
|
inline |
Definition at line 126 of file CRNImage.h.
crn::Image<crn::SumType<typename std::common_type<T1, T2>::type> > operator/ | ( | const crn::Image< T1 > & | i1, |
const crn::Image< T2 > & | i2 | ||
) |
Definition at line 1410 of file CRNImage.hpp.
|
inlinenoexcept |
Definition at line 335 of file CRNImage.h.
cv::Mat crn::WrapCVMat | ( | crn::Image< T > & | img | ) |
Wraps an image to an OpenCV matrix.
Wraps an image to an OpenCV matrix. The returned cv::Mat uses the same memory as the crn::Image. In other words, any modification made to the cv::Mat is immediately passed on the crn::Image and vice-versa.