9

I'm trying to apply a CIFilter to a specific group of vertices from the ARFaceAnchor. I was able to access the vertices using:

let vertices = faceAnchor.geometry.vertices 

let relevantVertices = [vertices[580], 
                        vertices[1019], 
                        vertices[1017], 
                        vertices[660]]

But I can't understand how to use it in with a node (not sure if that's the solution) in order to keep those vertexes continuously updated with the CIFilter as the face moves.

For example, I chose some vertexes and applied a black and white filter on the selected vertices (hard-coded) using Photoshop for demonstration. Imagine there are no lines :)

enter image description here

Any help would be highly appreciated!

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
  • 1
    I don't have enough time to type out a response with code, but what you're asking to do may be more complex than just adding a CIFilter. In this case, the "nodes" aren't actually being rendered or textured with your camera capture. I think the approach would be to unproject the relevant triangles into 2D (pixel) space, render those to a texture and use that as a mask for a filter/shader. – Dennis L Sep 01 '20 at 16:06
  • Hey @DennisL, thank you for your response! I tried to do it, but it's way out of my ARKit scope (unfortunately). I added a large bounty if that makes any difference, as we really hit the wall in our internal efforts. Would love your help on this one. – Roi Mulia Sep 02 '20 at 12:32
  • @RoiMulia actually i'm trying to understand you question, do you need to apply `node` on specific `vertices` – a.masri Sep 04 '20 at 20:20
  • Hey @a.masri. I'm trying to apply a `CIFilter` on specific `vertices` that I get from the face mesh (like I showed above). So basically for example `blur`/`black & white` part of the face using the `vertices` I choose. If using `node` is the right way then I didn't find it yet haha. – Roi Mulia Sep 06 '20 at 07:38
  • @a.masri Bounty expires soon if it's interesting you – Roi Mulia Sep 08 '20 at 12:16
  • @DennisL Bounty expires soon if it's interesting you – Roi Mulia Sep 08 '20 at 12:16

0 Answers0