Skip to content
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

[fuseCut] improve delaunayGraphCut #832

Merged
merged 28 commits into from
Jul 29, 2020
Merged

Conversation

dsmtE
Copy link
Contributor

@dsmtE dsmtE commented Jul 6, 2020

Description

Code rewriting and cleaning.
Improvement intersection by using directly the rayCellIntersection function in few loops to avoid unnecessary computations.

Features list

  • Group and delete duplicated codes
  • Remove unnecessary functions by using rayCellIntersection directly in loops
  • Take into account the previously intersected facet instead of only cellIndex (in order to improve intersection later)
  • Remove the unused JancosekCVPR11 method
  • Add debug method to export a mesh representation(tetrahedralization vote)

@dsmtE dsmtE added refactoring wip work in progress labels Jul 6, 2020
@dsmtE dsmtE force-pushed the dev/ImproveDelaunayGraphCut branch 2 times, most recently from d13085f to 4f42a60 Compare July 7, 2020 15:46
@dsmtE dsmtE force-pushed the dev/ImproveDelaunayGraphCut branch 5 times, most recently from e4a358c to e6dd5f7 Compare July 13, 2020 16:28
@dsmtE dsmtE force-pushed the dev/ImproveDelaunayGraphCut branch from e6dd5f7 to a599e5e Compare July 16, 2020 13:41
refactoring nearestNeighCellToTheCamOnTheRay and farestNeighCellToTheCamOnTheRay  functions into a common function with a boolean parameter.
- remove unnecessary double assignment :
    f1.cellIndex = GEO::NO_CELL;
    f1.localVertexIndex = GEO::NO_VERTEX;
- move 'p = outIntersectPt' assigment in a higher level in loop with 'p = lpi;' each time the functions nearestNeighbourCellToTheCamOnTheRay and farestNeighbourCellToTheCamOnTheRay are used
…nTheRay function (CRITIC)

Remove the unnecessary neighborCellToTheCamOnTheRay function by using rayCellIntersection directly in loops and use mirrorFacet when it' s necessary to ensure loop recursion and get the next cell.
Remove and rename unnecessary getFacetInFrontVertexOnTheRayToThePoint3d function using directly getFacetInFrontVertexOnTheRayToTheCam function.
about getFacetInFrontVertexOnTheRayToTheCam and getFacetBehindVertexOnTheRayToTheCam which use the same code except one boolean.
@dsmtE dsmtE force-pushed the dev/ImproveDelaunayGraphCut branch from e306d5e to 5f85d2e Compare July 21, 2020 09:46
@fabiencastan fabiencastan added this to the 2020.1.0 milestone Jul 28, 2020
@dsmtE dsmtE force-pushed the dev/ImproveDelaunayGraphCut branch from 5f85d2e to 7aa5b7b Compare July 28, 2020 15:45
Delete the unnecessary pold variable and move the dist variable.
Add a new function getNeighboringCellsByVertexIndex used to loop over neighboring cells in a more meaningful way than using a loop 'for(int k = 0; true; ++k)'.
Use directly isLineInTriangle in getFacetFromVertexOnTheRayToTheCam instead of rayCellIntersection because we come directly from a vertex and only the opposite facet of an adjacent cell can be intersected.

Stop the collision tests as soon as an intersection with a facet is found.
The configuration with convex geometry of the adjacent 
 cells(tetrahedrons) to a vertex means that only two intersections can be found with a ray crossing this vertex.
When the intersection verifying the distance condition is found, it can be returned without iterating on the other cells.
dsmtE and others added 13 commits July 28, 2020 18:41
Use directly isLineInTriangle in getFirstFacetOnTheRayFromCamToThePoint instead of rayCellIntersection .
Consider the previously intersected facet in rayCellIntersection instead of CellIndex in order to avoid later testing the collision with the previously intersected facet. (performance improvement)
- Rewrite createRandomArrayOfIntegers using stl.
- Expose seed in meshing params using MultiViewParams.
readImageMetadata throw an error if the path does not exist.
@dsmtE dsmtE force-pushed the dev/ImproveDelaunayGraphCut branch from 7aa5b7b to d970a82 Compare July 28, 2020 16:42
@dsmtE dsmtE marked this pull request as ready for review July 28, 2020 16:50
The function "estimateDimensions" is no more called, and it was
indirectly adding a small margin.
@fabiencastan fabiencastan merged commit aad5edc into develop Jul 29, 2020
@fabiencastan fabiencastan deleted the dev/ImproveDelaunayGraphCut branch July 29, 2020 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring wip work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants