ARKit – Apply CIFilter to a specific vertices of ARFaceAnchor
Asked Answered
U

0

10

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!

Undersurface answered 30/8, 2020 at 21:27 Comment(6)
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.Brentonbrentt
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.Undersurface
@RoiMulia actually i'm trying to understand you question, do you need to apply node on specific verticesStuck
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.Undersurface
@Stuck Bounty expires soon if it's interesting youUndersurface
@DennisL Bounty expires soon if it's interesting youUndersurface

© 2022 - 2024 — McMap. All rights reserved.