31 #ifndef VP_TUTO_MEAN_SQUARE_FITTING_H
32 #define VP_TUTO_MEAN_SQUARE_FITTING_H
34 #include <visp3/core/vpConfig.h>
35 #include <visp3/core/vpDisplay.h>
36 #include <visp3/core/vpImagePoint.h>
37 #include <visp3/core/vpMatrix.h>
38 #include <visp3/core/vpRobust.h>
40 #include "vpTutoParabolaModel.h"
42 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 class vpTutoMeanSquareFitting
60 vpTutoMeanSquareFitting(
const unsigned int °ree,
const unsigned int &height,
const unsigned int &width);
68 void fit(
const std::vector<VISP_NAMESPACE_ADDRESSING vpImagePoint> &pts);
76 double evaluate(
const std::vector<VISP_NAMESPACE_ADDRESSING vpImagePoint> &pts);
84 double evaluate(
const VISP_NAMESPACE_ADDRESSING
vpImagePoint &pt);
94 double model(
const double &u);
96 #ifdef VISP_HAVE_DISPLAY
105 void display(
const VISP_NAMESPACE_ADDRESSING
vpImage<T> &I,
const VISP_NAMESPACE_ADDRESSING
vpColor &color,
106 const unsigned int &vertPosLegend,
const unsigned int &horPosLegend)
109 for (
unsigned int u = 0; u < width; ++u) {
110 int v =
static_cast<int>(model(u));
112 VISP_NAMESPACE_ADDRESSING
vpDisplay::displayText(I, vertPosLegend, horPosLegend,
"Least-mean square model", color);
125 inline vpTutoMeanSquareFitting &operator=(
const vpTutoMeanSquareFitting &other)
127 m_model = other.m_model;
128 m_isFitted = other.m_isFitted;
137 inline VISP_NAMESPACE_ADDRESSING
vpColVector getCoeffs()
const
139 return m_model.toVpColVector();
147 inline const vpTutoParabolaModel &getModel()
const
153 unsigned int m_degree;
154 unsigned int m_height;
155 unsigned int m_width;
156 vpTutoParabolaModel m_model;
Implementation of column vector and the associated operations.
Class to define RGB colors available for display functionalities.
static void displayPoint(const vpImage< unsigned char > &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Definition of the vpImage class member functions.
unsigned int getWidth() const