Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Planar tracking a face

From: VFX Techniques: Tracking Objects onto a Face

Video: Planar tracking a face

We have imported our prepared image sequence into mocha. Now to open up that file or to work in mocha again, we do need to go through After Effects, at least with mocha for After Effects in CS6. The trick for doing that is to select a layer. It doesn't even matter which layer it is. Go to Animation, and go to Track in mocha AE. Mocha opens, but we don't necessarily want this. I can just cancel this New Project. I'll maximize it here. And then you can go and open the file that you want.

Planar tracking a face

We have imported our prepared image sequence into mocha. Now to open up that file or to work in mocha again, we do need to go through After Effects, at least with mocha for After Effects in CS6. The trick for doing that is to select a layer. It doesn't even matter which layer it is. Go to Animation, and go to Track in mocha AE. Mocha opens, but we don't necessarily want this. I can just cancel this New Project. I'll maximize it here. And then you can go and open the file that you want.

So here is the image sequence again. Now to make room to see our eventual layers, I want to close the Overlay Colors down here, View, turn off Overlay Colors. There we go, lots of room now. Mocha is a planar tracker, which means you identify a pattern surrounded with a spline shape, figure out where that goes over time, and then attach a planar surface to it, as if it was a flat piece of paper.

So let's get started with that. There are several ways to draw spline shapes inside mocha, which you have up here in the toolbar. I find the X-spline the easiest to use, so we're going to start with that. I want to zoom in nice and close though, so I'm going to use the zoom tool right here. Right-mouse click and just drag to get closer. It would be good to start in a frame where everything is very visible, in better resolution. So I'm going to go to a later frame, I think 200 will be good, I'll just type 200 in here, and there we go.

Now in terms of the X-spline, I'll just click this icon and then click in the viewer. Each time you click, you get a point, and it starts to form a closed spline shape. Now you don't have to have just four, you can go further, but I just want four in this case, it makes sense. In order to finish this shape without putting in additional points, right-mouse click, and there you go. As soon as you make this shape, you get a layer that appears up in the Layer Controls panel, and you can rename it, just click on it, backspace, and type a new name, like Cheek.

All right, I'm going to go back to my Pick Tool and click on that, so we can edit it. The goal here is to adjust the X-spline, so it surrounds these dots and so I can tweak it down the road. So a good way to do it here is to move these corner points close so they just touch the edge of the dots. As I move thess around, you'll notice that there's a little zoom window at the top left. This will come in handy once we start seeing keyframes to compare current frames with previous or next keyframes.

So for now I'm going to touch the edge of each dot. Okay, looks good. And notice that a keyframe gets placed, a little green one, right here when I do that. Now we're ready to start tracking. I'm closer to the end so I'm going to track forward, which is this button right here. Once it stops, you'll see a bluish, purplish bar here that indicates that tracking has occurred.

Now mocha will try its best to follow that pattern. But it will slip off based on resolution or grain or color, what have you. What you can do though is adjust this X-spline shape at key junctures to make it fit. Those become keyframes; it will help make the tracker more accurate. So I can just grab these corners again and click-drag, and you'll notice the zoom windows will show our previous keyframe and the current frame. This allows you to match up the keys. All right, that looks pretty good.

I'm going to go back to 200 now and track from this point to the beginning, and here is that button. Okay, looks good. All right, that looks pretty good. And there we go. Now it does slip off, the pattern does slip off, because one thing that interferes is her touching her face.

Two of the tracking marks were covered up and that confuses the tracker. It's consistent once the finger leaves, but it slipped off the dots. What we can do is apply additional keyframes to fix that. Before I go and do that, I want to mention one thing. I'm going to go back to 200 and show you the hidden planar surface. This is off by default, but you can show it by pressing this S button right here. Initially it's just rectangular and square to the camera, but this is the area where the thing you track in After Effects will eventually be placed, the four corners of the tracked layer in After Effects will be pulled towards the four corners of this planar shape.

What we can do at this point is zoom in a little bit and adjust this to match our tracked dots. I'm going to pull the corners, and just for now I want to place them at the corners of the X-spline right here, right here, so I'm overlapping the solid blue line of this shape or this planar surface with the dotted line of the X-spline. Now I'll have to adjust this as we go further in the tracking, but just for now I want to set the shape right here on Frame 200, then I'll hide it.

In any case, now I can go back and set more keyframes to get this planar surface to stick. Now keyframes disappear unless you have one of these points selected and then they appear again. So here I'm on Frame 1 or Frame 0, the first frame. I could try to get these in the correct position. Now the resolution is very small here for this section, but I'll try my best. Okay, looks good. Now you'd approach is like you would in After Effects. You'd place keys where you think they would produce the best curves.

In this case, it would be good to place additional keyframes where there are sudden changes in motion or where the X-spline suddenly slips off. Now it's going to be difficult for me to do this in real time, so I'm going to give you some frame numbers where it would be good to set additional keys. One is Frame 40. That's where it starts to slip off a little bit, even after your keyframe 0. There's Frame 70. Again, a point where it starts to slip off, and this actually is right before her finger touches her face.

77, when her finger is right over this dot here and the shadow starts to interfere. 88, the finger touches the face, we lose one dot completely. 103, where the finger presses deeply into the skin and starts to distort those four dots in terms of their planar quality. And 114, where the finger leaves, and once again, all four dots are visible.

So the idea would be to go to those keyframes and then adjust the X-spline shape to produce additional keyframes. If you do those minimal number of keyframes, then it should be sufficient to get pretty good tracking data. Now there still is a problem where the finger touches the face, but we'll talk about that further later on. We have drawn the X-spline shape and adjusted it over time based on the tracking. In turn the X-spline will determine where the planar surface goes, and that planar surface will turn into tracking data inside After Effects. So you can imagine that the artwork we track in After Effects will be where the X-spline shape is.

Show transcript

This video is part of

Image for VFX Techniques: Tracking Objects onto a Face
VFX Techniques: Tracking Objects onto a Face

30 video lessons · 6108 viewers

Lee Lanier
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed VFX Techniques: Tracking Objects onto a Face.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.