Operator SYNC

The operator SYNC performs time and image dimension synchronization of all input links. The number of links which have to be synchronized is specified upon operator instantiation. The output images on all output links are synchronous, i.e., they are output at the same time and they all have the same image dimension. Thus, the operator synchronizes asynchronous links so that they are O-synchronous and can be used in an O-type VisualApplets operator network.

The operator does not support empty lines or empty frames.

In case of mixed domain synchronization like 2D with 1D and 0D streams, the operator converts the output links to the highest input domain. When using SYNC to synchronize a 2D link with a 1D link, both output links will be set to the 2D format. An error will be issued if the 1D link doesn't provide enough lines. When using the operator to synchronize 1D links with 0D links, all output links will be in the 1D format. In this case, an error will be issued if the 0D link doesn't provide enough pixels.

In case of input images with different image dimensions, the operator synchronizes the images so that all output images have the same size.

[Tip] Synchronization Rules

Before using the SYNC operator, ensure that you understand all synchronization rules. User manual and Tutorial explain the synchronization rules in detail, see:

Both, the timing synchronization and the image dimension synchronization, are explained in the following.

The Timing Synchronization

During transmission of the pixels, pauses can occur due to the flow control or the link bandwidth exceeding the bandwidth of the image source. The figure above shows how the time synchronization is performed for 2 links. Both input links have a different timing. However, the output link data is synchronized, i.e., the pixels are output at the same time on all links.

The operator acts like a valve for all input links: The input links are closed until a valid pixel is present on all inputs. The operator will then forward the pixels of all inputs to the output, i.e., open the valve.

The Image Dimension Synchronization

The SYNC operator is capable of synchronizing images using different image protocols VALT_IMAGE2D, VALT_LINE1D or VALT_PIXEL0D. The following three figures illustrate some images of the different image protocols.

  • 2D

    2D images have a finite height H and a finite width W. The first image shown in the figure is a regular 2D image. The 2nd image is an irregular 2D image having different line lengths.

  • 1D

    1D lines have a finite width W but an infinite height. Images of these types are usually created in line scan applications. Again, the second image illustrated in the figure has different line lengths.

  • 0D

    0D streams do not have any width or height. These streams are infinite data streams.

The image dimension synchronization is applied if the images on the input links have different image dimensions, i.e., a different width (or line length) and a different height. The image dimension synchronization guarantees that all images at the output are of the same dimension. The SYNC operator supports 2 synchronization modes: synchronization to the smallest image (SyncToMin) and synchronization to the largest image (SyncToMax). You select the synchronization mode via parameter SyncMode. The SyncToMin mode cuts larger images to fit into the smallest one. The SyncToMax mode expands small images to fit the largest one. The missing pixels are filled with dummy zero pixels (black pixels). Combining these 2 modes with the 3 different image domains, the following base synchronization combinations are possible:

2D to 2D SyncToMin

2D to 2D SyncToMax

The padding pixels are zero pixels.

1D to 1D SyncToMin

1D to 1D SyncToMax

The padding pixels are zero pixels.

0D to 0D SyncToMin / SyncToMax

Synchronization between 0D images is a pure time synchronization since 0D images have no image dimensions.

2D to 1D SyncToMin

SyncToMin synchronization for 2D to 1D images performs an image dimension synchronization of the width. The output images keep the image height of the input 2D image. The 1D line stream is split into images which have the same height as the 2D image.

2D to 1D SyncToMax

SyncToMax synchronization for 2D to 1D images performs an image dimension synchronization of the width. The output images keep the image height of the input 2D image. The 1D line stream is split into images which have the same height as the 2D image.

2D to 0D SyncToMin / SyncToMax

Since 0D data streams have no shape the 2D to 0D synchronization is a simple bypass of both links. Of coures, the SYNC operator still performs the timing synchronization There is no difference between the SyncToMin and SyncToMax operation for this combination.

1D to 0D SyncToMin / SyncToMax

