Operator Library: Memory
This operator buffers the image stream in the Frame Grabber RAM (DRAM). One VisualApplets resource of type RAM is required. Check 'Allocation of Device Resources' for more information. The operator additionally features region-of-interest (ROI) support. The total number of bits (bit width times parallelism) must not exceed the memory limitations of the respective frame grabber.
For information on the latency of the operator, see Table 43, 'Individual Latencies of the Operators in Library Memory'.
The operator works like a FIFO. Any input data is immediately forwarded to the output. However, if the output is blocked, for example, because the following operators cannot process the input bandwidth, the operator will store the data. Thus, the memory will only be filled if the operator cannot output the data. Often, the operator is used to compensate peak input bandwidths.
Internally, the image buffer operates on image lines. This internal line buffer feature results in a very short memory latency. Of course, latency increases if the buffer is filled with more lines. For example, images which are transfered into the memory will be immediately forwarded to the output. In an application, partial camera images can be forwarded to the PC while the camera still transfers the remaining image lines.
Using the parameters XOffset, XLength, YOffset and YLength you can define the ROI size. If the input image width is less than the sum of the XOffset and XLength, the operator will still read the parameterized XLength. In this case, the operator will output undefined memory content for the additional pixels. If the input image height is less than the requested output image height, the operator will only output the available lines.
In Line1D application mode, the YOffset and YLength settings do not affect the buffer.
To measure the fill level of the buffer, the operator provides 2 parameters: FillLevel and Overflow. FillLevel shows the fill level of the RAM in 25% steps. The Overflow parameter is set to 1 when FillLevel is close to or equal to 100% and the next image to be stored in the buffer will exceed the RAM capacity. In case of an overflow, input data is discarded and the input image height is reduced. Thus, incomplete images are stored in the memory. Users have to poll for the overflow parameter. As the duration of the overflow state can be very short, it is possible that it occurs within the polling cycle of the operator.
The parameter InfiniteSource is used to specify if the operator is directly connected to a camera or is sequenced with other memory operators. Check 'Infinite Sources / Connecting Cameras' for more information.
Operator Restrictions
-
Empty frames are not supported.
Available Memory Space | |
---|---|
The operator needs additional memory space for internal data. Thus, not the full amount of the used RAM resource can be used for buffering image data. The space actually available for buffered image data depends on the hardware platform (Platform RAM Size and Platform RAM Interface Width) and on the link configuration. For information on Platform RAM Size and Platform RAM Interface Width, see Appendix. Device Resources.) You can calculate the available capacity of the RAM resource using the following formulas:
Abbrevations used in the formulas and units of measure:
|
The theoretical bandwidth [bits/second] going through an operator that uses the Frame Grabber RAM (DRAM) is calculated in accord with the following formula:
However, the actual bandwidth is always less than the theoretical bandwidth due to the DRAM efficiency.
The maximum bandwidth going through the operator is reached if the product of Bit Width and Parallelism is equal to the internal RAM Port Width.
Platform-specific values | |
---|---|
RAM Port Width and System Clock are platform-specific. See Appendix. Device Resources for detailed information on your individual platform. |
Property | Value |
---|---|
Operator Type | M |
Input Link | I, image data input |
Output Link | O, data input |
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 product of the bit width and the parallelism must not exceed the native ram data width. Check Appendix. Device Resources for more information. |
XOffset | |
---|---|
Type | dynamic/static read/write parameter |
Default | 0 |
Range | [0, Max.Img Width - XLength] |
This parameter defines the x-coordinate of the upper left corner of the ROI. The step size is the parallelism. |
XLength | |
---|---|
Type | dynamic/static read/write parameter |
Default | 1024 |
Range | [2*parallelism, Max.Img Width - XOffset] |
This parameter defines the width of the ROI. The step size is the parallelism. |
YOffset | |
---|---|
Type | dynamic/static read/write parameter |
Default | 0 |
Range | [0, Max.Img Height - YLength] |
This parameter defines the y-coordinate of the upper left corner of the ROI. |
YLength | |
---|---|
Type | dynamic/static read/write parameter |
Default | 1024 |
Range | [1, Max.Img Height - YOffset] |
This parameter defines the height of the ROI. |
FillLevel | |
---|---|
Type | dynamic read parameter |
Default | 0 |
Range | [0%, 100%] |
This parameter provides the fill level of DRAM in 25% steps. |
Overflow | |
---|---|
Type | dynamic read parameter |
Default | 0 |
Range | [0, 1] |
This parameter indicates a buffer overflow. |
InfiniteSource | |
---|---|
Type | static parameter |
Default | ENABLED |
Range | {ENABLED, DISABLED} |
This parameter activates support for infinite source operators like Camera operators. See 'Infinite Sources / Connecting Cameras' for more information. |
The use of operator ImageBuffer is shown in the following examples:
-
Getting Started
-
Figure 9, 'Simple VisualApplets Design'
Basic Principles - Learn the Idea of VisualApplets
-
Data Flow - Learn about the Pipeline Structure used in VisualApplets
-
Synchronization Rules - The use of the operator in an O-type Network.
-
'Infinite Sources / Connecting Cameras'
Infinite Sources - Connecting operators to cameras. (DRC2 Latency Error)
-
Design Parameterization
-
Design Parametrization - Disabled Parameters
-
'Illegal Parameter Value States'
Design Parametrization - Illegal Parameter Value
-
'Allocation of Device Resources'
Learn the allocation of the device resources of the operator.
-
Figure 212, 'Illegal Condition after Link Property Change'
Tutorial Basic Acquisition - Illegal Condition at ImageBuffer operator
-
Examples - A simple example which shows the usage of the JPEG operators.
-
'JPEG Compression Using Operator JPEG_Encoder'
Examples - Simple examples which show the usage of the operator JPEG_Encoder.
-
'JPEG Color Compression Using User Library Elements'
Examples - Simple examples which shows the usage of the JPEG user library elements for color JPEG compression.
-
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
-
Examples - Shows the usage of operator Blob_Analysis_1D in line scan applications.
-
Examples - The blob analysis operator is applied to an input camera image. The applet shows the usage of the blob data in the applet. In this case, the object with the maximum are is localized and the coordinates are used to cut out the object from the original image.
-
Example - The image dimension is measured and can be used to analyze the design flow.
-
Example - While image timing is provided by a generator the designs data flow can be analyzed.
-
Example - For debugging purposes images can be inserted manually.
-
Examples - Calculates the differences between two successive images. The differences are thresholded and output via DMA channel.
-
'Filter for Line Scan Cameras'
Examples - Explains how to implement a filter for line scan cameras.
-
'A rolling average is applied on a dynamic number of images'
Examples - Rolling Average - Loop