rtl
rtl copied to clipboard
ComputeModel function implementation in Line
Hi, the line parameters solving in your code involves eigenvalues. Can you show me a formula derivation about this implementation. I tried to do it by myself but failed. Thank you so much.
I think there is a bug.
virtual Line ComputeModel(const std::vector<Point>& data, const std::set
double maxDiffX=0.;
double maxDiffY=0.;
for(int np=0;np<(data.size()-1);np++)
{
double diffX=fabs(data[np+1].x-data[np].x);
if(diffX>maxDiffX) maxDiffX=diffX;
double diffY=fabs(data[np+1].y-data[np].y);
if(diffY>maxDiffY) maxDiffY=diffY;
}
if(maxDiffX<maxDiffY)
{
line.a = 1;
line.b = 0;
}
else
{
line.a = 0;
line.b = 1;
}