-
Notifications
You must be signed in to change notification settings - Fork 351
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
How to add RGB information to mesh? #21
Comments
|
That first step of yours will at least make sure the colour information is integrated into the 3D volume. However, extracting it from there into the mesh data structure and exporting RGB along with the geometry into an STL file are not currently supported. Others have asked for this feature as well, and since it's not too complicated to implement, they've even started working on it. If you want to try yourself and need some hints, please let me know. I'll see whether we can get some sort of common implementation into the repository at some point. |
Thx for the reply, and yes, I want to try myself. |
To extract color into the mesh data structure template<bool hasColor, class TVoxel, class TIndex> struct SimpleVoxelColorReader;
template<class TVoxel, class TIndex>
struct SimpleVoxelColorReader<false, TVoxel, TIndex> {
_CPU_AND_GPU_CODE_ static Vector3f calc(const CONSTPTR(TVoxel) *voxelData, const CONSTPTR(typename TIndex::IndexData) *voxelIndex,
const THREADPTR(Vector3i) & point)
{
return Vector3f(0.0f, 0.0f, 0.0f);
}
};
template<class TVoxel, class TIndex>
struct SimpleVoxelColorReader<true, TVoxel, TIndex> {
_CPU_AND_GPU_CODE_ static Vector3f calc(const CONSTPTR(TVoxel) *voxelData, const CONSTPTR(typename TIndex::IndexData) *voxelIndex,
const THREADPTR(Vector3i) & point)
{
typename TIndex::IndexCache cache;
bool isFound;
TVoxel resn = readVoxel(voxelData, voxelIndex, point, isFound, cache);
// TODO: optimize
if (isFound)
return Vector3f(resn.clr.x / 255.0f, resn.clr.y / 255.0f, resn.clr.z / 255.0f);
else
return Vector3f(0.0f, 0.0f, 0.0f);
}
}; |
Amazing Would you like to share the code changes for rgb-d fusiin? Thanks |
Actually, could you make a PR and we might be able to merge that back to Thanks and best wishes, Carl Carl Yuheng Ren 任禹衡 On Fri, Sep 18, 2015 at 5:31 PM, Asif Rajput notifications@github.com
|
Sure, I will make a PR after cleaning the code. |
Fix ITMRenTracker
@carlren @rajputasif Can you have a look at the PR? |
Hi, I have tried your work and got an RDB mesh. I wonder if I can expand this function, well, I mean I want to get the whole live reconstruction scene with RGB information, not only the mesh generated by pressing 'w'. Could you please give some advice? @vinjn |
Hi @vinjn excellent work, for some reason I am able to view Colored raycasting in viewer but the mesh is all black... Strange |
@MarkZurkberg I just checked this version |
Thanks! I will check this branch later. By the way, I want to add some 3D models like .obj files into the reconstruction scene, do you have some good advice? @rajputasif |
It works good, but when I want to import the .obj file by glm( a library used to load models ) it doesn't show any color information. So I check the .obj file using txt tools, I find this output .obj file kind of special because there are 6 numbers after each line of information for vertex. Of course, the last three numbers are used for RGB information, right? I still want to write a program to load models with color information, but I have no idea how to deal this kind of .obj file, and direction would be appreciated. Thanks! @vinjn @carlren @olafkaehler |
meshlab supports this kind of obj. (x,y,z,r,g,b) |
Yeah! Meshlab works good, But if I want to write a program myself, I have no idea how to deal with this kind of format. Could you please give me some directions? Thanks! @vinjn |
@rajputasif @MarkZurkberg @vinjn I just checked out the master branch and tried the demo with Teddy frames. However, I did not see color on the reconstructed scene even I turned on 'color' using UI. Do you know what's the reason? Thanks! |
@ganlumomo Did you change the |
@vinjn @MarkZurkberg |
I test this branch "https://github.com/victorprad/InfiniTAM/tree/c8ba1872746a4f490568613e331069a9166a855f" but I didn't |
My PR #22 was rejected :( and I am not working on this project anymore. You can still use my old fork which has color info -> https://github.com/jing-vision/InfiniTAM |
Thank you very much |
@vinjn Thank you for help. I download your color version InfiniTAM and I compiled it successfully. |
I know why! see the following codes: |
@vinjn |
-> vinjnz |
Well, it's 2020 now. I also want to make rgb in Infinitam works.
I know it may not easy to answer since many people won't test tum rgbd dataset but just in case someone knows it... |
I would like generate a mesh with x,y,z,r,g,b attributes.
Thanks.
The text was updated successfully, but these errors were encountered: