The ability to use AE's built in trackers to track movement of someone's head depends entirely on the shot. If you shoot properly then you can use AE's mask tools to isolate just the head and then pre-compose the footage and Camera Track the masked footage. When you get a good camera solution you then simply delete the mask or turn it off and insert your element as a 3D layer. The problem with doing that in AE is that 3D layers are just flat cards so it's going to be difficult to make the halo appear to spin. You may be able to do that by adding a reference solid and light that simulates the light in the scene then exporting the Comp as a C4D file, then adding your halo in C4D (lite).
The other option would be to Motion Track the position of the girls head so that you have a fixed point to follow and then create your Halo using a long narrow comp and CC Cylinder.
The best option depends on the look you are going for and the shot.
First of all, thanks a lot for you message. I tried to use your algorithm, but I failed on the step of Track Camera. I have masked girl's head, made pre-compose, but the analysis failed. I have to say that the footage is of very good quality: it was shot on the nice green screen in high quality with ProRes format with the resolution as much as 3840x2160 (fps is 29.97 but I guess it doesn't really matter) by stable camera. I tried to track it in Mocha AE. I used the Planar Tracker: I masked her head and resulted with the plane moving together with the girl's head. I exported the tracking data information into After Effects and applied it to the red solid layer I have created before. So now I can really see the red rectangle hovering over girl's head and correctly following it's motion. Also I have made a yellow-white transparent torus (the halo I need) in the Maxon 4D Cinema... And I stopped in this point! I supposed just to import that C4D torus file into my AE composition and "attach" the torus (halo) to the red plane! But... I faced the problem - I can't change the C4D's transform parameters in the Ae! (This mean that I cannot "attach" my torus to the red plane). And I also discovered that that red plane is not a 3D layer moving in the 3D space, but instead it's still just a 2D layer with the applied effect Corner Pin! So now I don't know what to do and on what step I did a mistake?
Rick, I hope to hear more valuable suggestions from you. Thank you very much!
It's not necessarily the quality of the video it's the amount of detail that's available. You also may have to try different solutions. You may also have to crop the composition. To use a 3D model in AE you have to have a camera in the shot and a reference 3D solid then you export that to C4D and then add your object and position it using the plane as a reference.
Here's a simple walkthrough of the process I threw together a long time ago:
If you want to have another go at tracking the head take a look at this tutorial: 3D head tracking after effects tutorial - YouTube
His technique is fair. If you post a screenshot of the video or even your comp I can make other suggestions.
Here's a part of my video I've just uploaded into YouTube to show you. After it appeared on YouTube it has slightly changed it's color gamma, but I guess it doesn't matter - I mean it looks better and brighter originally. Well, I've just watched both tutorials you posted, but I'm not sure if that guy's technique is suitable in my case, 'cause he works with the 2D object (his mustach is actually a 2D picture), and I have created the halo in 3D using C4D... You write "To use a 3D model in AE you have to have a camera in the shot and a reference 3D solid" and I realized the same thing from the tutorials I watched, but I can't understand how can I set the camera and the "ground and origin" in my case, 'cause I can't actually use there camera tracker... Well, anyway, I have uploaded the video into YouTube, so, now, I hope, you'll be able to suggest me what to do! :-) Thank you very much!
Your video is private so I can't see it. You can make it unlisted and give us a link or use Vimeo and give the video a password.
Rick, I've just changed the settings - so now the video seems to be available for everyone. Check it out please.
Ok I played with the footage for a few minutes and the easiest solution I could come up with was to first adjust the footage to bring out as much detail in the hair as I could, then I keyed it to remove the background. The nest step was to use AE's tracker to track the movement of the head right where the hair is parted.
When that track was good I added a Tracker null to the comp and applied the tracking to the null. A 3D solid was added and positioned to line up with the top of the head using x y and z rotation and eyeballing the perspective so the plane lined up with the top of the head and looked like it was slicing through the head. The tracker null was made 3D and I parented the 3D solid to the tracker. I then animated the X Y and Z rotation selecting points where the direction of motion changed. The footage was also 3D. I added a camera to the scene to be used later. It didn't take that many keyframes to tie the pink solid to the head and make it look like it was attached.
The entire comp can then be exported to C4D and if you replace the pink solid in C4D with your halo you should be good to go.
Unfortunately, because of the way the shot is framed there is no practical way to do Camera Tracking on this shot.
If you have a budget you can track this shot in Syntheses and build a 3D model of the head from the track then bring all of that info into a 3D app like the full version of C4D and insert the halo there. AE is just not up to doing everything automatically with it's built in tools.
Rick, thank you very much for the detailed answer! Tomorrow or the day after tomorrow I'll try to go the suggested way. I think the question may appear, so I'll ask. Thank you very much once again for your help. I'll let you know the final result! :-)
Well, actually I've done it using your instructions. So, thank you very much! However, I failed the last one step. I guess, it's easy, but I'm very far from being an experienced user of the C4D. I'm speaking about the attaching or like you said 'replacing' the solid exported from AE by the halo. Could you please suggest me here?
Thanks in advance!