I think there is a small bug in the function
ImageLinePruneMerge.pruneSimilar
The relevant snippet is as below:
// now just see if they are very close
float distA = Distance2D_F32.distance(a, b.a);
float distB = Distance2D_F32.distance(a, b.b);
if (distA > toleranceDist && distB > toleranceDist) {
continue;
}
distA = Distance2D_F32.distance(b, b.a);
distB = Distance2D_F32.distance(b, b.b);
if (distA > toleranceDist && distB > toleranceDist) {
continue;
}
It first finds and checks the distance between line a and end points of line b.
Then it finds and checks the distance between line b and end points of line b.
I think the second one is wrong. It should find and check the distance between line a (not b) and end points of line b.
Thanks