<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JDAIP</journal-id><journal-title-group><journal-title>Journal of Data Analysis and Information Processing</journal-title></journal-title-group><issn pub-type="epub">2327-7211</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jdaip.2022.102006</article-id><article-id pub-id-type="publisher-id">JDAIP-116305</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject><subject> Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Fast Object Extraction and Euler Number on Block Represented Images
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Iraklis</surname><given-names>M. Spiliotis</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Alexandros</surname><given-names>S. Peppas</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Nikolaos</surname><given-names>D. Karampasis</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Yiannis</surname><given-names>S. Boutalis</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of Electrical and Computer Engineering, Democritus University of Thrace, GR, Xanthi, Greece</addr-line></aff><pub-date pub-type="epub"><day>31</day><month>03</month><year>2022</year></pub-date><volume>10</volume><issue>02</issue><fpage>91</fpage><lpage>109</lpage><history><date date-type="received"><day>2,</day>	<month>January</month>	<year>2022</year></date><date date-type="rev-recd"><day>28,</day>	<month>March</month>	<year>2022</year>	</date><date date-type="accepted"><day>31,</day>	<month>March</month>	<year>2022</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  The identification of objects in binary images is a fundamental task in image analysis and pattern recognition tasks. The Euler number of a binary image is an important topological measure which is used as a feature in image analysis. In this paper
  ,
   a very fast algorithm for the detection and localization of the objects and the computation of the Euler number of a binary image is proposed. The proposed algorithm operates in one scan of the image and is based on the Image Block Representation (IBR) scheme. The proposed algorithm is more efficient than conventional pixel based algorithms in terms of execution speed and representation of the extracted information.
 
