Abstract
With the development of novel parallel architectures for image processing, the implementation of well-known image operators needs to be reformulated to take advantage of the so-called massive parallelism. In this work, we propose a general algorithm that implements a large class of nonlinear filters, called stack filters, with a 2D-array processor. The proposed method consists of decomposing an image into bitplanes with the bitwise decomposition and then processes every bitplane hierarchically. The filtered image is reconstructed by simply stacking the filtered bitplanes according to their order of significance. Owing to its hierarchical structure, our algorithm allows us to trade-off between image quality and processing time, and to significantly reduce the computation time of low-entropy images. Also, experimental tests show that the processing time of our method is substantially lower than that of classical methods when using large structuring elements. All these features are of interest to a variety of real-time applications based on morphological operations such as video segmentation and video enhancement.
Similar content being viewed by others
References
Abbo, A.A., Kleihorst, R.P., Schueler, B.: Xetal-II: a low-power massively-parallel processor for video scene analysis. Signal Process. Syst. 62(1), 17–27 (2011)
Avedillo, M., Quintana, J., Alami, H., Jimenez-Calderon, A.: A practical parallel architecture for stacks filters. J. VLSI Signal Process. Syst. Signal Image Video Technol. 38(2), 91–100 (2004)
Chakrabarti, C., Lucke, L.: VLSI architectures for weighted order statistic (WOS) filters. In: IEEE international symposium on circuits and systems (ISCAS), vol. 2, pp. 320–323 (1998)
Chen, K.: Bit-serial realizations of a class of nonlinear filters based on positive boolean functions. IEEE Trans. Circuits Syst. 36(6), 785–794 (1989)
Droogenbroeck, M., Buckley, M.: Morphological erosions and openings: fast algorithms based on anchors. J. Math. Imaging Vis. 22(2–3), 121–142 (2005)
Frías-Velázquez, A., Morros, J.: Gray-scale erosion algorithm based on image bitwise decomposition: application to focal plane processors. In: IEEE international conference on acoustics, speech and signal processing, ICASSP, pp. 845–848 (2009)
Frías-Velázquez, A., Philips, W.: Bit-plane stack filter algorithm for focal plane processors. In: IEEE international conference on image processing ICIP, pp. 3741–3744. IEEE (2010)
Gevorkian, D., Egiazarian, K., Agaian, S., Astola, J., Vainio, O.: Parallel algorithms and VLSI architectures for stack filtering using Fibonacci p-codes. IEEE Trans. Signal Process. 43(1), 286–295 (1995)
Gonzalez, R.C., Woods, R.E.: Digital Image Processing. Prentice-Hall, Inc, Upper Saddle River (2006)
Maragos, P., Schafer, R.: Morphological filters-Part II: their relations to median, order-statistic, and stack filters. IEEE Trans. Acoust. Speech Signal Process. 35(8), 1170–1184 (1987)
Mertzios, B.G., Tsirikolias, K.: Coordinate logic filters and their applications in image processing and pattern recognition. Circuits Syst. Signal Process. 17(4), 517–538 (1998)
Rodríguez-Vázquez, A., Domínguez-Castro, R., Jiménez-Garrido, F., Morillas, S., Listán, J., Alba, L., Utrera, C., Espejo, S., Romay, R.: The Eye-RIS CMOS vision system. In: Analog Circuit Design, pp. 15–32. Springer, The Netherlands (2008)
Roth Jr., C., Kinney, L.: Fundamentals of Logic Design. Cengage Learning, Boston (2013)
Shannon, C., et al.: The synthesis of two-terminal switching circuits. Bell Syst. Tech. J. 28(1), 59–98 (1949)
Shi, Y.: Smart cameras for machine vision. In: Smart Cameras, pp. 283–303. Springer (2010)
Spiliotis, I., Boutalis, Y.: Parameterized real-time moment computation on gray images using block techniques. J. Real-Time Image Process. 6(2), 81–91 (2011)
Urbach, E., Wilkinson, M.H.F.: Efficient 2-D grayscale morphological transformations with arbitrary flat structuring elements. IEEE Trans. Image Process. 17(1), 1–8 (2008)
Wendt, P., Coyle, E., Gallagher, N.C.: Stack filters. IEEE Trans. Acoust. Speech Signal Process. 34(4), 898–911 (1986)
Wu, C., Aghajan, H., Kleihorst, R.: Mapping vision algorithms on SIMD architecture smart cameras. In: First ACM/IEEE International Conference on Distributed Smart Cameras, pp. 27–34 (2007)
Zarándy, Á.: Focal-Plane Sensor-Processor Chips. Springer, Berlin (2011)
Zivkovic, Z.: Wireless smart camera network for real-time human 3D pose reconstruction. Comput. Vis. Image Underst. 114(11), 1215–1222 (2010)
Zivkovic, Z., Kleihorst, R.: Chapter 21—smart cameras for wireless camera networks: Architecture overview. In: Aghajan, H., Cavallaro, A. (eds.) Multi-camera Networks, pp. 497–510. Academic Press, Oxford (2009)
Acknowledgements
This work has been supported by IMEC and by the Flemish Fund for Scientific Research (FWO), and Project TEC2016-75976-R, financed by the Spanish Ministerio de Economía y Competitividad and the European Regional Development Fund (ERDF).
Author information
Authors and Affiliations
Corresponding author
Appendices
Appendix 1: Derivation of Eq. (5)
The bitwise decomposition function, stated in (2), can be expressed in terms of floor functions using the modulo operator \(x \mod y = x - y \left\lfloor {x}/{y} \right\rfloor\) and the identity \(\left\lfloor {\left\lfloor {x}/{p} \right\rfloor }/{q} \right\rfloor = \left\lfloor {x}/{pq} \right\rfloor\) as follows
In general, a floor function has a staircase shape, where every step can be expressed in terms of threshold functions. Therefore, we can state that
where p is an integer number that determines the stair width. Consequently, the floor functions in (16) can be expressed as
where \(N_{k}=2^{K-k}-1\) and K represents the bit depth of the image. As the stair width in (19) is two times larger than in (18), the indices j and \(j'\) point to different thresholding levels. Therefore, to use a common index, we express (18) with the index j as follows
By substituting (19) and (20) into (16), we obtain the relation between decompositions as
Equivalently, we can express this relation in terms of Boolean operators as shown below
Appendix 2: Derivation of Eq. (6)
As stated in (1), the threshold function is based on the comparison of the image I and a gray level \(\ell\). The equality comparator, on the other hand, is a more fundamental operation defined as shown below
If we apply the bitwise decomposition to I and \(\ell\), we get \(\left( B_{K-1},\ldots ,B_{0}\right) _{2}\) and \(\left( \beta _{K-1,\ell },\ldots ,\beta _{0,\ell }\right) _{2}\), respectively. By comparing their K bit levels of decomposition, we can also express the equality comparator as follows
Based on equality comparisons, we can reformulate the threshold function (1) as shown below
where \(C_\ell\) can be substituted by (24) leading to
This Boolean function has the canonical form of a sum of products (SoP) [13], and it can be minimized yielding a simplified representation. In the following paragraphs, we will perform the minimization of (26) by assuming that \(T_{l}\) returns the minimized expression and \(F_{l}(B_{K-1},B_{K-2},\ldots ,B_{0})\) is the sum-of-products representation. In this way, we start applying the Shannon’s expansion theorem [14] to \(F_{l}\) as follows
where \({\mathbf {1}}\) and \({\mathbf {0}}\) represent bitplanes of ones and zeros, respectively. This expression can be reduced for two possible cases:
- Case 1 :
-
If \(l < 2^{K-1}\), then \(F_{l}\left( {\mathbf {1}},B_{K-2},\ldots ,B_{0}\right) = {\mathbf {1}}\) by the uniting theorem [13]. As a result, we can reduce (27) to \(F_{l}\left( B_{K-1},B_{K-2},\ldots ,B_{0}\right) = B_{K-1} \vee (\lnot B_{K-1} \wedge F_{l}({\mathbf {0}},B_{K-2},\ldots ,B_{0}))\), and then use the elimination theorem [13] to get
$$\begin{aligned} F_{l}\left( B_{K-1},B_{K-2},\ldots ,B_{0}\right) = B_{K-1} \vee F_{l}\left( {\mathbf {0}},B_{K-2},\ldots ,B_{0}\right) . \end{aligned}$$(28) - Case 2 :
-
If \(l\ge 2^{K-1}\), then \(F_{l}\left( {\mathbf {0}},B_{K-2},\ldots ,B_{0}\right) = {\mathbf {0}}\). For this case, Eq. (27) is reduced to
$$\begin{aligned} F_{l}\left( B_{K-1},B_{K-2},\ldots ,B_{0}\right) = B_{K-1} \wedge F_{l}\left( {\mathbf {1}},B_{K-2},\ldots ,B_{0}\right) . \end{aligned}$$(29)
By gathering (28) and (29) into a single function, we can express (27) as follows
where \(\lambda _{K-1}\) is the most significant bit of l given that \((l)_{10}=(\lambda _{K-1}\lambda _{K-2}\ldots \lambda _{0})_{2}\). Note that \(\lambda _{K-1} = 0\) implies that \(l < 2^{K-1}\), while \(\lambda _{K-1} = 1\) implies that \(l\ge 2^{K-1}\). This piecewise function can be redefined more compactly as follows
where \(\varvec{\lambda }_{K-1}\) represents a bitplane of either zeros or ones depending on the value of \(\lambda _{K-1}\), while the bow tie operator is defined by
The expression in (31) can be further worked out by applying the Shannon’s expansion theorem to \(F_{l}(\varvec{\lambda }_{K-1},B_{K-2},\ldots ,B_{0})\), which leads to
This expression can be simplified for four possible cases:
- Case 1 :
-
If \(l<2^{K-2}\), then \(F_{l}\left( {\mathbf {0}},{\mathbf {1}},B_{K-3},\ldots ,B_{0}\right) = {\mathbf {1}}\), which after substituted in (33) we get
$$\begin{aligned} F_{l}\left( {\mathbf {0}},B_{K-2},\ldots ,B_{0}\right) = B_{K-2} \vee F_{l}\left( {\mathbf {0}},{\mathbf {0}},B_{K-3},\ldots ,B_{0}\right) . \end{aligned}$$(34) - Case 2 :
-
If \(l\ge 2^{K-2}\), then \(F_{l}({\mathbf {0}},{\mathbf {0}},B_{K-3},\ldots ,B_{0})= {\mathbf {0}}\), which reduces (33) to
$$\begin{aligned} F_{l}\left( {\mathbf {0}},B_{K-2},\ldots ,B_{0}\right) = B_{K-2} \wedge F_{l}\left( {\mathbf {0}},{\mathbf {1}},B_{K-3},\ldots ,B_{0}\right) . \end{aligned}$$(35) - Case 3 :
-
If \(l<3\cdot 2^{K-2}\), then \(F_{l}\left( {\mathbf {1}},{\mathbf {1}},B_{K-3},\ldots ,B_{0}\right) = {\mathbf {1}}\), and the expansion is simplified as
$$\begin{aligned} F_{l}\left( {\mathbf {1}},B_{K-2},\ldots ,B_{0}\right) = B_{K-2} \vee F_{l}\left( {\mathbf {1}},{\mathbf {0}},B_{K-3},\ldots ,B_{0}\right) . \end{aligned}$$(36) - Case 4 :
-
If \(l\ge 3\cdot 2^{K-2}\), then \(F_{l}({\mathbf {1}},{\mathbf {0}},B_{K-3},\ldots ,B_{0})= {\mathbf {0}}\), which after substituted in (33) returns
$$\begin{aligned} F_{l}\left( {\mathbf {1}},B_{K-2},\ldots ,B_{0}\right) = B_{K-2} \wedge F_{l}\left( {\mathbf {1}},{\mathbf {1}},B_{K-3},\ldots ,B_{0}\right) . \end{aligned}$$(37)
All these cases are put together in the following form:
In the light of (31) and (38), we can easily deduce the last Shannon’s expansion as follows
Given that \(F_{l}(\varvec{\lambda }_{K-1},\varvec{\lambda }_{K-2},\ldots ,\varvec{\lambda }_{0})={\mathbf {1}}\), then Eq. (39) can be simplified if the least significant bits of l are set to zero. For instance, if z is the number of the least significant bits of l set to zero, then \(\lambda _{z-1}=\lambda _{z-2}=\cdots =\lambda _{0}=0\) and the rightmost part of (39) is reduced as follows \(B_{z-1} \vee B_{z-2} \vee \cdots \vee {\mathbf {1}}={\mathbf {1}}\). Finally, the minimization of the sum of products stated in (26) is shown below
where \(q = K - z\).
Rights and permissions
About this article
Cite this article
Frías-Velázquez, A., Morros, J.R., García, M. et al. Hierarchical stack filtering: a bitplane-based algorithm for massively parallel processors. J Real-Time Image Proc 16, 1717–1730 (2019). https://doi.org/10.1007/s11554-017-0681-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11554-017-0681-8