You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
convert floating point projected vertex to integers to create u-v coordinates
index into color image at projected vertex u-v coordinate to get color for vertex
add color info to original mesh vertex
Here's a snippet of some Python psuedocode for doing this
# Get transform from camera to mesh (using TF)camera_to_mesh= ...
# Extract camera matrix from ROS camera info messagecamera_matrix=np.array(camera_info.P).reshape((3, 4))
# Put mesh vertices into homogenous coordinates (i.e., [x, y, z, 1])verts=np.vstack([mesh_verts.T, np.ones((mesh_verts.shape[0],))])
# Project the mesh vertices into the camera frameprojected_verts=camera_matrix @ camera_to_mesh @ vertsprojected_verts/=projected_verts[2, :]
# Convert to u-v coordinatesvert_coords=projected_verts[:2, :].T.astype(int)
# Extract the colors from the imagecolors=image[vertex_coords[:, 1], vertex_coords[:, 0]]
Hi,
I have seen in your README.md that you present a use case where you project an image's color onto a mesh.
And i wanted to know how did you do that ?
Did you programmatically add the color of each pixel on each point ?
The text was updated successfully, but these errors were encountered: