Patch Editor

 

Overview

Patch nodes (or Patches) such as Rectangle, BezierWarp, QuadWarp, and others (see the full list of patch nodes) are designed to apply various types of image* geometry correction (warping), transformation, arrangement, and mapping. Extensive control for the patch management is provided in the Patch Editor integrated into the Canvas (or RenderTarget) Editor widget.** In addition, most operations with the patches can be performed directly from a computer keyboard connected to the Server.

*The term “image” refers to any static or dynamic media (i.e. video).

**To access the Patch Editor, add the Canvas (or RenderTarget) Editor widget to your workspace in the Screenberry Panel and select the Patches option in the view mode dropdown menu (at the top left).

Patch Editor View

The Patch Editor view: (1) Work area interface controls bar, (2) Work Area which is split into two parts: (A) Geometry Layout Area, and (B) UV Layout Area, (3) Displays and Patches List, (4) Settings panel.

Work Area Interface Controls

Show/Hide Layout Areas

Users can choose to display only the Geometry Layout Area or the UV Layout Area, or both by clicking the button  on the interface controls bar to open a multi-select dropdown.

Horizontal and Vertical Split Views

To switch between the horizontal and vertical Geometry and UV Layout split views, use the toggle  / in the interface controls bar.

Zoom and Pan Functions

Тo zoom in and out of a specific area in the Geometry Layout Area or UV Layout Area of the Patch Editor, move the mouse cursor to the location and use the mouse scroll wheel. Alternatively, click the button in the top right corner and move the mouse to change the magnification.

To pan a view, do one of the following:

  • Hold the mouse scroll wheel button (or the Alt key) while moving the mouse.
  • Click the button in the top right corner and move the mouse.

Adding a Patch

Patch nodes are added in the Node Graph (see Adding Nodes). In a typical setup, a patch node is connected to the source image node on the input and the Display or Canvas node on the output.

The BezierWarp receives input from the Media Player and sends output to the Canvas

Deleting a Patch

To delete a patch, right-click on the patch name in the Displays and Patches List and select Delete Patch from the dropdown menu, or delete the related patch node in the Node Graph.

Editing Patches

Selecting a Patch for Editing

To select a patch for editing, сlick on the patch name in the Displays and Patches List in the Canvas (or RenderTarget) Editor widget and make sure that the Patches option is selected in the view mode dropdown menu.

To switch between patches, do one of the following:

  • Press the Z key to go to the next patch, or press Shift + Z to go to the previous patch, 
  • Right-click in the Patch Editor work area and choose Select Next Patch or Select Previous Patch from the dropdown menu.

When a particular patch is selected, its Settings panel opens to provide control over its parameters. 

Multiple patches can be selected at once by Ctrl-clicking or Shift-clicking on the patch names in the Displays and Patches List.

Modifying Image Geometry with Control Points

In the Geometry Layout Area, select and drag the circular handles of the mesh control points to change the image geometry.

Multiple control points can be selected at once by Shift-clicking them one by one, or left-clicking and dragging a marquee box around them.

Note:
It is recommended to have visual control over Screenberry output while making image geometry adjustments.

Adjusting UV Mapping

In the UV Layout Area,  select and drag the circular handles to modify the control point coordinates of the mapping mesh for the source image.

Note:
The mapping mesh should not extend beyond the edges of the source image.

Setting Control Points Coordinates

To show control points coordinates, press the Spacebar, or right-click in the Patch Editor work area and select Show Coordinates from the dropdown menu.

To change control point coordinates manually, select the control point and press the Enter key, or right-click on the control point and select Set Position from the dropdown menu. Enter X and Y coordinates in the dialog window.

Note:
The coordinate origin (0,0) is located at the top-left corner.

Flipping and Rotating the Patch Indexes

You can apply a vertical flip or 90 degrees clockwise rotation to the source media in the Geometry Layout Area, or to a UV selection in the UV Layout Area.

To flip, select a control point and press the F key, or right-click on a control point and select Transform>Flip from the dropdown menu.

To rotate, select a control point and press the R key, or right-click on a control point and select Transform>Rotate Indexes from the dropdown menu.

Note:
Selecting a control point when flipping or rotating the image helps to understand which transformation has been performed in relation to geometry and UV layouts.

Modifying Density of a Mesh Grid

You can change the density of the mesh grid to achieve more control over the image geometry correction.  

To change the mesh grid density, use the related keyboard shortcut, or right-click in the Patch Editor work area and select Subdivide/Merge/[Function] from the dropdown menu.

