Go to the documentation of this file.
37 m_img->grayscale(*new_img);
76 const size_t W =
m_img->getWidth();
77 const size_t H =
m_img->getHeight();
83 if (px < 0 || py < 0 || px > W || py > H)
95 return static_cast<double>(*
m_img->get_unsafe(px0, py0));
103 const int px0 = (int)floor(px);
104 const int px1 = (int)ceil(px);
105 const int py0 = (int)floor(py);
106 const int py1 = (int)ceil(py);
109 static_cast<double>(*
m_img->get_unsafe(px0, py0));
111 static_cast<double>(*
m_img->get_unsafe(px0, py1));
113 static_cast<double>(*
m_img->get_unsafe(px1, py0));
115 static_cast<double>(*
m_img->get_unsafe(px1, py1));
117 const double R1 = P11 * (px1 - px) +
119 const double R2 = P12 * (px1 - px) +
122 return R1 * (py1 - py) + R2 * (py - py0);
135 "The selected interpolation method is not supported in this "
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TInterpolationMethod m_method
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
CMappedImage(CImage::Ptr img, double x0=0, double x1=-1, double y0=0, double y1=-1, TInterpolationMethod method=IMG_INTERP_LINEAR)
Constructor: Must pass an image (as a smart pointer) and the coordinates of the border.
void changeCoordinates(double x0, double x1, double y0, double y1)
Changes the coordinates of the image (see constructor for the meaning)
int round(const T value)
Returns the closer integer (int) to x.
TInterpolationMethod
Interpolation methods for images.
A class for storing images as grayscale or RGB bitmaps.
std::shared_ptr< CImage > Ptr
double m_pixel_size
width * pixel_size = (x1-x0)
This base provides a set of functions for maths stuff.
double getPixel(double x, double y) const
Returns the interpolated pixel at the coordinates (x,y), in the range [0,255] (grayscale) If the poin...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |