xingyizhou / DeepModel

Code repository for Model-based Deep Hand Pose Estimation
GNU General Public License v3.0
111 stars 43 forks source link

NYU Dataset dist convert #5

Closed gjtjx closed 7 years ago

gjtjx commented 8 years ago

How to convert a NYU Dataset png img pixel value to z dist value?

xingyizhou commented 8 years ago

z = b + g * 256, where b and g are the blue and green channels of the pixel.

gjtjx commented 8 years ago

and how to generate png img by z dist?

xingyizhou commented 8 years ago

For the images to train and test the network, the z distance is normalized to be zero centered and range -1 ~ 1. For images in the demo folder, I re-scale the testing image to 0~255. It is just for visualization and not the real z value. If you want to recover the z value, you can add the real 3d location of root joint and re-scale by the cube size (300 in our case, you can find detail in training/GetH5DataNYU.py ), then you can write the b and g value as described above. Hope I have correctly understood your question.