Blender 2.8 Camera tracking tutorial (part 2)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back to another blender 2.8 tutorial and today we're going to do the second part of this camera tracking series so if you haven't seen the last one yet make sure to go back and watch it before continuing with this video in a lot of the steps I'll be going a lot faster than last time because I've already gone over it so really make sure that you watch that one and just as a refresher in the last part we went over the fundamentals of camera tracking and actually ended up tracking this shot and obviously I set up the shot so that there were a lot of tracking markers which makes everything very easy to track but in the real world the majority of the footage we're going to be using is not going to have any trackers at all so the goal of this video is to make sure we know how to track in much more general scenarios here's the footage we're going to be tracking today we have a car going down a long stretch of road and obviously we don't have any kind of dedicated markers and while the camera motion is very smooth I mean it's pretty much just moving forwards we do have some issues in this shot which make it somewhat difficult first thing to notice is that there's a good amount of flickering going on here especially if you look closely at the asphalt also this footage isn't super sharp which makes it hard to distinguish specific features and when we do find one there's probably going to be a good amount of motion blur and artifacts and that's going to make our lives very difficult so pretty much the name of the game is getting creative with which features we choose to track remember blender calculates the final camera solve based off of a bunch of point tracks so we need to make sure that we can find at least eight good ones during every single frame preferably we pick features that last throughout the whole shot so let's hop into blender and get started the first thing we're going to do just like last time is turn our video into an image sequence so that it is frame rate independent we're going to go into the movie clip editor and then import in our footage and here you can see some of the details of our footage like the resolution frame rate and also the frame duration if you don't see this you can just click and to toggle this window on and off and obviously we want our blender project to match these settings before we export the sequence we're going to go into the output tab and then change our frame rate with this drop down and in our case that's twenty three point nine eight frames per second next we're going to match our resolution it's 1080p by default but we wanted at 2560 by 1440 and lastly we just need to match our frame duration we can either do that man by entering 73 as our endpoint or we can hit set scene frames which does it for us automatically and now that everything matches we're gonna head over to the compositing window where we're gonna set up our output so enable use nodes and auto render so we can actually see what we're doing and that it constantly refreshes and then we're just going to delete this render layers node with X and then shift a to add a input and then movie clip so hook this up to your output and make sure that it's using the correct footage and if we want to view this just control shift click the node and it will automatically create a viewer for us I'm going to export this as a PNG sequence so it still has a good amount of detail and we're going to turn the compression down to 0 and for the output path I'm just going to create a new folder for our image sequence and then all that's left to do is to hit render animation with ctrl f12 and it's going to render with Eevee and then when that's done I'm just going to open a new blender project so that we can start fresh again go into the movie clip editor and import in your image sequence by selecting all the images with a and then import and here you see that we are now framerate independent so there is no framerate listed and we are free to pick whichever one we want and in the output tab I'm just going to choose 24 frames per second instead of twenty three point nine eight like we had before and also we need to make sure to match our resolution again to 2560 by 1440 and now we can finally get into some point tracking and the first thing I'm going to track is some features that are way off in the distance and these should be moving across the frame and getting slightly larger as they get closer to the camera and therefore it makes sense to use a location and scale tracker for this we don't expect this thing to rotate so there's no point in using rotation as well in tracking settings extra I'm going to set the correlation to 0.9 and again this means that from frame to frame it's only going to keep tracking if it's at least 90 percent confident in a match otherwise it's just going to terminate tracking I'm also going to turn on normalize which should handle any subtle lighting changes on these trackers so now let's just control click this bush looking thing to add a tracker and we can hit alt s to reveal the search box which again defines where it's going to search for the tracker and we can just resize this thing a little bit we begin manually tracking with alt right arrow to track forwards and then we can hit l2 lock our view to the tracker and once we're confident in the quality of this tracker just hit ctrl T and it's going to track to the end of the shot and we can lock this track by either hitting this button or just hitting ctrl L and this prevents us from accidentally moving it or adding any unwanted keyframes now I'm just going to repeat this process for two more trackers and notice that these features are very rigid so they're not swinging in the wind or anything like that so they should be very reliable and for this last one I'm also tracking it backwards and you can do that with shift control team and something that's going to be a lot more useful for us than the timeline is the graph view so to open this just go to the movie clip editor and make sure you're using the same shot and then we're just going to change clip into graph and this will explicitly tell us the location of the trackers throughout the shot and you see that the graphs are relatively smooth which is exactly what we'd expect and you see this little bump towards the beginning because right in the beginning of the shot the camera is tilting downwards very quickly so that's representing exactly that motion so now let's track what's probably the most obvious feature in the shot and that is these stripes on the road and we can do this by adding a marker on the stripe and then just resizing it so it captures the whole thing and this brings up the point that you don't only need to track small features you can also track big patterns as a whole and because this feature is on the road and coming towards us we expect some heavy perspective warping so let's go into tracking settings and change the motion model to perspective and now we can begin tracking backwards with alt left arrow and this is going to take a bit longer than the usual tracker because our pattern is much larger and by hitting shift control T we're going to have it track backwards automatically and eventually this tracking does terminate because our feature now looks very different from the original keyframe we set it on so to fix this we're just going to update our tracker which is going to effectively add a new keyframe and now it's going to use this keyframe as reference as it keeps tracking and you see this time it made it all the way back to the beginning of the footage and we can just lock this tracker now and now we're just going to play the same game with some of these other trackers and every time it terminates all we have to do is update the keyframe just like before and something interesting to notice is that these green curves on our graph are sloping downwards which is basically just representing how our trackers are going to the bottom of the frame as they get closer and now we're just going to add some high contrast features from the sand areas on either side and for these I'm going to go back to using location and scale for the motion model and these are generally going to be pretty nice tracking markers because they last throughout the majority of the shot and they're also fairly easy to spot again because this footage is in very sharp and has lots of artifacts we're going to need to do a lot of manual supervision over these tracks now in the case of this tracker it's becoming pretty problematic at around frame 15 but there's already tracking data calculated past that point so to fix this we can just use the graph view and it has this button which lets us delete the data to the left of any frame and now that it only has good data we can actually lock this tracker and since there are a lot of trackers it probably makes sense to actually save our project at this point probably not a good idea to lose all our progress right here and at this point I'm going to go over to the solve panel and try to do an initial camera solve I'm going to leave tripod disabled because this is a free moving shot and I'm going to enable the keyframe chat box which is going to let blender automatically choose key frame a and key frame B for me so it will choose which portion of the footage it's going to reconstruct the solve from and when I solve camera motion you see that I get an absolutely horrible error of around twenty one point six pixels and we definitely want this number to be under one and a good solve is usually under point five so this solve is actually really really terrible and you can see that in the graph view our newly added blue line is just all over the place and that represents a really bad track but the reality is this is the kind of thing that happens when your motion tracking you go for a solve and you get a really bad error and then what you have to do is add more high-quality trackers and that's exactly what we're gonna do so let's try adding one more tracker in the sand area and now that we've added another tracker we go to solve camera motion again and now we actually get a solve error of around 0.35 which is an absolutely crazy improvement this is already a great track but of course we can do some refinement so in the refine drop-down I'm going to select focal length and K 1 and K 2 so that blender can try to approximate the focal length of the camera and also the lens distortion and just by doing the small modification our solve error drops even more and now you can see that the blue line of the graph view is very smooth and very consistent and this indicates a good camera solve so if you go to clip display and then enable render undistorted we actually get to see what this footage looks like without the lens distortion and also by enabling info and 3d markers we can actually see what the solve air is representing so you can see that each of these trackers has a tiny green dot which is the actual point in 3d space that we get from our camera solve in the distance between our 3d marker which again is the green dot and our tracker is going to be some amount of pixels and this is exactly how the air is measured and it's going to change from frame to frame and each tracker is ultimately going to have its own average error and the tracker that has the highest amount of error is just the one that has this Green Point flail the furthest from our tracker on average so this is exactly what these numbers are representing formally but again we have a very good self that we can work with so let's actually just set up our scene the first thing we do is we hit set up tracking scene which sets up our moving camera and a whole bunch of other stuff but when we go into the camera view this does not look like it's actually tracking on properly and this is just an issue of orientation so to define our floor we're going to need to pick three trackers that are actually lying on the floor and we don't want all of these to be collinear so we need to pick one that's in the sand area so they're not all lining up all three of them and once we've selected these with shift-clicking we're just going to hit floor and then you see that everything just becomes way too big so we need to set a new scale we fix this by selecting any two trackers and then we just specify a distance and then hit set scale so the distance between the 3d markers corresponding to these trackers is now going to be five units and then we can just pick one of these trackers and make it the world origin so everything is centered and finally we're just going to pick a tracker that is above this origin and that's going to define the y-axis direction so basically what's happening here is it's taking the line between our selected tracker in the origin and saying that the y-axis will go along that direction and now when we play through this everything looks far more tracked on but it's still a little bit off and as a final touch we can select our camera and hit enter toggle the properties menu and then we can just rotate this camera until everything looks about right and since we're really just eyeballing this we want to make sure we're only making subtle changes and now we're going to go over to the render view and switch to the cycles render engine and when we do this you see that there are actually no shadows and that's just because we are viewing the foreground so we need to move the ground plane into the foreground collection and then we can just delete the background collection and also delete the background layer that was made when we hit set up tracking scene and now it's a make this more visually interesting I'm just going to switch out the objects and fix the lighting so that the shadows are coming from the correct direction and then in our camera and then inside camera properties we can go to the background image settings and bring up the Alpha and toggle render and distorted and this just lets us better see our scene once we're done setting this up all that's left to do is to go into compositing and I'm going to delete this default node setup so we can actually make a custom one from scratch also make sure to enable auto render so we can see everything refreshing and now with shift day I'm going to add a movieclip node and also a render layers node we're then going to combine these two using an alpha over node and we want to make sure that the render layers node is in the foreground of this and then we're just gonna hook this up to compositing and also to our viewers so we can actually see what's happening and it does work except we can't see our 3d object but that's just because we haven't rendered it yet so our render layers is essentially empty so I'm just gonna turn the compression down in the output tab and then I'm just gonna hit f12 to render and now we see that our node setup is doing exactly what we expect it to do however it's only keeping the first frame of the 3d object which means of course we need to render the whole animation and before we do that I'm just gonna define an output path into a new folder and then just hit ctrl f12 to render the animation and that's pretty much it so I hope you guys like this two-part camera tracking tutorial I tried to cover both the scenarios where you have trackers like the first part and where you don't have trackers like this part and yeah that's pretty much all I got for you guys thank you guys for watching and I'll see you guys in the next one
Info
Channel: CGMatter
Views: 123,563
Rating: undefined out of 5
Keywords: blender, 2.8, camera, tracking, matchmoving, tutorial, how to, part 2, perspective
Id: 6Vo-jyWlDhM
Channel Id: undefined
Length: 12min 52sec (772 seconds)
Published: Mon Apr 08 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.