-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend segmentation components #23
Conversation
thanks for the proposal @DamienGilliard ! 🚀 my questions/doubts:
|
Thanks for the reply ! I share your doubts about the recursive registration, i will soon know if it works sufficiently well (computation time wise, and accuracy wise) For the second point, the reason is that planar surfaces in the scan can be the result of different pieces combined. This means that plane segmentation is not sufficient to get the point clouds of each piece. Do you agree ? I might be missing something ;) |
Yes you are right indeed. Got no solutions for that though.. |
… colors from Rhino
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NormalBasedSegmentation would not be more appropiate? Why "Smooth"? @DamienGilliard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I used smooth because it looks for breaks in the normals to segment, and thus keeps "smooth" segments, but it's over-specific. NormalBasedSegmentation is clearer. I fix it today
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rebase of the branch of this branch went so smoothly I doubted it had worked 👌
… for cluster to mesh face association
Backend cpp for model-based semantic segmentation
Et merci !! |
Hello @DamienGilliard ! As discussed here's the 🥔 .. The metadata and wrap is there, just some work from c++ is needed. As a note:
Let me know if you can make the associator a bit more tolerant to worse normal and less populated points as the one internalized the gh file.. thanks` 🦖 |
@9and3 I'm on it ! |
…letions in DFSegmentation methods
[WIP]:
Next Step: |
this point can be achieved by euclidean clustering/filtering maybe |
Let me know when we can merge (I left a note for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe here we could add the function to test if a point is on a mesh face @DamienGilliard ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your suggestion was implemented ;)
bool DFMesh::IsPointOnFace(Eigen::Vector3d point, double associationThreshold) | ||
{ | ||
/* | ||
To check if the point is in the face, we take into account all the triangles forming the face. | ||
We calculate the area of each triangle, then check if the sum of the areas of the tree triangles | ||
formed by two of the points of the referencr triangle and our point is equal to the reference triangle area | ||
(within a user-defined margin). If it is the case, the triangle is in the face. | ||
*/ | ||
std::vector<Eigen::Vector3i> faceTriangles = this->Faces; | ||
for (Eigen::Vector3i triangle : faceTriangles) | ||
{ | ||
Eigen::Vector3d v0 = this->Vertices[triangle[0]]; | ||
Eigen::Vector3d v1 = this->Vertices[triangle[1]]; | ||
Eigen::Vector3d v2 = this->Vertices[triangle[2]]; | ||
Eigen::Vector3d n = (v1 - v0).cross(v2 - v0); | ||
double normOfNormal = n.norm(); | ||
n.normalize(); | ||
|
||
Eigen::Vector3d projectedPoint = point - n * (n.dot(point - v0)) ; | ||
|
||
double referenceTriangleArea = normOfNormal*0.5; | ||
Eigen::Vector3d n1 = (v1 - v0).cross(projectedPoint - v0); | ||
double area1 = n1.norm()*0.5; | ||
Eigen::Vector3d n2 = (v2 - v1).cross(projectedPoint - v1); | ||
double area2 = n2.norm()*0.5; | ||
Eigen::Vector3d n3 = (v0 - v2).cross(projectedPoint - v2); | ||
double area3 = n3.norm()*0.5; | ||
double res = (area1 + area2 + area3 - referenceTriangleArea) / referenceTriangleArea; | ||
|
||
// arbitrary value to avoid false positives (points that, when projected on the triangle, are in it, but that are actually located too far from the mesh to actually belong to it) | ||
double maxProjectionDistance = std::min({(v1 - v0).norm(), (v2 - v1).norm(), (v0 - v2).norm()}); | ||
|
||
if (std::abs(res) < associationThreshold && (projectedPoint - point).norm() < maxProjectionDistance) | ||
{ | ||
return true; | ||
} | ||
} | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@9and3 It's there !
This PR concerns the segmentation of the scan. We use the 3d model to identify the pieces we need to segment. It introduces both the cpp backend and components for: