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

Compute texture patch #988

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Compute texture patch #988

wants to merge 3 commits into from

Conversation

MikeCernea
Copy link
Collaborator

Add a method to calculate texture patches and added a feature in Viewer to visualize the texture for a selected face.
In Viewer open a scene with cameras, then drag and drop the obj file for textured mesh.

  • hold Ctrl+Shift and click on a face to see the texture patch in a new window
  • hold Ctrl+Alt+Shift and click on a face to save the texture patch for that face in a jpg file

@cdcseacave cdcseacave changed the base branch from master to develop May 12, 2023 20:33
@@ -4086,6 +4134,46 @@ REAL Mesh::ComputeVolume() const
volume += ComputeTriangleVolume(vertices[face[0]], vertices[face[1]], vertices[face[2]]);
return volume;
}

String Mesh::PlotTexturePatch(const FIndex dbgFaceId, FaceIdxArr& face_patch_ids, cv::Mat& imgOut, const bool bSaveToFile) const {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably want const face_patch_ids

@@ -60,6 +60,7 @@ class Scene
Window window;
ImageArr images; // scene photos
ImageArr textures; // mesh textures
MVS::Mesh::FaceIdxArr face_patch_ids;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why placing it here as you seem to be using it only in Scene::CastRay?

@@ -398,6 +398,54 @@ void Mesh::ComputeNormalVertices()
}
#endif

uint32_t Mesh::ComputeTexturePatchFaces(FaceIdxArr& face_patch_ids) const {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

short description of what the fucntion does and what returns

@@ -4086,6 +4134,46 @@ REAL Mesh::ComputeVolume() const
volume += ComputeTriangleVolume(vertices[face[0]], vertices[face[1]], vertices[face[2]]);
return volume;
}

String Mesh::PlotTexturePatch(const FIndex dbgFaceId, FaceIdxArr& face_patch_ids, cv::Mat& imgOut, const bool bSaveToFile) const {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

short description of what the fucntion does and what returns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants