Summary: | This paper considers the problem of memory allocation for the organization of the LIFO-stack in the algorithm for image segmentation based on growing regions is considered. Segmentation divides the image into regions with identical or similar properties and is the most demanding process for the capacity of RAM. The cultivation of areas begins with the neighborhoods of pre-selected initial growth pixels and uses stacks to store the coordinates of adjacent pixels attached to the cultivated region. Stack loading is maximized when the segment size matches the size of the YX image. In the absence of an expression for the exact determination of the size of the stack, it is possible to guarantee the stable operation of the algorithm for growing regions, eliminating the overflow of the memory allocated for processing if the stack size is assumed equal to YX. However, this approach does not take into account the fact that filling the coordinate stacks is also accompanied by a selection of them, which makesthe stack size always smaller than YX. The article proposes an expression that allows one to increase the accuracy of determining the required size of the LIFO-stack for storing the coordinates of adjacent pixels depending on the image size. The expression takes into account the conditions of the maximum load of the LIFO-stack when: a) the segmentation of the square region with the initial growth pixel in the corner of this region is carried out; b) in the scan window, adjacent pixels are always selected in order with the first selectable pixel located in the corner of the scan window. Using the proposed expression to calculate the required capacity of the LIFO-stack under conditions of its maximum load in the image segmentation algorithm based on growing regions provides a 2-fold reduction in the number of LIFO-stack memory cells.
|