1. "Does IPCore require Full Image Buffers ?"

Every few months, the question of whether IPCore requires full image buffers resurfaces somewhere in the Corporation, so it is time to put this issue to rest once and for all.

First of all, this is really an ill-posed problem. A better question might be: "Does IPCore require full page buffers in order to do operation X?". An even better question would be: "What is the high-water mark in term of memory usage required by IPCore to do operation X, based on input Y?". For example, one might be interested in knowing how much RAM is required by IPCore to run a despeckle operation, based on a 3000x4000 binary input buffer.

IPCore is a set of libraries composed of two separate chunks: (1) IPShared, which is a set of very low-level image processing libraries, essentially a very careful and efficient implementation of a number of low-level, deterministic image operations (e.g., rotation, morphological dilation/erosion, bit-depth conversion, dithering, scaling, connected component extraction, etc.) (2) IPWrap, which, as the name indicates, contains "wrapper" routines, among others. More specifically, IPWrap contains wrapper to the IPShared low-level routines and also a bunch of higher-level, often based on some heuristics. There is a long list of such higher level routines. They include:

The low-level routines in IPShared are all written such that there interface does not use any data structures or pointers to data structures. Basically, they take as input a series of numbers and pointers to buffers. This design was dictated by some of the FlowPort requirements. When a buffer is passed to IPShared for processing, it is can be a full image buffer, or a strip, or a tile, or whatever portion extracted from an image buffer. The low-level IPShared function do not care. All that matter is that the size, bit-depth, and other information regarding the buffer be correctly passed to this function. If small buffers are used, little memory will be required. If large buffers are used, larger amounts of memory will typically be required. The exact amount of memory required depends on the routines called.

Higher-level routines (in IPWrap) can be written to be fairly crude in terms of memory usage, which usually means that one or several full image buffers will end up being required. For some operations, there is no way to be very efficient memory-wise.... But in some cases, through careful engineering, one can write the high-level algorithms in such a way that they call IPShared (and other) low-level routines one line at a time, or one strip at a time, or one tile at a time. When this can be done, overall memory usage is usually reduced dramatically. However, this usually results in moderately slower execution, more complex algorithms, and can also be the source of artifacts at the boundary between tiles/strips.

The 'autoScan' routines of IPWrap are an archetypical example of functions designed to be memory efficient. autoScan embodies a lot of complex functionality (segmentation, despeckle, AIE, auto-deskew, auto-orient, etc.). Some of the processing in autoScan is done in strips (e.g., binarization), some of it is done through reduction of resolution (e.g., the text/image segmenter). The net result is a set of memory efficient library routines.

So, the answer to the question "Does IPCore require Full Image Buffers?" is: it depends. But in general, the code is written to be very fast and very efficient in terms of memory. In other words, if something can be done without requiring a full image buffer to be in memory, this is typically the way it is implemented.