Operator Library: Synchronization
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.
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.
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 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:
Synchronization between 0D images is a pure time synchronization since 0D images have no image dimensions.
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.
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.
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.
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.
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 | |
---|---|
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:
|
More information on the different image protocols can be found in 'Image Protocols, Image Dimensions and Data Structure'.
Property | Value |
---|---|
Operator Type | M |
Input Links | I[0], data input I[k], data input |
Output Link | O[k], data output |
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]. |
|
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. |
|
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. |
|
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.
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. |
The use of operator SYNC is shown in the following examples:
-
'M-type Operators with Multiple Inputs'
Synchronization Rules - Use of the SYNC Operator
-
Synchronization - Avoiding deadlocks.
-
'Combine Image Data From Two Camera Sources - Building an Overlay Blend'
Tutorial - Synchronizing two cameras.
-
Tutorial - Basic Acquisition
-
'Grayscale Camera Link Full Area'
Tutorial - Basic Acquisition
-
Examples - A high speed and robust laser line detection algorithm. The algorithm determines center of gravity coordinates to obtain sub-pixel resolution results.
-
Example - Histogram thresholding
-
'Bayer De-Mosaicing Algorithm According to Laroche'
Examples - Laroche Bayer De-Mosaicing filter
-
'Modified Laroche Bayer De-Mosaicing Algorithm '
Examples - Ressource Optimized Laroche Bayer De-Mosaicing filter
-
Examples - Calculates the differences between two successive images. The differences are thresholded and output via DMA channel.
-
'High Dynamic Range and Low Dynamic Range Example Using Camera Response Function'
Examples - High Dynamic Range According to Debevec
-
'High Dynamic Range and Low Dynamic Range Example with a Weighted Linear Ansatz'
Examples - High Dynamic Range with Linear Ansatz
-
'A rolling average is applied on a dynamic number of images'
Examples - Rolling Average - Loop
-
'Depth From Focus Using Loops'
Examples - Depth From Focus using Loops
-
'2D Shading Correction / Flat Field Correction'
Examples - The example shows the implementation of a 2D shading correction. Correction values are stored in frame grabber RAM. The applet performs a high precision offset and gain correction.
-
'2D Shading Correction / Flat Field Correction Using Operator RamLUT'
Examples - The example shows the implementation of a 2D shading correction. Correction values are stored in the operator RamLUT. The applet performs a high precision offset and gain correction.