Skip to content
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

Question about handdetector module #3

Closed
shimiaoli opened this issue Mar 8, 2017 · 4 comments
Closed

Question about handdetector module #3

shimiaoli opened this issue Mar 8, 2017 · 4 comments

Comments

@shimiaoli
Copy link

Hi, @moberweger ,
In handdetector.py module, line 192, while project to 2D:
xstart = int(numpy.floor((com[0] * com[2] / self.fx - size[0] / 2.) / com[2]*self.fx))
Only when I take Zstart = Zcom (=com[2]) , I can derive out the same equation and cancel out ux.
However, I think it should be Zstart = Zcom - size[2]/2 ? Or you have made an approximation Zstart ~= Zcom here ?
Thanks.

@moberweger
Copy link
Owner

@shimiaoli
So assume com3D is the com point in 3D (com3D=(com[0]+ux) * com[2] / fx). Then a metric cube is extracted around this point, which has z-coordinates com3D[2] +/- size[2]/2 (handdetector.py L190-191). Then, we calculate the top and bottom projections around the 3D point com3D by com3D[0] +/- size[0]/2 for the x-axis, ie the top and bottom side of the cube. The z-coordinate stays the same, since we only add on the x-axis. This way, the 2D crop (2D projections of these sides of the cube) is taken around the com3D point with z=com3D[2]. Otherwise the crop would be larger if we take the top and bottom part from the back side of the cube or smaller from the front side, ie z=com3D[2] +/- size[2]. Also, the different sizes would depend on the distance of com3D to the camera, which should be irrelevant for the hand pose and would make the problem harder. Using this parametrization ux cancels and one should derive the used equation.

@jakeoung
Copy link

Sorry, but could I have a question? How do we cancel out ux? My derivation is like this: (I assume com3D=(com[0]-ux) * com[2] / fx)

((com[0] - ux) * com[2] / self.fx - size[0] / 2.) / com[2]*self.fx)

Here, I don't know how to cancel out $ux$.

@moberweger
Copy link
Owner

Hi @jakeoung
So the derivation could go like this:

Since
com3D=(com[0]-ux) * com[2] / fx <--> com[0] = com3D * fx / com[2] + ux

we plug in and derive
((com[0] - ux) * com[2] / fx - size[0] / 2.) / com[2]*fx + ux = com[0] - size[0] / 2. * fx / com[2]

@jakeoung
Copy link

jakeoung commented Apr 26, 2017

Hello @moberweger,
I am very thankful for your reply. I can understand it now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants