IntelRealSense / hand_tracking_samples

:wave: :ok_hand: research codebase for depth-based hand pose estimation using dynamics based tracking and CNNs
https://realsense.intel.com/
Apache License 2.0
217 stars 74 forks source link

HandTracker works bad on other camera data. #7

Closed lyyiangang closed 6 years ago

lyyiangang commented 6 years ago

hi, I am very excited about your project, It seem your method works well on hand pose recognization. HandTracker works well in your "synthetic-hand-tracker-vs2015", but it works bad on my data. I download some MSRA hand data. Their camera sensor size 320*240 and the focal length is 241.42. the center is (160, 120). I make a small modification on "realtime-hand-tracker-vs2015" and make it support the recognization of a single frame. msra-hand.txt is a single frame depth data. Here is some code:

std::string filename = "msra-hand.txt";
DCamera dcam({ 320,240 }, { 241.42f,241.42f }, { 160.0f,120.0f }, 0.001f);
auto dimage= LoadFrame(dcam, filename);

here is LoadFrame:

Image<unsigned short> LoadFrame(const DCamera& dCam, const std::string& filename)
{
    std::ifstream iStream(filename);
    unsigned short backgournd = 3;
    Image<unsigned short> frame(dCam);
    for (int yy = 0; yy < dCam.dim().y; ++yy)
    {
        for (int xx = 0; xx < dCam.dim().x; ++xx)
        {
            int depth = 0;
            iStream >> depth;
            frame.pixel({ xx,yy }) = depth;
        }
    }
    return frame;
}

then use htk.update(std::move(dimage)) to recognize hand pose. Unfortunately, I get a wrong result like this. I also try some other gestures, but I don't get good results. Then how could I make HandTracker works better on MSRA's hand dataset ? Do I miss something important??

Thanks

melax commented 6 years ago

a few things to mention:

lyyiangang commented 6 years ago

Thanks very much for your reply. It works now for my data. Two things I have done following your tips.

  1. Change the background depth value to 1000 millimeter.
  2. The code can't find entry point since the lost of arm depth info. After adding a virtual arm ( I add some depth value in the arm region manually), I get the inferred results finally. we could close this issue now. Thanks very much @melax .