face-frontalization icon indicating copy to clipboard operation
face-frontalization copied to clipboard

Bug in the function point_in_frustum(x, y, z, frustum)

Open CharlesNord opened this issue 4 years ago • 1 comments

https://github.com/dougsouza/face-frontalization/blob/6cf2f094ef8009fab90ae902c28b2d7bf9ec252f/camera_calibration.py#L118

Hi, thank you very much for your code. I think this function is not well implemented. First of all, when we check if one point in a frustum, we should go through 6 faces rather than 3 faces. so.

for p in range(0,3):

should be changed to

for p in range(0, 6)

Second, there is a typo in your code:

if(frustum[p, 0] * x + frustum[p, 1] * y + frustum[p, 2] + z + frustum[p, 3] <= 0):

the frustum[p, 2] + z should be changed to frustum[p, 2] * z

CharlesNord avatar Sep 27 '20 04:09 CharlesNord

@CharlesNord,

Yes, it looks like there is a typo. Would you care to make the changes, test and submit a PR?

Cheers

dougsouza avatar Sep 28 '20 16:09 dougsouza