Tastenkunst / brfv4_javascript_examples

BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
463 stars 148 forks source link

How to generate the brfv4Example.faceTextures? #13

Closed lesrpo closed 7 years ago

lesrpo commented 7 years ago

Hello,

I've been going around with this, I would like to know how can I generate more faceTexture objects, I am taking a picture from the camera and getting the vertices of it as well, but it never overlap the pictures.

Thank you

MarcelKlammer commented 7 years ago

Depends on what you would like to add.

  1. actual face:

Track that face with BRFv4. Then crop the face to whatever size, you can even use the input camera image. Then "record" the tracked 68 points for that image and calculate the normalized values (0.0 to 1.0) for the image you are saving.

So if you want to use a 640x480 camera image, on click freeze that image and read the 68 points. Their values would need to be normalized like this: x = x / 640.0 and y = y / 480.

Then you can use that frozen image that you saved as texture and the normalized values as uv data.

  1. a mask overlay that can't be tracked.

Open the face texture that comes with the examples in Photoshop and paint above that face whatever you want. Save your painting and load that as face texture.