3D Matchmoving

Week 1

  • Today we went through the basic 3D nodes in Nuke, how to setup a 3D scene in Nuke and converting it from and to 2D scenes, and we imported a camera and object from Maya into Nuke.

General

When you create a camera there are two things you always want to check and make sure are correct:

  • Focal Length
  • Sensor

Always start the timeline on 1001 to ensure you have pre roll.

36 x 24mm sensor is called a full frame.

Nuke

In Nuke to adjust the sensor you use the Horizontal and Vertical Apperture. They are measured in mm and represent the height and width of the sensor.

Red nodes are 3D nodes.

To put a 2D in the 3D environment you can put it on a card. A card is like a plane/grid.

You use the scene node to connect the cards and camera to be able to view it. It works sort of like a merge node.

To be able to convert the 3D environment back to a 2D environment you use scanline render.

Import 3D model into Nuke. ReadGeo node.

  • You can import as one node, or split up the imports in separate nodes such as object and camera.

Hotkeys

  • Tab in viewport – shift between 2D and 3D viewport
  • Ctrl + shift + X – Unplugs node from everything

3D Environment in Nuke

Basic Setup for a 3D Environment in Nuke

Converting it back to a 2D environment with scanline render node. Then you are able to use 2D nodes such as grade to adjust the scene. If you have multiple assets, and you only want to edit one, you could plug 2D nodes to your asset before the card node.

 

Importing camera and object from Maya to Nuke

Maya

DO NOT scale the camera.

Make sure color space is correct.

Change to scale in meters.

Cache Alembic Export

  • UV Write
    • Because you want the UVs for the model.
  • World Space
    • To ensure constraints and groups will export as well.

2D and 3D view

Setup with the camera from Maya and the Geometry plugged into the scene.

Color Space

sRGB can be found in JPG. The standard color space.

ACES is a bigger color palette. We also use ACES because it is linear and our CG renders are linear.

16 bits give you the ability to have color values above 1.

OCIO – Open Color Input Output

  • Tool to manage color management.

3D Equalizer

You don’t have scale in 3D Equalizer. There are two methods to fix this.

  • Photogrammetry
  • Create scene in Maya

This ensures you get the correct camera movement and motion blur.


 

Week 2

  • In todays lesson we worked in Nuke and learned about distortion of footage, 3D camera tracker and .

General

Shuffle 

  • Reshuffle channels.
  • Redirect the channels where you want. 

 

Distortion

Distortion 

There are multiple workflows for distortion. 

  • You can either use ST maps for UD and RD

Overscan is an empty space around the footage.

  • “Overscan extends the render region beyond the regular image coordinates.” 
  • For CG we always render with 5% overscan.

ST maps are generated in softwares such as 3D equalizer.

  • An ST map needs to be at least 16 bits to contain enough data.

CG is undistorted so when you integrate it with live action you need to undistort the image and add the CG to the undistortet version. 

Undistortion 

We use reformat to create overscan because the undistortion will expand the pixels outside of the bounding box. 

UD is short for undistortion.

We undistort using a ST map. 

Redistort 

RD means redistort. 

We redistort the image after the undistortion and it goes back to looking like the original footage. 

A separate ST map with redistortion data.

To undistort a plate you start with using reformat to create overscan for the footage. Then we plug in an ST Map to that footage. Then you will get undistortet footage.

ST Map

Overscan

Final footage after UD and RD. It looks identical to the original footage from before the distortion.

 

3D Camera Tracking

General

Tracks only what is static. 

  • It can’t track things that are moving. 
  • People walking or water will confuse the tracker.

You need to know the focal length of the camera. 

Film back size is the camera sensor (aperture). 

It creates tracking in a 3D environment, but the track itself is 2D. 

  • This is because you don’t have scale or rotation data. 

Settings

The first thing you do is plug in the information about the camera, then you go in the settings and adjust the features settings. 

  • In the features you control amount of tracking points, detection threshold and separation between them. 

AutoTracks

  • Graphs that give you information about the tracks

Cleanup

Before solve you go in and delete tracking points that are disturbing the track. 

You need to clean your solve. You should have a solve error of lower than 1. 

  • Something between 1-2 is okay, but aim for below 1. Anything above 2 is not good. 
  • After solve you can use the parameters under AutoTracks to clean the tracks.
    • Max Track Error will adjust the maximum amount of error tracks. 

You should have at least 10 tracking points. 

