turinevgeny/rapid

Food for research and discussion

Closed this issue · 3 comments

capture
On the left side is located blue Model with blue control points and white shape of the box.
On rigth side you can see two types of points: red and purple.
Red points - found points. But as the search is conducted in 2 directions at the same time,so there are purple points, where the search was stopped.
You can find out two strange things from console output:

  1. One of the lengths is negative, others are positive. It is not logical. Because the sign determines the "direction of the length". But direction is the same for all points(see screenshot)
  2. I think the length is too small.

The reason the first strange thing: arrangement of control points and companion points are not the same for the edge.
RAPIDTracker::GetDisplacement

double tempX=(companionPoint.x-controlPoint.x);
double tempY=(companionPoint.y-controlPoint.y);

double sineAlpha = tempY/sqrt(tempX_tempX + tempY_tempY);
double cosineAlpha = tempX/sqrt(tempX_tempX + tempY_tempY);

Sine or cosine changes sign depending on how the companion point is located.

About second thing: length is so small due to Kx and Ky. (Kx=1/Fx, Ky=1/Fy; Fx,Fy~600).
We need a good deal in these two places so that at least understand and find the bug.

The first thing is pretty funny indeed.
I hardly understand what unit is used to express a length there. That's one of the reasons I suggested to break down the algorithm to pieces.