C_VerticalAligner
C_VerticalAligner, based on Ocula's O_VerticalAligner, eliminates vertical differences between stereo camera pairs while maintaining horizontal pixel positions. C_VerticalAligner is predominantly designed for use in rectilinear space, but it can also warp in latlong space to provide better results from fisheye lenses.
C_VerticalAligner includes a discrete solver allowing you to use it independently, but it can also ingest metadata from C_CameraSolver and pass it downstream to C_Stitcher to improve stitch results between camera pairs in a stereo rig.
Inputs and Controls
Connection Type |
Connection Name |
Function |
Input |
Source |
The stereo camera pair to align. The cameras can be either: • A stereo pair of images containing rig metadata from C_CameraSolver, or • A stereo pair of images passed through a JoinView node. |
Control (UI) |
Knob (Scripting) |
Default Value |
Function |
C_VerticalAligner Tab |
|||
Input |
|||
Left View |
letfView |
main |
Sets the view to use for the left eye when calculating alignment. |
Right View |
rightView |
main |
Sets the view to use for the right eye when calculating alignment. |
Align |
alignWhat |
Both Views |
Sets how the misalignment between views is corrected: • Both Views - aligns both views equally. • Left to Right - align the left view to the right view. • Right to Left - align the right view to the left view. |
Pass-through Other View |
passThroughOther |
disabled |
When enabled, the passive view is not transformed or projected into spherical space. |
Camera Layout |
layoutType |
Default (Source) |
Sets the expected camera layout for alignment: • Default (Source) - uses metadata ingested from C_CameraSolver to determine the camera positions before alignment. • Stereo Layout - uses the internal feature solver to determine camera positions before alignment. |
Keying |
|||
Analysis Keys |
Key number |
1 |
Displays the total number of analysis keyframes added to the sequence. |
Key count |
1 |
Displays the current analysis keyframe. |
|
|
N/A |
N/A |
Click to jump to the previous keyframe. |
|
N/A |
N/A |
Click to jump to the next keyframe. |
|
N/A |
N/A |
Click to add a keyframe at the current frame in the sequence. |
|
N/A |
N/A |
Click to delete the keyframe at the current frame in the sequence. |
Step |
keyStep |
30 |
Sets the interval between keyframes for the Key All button. |
Key All |
addAllAnalysisKeys |
N/A |
Click to add keyframes to the sequence at intervals set by the Step control. |
Delete All |
deleteAllAnalysisKeys |
N/A |
Click to delete all keyframes from the sequence. |
Import |
importAllKeys |
N/A |
Click to import existing keyframes automatically from existing nodes in the current script. Note: Importing keyframes deletes any existing keyframes. |
Analysis |
|||
Match |
match |
N/A |
Click to calculate and correct the mismatch in vertical alignment using feature matches in the sequence. |
Error Threshold |
errorThreshold |
10 |
Sets the error level permitted, below which matched features are rejected. Reducing the allowed error level dynamically rejects features that fall out side the new level, allowing you to easily reject them and refine the match. |
Output |
|||
Alignment Space |
alignmentSpace |
Spherical |
Sets whether the alignment occurs in Rectilinear or Spherical space. |
Converge |
convergeDepth |
10 |
Sets the depth at which the cameras overlap, allowing you to bring particular areas in the scene into focus. Convergence can be used to align input images before stitching to reduce vector warp artifacts. |
Auto |
autoConvergenceDepth |
enabled |
When enabled, the Converge control is set automatically by upstream metadata. When disabled, you can use the Converge control to manually adjust what convergence depth is in focus. |
Format |
outputFormat |
dependent on Compositing environment Project Settings |
Sets the output resolution passed down the node tree. Typically, you would set the format globally in the Project Settings, but this control overrides the global setting. |
filter |
filter |
Lacnzos6 |
Sets the filtering algorithm you want to use when remapping pixels from their original positions to new positions. This can help to avoid problems with image quality, particularly in high contrast areas of the frame (where highly aliased, or jaggy, edges may appear if pixels are not filtered and retain their original values). • Impulse - remapped pixels carry their original values. • Cubic - remapped pixels receive some smoothing. • Keys - remapped pixels receive some smoothing, plus minor sharpening. • Simon - remapped pixels receive some smoothing, plus medium sharpening. • Rifman - remapped pixels receive some smoothing, plus significant sharpening. • Mitchell - remapped pixels receive some smoothing, plus blurring to hide pixelation. • Parzen - remapped pixels receive the greatest smoothing of all filters. • Notch - remapped pixels receive flat smoothing (which tends to hide Moiré patterns). • Lanczos4 - remapped pixels receive some sharpening which can be useful for scaling down. • Lanczos6 - remapped pixels receive moderate sharpening which can be useful for scaling down. • Sinc4 - remapped pixels receive sharpening which can be useful for scaling down. |
Settings Tab |
|||
Preset |
Full |
Full |
Sets the type of global alignment correction to apply: • Custom - manually define the types of alignment you want to include using the checkboxes. • Transform - perform a 2D correction without any change in pixel aspect or skew. • Match Camera - perform a correction using a match move camera connected to an upstream C_CameraSolver. • Keystone Only - correct vertical alignment without changing the parallax. • Full - applies all alignment options except Vertical skew. Each option is applied in order from top to bottom. |
Camera correction |
alignCamera |
disabled |
When enabled, correct the vertical alignment for a match-move camera connected to an upstream C_CameraSolver. If there is no camera connected, this uses the internal camera calculated by C_VerticalAligner. The correction is refined by other the alignment options that are selected. |
Focal length |
alignScale |
enabled |
When enabled, align feature matches by calculating a 2D scale to correct focal length differences. |
Vertical shift |
alignShift |
enabled |
When enabled, align the feature matches vertically by moving the entire image up or down. Calculate a 2D vertical shift to correct a global offset. |
2D rotation |
alignRotate |
enabled |
When enabled, align the feature matches vertically by rotating the entire image around a point. The center of the rotation is determined by the algorithm. This helps correct in-plane camera roll. |
Perspective warp |
alignPerspective |
enabled |
When enabled, perform a four-corner warp on the images to align them on the y axis. This may move the features slightly along the x axis. Perspective warp can help correct camera tilt as well as roll. Note: Enabling Perspective warp can alter pixel aspect ratio and introduce pixel skew. |
Vertical skew |
alignVerticalSkew |
enabled |
When enabled, align the features along the y axis using a skew. This does not move the features along the x axis. Vertical skew allows you to correct keystoning without changing horizontal disparity. This varies the vertical shift across the image without changing the horizontal position of pixels. Note: Enabling Vertical skew can introduce pixel skew. |
Local |
|||
Local alignment |
localAlignment |
disabled |
When enabled, rebuild the view(s) to remove vertical disparity. Use this mode to create a per-pixel correction if there are any local distortions and changes in alignment with depth. Note: This option requires a disparity channel from an upstream C_DisparityGenerator. |
Pre-blur |
disparityBlurSize |
16 |
Sets the size of the blur applied before performing a local alignment. To smooth out the correction across depth boundaries, increase the blur size. |
Correction |
localCorrection |
1 |
Sets the amount of local correction to apply between the global transform at 0 and the full correction at 1. This would be useful, for example, if you want to tone down the local distortion that is applied. |
Fix Scale |
|||
Zoom to prevent black in frame |
scaleToFit |
disabled |
When enabled, scale the image in order to prevent pulling pixels from outside the input image. To minimize the scale, change the Align dropdown to Both Views. Warning: The scale has to be applied to both images, even when aligning Left to Right or Right to Left. |
Calculate scale |
calculateScale |
N/A |
Click to calculate the scale at the current frame. If the alignment options change, the scale needs to be recalculated. You can lock the scale correction to prevent any changes by enabling Lock scale. |
Lock scale |
lockScale |
disabled |
When enabled, the Calculate scale and Scale controls are disabled to prevent unwanted changes. |
Scale |
scale |
1 |
Sets the global scale that is applied to prevent black in the frame. You can set a key to interpolate the scale calculated at different frames. Warning: Animating the Scale control creates a dynamic zoom on the shot, which may not be the original intent. In this case, it is recommended to use a static zoom from a single frame, to preserve the original intent of the shot. |
Fix Offset |
|||
Preserve subject parallax |
fixParallax |
disabled |
When enabled, shift the image in a way that preserves the parallax at the specified Fix Point. Note: This option requires a disparity channel from an upstream C_DisparityGenerator. |
Fix point (xy) |
fixPoint |
0, 0 |
Sets the position of the Fix point widget to sample the input disparity and update the applied offset to preserve parallax. |
Lock offset |
lockOffset |
disabled |
When enabled, the Fix point and Offset controls are disabled to prevent unwanted changes. |
Offset |
offset |
0 |
Sets the correction, in pixels, that is applied to prevent parallax changes at the Fix point. To interpolate the offset calculated at different frames, set a key. |
Python Tab (These controls are for Python callbacks and can be used to have Python functions automatically called when various events happen in Nuke.) |
|||
before render |
beforeRender |
none |
These functions run prior to starting rendering in execute(). If they throw an exception, the render aborts. |
before each frame |
beforeFrameRender |
none |
These functions run prior to starting rendering of each individual frame. If they throw an exception, the render aborts. |
after each frame |
afterFrameRender |
none |
These functions run after each frame is finished rendering. They are not called if the render aborts. If they throw an exception, the render aborts. |
after render |
afterRender |
none |
These functions run after rendering of all frames is finished. If they throw an error, the render aborts. |
render progress |
renderProgress |
none |
These functions run during rendering to determine progress or failure. |