shurans / sscnet

Semantic Scene Completion from a Single Depth Image
http://sscnet.cs.princeton.edu/
339 stars 91 forks source link

Some generated voxel seems not right #39

Open sunshineatnoon opened 6 years ago

sunshineatnoon commented 6 years ago

Thanks for sharing this awesome work. I am using the camera parameters from pbrs to generate my own training data, however, I found that some voxels look like a plain rather than a voxel, can anyone give me any hints on this ? Left image below is the depth and right image shows the corresponding voxel visualization using show_volume.m

mgarbade commented 6 years ago

The voxels are stored in the *.bin files. The png files contain the 2D depth maps only

sunshineatnoon commented 6 years ago

@mgarbade Hi, Thanks for the reply. This is the voxel visualized from the .bin files, I just put the depth map for comparison.

sunshineatnoon commented 6 years ago

After examining the code, I think I found the problem. This issue only occurs for second floor rooms. Because line 21 in getSceneVoxSUNCG.m (link) manually changes the world y coordinate of voxel origin to height_belowfloor. This does not apply to rooms in second floor, so after commenting this line out, I can get correct voxels. But why do we need this line in the beginning and will deleting this line cause any future trouble? I would be appreciate if anyone can give me some hints on this.

KnightOfTheMoonlight commented 6 years ago

@sunshineatnoon Hi, did u find a good voxorigin setting? Theoratically, as my understanding, voxel origin could be anywhere, cause this parameter is only for translation of transform. And Translation is not import for a whole scene 3d model rather than object inside a whole scene.

sunshineatnoon commented 6 years ago

@KnightOfTheMoonlight Hi, what do u mean voxel origin? If u mean the world coordinate of voxel origin, u can find them in the .mat or .bin files. In my case, I can calculate the world coordinates of things I care about, and since I know the world coordinate of the voxel origin ((0,0,0) in the voxel), I can calculate the voxel coordinate of all things under my consideration.

aluo-x commented 5 years ago

Also encountered this issue when porting the code, I believe the min of the bounding box for a room can be used as an origin. This can be found as roomnode["bbox"]["min"] using any json library in python, alternatively it can be found in matlab via roomStruct.bbox.min(2) since the rooms are Y up.