</p></abstract><kwd-group><kwd>Image Block Representation</kwd><kwd> Object Detection</kwd><kwd> Hole Detection</kwd><kwd> Euler Number</kwd><kwd> Connected Components Labeling</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>In our days, vast amounts of image and video data are generated, transmitted and analyzed, thus the development of fast algorithms able to achieve high processing rates is of great importance for many applications.</p><p>Binary images are suitable for a number of image analyses, pattern recognition, document processing, robot vision, and image based industrial applications, especially when the shape of the objects is important and the segmentation from the background is simple and without uncertainty. Object detection and localization are fundamental tasks in various applications. The Euler number E of a binary image is an important topological property that remains invariant under certain image rubber-sheet transformations, such as stretching and under scaling, rotation, or translation [<xref ref-type="bibr" rid="scirp.116305-ref1">1</xref>]. It is defined as the difference between the number of connected object components C and the number of holes H of the binary image, E = C − H. It has been used in various image processing and analysis applications such as medical image diagnosis [<xref ref-type="bibr" rid="scirp.116305-ref2">2</xref>], image database retrieval [<xref ref-type="bibr" rid="scirp.116305-ref3">3</xref>], and robot vision. Since C is the number of objects, the operations of object detection and Euler number computation are closely related.</p><p>Algorithms for object detection were developed 50 years ago [<xref ref-type="bibr" rid="scirp.116305-ref4">4</xref>]. Due to their mode of operation, they are called Connected Components Labeling (CCL). In recent years, new improved CCL algorithms with reduced complexity have been presented [<xref ref-type="bibr" rid="scirp.116305-ref5">5</xref>] [<xref ref-type="bibr" rid="scirp.116305-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.116305-ref7">7</xref>].</p><p>The CCL operation assigns a unique label to the pixels of each connected component of the image. Each connected component is a different object. After the labeling operation, the separation of objects from the image is feasible. As a result, the output of any CCL algorithm is an array of pixel labels, where each label corresponds to a different object in the image. Subsequently, the feature extraction and object classification tasks can be performed using the above labeling. Therefore, CCL is a significant operation in binary image analysis, pattern recognition, object tracking [<xref ref-type="bibr" rid="scirp.116305-ref8">8</xref>], and computer vision in general.</p><p>For the calculation of the connected components labeling, two kinds of algorithms have been presented. The first one is the label equivalence-based algorithms, which process the image with raster scans. A provisional label is assigned to each foreground pixel in the first scan, while the resulting label equivalences are resolved in the subsequent scans [<xref ref-type="bibr" rid="scirp.116305-ref9">9</xref>] [<xref ref-type="bibr" rid="scirp.116305-ref10">10</xref>] [<xref ref-type="bibr" rid="scirp.116305-ref11">11</xref>]. The second kind is the label propagation algorithms which scan the image, locate a foreground pixel, assign to it a new label and then assign this label to its connected foreground pixels [<xref ref-type="bibr" rid="scirp.116305-ref12">12</xref>].</p><p>A number of different approaches have been proposed for the calculation of the Euler number on binary images. Dyer [<xref ref-type="bibr" rid="scirp.116305-ref13">13</xref>] and Samet and Tamminen [<xref ref-type="bibr" rid="scirp.116305-ref14">14</xref>] proposed an algorithm based on the quadtree representation of images. Chen and Yen presented a parallel algorithm using graphs of the image [<xref ref-type="bibr" rid="scirp.116305-ref15">15</xref>]. D&#237;az-De-Le&#243;n et al. presented an algorithm using the skeleton of the image [<xref ref-type="bibr" rid="scirp.116305-ref16">16</xref>]. Zenzo et al. presented a run-based algorithm using the number of runs and 8-neighbor runs in the image [<xref ref-type="bibr" rid="scirp.116305-ref17">17</xref>]. Also, there are algorithms based on 2 &#215; 2 pixel patterns called bit-quads in the image [<xref ref-type="bibr" rid="scirp.116305-ref6">6</xref>] [<xref ref-type="bibr" rid="scirp.116305-ref18">18</xref>]. Parallel implementation on a multicore computer for the computation of CCL [<xref ref-type="bibr" rid="scirp.116305-ref19">19</xref>] and a VLSI implementation [<xref ref-type="bibr" rid="scirp.116305-ref20">20</xref>] were also proposed.</p><p>Recently, He et al. proposed the GLC algorithm for integrating connected components labeling and Euler number computation [<xref ref-type="bibr" rid="scirp.116305-ref7">7</xref>]. In the GLC algorithm, a binary image is converted into a graph G, and using Euler’s theorem [<xref ref-type="bibr" rid="scirp.116305-ref21">21</xref>], the Euler number can be calculated according to the numbers of vertices, edges, and faces. The advantage of the above GLC algorithms is that they use 16 possible patterns of the connected-component labeling masks, but they take into account only the four of them. So they achieve bigger acceleration than the previous algorithms CHE [<xref ref-type="bibr" rid="scirp.116305-ref22">22</xref>] and ML [<xref ref-type="bibr" rid="scirp.116305-ref6">6</xref>], which were also proposed previously by He et al. All of these algorithms compute the Euler number and the connected component labeling in one scan, simultaneously.</p><p>He et al. relied on Chen’s and Yan’s algorithm [<xref ref-type="bibr" rid="scirp.116305-ref15">15</xref>] to implement a new algorithm to calculate the Euler number [<xref ref-type="bibr" rid="scirp.116305-ref6">6</xref>]. More specifically, they transform a binary image into a square graph G, where the 8-connectivity of the neighboring pixels is utilized. Each foreground pixel in the image is considered as a vertex in the graph and an edge is added if pixels p and q are 8-neighbors. Suppose v, e, r, and c are the numbers of vertices, edges, squares, and connected components in G, respectively.</p><p>According to Euler’s theorem [<xref ref-type="bibr" rid="scirp.116305-ref21">21</xref>], v − e + r = c + 1, where squares include holes, basic faces, and an infinite square outside of G. Also h and s are respectively the numbers of holes and basic faces in graph G. Then, r = h + s + 1. Thus, the Euler number E of G can be represented as:</p><p>E = c −h = v −e + s (1)</p><p>The faces are the basic right angle triangles, each of which consists of two right-angle sides of length one, as shown in <xref ref-type="fig" rid="fig1">Figure 1</xref>(a) and <xref ref-type="fig" rid="fig1">Figure 1</xref>(b).</p><p>The Euler number can be calculated by counting the numbers of vertices, faces, and edges by adding pixels one-by-one in the raster scan. For each pixel being added, the increments of the numbers of vertices, edges, and faces generated by adding this pixel are calculated. If the pixel is a background pixel, no new vertex, edge, or face is generated, and thus nothing needs to be done. Otherwise, the pixel is a foreground pixel and the number of vertices should be increased by one. Due to the fact that it is not convenient to compute the Euler number by directly counting the numbers of vertices, edges, and faces generated by adding a foreground pixel one-by-one [<xref ref-type="bibr" rid="scirp.116305-ref9">9</xref>], He et al proposed the usage of the Dv, De, and Ds, which are the increments in the numbers of vertices, edges, and faces, respectively, when the current foreground pixel is added. Thus, the corresponding change in the Euler number DE can be calculated as</p><p>DE = Dv – De + Ds (2)</p><p>These increments can be calculated by using the mask patterns of <xref ref-type="fig" rid="fig2">Figure 2</xref>. In fact, the Euler number can be calculated by using the patterns of the masks of <xref ref-type="fig" rid="fig2">Figure 2</xref>. So, by using the connected component labeling the Euler number can be calculated as:</p><p>E = w – k (3)</p><p>where w is the number of provisional labels, such as the number of pattern P1 occurrences from <xref ref-type="fig" rid="fig2">Figure 2</xref>, and k is the number of label equivalence resolutions, that is the total number of occurrences of patterns P10-P12 from <xref ref-type="fig" rid="fig2">Figure 2</xref>. The label equivalences, the Euler number and the connected components labeling can be calculated by the HCS algorithm, proposed by He et al. [<xref ref-type="bibr" rid="scirp.116305-ref9">9</xref>]. This algorithm is referred to as GLC. He et al. also proposed the calculation of the Euler number only, from the DE of the mask patterns in <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p><p>In short, the GLC algorithm operates in one image scan considering only the foreground pixels and is the fastest pixel based CCL and Euler number algorithm to date. The execution of the GLC algorithm requires the checking of four neighboring previous pixels of the current foreground pixel.</p><p>In this paper, a very fast algorithm for the detection of objects and the computation of Euler number in one scan of the image is presented. This algorithm is called Euler number in Block Represented Images (EBRI) and is based on Image Block Representation (IBR) [<xref ref-type="bibr" rid="scirp.116305-ref23">23</xref>], which represents the binary image as a set of non-overlapping rectangular areas with foreground pixels. Each foreground pixel belongs to one block, and the IBR is an information lossless representation equivalent to the 2D array image representation. The presented EBRI algorithm is faster than any CCL algorithm. However, the greater benefit of the EBRI algorithm is that it provides, in one scan, improved machine perception of the binary image. Any object of the image is represented as a list of coordinates, thus all the information concerning the object and its location is directly provided to the machine. In contrast, the CCL algorithms require additional image scans, in order to separate the objects according to their labels.</p><p>The rest of the paper is organized as follows. In Section 2 the EBRI algorithm is introduced and analyzed. Experimental results and comparisons are given in Section 3, while conclusions are given in Section 4.</p></sec><sec id="s2"><title>2. The EBRI Algorithm</title><p>The proposed EBRI algorithm consists of a number of discrete tasks, which are implemented concurrently. These steps are 1) the Block Representation of the binary image, 2) the extraction of connectivity among the blocks, 3) the objects detection and representation using blocks’ coordinates, and 4) the holes detection and Euler number calculation. The first step of block representation is the only step that involves pixel checking, and all the subsequent steps work directly on the derived blocks.</p><p>In order to clarify the algorithm, these tasks are initially presented separately and the combined algorithm follows.</p><sec id="s2_1"><title>2.1. Image Block Representation</title><p>In a binary image, the foreground pixels are represented by a set of non-overlapping rectangles with edges parallel to the axes, in such a way that every object’s pixel belongs to only one rectangle. These rectangles are called blocks and this representation is called Image Block Representation (IBR) [<xref ref-type="bibr" rid="scirp.116305-ref23">23</xref>] and is an information lossless representation of the image.</p><p>A binary image is called block represented,if it is represented by a set of blocks with object level, and if each pixel of the image with object value belongs to one and only one block.</p><p>A block represented image is denoted as the set of the blocks, where each block is described by four integers, the coordinates of the upper left and down right corner in vertical and horizontal axes as shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>(a). In <xref ref-type="fig" rid="fig3">Figure 3</xref>(b) the blocks that represent the image of character d, as extracted when using Algorithm 1, are illustrated. A block represented image is denoted as:</p><p><sub> f ( x , y ) = { b i : i = 0 , 1 , ⋯ , b n o − 1 } </sub> (3)</p><p>where b<sub>no</sub> is the number of the blocks.</p><p>The IBR process requires one image scan and simple pixel checking operations; Algorithm 1 implements the IBR.</p><p>Algorithm 1. Image block representation.</p></sec><sec id="s2_2"><title>2.2. Connectivity of the Blocks</title><p>In correspondence with the 4 and D pixel connectivity, the following definitions clarify block connectivity schemes.</p><p>Definition 1. Two blocks are 4-connected, if there exists a pair of 4-connected pixels, one from each block.</p><p>Definition 2. Two blocks are D-connected, if they are not 4-connected and exist a pair of D-connected pixels one from each block.</p><p>The connectivity among the image blocks may be determined during the image block representation process, or directly on a given block represented image, using the following criteria [<xref ref-type="bibr" rid="scirp.116305-ref24">24</xref>]:</p><p>Lemma 1. Two blocks are 4-connected if their projections on one of the x or y axes are overlapped and their projections on the other axis are neighbors.</p><p>Lemma 2: Two blocks are D-connected if their projections on both axes are neighbors.</p><p>Each block b is stored as the structure</p><p>b = {y<sub>1</sub>, x<sub>1</sub>, y<sub>2</sub>,x<sub>2</sub>, nc, c[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>]} (5)</p><p>where y<sub>1</sub>, x<sub>1</sub>, y<sub>2</sub>, x<sub>2</sub> the coordinates of the upper left and lower right angular points, nc the number of the connected blocks and c[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>] the list with their indices.</p></sec><sec id="s2_3"><title>2.3. Object Detection</title><p>The connectivity information of each block allows the creation of lists of connected blocks that form the objects. A suitable data structure for storing the m objects is the vector o[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>], where each object o<sub>i</sub>, i = 0, 1, …, m − 1 is the data structure</p><p>o<sub>i</sub> = {bid<sub>i</sub>[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>], nb<sub>i</sub>} (6)</p><p>where the vector bid<sub>i</sub>[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>] that belongs to the object structure, holds the indices of the blocks that constitute the i-th objecto<sub>i</sub>, while nb<sub>i</sub> is the number of the blocks that form o<sub>i</sub>.</p><p>In order to extract the objects, the following procedure is used. All blocks of the binary image are examined; if the examined block (current block) has not been assigned to an object, a new object is created and the current block is assigned to the new object (current object). For the current block, every single neighboring block is being processed. If a neighbor is not assigned to an object, then it is assigned to the current object. Otherwise, if the neighbor is already assigned to a different object, a conflict between the two objects occurs and has to be resolved. The algorithm that resolves the label equivalences and presented by He et al. [<xref ref-type="bibr" rid="scirp.116305-ref9">9</xref>] is used to handle this object equivalence similar situation. Algorithm 2 implements the extraction of objects using the block and the connections among the blocks as presented above.</p><p>Algorithm 2. Object extraction.</p><p>The auxiliary vector oid[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>] holds the object index for each block, i.e. oid[k] is the object id in which the k-th block belongs. The function AddNeighborToObject(), assigns the neighbor block to the object of the current block and is given in Algorithm 3.</p><p>Algorithm 3. Function AddNeighborToObject.</p><p>In the case of the equivalence between two objects, the lists of the blocks that make up the two involved objects, are merged into one list, as the two objects become one. The ObjectEquivalenceResolve() function is responsible for solving the object equivalence situation and is presented in Algorithm 4. The m and n are the representative objects for each object and u and v are the conflicting objects whose equivalence should be resolved.</p><p>Algorithm 4. Function ObjectEquivalenceResolve.</p><p>The vector rep_object[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>] stores the representative object for each object. The 2-D array equiv_list<sub>n</sub> is the equivalence list of the object n and contains all the previous equivalent objects in relation to it.</p><p>Considering the application of Algorithm 2 on the image of <xref ref-type="fig" rid="fig4">Figure 4</xref>(a), the extracted objects are o<sub>0</sub> = {[0, 2], 2}, o<sub>1</sub> = {[1, 3, 4], 3}. In the example of the <xref ref-type="fig" rid="fig4">Figure 4</xref>(b) image, two objects o<sub>0</sub> = {[0, 2, 3], 3}, o<sub>1</sub> = {[1, 4, 5], 3} are initially extracted. In the examination of the block b<sub>3</sub> the two north neighbor blocks b<sub>2</sub>, b<sub>1</sub> belonging to different objects o<sub>0</sub>, o<sub>1</sub> are detected, and the execution of function ObjectEquivalenceResolve() sets the equivalence o 0 ≡ o 1 and the blocks of o<sub>1</sub> are merged with the blocks of o<sub>0</sub>. Thus, only one object is extracted from the image, that is the object o<sub>0</sub> = {[0, 2, 3, 1, 4, 5], 6}.</p><p>A significant feature of the proposed algorithm is that it directly provides the information for the localization of each extracted object using the coordinates of its blocks.</p></sec><sec id="s2_4"><title>2.4. Hole Detection and Euler Number</title><p>Based on the previous approach for the extraction of the objects, a hole is detected when there is a block with two north neighbor blocks that belong to the same or equivalent objects. If the two objects already have the same representative object, it means that the left and right sides belong to the same object, as the top side is common.</p><p>In <xref ref-type="fig" rid="fig5">Figure 5</xref> two examples of hole detection are demonstrated. In <xref ref-type="fig" rid="fig5">Figure 5</xref>(a) all the extracted blocks are assigned to the same object o<sub>0</sub>. Therefore in the examination of block b<sub>4</sub>, the two north neighbor blocks b<sub>3</sub>, b<sub>5</sub> belong to the same object and a hole is detected.</p><p>In <xref ref-type="fig" rid="fig5">Figure 5</xref>(b), in the examination of block b<sub>5</sub>, the north neighbors b<sub>1</sub>, b<sub>2</sub> belong to different objects that are not equivalent yet, thus no hole is detected; instead, the function ObjectEquivalenceResolve() is called and sets the equivalence of objects o<sub>0</sub>, o<sub>1</sub>. Also in the examination of b<sub>5</sub>, the north neighbors b<sub>2</sub>, b<sub>3</sub>, b<sub>4</sub> belong to the same object, and the two holes are detected. In the examination of block b<sub>8</sub> the north neighbors b<sub>6</sub>, b<sub>7</sub> belong to the same object and the third hole of the object is detected.</p><p>As the number of Objects C and the number of Holes H of a binary image are known, the Euler number can be found as E = C − H.</p></sec><sec id="s2_5"><title>2.5. The Proposed One Scan EBRI Algorithm</title><p>The proposed algorithm’s goal is to calculate simultaneously in one image scan the blocks and their location coordinates, the number of the Objects and their location coordinates, the number of holes and the Euler number. The combination of the steps described in the previous subsections constitutes the proposed EBRI Algorithm. The proposed algorithm scans each pixel of the binary image and searches for object level intervals in the image rows. When an interval is found, then the interval is assigned to an existing block or a new block is created; in the case of a new block, the block connectivity, object assignment and hole detection tasks are executed, as presented in Algorithm 5.</p><p>Algorithm 5. EBRI.</p><p>The function NewBlock() creates a new block and is presented in Algorithm 6. Algorithm 7 presents the function ConnectivityRegistration (u, v) which registers the connectivity of the blocks b[u] and b[v]. The function BlockToObjectRegistration(u,v) performs the registration of the v-th block b[v] in the list of the blocks that constitute the u-thobject o[u] and is presented in Algorithm 8.</p><p>Algorithm 6. Function NewBlock.</p><p>Algorithm 7. Function ConnectivityRegistration.</p><p>Algorithm 8. Function BlockToObjectRegistration.</p><p>The variables W and L are the image width and length, the flag intervalfound detects the beginning of an object level interval in an image row, the flag try2match detects the completion of an object level interval and enables the matching of the interval with the blocks of the previous image row. The value 1 in the flag intervalmatched indicates the matching of the interval with a block of the previous image row, while the value 0 enables the creation of a new block. The vectors p[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>],c[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>] hold the blocks of the previous and current image row, while kp, kc are their number. The vector oid[<xref ref-type="bibr" rid="scirp.116305-ref"></xref>]holds the object indices for each extracted block, i.e. oid<sub>k</sub> is the index of the object in which the k-th block b[k] belongs to; its initial value is −1 and the negative value indicates that the block is not yet associated with an object.</p></sec></sec><sec id="s3"><title>3. Experimental Results</title><p>In this section, the experimental results for the execution of the proposed EBRI algorithm are presented. Also, experimental results and comparisons with the fast algorithm GLC are provided. The results provided by the two algorithms are equivalent for all the test images used, that is, the number of objects and their location as well as the number of holes are always the same. The location of the objects in the proposed method is described by the blocks’ coordinates.</p><sec id="s3_1"><title>3.1. Qualitative Results</title><p>It has to be stressed that the EBRI algorithm provides all the necessary information of objects and their location in a compact form, in one image scan. Moreover, it requires less execution time, and usually real world images require less information than the pixel based algorithms. In order to clarify the qualitative superiority of the EBRI algorithm in comparison with CCL algorithms, consider the simplified image of <xref ref-type="fig" rid="fig6">Figure 6</xref>(a), which depicts text. The image of <xref ref-type="fig" rid="fig6">Figure 6</xref>(a) contains 5 characters or 5 objects according to the EBRI algorithm or 5 connected components represented by labels according to CCL algorithms. <xref ref-type="fig" rid="fig6">Figure 6</xref>(b) demonstrates the 5 connected components as extracted by the GLC algorithm. In the CCL case for the extraction of each labeled object, an additional image scan is required, so that each object pixel is copied to an image f<sub>L</sub>, where L is the label.</p><p><xref ref-type="table" rid="table1">Table 1</xref> demonstrates the information of objects and blocks as extracted by the EBRI algorithm. The image contains 5 objects, 38 blocks and each object is represented by the corresponding blocks without any necessity for an additional image scan. Obviously, this is a compact representation of the binary image, as it includes the number of objects and their localization information is determined by the coordinates of the blocks. This qualitative feature constitutes the first advantage of the proposed method in comparison with the CCL methods. The smaller execution time of EBRI complements and enhances this qualitative characteristic.</p></sec><sec id="s3_2"><title>3.2. Time Complexity</title><p>For the experimental evaluation, a computer with total 8 AMD Opteron cores at 2.2GHz and 16 GB of memory was used. The operating system was Linux CentOS 7, all the programs implemented in C programming language, compiled with gcc for serial execution using one CPU core. To decrease random variation, all the execution time complexities were measured as the average of 1000 runs. <xref ref-type="fig" rid="fig7">Figure 7</xref> demonstrates a sample of the test binary images in different sizes that have been used in the experiments.</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> The result of EBRI algorithm for the input image of <xref ref-type="fig" rid="fig6">Figure 6</xref>(a)</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >O<sub>0</sub> = {11, [0, 7, 8, 14, 15, 22, 26, 27, 33, 34]} O<sub>1</sub> = {1, [<xref ref-type="bibr" rid="scirp.116305-ref1">1</xref>]} O<sub>2</sub> = {8, [4, 9, 10, 18, 19, 28, 29, 35]} O<sub>3</sub> = {7, [5, 11, 12, 20, 30, 31, 36]} O<sub>4</sub> = {11, [2, 3, 6, 13, 16, 21, 23, 24, 25, 32, 37]}</th><th align="center" valign="middle" ></th></tr></thead><tr><td align="center" valign="middle" >b<sub>0</sub> = {1, 1, 8, 2, 1, [<xref ref-type="bibr" rid="scirp.116305-ref8">8</xref>]} b<sub>1</sub> = {1, 11, 19, 12, 0, [<xref ref-type="bibr" rid="scirp.116305-ref"></xref>]} b<sub>2</sub> = {1, 36, 9, 37, 1, [<xref ref-type="bibr" rid="scirp.116305-ref16">16</xref>]} b<sub>3</sub> = {5, 42, 6, 43, 1, [<xref ref-type="bibr" rid="scirp.116305-ref6">6</xref>]} b<sub>4</sub> = {7, 18, 8, 20, 2, [9, 10]} b<sub>5</sub> = {7, 29, 8, 31, 2, [11, 12]} b<sub>6</sub> = {7, 41, 8, 42, 2, [3, 13]} b<sub>7</sub> = {8, 4, 8, 7, 1, [<xref ref-type="bibr" rid="scirp.116305-ref8">8</xref>]} b<sub>8</sub> = {9, 1, 9, 7, 2, [7, 14]} b<sub>9</sub> = {9, 16, 10, 17, 2, [4, 18]} b<sub>10</sub> = {9, 21, 10, 22, 2, [4, 19]} b<sub>11</sub> = {9, 27, 10, 28, 2, [5, 20]} b<sub>12</sub> = {9, 32, 10, 33, 1, [<xref ref-type="bibr" rid="scirp.116305-ref5">5</xref>]} b<sub>13</sub> = {9, 40, 9, 41, 2, [6, 16]} b<sub>14</sub> = {10, 1, 10, 3, 2, [8, 17]} b<sub>15</sub> = {10, 7, 11, 8, 2, [8, 22]} b<sub>16</sub> = {10, 36, 10, 41, 3, [2, 13, 21]} b<sub>17</sub> = {11, 1, 15, 2, [14, 26]} b<sub>18</sub> = {11, 15, 15, 16, 2, [9, 28]}</td><td align="center" valign="middle" >b<sub>19</sub> = {11, 22, 15, 23, 2, [10, 29]} b<sub>20</sub> = {11, 26, 15, 27, 2, [11, 30]} b<sub>21</sub> = {11, 36, 12, 39, 3, [16, 23, 24]} b<sub>22</sub> = {12, 8, 15, 9, 2, [15, 27]} b<sub>23</sub> = {13, 36, 19, 37, 1, [<xref ref-type="bibr" rid="scirp.116305-ref21">21</xref>]} b<sub>24</sub> = {13, 39, 14, 40, 2, [21, 25]} b<sub>25</sub> = {15, 40, 16, 41, 2, [24, 32]} b<sub>26</sub> = {16, 1, 17, 3, 3, [17, 33, 34]} b<sub>27</sub> = {16, 7, 17, 8, 2, [22, 34]} b<sub>28</sub> = {16, 16, 17, 17, 2, [18, 35]} b<sub>29</sub> = {16, 20, 17, 21, 2, [19, 25]} b<sub>30</sub> = {16, 27, 17, 28, 2, [20, 6]} b<sub>31</sub> = {16, 32, 17, 33, 1, [<xref ref-type="bibr" rid="scirp.116305-ref36">36</xref>]} b<sub>32</sub> = {17, 41, 17, 42, 2, [25, 37]} b<sub>33</sub> = {18, 1, 19, 2, 1, [<xref ref-type="bibr" rid="scirp.116305-ref26">26</xref>]} b<sub>34</sub> = {18, 4, 19, 7, 2, [26, 27]} b<sub>35</sub> = {18, 17, 19, 20, 2, [28. 29]} b<sub>36</sub> = {18, 29, 19, 32, 2, [30, 31]} b<sub>37</sub> = {18, 42, 19, 43, 1, [<xref ref-type="bibr" rid="scirp.116305-ref32">32</xref>]}</td></tr></tbody></table></table-wrap><p><xref ref-type="table" rid="table2">Table 2</xref> presents the number of blocks and the number of foreground pixels for each test image. It should be noticed that the number of blocks is significantly smaller than the number of foreground pixels. <xref ref-type="table" rid="table3">Table 3</xref> demonstrates the required execution times in milliseconds of the proposed EBRI algorithm and of the GLC which is the fastest CCL and Euler number calculation algorithm to date. In <xref ref-type="fig" rid="fig8">Figure 8</xref> the mean execution times of the two algorithms for a number of test images with sizes from 128 &#215; 128 up to 2048 &#215; 2048 pixels are presented.</p><p>Both EBRI and GLC algorithms operate in real time, but the proposed EBRI algorithm has lower time complexity than the GLC algorithm, especially when the image size increases. The EBRI algorithm locates the foreground pixels only for the extraction of object level intervals in image rows; the rest of the processing takes place at a higher level since it deals with the blocks and objects. On the contrary, the GLC algorithm deals with 4 neighbor pixels for each foreground pixel, which means memory accesses and execution of logical operations. Since the number of blocks is significantly reduced in comparison to the foreground pixels as demonstrated in <xref ref-type="table" rid="table2">Table 2</xref>, the complexity of the EBRI algorithm is lower than the complexity of the GLC algorithm.</p><p>It should be noticed that execution times of the GLC algorithm are measured only for the creation of the label images (see <xref ref-type="fig" rid="fig6">Figure 6</xref>(b)), where each label represents a different object. The label images are not directly useful for any image analysis and object recognition task. In order to achieve object recognition, object segmentation and perhaps the creation of a bounding box for each object are usually required; these procedures require one or more image scans, which are not taken into account in <xref ref-type="table" rid="table3">Table 3</xref> and <xref ref-type="fig" rid="fig8">Figure 8</xref>.</p><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> The size, number of blocks and number of foreground pixels of test images</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Image</th><th align="center" valign="middle" >Size</th><th align="center" valign="middle" >Blocks</th><th align="center" valign="middle" >Foreground Pixels</th></tr></thead><tr><td align="center" valign="middle" >Lena</td><td align="center" valign="middle" >256 &#215; 256</td><td align="center" valign="middle" >2102</td><td align="center" valign="middle" >33,513</td></tr><tr><td align="center" valign="middle" >Shapes</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >927</td><td align="center" valign="middle" >239,421</td></tr><tr><td align="center" valign="middle" >Text page</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >18,753</td><td align="center" valign="middle" >99,606</td></tr><tr><td align="center" valign="middle" >Fingerprint1</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >13,812</td><td align="center" valign="middle" >428,616</td></tr><tr><td align="center" valign="middle" >Fingerprint2</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >7362</td><td align="center" valign="middle" >181,147</td></tr><tr><td align="center" valign="middle" >Birds</td><td align="center" valign="middle" >2048 &#215; 2048</td><td align="center" valign="middle" >4429</td><td align="center" valign="middle" >135,158</td></tr></tbody></table></table-wrap><table-wrap id="table3" ><label><xref ref-type="table" rid="table3">Table 3</xref></label><caption><title> Execution time (msec) of EBRI and GLC algorithms for test images</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Image</th><th align="center" valign="middle" >Size</th><th align="center" valign="middle" >EBRI</th><th align="center" valign="middle" >GLC</th></tr></thead><tr><td align="center" valign="middle" >Lena</td><td align="center" valign="middle" >256 &#215; 256</td><td align="center" valign="middle" >1.914</td><td align="center" valign="middle" >1.473</td></tr><tr><td align="center" valign="middle" >Shapes</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >7.809</td><td align="center" valign="middle" >9.791</td></tr><tr><td align="center" valign="middle" >Text page</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >15.840</td><td align="center" valign="middle" >16.640</td></tr><tr><td align="center" valign="middle" >Fingerprint1</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >14.010</td><td align="center" valign="middle" >16.620</td></tr><tr><td align="center" valign="middle" >Fingerprint2</td><td align="center" valign="middle" >1024 &#215; 1024</td><td align="center" valign="middle" >13.430</td><td align="center" valign="middle" >14.440</td></tr><tr><td align="center" valign="middle" >Birds</td><td align="center" valign="middle" >2048 &#215; 2048</td><td align="center" valign="middle" >21.005</td><td align="center" valign="middle" >24.630</td></tr></tbody></table></table-wrap></sec></sec><sec id="s4"><title>4. Conclusions</title><p>In this paper the EBRI algorithm is presented; which aims to provide block representation of binary images, connectivity information among the blocks, extraction of objects in a compact form using blocks, holes detection, and Euler number computation in one image scan.</p><p>From the experimental results, the proposed EBRI algorithm is evaluated as faster than the GLC algorithm and achieves a higher processing rate.</p><p>Additionally to the execution time, there is a qualitative perspective that is also significant. The proposed algorithm produces results in the compact form of blocks and objects, which provide to a vision system the perception of image areas that are greater than a pixel. Various feature extraction fast algorithms on block represented images have been presented in the past, specifically the skeletonization [<xref ref-type="bibr" rid="scirp.116305-ref24">24</xref>], the moment computation on binary images [<xref ref-type="bibr" rid="scirp.116305-ref23">23</xref>] and on gray images [<xref ref-type="bibr" rid="scirp.116305-ref25">25</xref>] [<xref ref-type="bibr" rid="scirp.116305-ref26">26</xref>] and the Hough transform [<xref ref-type="bibr" rid="scirp.116305-ref27">27</xref>].</p><p>On the other hand, the GLC algorithm requires an additional image scan to extract each labeled object and copy each object pixel to a new image fL, where L is the label of the object pixels. In contrast, the proposed EBRI algorithm extracts all objects in the same image in one scan and in a shorter time. This feature is very important for real-time pattern recognition applications.</p><p>The development of more feature extraction algorithms using block representation is a direction of our research. Also, the parallel implementation of the related algorithms is another interesting research direction. Recently, the parallel implementation of the IBR algorithm [<xref ref-type="bibr" rid="scirp.116305-ref28">28</xref>] and the parallel computation of discrete orthogonal moments on block represented images [<xref ref-type="bibr" rid="scirp.116305-ref29">29</xref>] using OpenMP API on shared memory computers have been presented. The development of a parallel EBRI algorithm is also a future research direction.</p></sec><sec id="s5"><title>Acknowledgements</title><p>This work was partially supported by Special Account for Research Funds, Democritus University of Thrace, Project KE 82319 and Project KE 82742.</p></sec><sec id="s6"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s7"><title>Cite this paper</title><p>Spiliotis, I.M., Peppas, A.S., Karampasis, N.D. and Boutalis, Y.S. (2022) Fast Object Extraction and Euler Number on Block Represented Images. Journal of Data Analysis and Information Processing, 10, 91-109. https://doi.org/10.4236/jdaip.2022.102006</p></sec></body><back><ref-list><title>References</title><ref id="scirp.116305-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Gonzalez, R.C. and Woods, R.E. (2018) Digital Image Processing. 4th Edition, Pearson Education, London.</mixed-citation></ref><ref id="scirp.116305-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Hashizume, A., Suzuki, R. and Yokouchi, H. (1990) An Algorithm of Automated RBC Classification and Its Evaluation. Japanese Journal of Medical Electronics and Biological Engineering, 28, 25-32.</mixed-citation></ref><ref id="scirp.116305-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Bishnu, A., Bhattacharya, B.B., Kundu, M.K., Murthy, C.A. and Acharya, T. (2005) Euler Vector for Search and Retrieval of Gray-Tone Images. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 35, 801-812.https://doi.org/10.1109/TSMCB.2005.846642</mixed-citation></ref><ref id="scirp.116305-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Rosenfeld, A. and Kak, A.C. (1982) Digital Picture Processing. 2nd Edition, Academic Press, San Diego, CA.</mixed-citation></ref><ref id="scirp.116305-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Grana, C., Borghesani, D. and Cucchiara, R. (2010) Optimized Block-Based Connected Components Labeling with Decision Trees. IEEE Transactions on Image Processing, 19, 1596-1609. https://doi.org/10.1109/TIP.2010.2044963</mixed-citation></ref><ref id="scirp.116305-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">He, L.F., Zhao, X., Yao, B., et al. (2017) A Combinational Algorithm for Connected-Component Labeling and Euler Number Computing. Journal of Real-Time Image Processing, 13, 703-712. https://doi.org/10.1007/s11554-014-0433-y</mixed-citation></ref><ref id="scirp.116305-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">He, L.F., Zhao, X., Yao, B., et al. (2018) A Fast Algorithm for Integrating Connected-Component Labeling and Euler Number Computation. Journal of Real-Time Image Processing, 15, 709-723. https://doi.org/10.1007/s11554-015-0499-1</mixed-citation></ref><ref id="scirp.116305-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Dung, L., Wang, S. and Wu, Y. (2018) A Multiple Random Feature Extraction Algorithm for Image Object Tracking. Journal of Signal and Information Processing, 9, 63-71. https://doi.org/10.4236/jsip.2018.91004</mixed-citation></ref><ref id="scirp.116305-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">He, L.F., Chao, Y.Y. and Suzuki, K. (2008) A Run-Based Two-Scan Labeling Algorithm. IEEE Transactions on Image Processing, 17, 749-756.https://doi.org/10.1109/TIP.2008.919369</mixed-citation></ref><ref id="scirp.116305-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">He, L.F., Chao, Y.Y. and Suzuki, K. (2009) Fast Connected-Component Labeling. Pattern Recognition, 42, 1977-1987. https://doi.org/10.1016/j.patcog.2008.10.013</mixed-citation></ref><ref id="scirp.116305-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">He, L.F., Chao, Y.Y. and Suzuki, K. (2010) An Efficient First-Scan Method for Label Equivalence-Based Labeling Algorithms. Pattern Recognition Letters, 31, 28-35.https://doi.org/10.1016/j.patrec.2009.08.012</mixed-citation></ref><ref id="scirp.116305-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Hu, Q., Qian, G. and Nowinski, W.L. (2005) Fast Connected-Component Labelling in Three-Dimensional Binary Images based on Iterative Recursion. Computer Vision and Image Understanding, 99, 414-434. https://doi.org/10.1016/j.cviu.2005.04.001</mixed-citation></ref><ref id="scirp.116305-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Dyer, C.R. (1980) Computing the Euler Number of an Image from Its Quadtree. Computer Graphics and Image Processing, 13, 270-276. https://doi.org/10.1016/0146-664X(80)90050-7</mixed-citation></ref><ref id="scirp.116305-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Samet, H. and Tamminen, H. (1985) Computing Geometric Properties of Images Represented by Linear Quadtrees. IEEE Transactions on Pattern Analysis and Machine Intelligence, 7, 229-240. https://doi.org/10.1109/TPAMI.1985.4767646</mixed-citation></ref><ref id="scirp.116305-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Chen, M.-H. and Yan, P.-F. (1988) A Fast Algorithm to Calculate the Euler Number for Binary Images. Pattern Recognition Letters, 8, 295-297.https://doi.org/10.1016/0167-8655(88)90078-5</mixed-citation></ref><ref id="scirp.116305-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Díaz-De-León, J.L. and Sossa-Azuela, J.H. (1996) Οn the Computation of the Εuler Number of a Binary Object. Pattern Recognition, 29, 471-476.https://doi.org/10.1016/0031-3203(95)00098-4</mixed-citation></ref><ref id="scirp.116305-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Zenzo, S., Cinque, L. and Levialdi, S. (1996) Run-Based Algorithms for Binary Image Analysis and Processing. IEEE Transactions on Pattern Analysis and Machine Intelligence, 18, 83-89. https://doi.org/10.1109/34.476016</mixed-citation></ref><ref id="scirp.116305-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Gray, S.B. (1971) Local Properties of Binary Images in Two Dimensions. IEEE Transactions on Computers, 20, 551-561. https://doi.org/10.1109/T-C.1971.223289</mixed-citation></ref><ref id="scirp.116305-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Cabaret, L., Lacassagne, L. and Etiemble, D. (2018) Parallel Light Speed Labeling: An Efficient Connected Component Algorithm for Labeling and Analysis on Multi-Core Processors. Journal of Real-Time Image Processing, 15, 173-196.https://doi.org/10.1007/s11554-016-0574-2</mixed-citation></ref><ref id="scirp.116305-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Dey, S., Bhattacharya, B.B., Kundu, M.K. and Acharya, T. (2000) A Fast Algorithm for Computing the Euler Number of an Image and Its VLSI Implementation. Proceedings of 13th International Conference on VLSI Design, Calcutta, 3-7 January 2000, 330-335. https://doi.org/10.1109/ICVD.2000.812628</mixed-citation></ref><ref id="scirp.116305-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">West, D.B. (2001) Introduction to Graph Theory. 2nd Edition, Prentice Hall, Hoboken.</mixed-citation></ref><ref id="scirp.116305-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">He, L.F., Chao, Y.Y. and Suzuki, K. (2013) An Algorithm for Connected-Component Labeling, Hole Labeling and Euler Number Computing. Journal of Computer Science and Technology, 28, 468-478. https://doi.org/10.1007/s11390-013-1348-y</mixed-citation></ref><ref id="scirp.116305-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Spiliotis, I. and Mertzios, B. (1998) Real-time Computation of Two-Dimensional Moments on Binary Images Using Image Block Representation. IEEE Transactions on Image Processing, 7, 1609-1615. https://doi.org/10.1109/83.725368</mixed-citation></ref><ref id="scirp.116305-ref24"><label>24</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Spiliotis I.M. and Mertzios</surname><given-names> B.G. </given-names></name>,<etal>et al</etal>. (<year>1997</year>)<article-title>A Fast Skeleton Algorithm on Block Represented Binary Images</article-title><source> 13th International Conference on Digital Signal Processing</source><volume> Santorini</volume>,<fpage> 2</fpage>-<lpage>4 July</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.116305-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Spiliotis, I. and Boutalis, Y. (2011) Parameterized Real-Time Moment Computation on Gray Images Using Block Techniques. Journal of Real-Time Image Processing, 6, 81-89. https://doi.org/10.1007/s11554-009-0142-0</mixed-citation></ref><ref id="scirp.116305-ref26"><label>26</label><mixed-citation publication-type="other" xlink:type="simple">Spiliotis, I.M., Karampasis, N.D. and Boutalis, Y.S. (2020) Fast Computation of Hahn Mo-ments on Gray Images Using Block Representation. Journal of Electronic Imaging, 29, Article ID: 013020. https://doi.org/10.1117/1.JEI.29.1.013020</mixed-citation></ref><ref id="scirp.116305-ref27"><label>27</label><mixed-citation publication-type="other" xlink:type="simple">Gatos, B., Perantonis, S. and Papamarkos, N. (1996) Accelerated Hough Transform Using Rectangular Block Decomposition. Electronic Letters, 32, 730-732.https://doi.org/10.1049/el:19960510</mixed-citation></ref><ref id="scirp.116305-ref28"><label>28</label><mixed-citation publication-type="other" xlink:type="simple">Spiliotis, I.M., Bekakos, M.P. and Boutalis, Y.S. (2020) Parallel Implementation of the Image Block Representation Using OpenMP. Journal of Parallel and Distributed Computing, 137, 134-147. https://doi.org/10.1016/j.jpdc.2019.11.006</mixed-citation></ref><ref id="scirp.116305-ref29"><label>29</label><mixed-citation publication-type="other" xlink:type="simple">Spiliotis, I.M., Sitaridis, C. and Bekakos, M.P. (2021) Parallel Computation of Discrete Orthogonal Moment on Block Represented Images Using OpenMP. International Journal of Parallel Programming, 49, 440-446. https://doi.org/10.1007/s10766-021-00713-2</mixed-citation></ref></ref-list></back></article>