Since 0D data streams have no shape the 1D to 0D synchronization is a simple bypass of both links. Of coures, the SYNC operator still performs the timing synchronization There is no difference between the SyncToMin and SyncToMax operation for this combination.

2D to 1D to 0D SyncToMin / SyncToMax

This operation is a combination of 2D to 1D and 2D to 0D and 1D to 0D operations. The 2D image and the 1D line stream are synchronized in line lengths. The 1D link must provide at least the amount of lines the 2D image contains. Also the 0D link must provide at least the amount of pixels the result of 2D to 1D synchronization produces. If both of these conditions are fulfilled, the operator will output the result.

[Caution] Caution

Warning: Simulation of mixed operaton modes like 2D to 1D or 1D to 0D or any combination of all 3 requires the following conditions to be met:

  1. The links with inifinite height but finite width, i.e. 1D links, must contain at least the maximal (SyncToMax) / minimal (SyncToMin) amount of lines of all 2D channels participating in the synchronization.

  2. The links with infinite width and height, i.e. 0D links, must provide at least the maximal (SyncToMax) / minimal (SyncToMin) amount of pixels the result of all 2D to 2D and 2D to 1D operations can produce.

  3. Simulation of image sequences for mixed domain synchronization is not possible unless a special condition is met, because an infinite line cannot have a sequence on lines, otherwise it would not be infinite anymore. The same applies for the height. If the height is finite, it is not a 1D link but a 2D link. To simulate a sequence of images on all links, the amount of pixels on 0D channel must be exactly the same as the amount of pixels after 2D to 1D synchronization. The amount of lines on 1D channels must be exactly the same as the result after 2D to 1D synchronization. The exceeding lines (1D) respectively the exceeding pixels (0D) will not carry over to the next image sequence.

More information on the different image protocols can be found in 'Image Protocols, Image Dimensions and Data Structure'.

I/O Properties

Property Value
Operator Type M
Input Links I[0], data input
I[k], data input
Output Link O[k], data output

Supported Link Format

Link Parameter Input Link I[0] Input Link I[k] Output Link O[k]
Bit Width [1, 64]1 [1, 64]2 as I[k]
Arithmetic {unsigned, signed} {unsigned, signed} as I[k]
Parallelism any as I[0] as I[0]
Kernel Columns any any as I[k]
Kernel Rows any any as I[k]
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} auto3
Color Format any any as I[k]
Color Flavor any any as I[k]
Max. Img Width any any auto4
Max. Img Height any any auto5

1 2

The range of the input bit width is [1, 64] for unsigned inputs. For signed inputs, the range is [2, 64]. For unsigned color inputs, the range is [3, 63] and for signed color, the range is [6, 63].

3

The output image protocol is VALT_IMAGE2D if at least one of the inputs is VALT_IMAGE2D otherwise VALT_LINE1D if at least one of the input is VALT_LINE1D. VALT_PIXEL0D of all inputs have image protocol VALT_PIXEL0D.

4

If parameter SyncMode is SyncToMin the maximum ouput image width is the minimum of the input maximum image widths. If the parameter is set to SyncToMax the maximum ouput image width is the maximum of the input maximum image widths.

5

If parameter SyncMode is SyncToMin the maximum ouput image height is the minimum of the input maximum image heights. If the parameter is set to SyncToMax the maximum ouput image height is the maximum of the input maximum image heights.

Synchronous and Asynchronous Inputs

  • All inputs are asynchronous to each other i.e. they may be sourced by different M-type operators through an arbitrary network of O-type operators.

Parameters

SyncMode
Type static parameter
Default SyncToMin
Range {SyncToMin, SyncToMax}

The parameter specifies the mode of operation: In SyncToMin mode the operator will synchronize all input images to the smalles image, i.e. cutting larger images. In SyncToMax mode the operator will expand all smaller images to the largest image. See descriptions above.

Examples of Use

The use of operator SYNC is shown in the following examples: