69 float xx1 = p1.
x * p1.
x;
70 float xx2 = p2.
x * p2.
x;
71 float xx3 = p3.
x * p3.
x;
72 b = ((p3.
y-p1.
y)/(xx3-xx1)-(p2.
y-p1.
y)/(xx2-xx1)) /
73 ((p1.
x-p2.
x)/(xx2-xx1)-(p1.
x-p3.
x)/(xx3-xx1));
75 a = (
b*(p1.
x-p2.
x)+(p2.
y-p1.
y)) / (xx2-xx1);
77 c = p1.
y-
a*xx1-
b*p1.
x;
90 printf(
"f(x)=%f*x²+%fx+%f\n",
a,
b,
c);
undocument this line if you encounter any issues!
Definition: Any.h:37
Utility class for the parable-based chromaticity segmentation.
Definition: Parable.h:48
float y
y position of this point
Definition: Point32f.h:48
Parable(utils::Point32f p1, utils::Point32f p2, utils::Point32f p3)
create a parable with given 3 points
Definition: Parable.h:64
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
float operator()(float x) const
Evaluate this parable at a given location x.
Definition: Parable.h:85
Parable()
create an empty parable (a=b=c=0)
Definition: Parable.h:51
float a
Definition: Parable.h:80
float x
x position of this point
Definition: Point32f.h:45
Parable(float a, float b, float c)
create a parable with given parameters a,b and c
Definition: Parable.h:54
void show() const
shows this parable to std::out
Definition: Parable.h:88
float c
Definition: Parable.h:82
float b
Definition: Parable.h:81