Make sure you spread you tracking points. The more spread they are, the more parallax you will have. 

You can create a garbage mat with roto to focus on the areas where the tracks need to go, or remove the areas that are messing with the track. This could be water, people or other moving elements. 

After the track is done you can create a scene+. This will create a scene with camera, distortion, point cloud and scanline render. 

Tracks

Tracks after being solved

Garbage Mat

Solved tracks after cleanup.

Pointcloud of the tracking points in 3D view

Pointcloud of the tracking points in 2D view

Node setup with the scene created from the track.

We picked points from the track to set the origin of the ground. Then we also defined Z axis. When that was done I picked a point where I wanted to create a card. Then I connected a color wheel on that card which was then attached to the wall. I did some quick grading to integrate it a little bit just to see better what it would look like.

 

Week 3

  • In todays lesson we started looking at 3D Equalizer, how to use the software and tracked a sequence.

Interface and setting up

When importing a sequence you go to the yellow line under object browser and camera.

 

To cache the sequence you go to playback, then export buffer compression file.

Set the camera settings by clicking on the line below lens. Then in the panel adjust the filmback width, which is the sensor width of the camera, focal length and the pixel aspect.

Right click on a button then you can assign the shortcuts to each button.

Shortcuts:

Z – Jump to start frame
X – Jump to end frame
A – Jump to previous keyframe
S – Jump to next keyframe
D – Delete keyframe
V – Step one frame forward
B – Step one frame back
Q – Track one frame forward
W – Track one frame back
E – End/Start point
R – Flip track direction
T – Track
Y – Center 2D
F – Full frame view

F1 – Overview Controls
F2 – Manual Tracking Controls
F3 – Distortion Grid Controls
F4 – Autotracking Controls
F5 – Lineup Controls
F6 – 3D Orientation Controls

Alt+1 – Object Browser
Alt+2 – Deviation Browser
Alt+3 – Timeline Editor
Alt+4 – Curve Editor
Alt+5 – Attribute Editor
Alt+6 – Parameter Adjustment Editor
Alt+7 – Image Controls Window
Alt+8 – Python Console Window
Alt+9 – Online Help Window
Alt+0 – New 3DE Window

Tracking

There is no going back, so make sure when you set new markers you have deselcted the previous. If not you’ll have to retrack that marker.

Ctrl + Click – Set a tracker
Alt + Click – Deselect tracker

When there is a tracking point that goes out of frame you need to adjust the pattern box before it disappears. Then track it frame by frame and set new endpoint right before it disappears.

When you have similar patterns next to each other make sure to adjust the searchbox, either before or mid track where it starts messing up.

Make sure the pattern box is not spreading over multiple depths because that can confuse it and make the track bad.

When you are done tracking the markers you want to calculate them.
Shortcut is alt + c for that. Then you open the deviation window. Here you can see each point and the green line is the average between all the points. In the lineup window you can check which points might be deviating to much. Select the points in the graph that are way off, and check in the lineup if the red dot stays dead center of the green cross.

Perfectly centered in the cross.

This is what you want to avoid.

In the deviation window you will get a number based on how good the track is. You want a deviation number below 2. It’s gonna get lower the more points you have. However, if it’s not lower when you add points you need to adjust two things. The first thing is the focal length because it might vary based on the distance.

The deviation number went from 2.7 to 0.089 by just adjusting the focal length.

For the distortion you need to change the lens distortion model to Classic LD model. Then select adjust for the distortion and the quartic distortion. Then jump back into the parameter adjustment window, make sure to only have those two parameters, remove any other parameters. Then click adjust, and calculate everything again.

 

 

Set the orientation
Select up to three points that are on the ground in the lineup view. You select by pressing alt + shift then click or drag. Then go into 3D view, press edit, then align X points to and then XZ plane. The next step is to pick a point to set to origin. Same process but select align 1 point to origin.

Locators
To create locators you select all points in the object browser by selecting the first, then holding in shift selecting the last point. Then in 3D viewport you go to geo, then create and locators. If you wanna scale them up or down, select all of them under geo objects in the object browser in the same way as before. Then in 3D viewport in the geo tab just click scale locators down or up.

Add a geometry to check trackIn 3D viewport you click on the 3D models tab, then create, then cube or something else. Then select the point you want the cube to stick to and the cube by holding alt + shift and click or drag. Then in the 3D models tab click snap to point. To adjust the roation and scale you select the cube in 3D view, then click on rotation or scale and adjust from there.