Available functions and related keyboard shortcuts:
Increase Subdivision (Ctrl + X) splits the edges and faces by cutting them in half and adding new vertices.
Decrease Subdivision (Ctrl + Shift + X) combines the neighboring polygons by removing their shared boundary.
Subdivide Columns (Ctrl + Shift + Right) splits the edges and faces of all columns by cutting them in half, and adding new vertices.
Merge Columns (Ctrl + Shift + Left) combines the neighboring polygons of all columns by removing their shared boundary.
Subdivide Rows (Ctrl + Shift + Up) splits the edges and faces of all rows by cutting them in half, and adding new vertices.
Merge Rows (Ctrl + Shift + Down) combines the neighboring polygons of all rows by removing their shared boundary.

Guidelines

When the position of the control points is edited, the green dotted horizontal and vertical smart guides are displayed. They provide a visual reference to the previous coordinates of the control point and help with its alignment along the prior axes.

In addition, when the position of the control points for the Rectangle patch in the Geometry Layout Area is modified, the diagonal white dotted smart guide, which corresponds to the aspect ratio of the source image based on its UV coordinates, is also displayed.

To add custom guidelines, right-click in the Patch Editor layout area and select Guideline Editor from the dropdown menu. In the dialog box, do one of the following:

  • Create the guideline grid by entering the number of Columns and Rows and pressing the Add Grid button.
  • Add individual guidelines by entering their coordinates and pressing the Add Horizontal Guideline or Add Vertical Guideline buttons. 

Press the Clear All button if you want to remove all guidelines.  After the guidelines setup is finished, press the OK button to add guidelines to the layout area.

Snapping

By default, the automatic snapping option is enabled. When you change the position of a control point, it snaps to the guidelines, smart guides, output canvas edges, and other control points if placed near them. To disable snapping temporarily while dragging a control point, hold down the Shift key.

Vertical and Horizontal Alignment of the Control Points

To align the selected control points horizontally press Shift + H or right-click on the selected control points and choose Align Horizontally from the dropdown menu.

To align the selected control points vertically press Shift + V or right-click on the selected control points and choose Align Vertically from the dropdown menu.

While editing, you can also constrain the movement of the control points:

  • To the horizontal axis by pressing the H key or right-clicking on the control point and selecting Constrain Horizontally from the dropdown menu. 
  • To the vertical axis by pressing the V key or right-clicking on the control point and selecting Constrain Vertically from the dropdown menu. 

Setting the Background Image

Setting the background image provides visual cues for the finer positioning of control points.

To set or refresh the background image, select the layout area and press F5. As a result,

  • In the Geometry Layout Area, the snapshot of the current video output of the media server will be loaded.
  • In the UV Layout Area, the snapshot of the source feed received by the patch will be loaded.

Pressing Shift + F5 removes the background image.

To set the uploaded file (for example, the photo of the object the warping is applied to) as a background image, press Shift + F5 or right-click in the Patch Editor work area and select Set Background Image from File from the dropdown menu.

Selecting a Display Mode for the Output

You can select one of the three available display modes by choosing the View Mode parameter in the Settings panel of the patch:

  • Texture shows the output image only.
  • Texture + Cage shows the output image and mesh grid (red lines).
  • Texture + Wireframe shows the output image, mesh grid (red lines), and subdivision wireframe (grey lines).

Example of the PerspQuad patch output in Texture mode

Example of the PerspQuad patch output in Texture + Cage mode

Example of the PerspQuad patch output in Texture + Wireframe mode

Modifying Density of a Subdivision Wireframe

The overall smoothness of the output image (the result of warping applied by the patch) can be improved by increasing the density of a subdivision wireframe. This results in a finer warping grid.

You can change the number of subdivisions by entering a value for the Subdivisions parameter in the Settings panel of the patch. The maximum value is 256, the minimum is 1, and the default is 5.

An example of how changing the wireframe subdivisions from 5 to 20  improves the smoothness of the output image

Note:
The number of subdivisions determines the wireframe density. A higher grid density increases warping precision but requires more processing time, a lower one does the opposite.

Selecting the Interpolation Algorithm

You can choose the Linear or Nearest-neighbor interpolation algorithm for translating pixel values of the patch by selecting the Scaling Algorithm parameter in the Settings panel.

Changing Patch Opacity and Edge Transparency

To change the patch opacity, enter a value for the Opacity parameter in the Settings panel.

To feather the edges of a patch, enter the number of pixels for the Soft Edge parameter in the Settings panel of the patch.

Applying Transformations to the Patch

Various transformations can be applied to the patch by using the transformation matrix. Click the Edit button for the Transform Matrix parameter in the Settings panel of the patch to edit the matrix values.

Examples of transformations:

sx000
0sy00
0010
0001
Scale:

sx specifies the scale factor along the x-axis.

sy specifies the scale factor along the y-axis.

1000
0100
0010
txty01
Translation:

tx specifies the displacement along the x-axis.

ty specifies the displacement along the y-axis.

1shy00
shx100
0010
0001
Shear:

shx specifies the shear factor along the x-axis.

shy specifies the shear factor along the y-axis.

100tx
010ty
0010
0001
Tilt:

