-
Notifications
You must be signed in to change notification settings - Fork 535
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
JeelizHelper tweakMoveYRotateY behaves differently on desktop and mobile #114
Comments
Hi, This value should be kept at In the glasses VTO demo https://jeeliz.com/demos/faceFilter/demos/threejs/VTO/ In your case I think the problem comes from the camera FoV (Field of view) set with This issue is related: #56 Best, |
Hi @xavierjs thanks for your support and clarification. I know some things about the camera calibration challenges from working on artoolkitX.js I do understand the FoV setting and will adjust it to work better. However, the VTO example you linked to it is set to 40° which works on desktop and mobile very good. So I'm wondering why you are proposing to set it to 90° for mobile? |
Hi, The FOV provided for the THREE.js camera and used to compute the position is the vertical FOV. But anyway, the fov is always the vertical angle of the camera. A mobile in portrait mode have the camera used in portrait mode, so the same camera will provide a vertical fov of 70°. Then the fov of mobile camera is a bit larger than laptop camera because they are made to be used from a shorter distance, and they should be able to provide landscape pictures. That's why I advise a 90° value. |
Hi @xavierjs thanks for your response: I've calculated it through. Given the FoV of the front camera released here: Given a full screen resolution of 375w 553h in Safari and using this resource https://themetalmuncher.github.io/fov-calc/ I end up with a vertical FOV of 74. I've placed the origin of my objects in the center between the eyes which if I understand correctly should make them appear on the tip of the nose. Because that is what your ML exposes as world origin. Then I move the object up a bit 0.4 - 0/5 to be placed over the eyes. Now the tricky part is the rotation I take it that pivotOffsetYZ moves the model origin so that I can set a different pivot point from the actual model origin. However, no matter what values I'm using the model always appears to be misplaced when rotating the head as if the pivot point is set incorrectly. Thanks |
Hi, Indeed the 74° for the FOV seems very plausible. If you want the best positionning as possible you should just start from the VTO demo (https://github.com/jeeliz/jeelizFaceFilter/tree/master/demos/threejs/VTO). The glasses are given as OBJ model: https://github.com/jeeliz/jeelizFaceFilter/tree/master/demos/threejs/VTO/models3D You can import them to help positionning and scaling your own model, then you just replace the glasses by your own model in the demo. Although the neural network was trained using the center of the 2 eyes as origin, it does not expose its coordinates since they should always be at a fixed place in 2D in the detection window. |
Hi @xavierjs thanks for your reply. |
Yeah, you can either change the positionning of your model according to the 3D glasses and reexport it using blender, or replace the model by a composite object |
So you are saying that changing pivotOffsetYZ is not the same as changing the origin of a model? |
yes it is not the same thing. |
Alright, I think I'm getting closer to my issue:
I get the same effect that I fixed by setting The result I'm seeing is that the glasses are placed correctly if I look straight at the screen and if I rotate my head around the y-axis. However, if I rotate the head around the z-axis (nodding) the glasses appear to be too far in the front. (Attached a picture to illustrate the axis I'm talking about) |
Have you enabled |
Sorry, rotation around x-axis (it is Friday afternoon my mind is already in the weekend I guess). Yes, followZRot is enabled. Basically I've cloned the VTO example from GitHub and changed the line as shown above here: https://github.com/jeeliz/jeelizFaceFilter/blob/master/demos/threejs/VTO/demo.js#L47 |
In this drawing glasses are drawn from a side view. Currently the Z position of the pivot point is correct since the glasses are well positionned if you rotate the head around Y (left <-> right). The X position of the pivot point should be 0 (because the head is symetric). The problem is with Y.
Currently I think your pivot point is not well positionned along Y. You can compensate this by moving the model, but it won't be the same as soon as the face rotates around X. |
Yes, exactly. And the same happens with your VTO example when fullscreen is enabled. Could you reproduce? |
So I think that you should lower the first value of |
If I do change that to
that fixes it for rotating upwards. (Looking to the sky) Still talking about the VTO example. |
Hi, I can reproduce the bug. There is definitely something wrong in JeelizFaceFilterHelper. I will figure out what happens. I have my idea about what is going wrong... |
…und X with different camera aspectRatios - see #114
I think I have found the bug :) . I did not updated the live demos yet. Can you tests with the new helper? Thank you very much! |
* commit '6bb4f14ccc20f4dd477898104fc16c318161e4a7': [FIX] Bug in JeelizThreeJSHelper with Y offset when rotating head around X with different camera aspectRatios - see jeeliz#114 [QUAL] Add set_videoOrientation method - jeeliz#113 [FIX] repair toogle_slow() method - jeeliz#112 [FIX] Correct a bug with MacOSX10.15 (Catalina) beta (set lame WebGL2) [DOC] add default alphaRange value in readme [FIX] add neural network model to fix this issue: jeeliz#85 , waiting for a real fix of the graphic driver...
Yes, the new helper makes it much better. I've still got some offset in my prod environment but the VTO example in fullscreen works much better now. |
Many thanks for the quick responses and instant fix @xavierjs |
Hi @ThorstenBux I took some days off. Best, |
…und X with different camera aspectRatios - see jeeliz/jeelizFaceFilter#114
Describe the bug
I just found that the setting JeelizHelper.tweakMoveYRotateY behaves completely different between mobile (iPhone 6s, Safari) and desktop (macOS Chrome)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Movement of the object should be the same
Desktop (please complete the following information):
iPhone 6s, Safari
Smartphone (please complete the following information):
macOS
Chrome
Additional context
I had set the value to 2 for desktop and 0.3 for mobile
The text was updated successfully, but these errors were encountered: