<p>The answer is surprisingly simple: You move the vertices of the face-geometry.</p>

<p>To elaborate, the white wireframe mesh on the left of your image is placed so the geometry aligns with the photo. It is then texture-mapped with the photo, meaning that for each vertex in the mesh, a texture-coordinate is assigned (the point on the photo that should map to the vertex).</p>

<p>With every vertex assigned a texture-coordinate you can deform the mesh, doing ordinary texture-sampling at the interpolated texture-coordinates to have the image stretch - as if it was painted onto the head.</p>

<p>If you need to do this in realtime, you can use your graphics-card to do this; texture mapping is one of the things GPUs are really good at.</p>

<p>Now, if you want to do this on a video, you need to track the facial features to continuously align the geometry to the video. This is not an easy task, but you can probably find a wealth of libraries to help you out.</p>

<p>I am a bit uncertain which of the above would be difficult, so please feel free to ask any questions.</p>

CC BY-SA 3.0
2016-01-26T15:37:28.180Z
2016-01-26T15:37:28.180Z
Mikkel Gjoel
<p>In a post processing step instead of sampling the origin pixel directly from where the target pixel is you instead sample the origin pixel slightly offset.</p>

<p>Where you get the offset can differ. For example you could provide an extra texture with the offsets encoded in the red and green channels.</p>

CC BY-SA 3.0
2016-01-22T16:25:27.713Z
2016-01-22T16:25:27.713Z
ratchet freak
<p>I writing the this video process app which requires the each video frame to be processed such that parts of the video are enlarged. As a reference, one of the snapchat lens filter enlarges the eyes of a person in the video. This is the exact effect I want to achieve. </p>

<p>How can I achieve this effect?</p>

<p>Update:</p>

<p>I have attached an example of eye enlargement from the web.
<a href="https://i.sstatic.net/XESgE.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XESgE.jpg" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-01-22T19:13:21.767Z
Before/after screenshots would be helpful, otherwise we're all trying to imagine what you mean. Also, is the question about how to enlarge a known region (i.e. you have already identified where the eyes are), or about how to find/track the objects to enlarge? Because those are very different questions. :)
Nathan Reed
CC BY-SA 3.0
2016-01-23T04:58:07.287Z
@NathanReed I have already tracked the region of the video for enlargement. I am only looking at enlarging the regions are blend well with the rest of the video content.
crab oz
<image-processing>
How enlarge parts of a video like snapchat lens filter
crab oz
# How enlarge parts of a video like snapchat lens filter

(Asked by: username_0 on 2016-01-22)

I writing the this video process app which requires the each video frame to be processed such that parts of the video are enlarged. As a reference, one of the snapchat lens filter enlarges the eyes of a person in the video. This is the exact effect I want to achieve.

How can I achieve this effect?

Update:

I have attached an example of eye enlargement from the web.
[![enter image description here](https://i.sstatic.net/XESgE.jpg)](https://i.sstatic.net/XESgE.jpg)

**Tags:** image-processing

> **Comments:**
> **username_1**: Before/after screenshots would be helpful, otherwise we're all trying to imagine what you mean. Also, is the question about how to enlarge a known region (i.e. you have already identified where the eyes are), or about how to find/track the objects to enlarge? Because those are very different questions. :)  
> **username_0**: @username_1 I have already tracked the region of the video for enlargement. I am only looking at enlarging the regions are blend well with the rest of the video content.  

---

## 2 answers

### Answer by username_2 on 2016-01-26. Score: 2 | Accepted answer

The answer is surprisingly simple: You move the vertices of the face-geometry.

To elaborate, the white wireframe mesh on the left of your image is placed so the geometry aligns with the photo. It is then texture-mapped with the photo, meaning that for each vertex in the mesh, a texture-coordinate is assigned (the point on the photo that should map to the vertex).

With every vertex assigned a texture-coordinate you can deform the mesh, doing ordinary texture-sampling at the interpolated texture-coordinates to have the image stretch - as if it was painted onto the head.

If you need to do this in realtime, you can use your graphics-card to do this; texture mapping is one of the things GPUs are really good at.

Now, if you want to do this on a video, you need to track the facial features to continuously align the geometry to the video. This is not an easy task, but you can probably find a wealth of libraries to help you out.

I am a bit uncertain which of the above would be difficult, so please feel free to ask any questions.


---

### Answer by username_3 on 2016-01-22. Score: 1

In a post processing step instead of sampling the origin pixel directly from where the target pixel is you instead sample the origin pixel slightly offset.

Where you get the offset can differ. For example you could provide an extra texture with the offsets encoded in the red and green channels.


---