tx specifies the tilt factor along the x-axis.

ty specifies the tilt factor along the y-axis.

Locking Patch Geometry

To avoid further (accidental) editing of the patch geometry, select the Lock Geometry checkbox in the Settings panel of the patch.

Note:
Patches with the Lock Geometry checkbox selected are skipped during cycling through the patches using Z (next patch) and Shift + Z (previous patch) keyboard shortcuts directly on the Server.

Using the GridImage Node as a Test Pattern

For more efficient and convenient patch editing, it is recommended to use the GridImage node connected to the patch node as the source image.

The GridImage node generates a test grid pattern that can be modified using various parameters in the node settings.

A default test grid pattern generated by the GridImage node

Restoring Patch Default Settings

To restore the default settings of a patch, right-click on the patch name in the Displays and Patches List and select Reset Patch from the dropdown menu.

Using Keyboard Shortcuts to Edit Patches

Keyboard shortcuts can be used for more effective patch editing. If necessary, manual calibration can also be performed directly on the server, without using the Screenberry Panel, and requires only a keyboard connected to the Server computer.  Keyboard shortcuts list:

 

ActionPanel ShortcutServer Shortcut
General
Enter/Exit calibration mode Ctrl + C
Show keyboard shortcuts list F1H or F1
UndoCtrl + ZCtrl + Z
RedoCtrl + Shift + ZCtrl +Shift + Z or Ctrl + Y
Reset patch geometry and UVCtrl + RCtrl + R
Patch Selection
Select the next patchZZ
Select the previous patchShift + ZShift + Z
Patch Editing Modes
Switch to Geometry mode (the mesh is highlighted in red)G (press G again to show/hide subdivisions)
Switch to UV mode (the mesh is highlighted in green)UU
Switch to Geometry+UV mode (the mesh is highlighted in blue)Y
Show/hide all patch cages and wireframesSpace
Increment Value (for movement, scale and rotation operations)
Increase increment+ or ==
Decrease increment (minus) or  _ (underscore)_ (underscore)
Reset increment to default0 (zero)0 (zero)
Control Points
Select control pointArrow keysArrow keys
Select mesh faces (for the TriMesh patch only)Ctrl + Arrow keys
Move control pointW, S, A, DW, S, A, D
Move control point in smaller (1/10) incrementsShift + W, S, A, DShift + W, S, A, D
Control Cage
Move cageCtrl + W, S, A, DCtrl + W, S, A, D
Move cage in smaller (1/10) incrementsCtrl + Shift + W, S, A, DCtrl + Shift + W, S, A, D
Scale cageAlt + W, S, A, DAlt + W, S, A, D
Scale cage in smaller (1/10) incrementsAlt + Shift + W, S, A, DAlt + Shift + W, S, A, D
Rotate cage clockwiseEE
Rotate cage clockwise in smaller (1/10) incrementsShift + EShift + E
Rotate cage counterclockwiseQQ
Rotate cage counterclockwise in smaller (1/10) incrementsShift + QShift + Q
Flip cage verticallyFF
Rotate cage 90 degrees clockwiseRR
Control Point Handles
Rotate handle 90 degrees clockwiseCtrl + E
Rotate handle clockwise in smaller (1/10) incrementsCtrl + Shift + E
Rotate handle 90 degrees counterclockwiseCtrl + Q
Rotate handle counterclockwise in smaller (1/10) incrementsCtrl + Shift + Q
Control Cage Density
Increase cage subdivisionCtrl + XCtrl + X
Decrease cage subdivisionCtrl + Shift + XCtrl + Shift + X
Increase rows subdivisionCtrl + Shift + Up ArrowCtrl + Shift + Up Arrow
Decrease rows subdivisionCtrl + Shift + Down ArrowCtrl + Shift + Down Arrow
Increase columns subdivisionCtrl + Shift + Right ArrowCtrl + Shift + Right Arrow
Decrease columns subdivisionCtrl + Shift + Left ArrowCtrl + Shift + Left Arrow
Increase wireframe subdivisionCtrl + =Ctrl + =
Decrease wireframe subdivisionCtrl + _ (underscore)Ctrl + _ (underscore)
Blending
Rebuild blend maps (if the SoftEdgeBlender node is connected)Ctrl + BCtrl + B
Increase transparency falloff area at the selected control point (5% increments)[[
Decrease transparency falloff area at the selected control point (5% increments)]]

Visual Examples of Using Keyboard Shortcuts on the Server

Selecting the Patch

Patch Editing Mode Selection

Selecting and Moving Control Points

Selecting Faces of the Patch Mesh (only for the TriangleMesh patch)

Moving and Scaling All Control Points of the Patch Mesh at Once

Changing the Editing Step Increment

Flipping and Rotating the Patch Mesh

Changing the Direction of the Control Point Handle

Modifying the density of the patch grid