Images are stored in image buffers, whose size depends on the resolution of the image and the number of bands it has. For example, on Matrox Iris GTR 1300, which captures 1280 x 1024 monochrome images, an image buffer is roughly 1.3 Mbytes in size. Whereas, on Matrox Iris GTR 1300C, which captures color images at the same resolution, an image buffer is 3 times larger.
Note that on a supported Matrox smart camera platform, memory is more limited than on a PC runtime platform.
Internal image buffers used for image acquisition include buffers used by the driver, as well as the image queue buffers.
These buffers are typically allocated in a section of memory called non-paged memory, also known as DMA memory. DMA/non-paged memory is a reserved section of physical memory that is not available to general-use applications.
During installation on a PC runtime platform, Matrox Design Assistant reserves 128 Mbytes of memory. For Matrox Iris GTR runtime platforms, the default amount of reserved memory is 64 Mbytes. You can use the MILConfig utility to adjust the quantity of non-paged memory.
The image queue of grabbed images is used to mitigate any variability of the processing time and trigger frequency of each grab. For more information on using image queues, see the Grab timing section in Chapter 28: Acquisition.
If your processing and product trigger times are fairly constant, or if it is guaranteed that a new trigger will never arrive before the current image has been analyzed, you might not need all 4 default grab buffers. To reduce the size of the image queues, open the Cameras page in the Platform Configuration dialog and reduce the value in the Image Queue Size field.
Note that when using multiple physical cameras, each one has its own image queue, and therefore its own grab buffers.
If you are using a very high resolution color camera, you might receive an error message regarding insufficient non-pooled memory. This is because the size of each image in the image queue, multiplied by the number of images in the image queue, is greater than the available space in DMA/non-paged memory.
To avoid the error, you can reduce the number of buffers in the image queue and/or use the MILConfig utility to increase the amount of memory available.
How much memory gets allocated for each step of your flowchart depends on what step is being used, and what operations are being carried out. If you are unexpectedly getting out of memory error messages, consider the following:
Every instance of the ImageProcessing step will allocate 2 image buffers. Additionally, during design-time, it will allocate an additional buffer per operation to allow previewing of all the intermediate results.
Every BlobAnalysis step allocates an internal buffer if the Threshold is different than None, allocates another buffer if Fill holes is enabled, and allocates another buffer if GenerateOutputImage is enabled.
The ModelFinder step allocates memory up to 10 times the size of the target image.
The ColorMatcher step allocates memory up to 6 times the size of the target image.
The AreaOpen operation in the ImageProcessing step allocates memory more than 4 times the size of the image in temporary storage.
Every variable of Type Image allocates an image buffer, and image array variables allocate multiple image buffers.
Every static image is stored in memory.
Every subflowchart that returns an image allocates an image buffer.
When an ImageWriter step is used, the output images are written to an image buffer by a background task, to isolate the processing loop from variations in network or file access times. Additional image buffers can be allocated (up to a maximum of 5) to hold images waiting to be written.
At runtime, filmstrip elements in the operator view will allocate a specific number of buffers, specified by the MaxTrendWithImage property. However, during design-time, no image buffers will be allocated. For more information on filmstrips, see the Structure and memory resources subsection of the Filmstrip section in Chapter 50: Customizing the operator view.