Next Article in Journal
Simulation and Optimization of Multi-Phase Terminal Trajectory for Three-Dimensional Anti-Ship Missiles Based on Hybrid MOPSO
Previous Article in Journal
Artificial Intelligence and the Human–Computer Interaction in Occupational Therapy: A Scoping Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Fast Equipartition of Complex 2D Shapes with Minimal Boundaries †

by
Costas Panagiotakis
1,2
1
Department of Management Science and Technology, Hellenic Mediterranean University, 72100 Agios Nikolaos, Greece
2
Institute of Computer Science, FORTH, 70013 Heraklion, Greece
This paper is an extended version of our paper published in International Conference on Pattern Recognition (ICPR), 2024.
Algorithms 2025, 18(5), 277; https://doi.org/10.3390/a18050277
Submission received: 5 April 2025 / Revised: 1 May 2025 / Accepted: 6 May 2025 / Published: 8 May 2025
(This article belongs to the Section Evolutionary Algorithms and Machine Learning)

Abstract

In this paper, we study the 2D Shape Equipartition Problem (2D-SEP) with minimal boundaries, and we propose an efficient method that solves the problem with a low computational cost. The goal of 2D-SEP is to obtain a segmentation into N equal-area segments (regions), where the number of segments (N) is given by the user under the constraint that the length of boundaries between the segments is minimized. We define the 2D-SEP, and we study problem solutions using basic geometric shapes. We propose a 2D Shape Equipartition algorithm based on a fast balanced clustering method (SEP-FBC) that efficiently solves the 2D-SEP problem under complex 2D shapes in O( N · | S | · l o g ( | S | ) ), where | S | denotes the number of image pixels. The proposed SEP-FBC method initializes clustering using centroids provided by the k-means algorithm, which is executed first. During each iteration of the main SEP-FBC process, a region-growing procedure is applied, starting from the smallest region and expanding until regions of equal area are achieved. Additionally, a Particle Swarm Optimization (PSO) method that uses the SEP-FBC method under different initial centroids has also been proposed to explore better 2D-SEP solutions and to show how the selection of the initial centroids affect the performance of the proposed method. Finally, we present experimental results on more than 2800 2D shapes to evaluate the performance of the proposed methods and illustrate that their solutions outperform other methods from the literature.

Graphical Abstract

1. Introduction

Image segmentation is a fundamental problem in the fields of computer vision and pattern recognition and plays a crucial role in a wide range of applications. These applications span various domains, including object recognition [1], remote sensing [2], and medical image analysis [3]. At its core, image segmentation involves the division of an image into meaningful regions or segments, facilitating higher-level analysis and interpretation. The task can be formulated in two principal ways: as a classification problem at the pixel level, known as semantic segmentation, or as an object-specific partitioning problem, referred to as instance segmentation.
The curve equipartition problem has been formally defined, explored, and solved in [4]. This problem has numerous applications across various domains, including polygonal approximation, signal modeling, and video summarization. The objective of the curve equipartition problem is to identify N 1 consecutive points along a given curve such that the curve is divided into N segments of equal chord lengths under a predefined distance function (see Figure 1 and Figure 2). This partitioning ensures that each segment maintains a consistent measure in terms of the chord length, which makes it highly relevant in geometric and computational applications. In [4], a level set approach is adopted to establish that for any continuous injective curve in a metric space and for any given number N, there always exists at least one valid N-equipartition. Furthermore, an approximate algorithm inspired by the level set approach is proposed to efficiently compute all possible solutions with high accuracy. The number of solutions to this problem generally depends on both the shape of the curve and the chosen value of N. In particular, for certain special classes of curves, the number of solutions for some values of N may be infinite. A geometric proof, provided in [4], demonstrates that the curve equipartition problem always has at least one solution for every continuous injective curve, regardless of the number of partitions.
Figure 2 illustrates the two distinct solutions for the curve equipartition problem with N = 5 . In this figure, the computed partition points (depicted in green) are projected onto the curve c ( t ) (represented by the blue curve) and are connected by red line segments. An interesting extension of the curve equipartition problem involves generalizing its formulation and solution techniques to different mathematical and computational structures, including meshes [5], images [6], and shapes [7]. These extensions open up new avenues for research and practical applications in geometric processing, computer vision, and pattern recognition.
In our previous work [7], a general version of the 2D shape equipartition problem (2D-SEP) with minimum intrinsic boundary length has been presented. According to the 2D shape equipartition problem, the goal is to compute a shape segmentation into N equal-area segments so that the length (L) of the intrinsic boundary between the segments is minimized. We have shown that for any convex shape S, the 2D-SEP problem has at least one solution for any value of N, even if the intrinsic boundaries are line segments. However, when a non-convex 2D shape is given, there exist some cases where the 2D-SEP has no solution even for N = 2 . In [7], two methods have been proposed to solve 2D-SEP:
  • A region-growing-based method that solves the general version of 2D-SEP problem called SEP-RG;
  • A sequential selection method that efficiently solves the problem under the constraint that the intrinsic boundaries are line segments called SEP-ILS.
The experimental results demonstrated that SEP-RG outperformed SEP-ILS [7].
In this work, we study in more depth the 2D shape equipartition problem (2D-SEP), studying optimal solutions for basic geometric shapes. Additionally, we propose two methods for solving 2D-SEP:
  • A 2D Shape Equipartition algorithm based on a fast balanced clustering method (SEP-FBC);
  • A Particle Swarm Optimization (PSO) method that uses the SEP-FBC method, called SEP-PSO FBC.
SEP-FBC uses initial seeds as SEP-RG, but instead of successive executions of region-growing steps of SEP-RG, firstly, it performs hard clustering and then performs a growing–shrinking process that gradually improves satisfaction with the criterion of equal-area regions. This results in a low computation cost method that makes possible its integration with Particle Swarm Optimization (PSO) framework, resulting on the top-performing method SEP-PSO FBC. To our knowledge, SEP-FBC is the most computationally efficient method to solve 2D-SEP. According to our experimental in about 90 % of 25,758 segmentation instances, the proposed methods clearly outperform in terms of intrinsic boundary length the current methods from the literature (SEP-RG and SEP-ILS). On average, the intrinsic boundary length of the SEP-PSO FBC is 7.2 % lower compared to the corresponding intrinsic boundary length of the top-performing method SEP-RG from the literature.
Figure 3 presents examples of the proposed 2D-SEP for different numbers of segments ( N { 2 , 3 , 4 , 5 } ). In the first and second rows, the results come from the SEP-ILS and SEP-RG methods [7], respectively. In the third row, the corresponding results come from the proposed SEP-FBC method. In any case, the segmentation consists of N equal-area segments. However, the intrinsic boundary length (L) differs by method. Figure 3a shows a segmentation of an apple for N = 2 , where a solution of a line segment close to the diameter of the apple seems to be the optimal solution of 2D-SEP. In this simple example, as expected, the SEP-ILS method, which exclusively uses line segments, yields the lowest intrinsic boundary length L = 46.1 . Figure 3i shows a corresponding segmentation using the proposed SEP-FBC method that yields a slightly higher intrinsic boundary length L = 46.4 . In more complex examples (see Figure 3i–l), the proposed SEP-FBC method yields a lower intrinsic boundary length than the other methods.
In summary, the main contributions of our work are the following:
  • To the best of our knowledge, this is the first work that extensively studies the 2D-SEP problem under the minimum intrinsic boundary length.
  • We study for the first time basic problem instances, providing the optimal 2D-SEP problem solutions of partitioning of a square and circle into two, three, four, and five equal-area regions and analyzing the case of partitioning of a plane into a high number of equal-area regions.
  • We study for the first time the properties of 2D-SEP, including the total intrinsic boundaries’ length of the optimal 2D-SEP solution as a sequence of N.
  • We propose a fast balanced clustering method (SEP-FBC) that can be combined with a Particle Swarm Optimization (PSO) framework, due to its lower computational cost compared to the baselines from the literature, to efficiently solve the general version of the 2D-SEP problem.
  • The quantitative results obtained on more than 2800 2D shapes included in two standard datasets quantify the outer performance of the proposed methods from baselines of the literature.
The rest of this paper is organized as follows: Section 2 reviews the related work for image segmentation and balanced clustering algorithms. The 2D-SEP problem formulation is given in Section 3. In Section 4, 2D-SEP instances and properties are studied. Section 5 presents the two proposed methods for solving 2D-SEP, respectively. Section 6 describes the experimental setup along with the results obtained. Finally, conclusions and future work are provided in Section 7.

2. Related Work

The problem of image segmentation has been studied extensively during the last decades. In the literature, a variety of image segmentation techniques have been proposed, each utilizing different principles and methodologies. Traditional approaches include thresholding methods [8,9], region-growing techniques, and region-merging strategies [10,11]. Other widely used techniques involve clustering algorithms, such as k-means [12], and edge-based methods such as watershed segmentation [13,14]. Furthermore, contour-based techniques, such as active contours [15], and graph-based methods, including graph cuts [16], have demonstrated effectiveness in various applications. Probabilistic approaches, such as conditional and Markov random fields, as well as sparsity-based methods [17], have been explored for robust segmentation under challenging conditions.
In recent years, the advent of deep learning (DL) has revolutionized the field of image segmentation, leading to significant improvements in accuracy and generalization. Deep learning models leverage hierarchical feature extraction and end-to-end learning capabilities to surpass traditional methods in performance. Convolutional neural networks (CNNs) and their advanced architectures, including fully convolutional networks (FCNs), U-Net, DeepLab, and Mask R-CNN, have established new benchmarks in image segmentation tasks in multiple domains [18]. These advances have enabled the development of highly accurate automated segmentation systems, facilitating progress in medical diagnostics, autonomous driving, and many other critical applications.
Different error criteria have been proposed for image segmentation problems. The Intersection Over Union (IoU) and the F-measure are two of the most popular supervised methods to evaluate image segmentation quality but require the ground truth [19]. Under unsupervised image (color or grayscale) segmentation methods, where the ground truth is completely unknown, clustering-based criteria such as the heterogeneity of pixels between regions and the homogeneity within the region objectively can be used to evaluate the segmentation [20].
Under the 2D-SEP problem, no ground truth is given. So, we have to select an unsupervised criterion. Additionally, the given image is binary, so no color-grayscale information is given. Similar to the polygonal approximation [21] problem, the 2D-SEP problem can be formulated in two ways:
  • The problem of minimum error, where the error (e.g., boundary length) is minimized given the number of segments N.
  • The problem of the minimum number of segments, where the approximation error is bounded, and the goal is to find the minimum number of segments (N) that gives an error lower than the given error.
In this work, according to the proposed problem formulation, we select the first problem formulation of error minimization given the number of segments N, under the error criterion of minimum intrinsic boundary length that may better divide the shape into N equal-area segments. The intrinsic boundary length criterion is selected since, in the given shape S, there does not exist color information, model error, or weights for the boundaries to use a more complicated criterion. Additionally, the same idea called a minimum cut has also been used in image segmentation [22].
Apart from image segmentation, the 2D-SEP problem is related to the balanced clustering problem in the sense that the goal of 2D-SEP is to group the pixels into balanced in-area regions. Clustering is an important problem in a broad spectrum of applications, such as data mining, computer vision, machine learning, and pattern recognition. Thousands of clustering algorithms have been proposed in the literature in many different scientific disciplines [23,24] that differ in the choice of the objective function, probabilistic generative models, and heuristics. Clustering algorithms can be divided into two main categories: hierarchical and partitional:
  • Hierarchical clustering algorithms recursively find nested clusters in either an agglomerative (bottom-up) mode or in a divisive (top-down) mode.
  • According to partitional clustering algorithms, the clusters are simultaneously computed as a partition of the data. Usually, the partition is based on a local optimization of a given criterion.
The K-means clustering algorithm [24,25] is one of the simplest partitional clustering algorithms that solves the clustering problem for a given number of clusters. Even though K-means was first proposed over 50 years ago, it is still one of the most widely used algorithms for clustering. K-means is a centralized clustering algorithm with a linear computation cost. The goal of K-means is to minimize the sum of squared error (SSE) over all clusters, which is an NP-hard problem even for K = 2 . K-means starts with K centroids, e.g., randomly selected in d-dimensional space, one for each candidate cluster. K-means converge to a local minimum of SSE. So, in the case where the given datasets consist of spherical and/or well-separated clusters, these centroids will eventually be placed at the centers of the clusters. In [26], a variant method (K-means++ algorithm) for centroid initialization has been proposed that chooses centers at random from the data points but weighs the data points according to their squared distance from the closest center already chosen. K-means++ usually outperforms K-means in terms of both accuracy and speed. An extension/variation of K-means is the K-medoid or Partitioning Around Medoids (PAM) [27], where the clusters are represented using the medoid of the data instead of the mean. Medoid is the object of the cluster with a minimum distance to all other objects in the cluster.
Traditional clustering aims to minimize the mean square error without considering the balance of the cluster size. Balanced clustering is a two-objective optimization problem in which two objectives contradict each other: to minimize error and to balance cluster sizes [28]. In hard-balanced-constrained clustering, the cluster size balance is a mandatory requirement that must be met, and minimizing the Mean Square Error is a secondary criterion. Balance-constrained clustering can be solved in O( S 3 ), using a balanced k-means clustering algorithm that solves the assignment problem by the Hungarian algorithm [28], where S denotes the number of points. In soft-balanced clustering, balance is an aim but not a mandatory requirement. In [29], a soft-balanced clustering method based on the k-means clustering algorithm and network simplex methods has been proposed.

3. Problem Formulation

The 2D Shape Equipartition Problem (2D-SEP) under the minimum intrinsic boundary length [7] is formulated hereafter. Let S be a given shape, and N be the given the number of equal-area segments (regions). Let R = { R 1 , R 2 , , R N } be a segmentation of S. Each region R i ,   i { 1 , , N } should be connected, which means that the pixels in the R i segment belong to the same connected component. Let B D ( R i , R j ) be the common boundary between the regions R i and R j ,   i , j { 1 , , N } . Then, the optimal segmentation of 2D-SEP R * = { R 1 * , R 2 * , , R N * } should satisfy the following constraints:
| R 1 * | = | R 2 * | = = | R N * | = | S | N
where | . | denotes the cardinality operation, e.g.,  | S | gives the area of shape S (the number of pixels).
R * = argmin R L ( R )
where L ( R ) the total intrinsic boundaries’ length of segmentation R:
L ( R ) = i = 1 N j = i + 1 N | B D ( R i , R j ) |
where | B D ( R i , R j ) | denotes the length of boundary B D ( R i , R j ) . In image processing with pixel accuracy, the satisfaction of Equation (1) is impossible in the case that the area of shape S is not exactly divided by N, and, at the same time, the equality constraint is very hard. Therefore, in this work, we have relaxed Equation (1) as follows:
i = 1 N | | R i * | | S | N | λ
where λ is set equal to 2 · N + 1 , resulting in a mandatory but realistic (feasible) requirement that should be satisfied. This selection can be explained by the fact that λ N 2 due to the pre-mentioned pixel accuracy effect. However, since the equality constraint is very hard, we have selected a higher threshold for λ , providing a good balance between the constraints. In Section 6.5, we have performed a sensitivity analysis of the parameter λ .
Furthermore, in our experimental results, we allow comparisons between different shape sizes and scales by using the normalized total intrinsic boundary length ( N L ( R ) ) of the segmentation R, defined as the ratio of L ( R ) to the outer boundary length of the object | B D ( S ) | .
N L ( R ) = L ( R ) | B D ( S ) |

4. 2D-SEP Instances and Properties

In the following, we study the basic instances and properties of 2D-SEP.

4.1. Plane Partition

Firstly, we will consider the case of the partitioning of a plane into a high number of equal-area regions. Figure 4 shows three popular regular tessellation patterns (equal-area regions) that can tile a plane without overlaps or gaps: tessellations using (equal) hexagons, squares, or equilateral triangle. According to 2D-SEP, we examine the efficiency of the above three patterns in Table 1 by comparing the boundaries of an equal-area (s) hexagon, and square, and equilateral triangles as a function of s. We find that tessellations using hexagons have 7 % and 18.4 % lower intrinsic boundary lengths compared to tessellations using square and equilateral triangles, respectively. Theoretically, SEP-FBC and SEP-RG are possible to generate hexagonal and square tessellations, while SEP-ILS is possible to generate only equilateral triangle tessellations. Consequently, SEP-FBC and SEP-RG hold a theoretical advantage over SEP-ILS, a finding that is further supported by our experimental results.
Hales [30] gives proof that any partition of the plane into regions of equal area has a perimeter at least that of the regular hexagonal honeycomb tiling, meaning that the optimal solution of 2D-SEP when the number of regions is large enough is the partition into equal hexagonals.

4.2. 2D-SEP of Square and Circle

Next, we consider the case of the partitioning of a square and circle into two, three, four, and five equal-area regions. To provide comparable numerical results, we assume a unit area square and circle. Figure 5 depicts optimal solutions of the 2D-SEP for unit area (a–d) square and (e–h) circle under N = 2, 3, 4 and 5, while Figure 6 shows some suboptimal solutions of the 2D-SEP for unit area (a,b) square and (c,d) circle for N { 3 , 5 } . Taking into account both figures, the optimality proof of most cases in Figure 5 is trivial; so, hereafter, we only provide the close form of the intrinsic boundary length (L), which is numerically reported in the caption of the figure.
  • When N = 2 (see Figure 5a,e), the optimal solution of 2D-SEP under the square and circle is given by the horizontal line that passes from the square centroid ( L = 1 ) and the diameter of the circle ( L = 2 R = 2 π = 1.128 ), respectively.
  • When N = 3 (see Figure 5b,f), the optimal solution of 2D-SEP under the square is given by two suitable vertical lines that divide the square into three rectangles | R 1 | = 1 × 1 3 , | R 2 | = | R 3 | = 1 3 × 2 3 , with  L = 1 + 2 3 = 1.667 . The optimal solution of 2D-SEP under the circle is given by the boundary of the three radiuses that passes from the center with L = 3 R = 3 π = 1.693 .
  • When N = 4 (see Figure 5c,g), the optimal solution of 2D-SEP under the square is given by two suitable vertical lines that cross at the square centroid and divide the square into four equal squares, with  L = 2 . The optimal solution of 2D-SEP under the circle is given similarly by two vertical diameters with L = 4 R = 4 π = 2.257 .
  • When N = 5 (see Figure 5d,h), the optimal solution of 2D-SEP under the square is given by a circle of the radius ( 1 5 π ) plus four suitable vertical lines of length ( 1 2 1 5 π ), with L = 2 π 5 π + 4 · ( 1 2 1 5 π ) = 2.576 . The optimal solution of 2D-SEP under the circle is given by five radiuses with L = 5 R = 5 π = 2.821 , which is slightly lower than the corresponding solution of Figure 6d with L = 2.833 .
An interesting remark of the above examples is that, in any case, the L of the optimal solution of the square is lower than the corresponding L of the circle. The proof that this is true (or this is not true) for any value of N is an open problem.
In Figure 7, we provide the corresponding results of the proposed method SEP-FBC (SEP-PSO FBC also provides the same results) under unit area square and circle and N 2 , 3 , 4 , 5 to compare with the optimal 2D-SEP solutions of Figure 5. We find that in any case of the circle, the SEP-FBC results in the optimal solution, while in two out of five cases of the square ( N = 3 , N = 5 ), the proposed segmentation of SEP-FBC is suboptimal with slightly higher L than the optimal one:
  • For N = 3 , SEP-FBC yields L = 1.755 , which is 5.02 % higher than the corresponding optimal L of Figure 5b.
  • For N = 5 , SEP-FBC yields L = 2.632 , which is 2.19 % higher than the corresponding optimal L of Figure 5d. In this case, a part of the intrinsic boundaries of the optimal solution is a circle. The reason why both proposed methods do not find it is that the intrinsic boundaries provided by the proposed method should be polygonal lines.

4.3. Intrinsic Boundaries’ Length

Hereafter, we study an important 2D-SEP property, the sequence of the total intrinsic boundaries’ length of the optimal 2D-SEP solution R * ( S , N ) of shape S into N regions as N increases. According to the problem definition, it holds that
lim N L ( R * ( S , N ) ) =
since the area of its region, as N tends to ∞, it tends to zero, so the total intrinsic boundaries’ length tends to ∞, covering the whole space of the shape S. When N = 2 , the  L ( R * ( S , 2 ) ) depends on shape S. The following inequality provides the upper bound of the L ( R * ( S , 2 ) )
0 L ( R * ( S , 2 ) ) P e r ( S ) 2
where P e r ( S ) denotes the perimeter of shape S. The proof is trivial for convex shapes by getting the suboptimal solution that the intrinsic boundaries are line segments L ( R / ( S , 2 ) ) L ( R * ( S , 2 ) ) . This solution always exists for convex shapes [7], and it satisfies the inequality (7).
In basic shapes of Section 4.2, for low values of N, it holds that
L ( R * ( S , N ) ) < L ( R * ( S , N + 1 ) ) .
The fact that L ( R * ( S , N ) ) may be a monotonically increasing sequence for some shapes is also supported by the inequalities (6) and (7), and it is true for several simple shapes and at least for low values of N.
However, there exist some shapes in which even for low values of N (e.g., N = 2 ), the inequality (8) is not true. Figure 8 depicts a shape that consists of three successive circles of radius, where
L ( R * ( S , 2 ) ) P e r ( S ) 3 · π 4 · ε > L ( R * ( S , 3 ) ) = 2 · ε .
The red and gray lines show the intrinsic boundary for the optimal segmentation into two and three regions, respectively. Since in this constructed example ε can be set almost zero, it holds that
L ( R * ( S , 2 ) ) > > L ( R * ( S , 3 ) ) .
Similarly, with the case of three circles, in the corresponding shape with successive circles N + 1 , it holds that
L ( R * ( S , N ) ) > > L ( R * ( S , N + 1 ) ) = N · ε .
In Section 6.5, we study the sequence L ( R ( S , N ) ) of the solutions derived by the proposed methods. Since the sequence may be monotonically increasing for low values of N and simple shapes, it can measure the complexity of the dataset. Furthermore, if we compare the derived sequence L ( R ( S , N ) ) for different methods, conclusions can be drawn about the robustness of the methods, as  L ( R ( S , N ) ) is expected to increase.

5. Methodology

5.1. SEP-Fast Balanced Clustering

This Section presents the proposed fast balanced clustering method (SEP-FBC) that sub-optimally solves the 2D-SEP in O( N · | S | · l o g ( | S | ) ), where | S | denotes the number of image pixels. The pseudo-code of the proposed SEP-FBC method is given in Algorithm 1. The input of SEP-FBC is the shape S (e.g., a binary image) and the number of the desired regions N of equipartition. The output is the segmentation R according to the constraints of the problem, as defined in Section 3. In the following, we analyze all the steps of the SEP-FBC method. SEP-FBC consists of two stages:    
Algorithm 1: The proposed SEP-FBC method
Algorithms 18 00277 i001
In the first stage, the hard clustering of the shape pixels is performed (lines 1–16 of Algorithm 1).
  • Initially, a graph G of the connected pixels from the 2D image space of shape S is computed using eight pixel connectivity. This graph is used to approximate the shortest path distance between the shape points of the complete graph (see Appendix A).
  • Then, an initial estimation of the centroids of the N clusters ( C = { C 1 , , C N } ) is calculated by the k-means++ method [26] (with computational cost O ( N · | S | ) ) followed by the round operation [ . ] to adjust C to the space of the image coordinates (see line 1 of Algorithm 1). In the case where C i does not belong in shape S ( S ( C i ) = 0 ), C i is set to the nearest shape pixel. This is conducted by the get_closest_point procedure (see line 5 of Algorithm 1 and Equation (9)).
    g e t _ c l o s e s t _ p o i n t ( C ( i ) , S ) = argmin p S | C ( i ) p | 2
    where the centroid C i corresponds to the region R i .
  • Furthermore, we initialize each region R i = Ø , i { 1 , , N } and compute for each region R i the vector G D 8 ( i , : ) with all the eight-connectivity graph-based distances between the centroid C i and the shape points (see lines 7–8 Algorithm 1 and procedure distances(G, C i )) (the computational cost of this process is O ( N · E · l o g | S | ) = O ( N · | S | · l o g | S | ) using the Dijkstra algorithm with the Adjacency List and Heap, since it is executed N times and the number of edges of the graph G is E = O ( | S | ) , due to the fact that each node of the graph has a limited number of neighbors (up to eight neighbors)). The initial clustering of shape pixels is performed using an approximation by the combination of the Euclidean distance and G D 8 ( . ) (see line 12 of Algorithm 1) of the graph-based distance of a complete graph of shape S. The use of graph-based distances for clustering provides better image component connectivity for clusters compared with the use of the pure Euclidean distance. This is due to the fact that graph-based distances take into account the component connectivity, while the pure Euclidean distance is directly computed from the pixels’ coordinates (see Figure A1b of Appendix A). The sum of the boundaries’ lengths of the resulting segmentation is low due to the distance-based clustering procedure, but the clusters’ sizes may not be equal.
In the second stage, the resulting clustering is balanced (lines 17–23 of Algorithm 1).
  • Initially, we ensure that all the clusters (regions) consist of connected pixels by assigning non-connected pixels to the smallest neighbor region. This is performed by the procedure correctConnectedComponets(R) (in line 17 of Algorithm 1). Additionally, we smooth the region boundaries by reassigning the pixels of each region boundary to the region that has the most neighbors which is carried out by the procedure smoothBoundaries(R) of line 18 of Algorithm 1.
  • Finally, we perform an iterative process that in each iteration grows the smallest region (areaGrow procedure) until the inequality (4) is satisfied (see lines 20–23 of Algorithm 1). The N × N symmetric matrix R R that counts the number of pixel reassignments between two regions is initialized to zero. The areaGrow procedure uniformly grows the smallest region c by applying the dilation operation with an open disk of radius one. The procedure prevents infinite loops by adding the extra pixels p in a descending way according to expression | R ( p ) | R R ( c , R ( p ) ) , where | R ( p ) | denotes the area of the region to which p belonged, and R R ( c , R ( p ) ) is the number of reassignments between the regions c and the region that p belonged ( R ( p ) ). The procedure can stop before growth has finished only if the current area of the region | R c | is at least | S | N 1 . The computational cost of this stage is O ( | S | + | S | + N 2 ) according to the procedures of lines 17–19 of Algorithm 1. The iterative step of lines 20–23 of Algorithm 1 has a computational cost of O ( N 2 + N · | S | ) .
Taking into account all the steps of the method, we obtain a total computation complexity equal to O ( N · | S | · l o g | S | + N 2 ) that is simplified to O ( N · | S | · l o g | S | ) since N < < | S | . This computational complexity is lower compared with the computational complexity O ( N 2 · | S | + | S | 2 ) of the most computational efficient method from the literature SEP-RG. In our experimental results, we also verify the computational efficiency of the proposed method by comparing the execution times of the proposed method and baselines from the literature. Both important differences in computational complexity and execution times compared with other state-of-the-art methods provide a justification for the Fast “fast” in the name of the method. Additionally, the most computationally efficient method for the simpler clustering problem is k-means with a O ( N · | S | ) computational cost. The proposed method that provides a solution to the more complex 2D-SEP problem with a slightly higher computational cost can also be considered as a fast method.
Figure 9 shows some segmentation results of the two stages of the proposed SEP-FBC method for N = 5 . Figure 9a shows the result of the first stage of the method with a total intrinsic boundary length equal to 106.6 , which produces regions of varying areas in the range [ 583 , 1132 ] . The execution of the second stage (see Figure 9b) yields equal-area segments with a total intrinsic boundary length equal to 121.6 . In another example of Figure 9c, the result of the first stage has the total intrinsic boundary length 116.9 with regions of varying areas in the range [ 918 , 2082 ] . The execution of the second stage (see Figure 9d) results in equal-area segments with a total intrinsic boundary length 162.6 .

5.2. SEP-PSO Fast Balanced Clustering

This Section presents the proposed Particle Swarm Optimization (PSO)-based fast balanced clustering method (SEP-PSO FBC), which combines the PSO framework with the proposed SEP-FBC method to improve its results.
PSO is a derivative-free optimization method designed to handle complex, multi-modal, and discontinuous objective functions with multiple local minima. The optimization process is driven by the evolution of a population (swarm) of candidate solutions (particles). These particles explore the parameter space of the objective function, adapting over a finite number of generations (iterations) based on a strategy that emulates “social interaction”. The key parameters of PSO are the number of particles and generations, whose product defines the computational budget—that is, the total number of objective function evaluations. PSO is capable of achieving near-optimal solutions and has been successfully applied to various challenging optimization problems in computer vision and pattern recognition, including classification, clustering, prediction, simplification, image segmentation, video co-segmentation, and object tracking [21,31,32,33].
According to the 2D-SEP problem definition, the proposed SEP-PSO FBC method optimizes the L ( R ) metric (see Equation (3)) for initial centroids, which initialize SEP-FBC method (instead of k-means initialization), that are directly represented by PSO particles. Similar to SEP-FBC, the input of SEP-PSO FBC is the shape S and the number of the desired regions N of equipartition, and the output is the segmentation R according to the constraints of the problem, as defined in Section 3.
Iteratively, PSO searches for the best combination of N initial centroids that minimize the L ( R ) metric. We represent each particle by a 2 · N vector with the 2D coordinates of the N-initial centroids of the regions. In order to reduce the search space, we assume that the vertices are sorted in ascending order concerning their distance from the top-left image corner; otherwise, in the evolution process, we correct the order of vertices of each particle according to this hypothesis. The fitness (objective function) of the particle is directly given by the L ( R ) metric of the particle (see Equation (3)). The SEP-PSO FBC algorithm is analytically described hereafter.
Initially, we create a population of M particles (e.g., M = 10 ) that are located in random positions in shape S, while the first particle is given by the k-means++ algorithm (see Section 5.1). In the evolution process, PSO finds the current optimal solution in order to update the best global solution. Furthermore, the best local solution for each particle is also updated, where the L ( R ) of the particle reaches a better solution. The method ends when the number of iterations of the evolution process exceeds the given number of generations. In this work, we use the upper limit of 50 generations.

6. Experimental Evaluation

6.1. Datasets

The proposed approaches were evaluated using two well-established datasets from the literature. More specifically, we employ the following:
  • A subset of LEMS [34], that is, 1462 shapes that come from the following categories of the original database: Buildings, Containers, Fish, Fruit and vegetables, Misc Animal, People, Robots, Toddlers, and Turtles [21].
  • MPEG-7 [35], which consists of 1400 binary shapes organized in 70 categories with 20 shapes per category. This dataset has been extensively used in shape tasks [21,36].
Figure 10 shows twelve sample images from the LEMS dataset and the MPEG-7 dataset.

6.2. Baseline Methods

We compared the performance of the proposed methods (SEP-PSO FBC, and SEP-FBC) with the baselines SEP-RG and SEP-ILS algorithms [7] that also solve 2D-SEP. Both baselines are briefly presented in Section 1. The methods are evaluated for a sufficient number of consecutive values of N, starting from N = 2 , the minimum value at which 2D-SEP can be defined. Therefore, in our experiments, we have evaluated the methods for nine different values of N { 2 , , 10 } , resulting in 25,758 2D segmentation instances ( 9 × ( 1400 + 1462 ) ). Additionally, the SEP-PSO FBC framework is compared with the SEP-FBC to show how the selection of the initial centroids affects the performance of the method SEP-FBC.
All the analysis has been performed using MATLAB 2023b on an Intel i7 core 3.20 GHz with 32 GB RAM without the use of code optimization or parallel processing tools. The code implementing the proposed methods along with the datasets are publicly available online: https://sites.google.com/site/costaspanagiotakis/research/shape-equipartition accessed on 7 May 2024.

6.3. Evaluation Metrics

Based on the formulation of the 2D-SEP problem, we have compared the performance of SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS on the normalized total intrinsic boundary length N L ( R ) (see Section 3). For a given dataset, we also compute P r ( m / N L ) , where m is a method in { SEP - PSO FBC , SEP - FBC , SEP - RG , SEP - ILS } . P r ( m / N L ) is defined as the percentage of shapes of the datasets where the method m outperforms the others under the N L , defined as follows:
P r ( m / N L ) = S D H ( N L m ( S ) m a x n m N L n ( S ) ) | D |
where H is the unit step function, | D | denotes the number of shapes of dataset D, and N L m ( P ) is the N L metric of method m given the shape S. This also means that the value 100 % m P r ( m / I o U ) gives the percentage of images for which there is no clear winner method. In addition, we study the computational efficiency of all methods by measuring the Average Execution Time ( A E T ) per image for different values of N.
Furthermore, in this work, we use the circularity ( C i r c ( S ) ) and solidity ( S o l ( S ) ) shape descriptors [37] to show that the used datasets consist of quite different shapes and to measure how the performance of the proposed methods is affected by the complexity of the shapes. Circularity ( C i r c ( S ) ) is defined by the ratio of the area of the shape | S | multiplied by the product 4 π divided by the square of the perimeter of the shape ( P e r ( S ) ). The circularity of a circle is one (maximum value), and, the lower it goes, the less circular it is or has a more complex outer boundary.
C i r c ( S ) = 4 π | S | P e r 2 ( S )
Solidity ( S o l ( S ) ) is defined by the proportion of pixels in the convex hull that are also in the region. Solidity describes the extent to which a shape is convex or concave. The solidity of a completely convex shape is one; the farther the solidity, the greater the extent of concavity in the structure. Figure 11a shows the circularity and solidity relative frequency histogram for the LEMS and MPEG-7 datasets, highlighting the diversity of shapes found in both datasets.

6.4. Comparisons on LEMS and MPEG7 Datasets

In the following, we present comparisons of the proposed and baseline methods on the normalized total intrinsic boundary length ( N L ) and in terms of computational efficiency.
Table 2 shows the average N L for nine different values of N { 2 , , 10 } of SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on MPEG7 and LEMS datasets. We find that SEP-PSO FBC clearly outperforms the other methods in any dataset under N L and P r ( m / N L ) metrics. It should be noted that UPF-FBC is clearly the most computationally efficient method since it is about six, thirty, and sixty times faster than SEP-RG, SEP-PSO FBC, and SEP-ILS, respectively. SEP-FBC also outperforms SEP-RG and SEP-ILS under the intrinsic boundary length. SEP-RG outperforms SEP-ILS under the intrinsic boundary length and computational cost. According to Table 2, in 89.2 % and 87.9 % of shapes for LEMS and MPEG7 datasets, respectively, the proposed methods clearly outperform, in terms of the intrinsic boundary length, the current methods from the literature (SEP-RG and SEP-ILS). On average, the NL of the SEP-PSO FBC is 7 % and 7.4 % lower compared to the corresponding NL of the top-performing method SEP-RG from the literature on LEMS and MPEG7 datasets, respectively.
Figure 12 shows the NL metric of the SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on LEMS and MPEG7 datasets for different values of N. We find that for any dataset and value of N, SEP-PSO FBC clearly outperforms the other methods. More specifically, SEP-PSO FBC produces a lower NL than SEP-PSO ranging from [ 2.7 % , 9 % ] on the LEMS and MPEG7 datasets. SEP-PSO FBC produces a lower NL than SEP-RG ranging from [ 3.5 % , 12.5 % ] on the LEMS and MPEG7 datasets. SEP-ILS outperforms SEP-RG and SEP-ILS under any dataset and value of N. Therefore, the results of the figure agree with the corresponding results of Table 2, showing that the top-performing method is the SEP-PSO FBC.
Figure 13 shows the average A E T (in secs) of the SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on all images of LEMS and MPEG7 dataset for different values of N. For a better visualization of the results, we set the scale of the y-axis to be logarithmic. The results of the figure agree with the corresponding A E T of Table 2, showing that under any value of N, the most computationally efficient method is the SEP-FBC.

6.5. Evaluation of the Proposed Methods

In the following, we present comparisons between the proposed methods SEP-PSO FBC and SEP-FBC on the normalized total intrinsic boundary length ( N L ). According to our methodology, it holds that SEP-PSO FBC outperforms SEP-FBC since it combines SEP-FBC and PSO framework to find better initial centroids. Next, we examine how the difference in performance of the proposed methods is affected by the complexity of the shapes. To do so, we create three equal-sized groups of shapes for each dataset with low, medium, and high values of circularity. The set with low circularity values consists of 33.3 % of shapes with lower circularity values, and so on. Similarly, we create three equal-sized groups of shapes for each dataset with low, medium, and high solidity values.
Figure 14 depicts the average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC and SEP-FBC computed on (a–c) LEMS and (d–f) MPEG7 datasets for (a) and (d) low; (b) and (e) medium; (c) and (f) high circularity shapes. Figure 15 depicts the average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC and SEP-FBC computed on (a–c) LEMS and (d–f) MPEG7 datasets for (a) and (d) low; (b) and (e) medium; (c) and (f) high solidity shapes. In both datasets, SEP-PSO FBC demonstrates a higher outperformance than SEP-FBC in shapes with low circularity or solidity than in those with high circularity or solidity. Therefore, in general, the more complex the shape, the higher the outperformance of SEP-PSO FBC since under complex shapes there may exist more candidate positions for the initial centroids that should be examined to find the best equipartition.
In Figure 16, we present the results of SEP-PSO FBC and SEP-FBC for the two shapes of the LEMS (first two columns) and MPEG7 (last two columns) datasets with N { 2 , , 9 } , where the outperformance of SEP-PSO FBC is maximized to show the upper limit of this outperformance. Under any value of N, it holds that SEP-PSO FBC provides better solutions in terms of N L metric than the corresponding solutions of SEP-FBC. In most cases, the proposed solutions of SEP-PSO FBC significantly differs from the corresponding solutions of SEP-FBC showing the importance of the selection of initial centroids, especially when a complex shape is given.
In Figure 17, we perform a sensitivity analysis of the NL metric for the parameter λ and different values of N under the SEP-FBC method and the MPEG7 dataset. We study how the NL metric of SEP-FBC method is affected by different values of the parameter λ { N + 1 , 2 N + 1 , 3 N + 1 , 4 N + 1 , 5 N + 1 } , defined in Section 3. As expected, the higher value of λ , the lower NL metric, which is true for any value of N. In this experiment, it holds that the difference in N L between two successive values of λ , having an absolute difference equal to N, in any case of N is less than 1 % , showing the robustness of the SEP-FBC method under different values of the parameter λ .
Finally, we study the sequence L ( R ( S , N ) ) of the solutions derived by the proposed methods as defined in Section 6.5. Figure 18 shows the percentage of shapes in which the sequence L ( R ( S , N ) ) derived by SEP-PSO FBC and SEP-FBC does not increase monotonically, with N 9 . SEP-PSO FBC yields lower values under any dataset and N. More specifically, the mean values of this percentage of SEP-PSO FBC are 1.76 and 2.91, while the corresponding mean values of SEP-PSO are 6.69 and 7.83, under LEMS and MPEG7 datasets, respectively. This means that SEP-PSO FBC yields more robust results compared to the SEP-PSO.

6.6. Applications of the Proposed Methods

The proposed methods can be applied to segmentation tasks, such as the tree detection problem [6], where the objective is to identify trees in aerial images. In cases of dense forests and low-quality imagery, unsupervised and deep learning methods often struggle to achieve accurate segmentation. Figure 19 shows a promising result of the proposed methods SEP-PSO FBC and SEP-FBC on the tree detection problem under a low quality dense forest image. In this example, even a human expert is almost impossible to detect the trees. SEP-FBC has been applied on the largest region of the bitmap image derived by RGBVI index as used in [6]. The number of trees was determined by dividing the area of the largest region by the typical size of a tree. The tree boundaries are colored blue. Under the assumption that the trees are equal sized, 188 trees were detected by the proposed methods. As expected, the N L of SEP-PSO FBC (2.713) is lower than that of SEP-FBC (2.806), indicating that the segmentation produced by SEP-PSO FBC is probably more preferable.

7. Conclusions

In this work, we introduced a novel methodology for the fast equipartition of complex 2D shapes while minimizing intrinsic boundary length. The proposed method, which is based on a fast balanced clustering algorithm, demonstrates superior performance in basic shapes and outperforms existing techniques in a large number of complex shapes. Additionally, our approach is combined with the PSO framework to improve partition quality and robustness, ensuring near-optimal subdivisions even in complex shapes. However, due to the high computation cost of SEP-PSO FBC, in real-time applications where the number of N is quite high (e.g., more than 100), SEP-FBC may be more preferable than the PSO framework due to its lower computational cost. Experimental results on various datasets of more than 2800 shapes with more than 25,000 segmentation instances in two standard datasets confirm the robustness and computational efficiency of our approach. Finally, we study the application of the proposed framework on the tree detection problem.
In ongoing and future work, we plan to study optimal solutions of the 2D-SEP problem with higher values of N and under more complex basic shapes. Moreover, our aim is to apply 2D-SEP on real computer vision and pattern recognition problems, where the goal is to provide segmentation of a given 2D shape. Future work could also explore extensions to three-dimensional shapes and other real-world applications.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The associated code and datasets are developed for the project can be shared publicly after the paper acceptance. The sharing of parts of the code or datasets could be approved, at the author’s discretion, upon request.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

Figure A1. (a) Examples of graph-based distances G D 8 ( . ) and G D ( . ) between the point p 1 and points of image space. The pixels where both distances agree are colored in white. (b) An example of graph-based and the Euclidean distance between the points p 1 and p 2 in a binary image. In this example, it holds that G D 8 ( p 1 , p 2 ) = G D ( p 1 , p 2 ) = 3 + 3 · 2 > | p 1 p 2 | 2 = 3 .
Figure A1. (a) Examples of graph-based distances G D 8 ( . ) and G D ( . ) between the point p 1 and points of image space. The pixels where both distances agree are colored in white. (b) An example of graph-based and the Euclidean distance between the points p 1 and p 2 in a binary image. In this example, it holds that G D 8 ( p 1 , p 2 ) = G D ( p 1 , p 2 ) = 3 + 3 · 2 > | p 1 p 2 | 2 = 3 .
Algorithms 18 00277 g0a1
In this appendix, we study the relationship between the (8-pixel connectivity) graph-based distance G D 8 ( . ) , the Euclidean distance and the complete graph-based distance G D ( . ) , as defined in Section 5, and we propose an approximation of the graph-based distance of a complete graph that combines the Euclidean distance, and G D 8 ( . ) . Figure A1a shows examples of graph-based distances G D 8 ( . ) and G D ( . ) between the point p 1 and some points ( p 2 , p 3 and p 4 ) of the image space using gray and blue lines, respectively. In this example, for any pair of points, it holds that the complete graph-based distance G D ( . ) is equal to the corresponding Euclidean distance. Concerning the G D 8 ( . ) , it is equal to the corresponding Euclidean distances (or G D ( . ) ) for pixels p 2 S with angle p 1 p 2 { 0 , 45 , 90 , 135 , 180 , 225 , 270 , 315 } (see the white pixels in Figure A1a).
G D 8 ( p 1 , p 2 ) = G D ( p 1 , p 2 ) p 1 p 2 = k · π 4 , { k N }
In Figure A1a, it holds that
G D 8 ( p 1 , p 2 ) = | p 1 p 5 | 2 + | p 2 p 5 | 2 = 2 + 1 5 | p 1 p 2 | 2
G D 8 ( p 1 , p 3 ) = | p 1 p 6 | 2 + | p 3 p 6 | 2 = 2 + 1 5 | p 1 p 3 | 2
G D 8 ( p 1 , p 4 ) = | p 1 p 7 | 2 + | p 4 p 7 | 2 = 8 + 1 13 | p 1 p 4 | 2
Due to the 8-pixel connectivity of the graph G, it holds that G D 8 ( p 1 , p 2 ) G D ( p 1 , p 2 ) | p 1 p 2 | 2 . More specifically, it holds that the ratio G D 8 ( p 1 , p 2 ) G D ( p 1 , p 2 ) 2 + 1 5 . This ratio is maximized for the pixels p 2 S with angle p 1 p 2 = π 8 + k · π 4 , { k N } (see the orange-colored pixels of Figure A1a). This direction corresponds to the bisector of the directions where the two distances are identical according to the Equation (A1). Therefore, it holds that
5 2 + 1 · G D 8 ( p 1 , p 2 ) G D ( p 1 , p 2 ) G D 8 ( p 1 , p 2 )
The graph-based distance G D ( p 1 , p 2 ) of a complete graph of shape S between two points p 1 S and p 2 S is equal to the Euclidean distance | p 1 p 2 | 2 if and only if the points of the line segment p 1 p 2 belong to the shape S. Otherwise, it holds that G D ( p 1 , p 2 ) > | p 1 p 2 | 2 . Moreover, it holds that G D ( p 1 , p 2 ) G D 8 ( p 1 , p 2 ) . These distances are equal if and only if the shortest paths between the points p 1 , p 2 under two graphs are identical. Examples of such cases are shown in Figure A1b. Therefore, taking also into account the Inequality (A2), it holds that the graph-based distance G D ( p 1 , p 2 ) can be approximated by the G D 8 ( p 1 , p 2 ) and the | p 1 p 2 | 2 as follows:
G D ^ ( p 1 , p 2 ) = m a x ( 5 2 + 1 G D 8 ( p 1 , p 2 ) , | p 1 p 2 | 2 ) .

References

  1. Jiang, D.; Li, G.; Tan, C.; Huang, L.; Sun, Y.; Kong, J. Semantic segmentation for multiscale target based on object recognition using the improved Faster-RCNN model. Future Gener. Comput. Syst. 2021, 123, 94–104. [Google Scholar] [CrossRef]
  2. Yi, Y.; Zhang, Z.; Zhang, W.; Zhang, C.; Li, W.; Zhao, T. Semantic segmentation of urban buildings from VHR remote sensing imagery using a deep convolutional neural network. Remote Sens. 2019, 11, 1774. [Google Scholar] [CrossRef]
  3. Li, H.; Zhao, X.; Su, A.; Zhang, H.; Liu, J.; Gu, G. Color space transformation and multi-class weighted loss for adhesive white blood cell segmentation. IEEE Access 2020, 8, 24808–24818. [Google Scholar] [CrossRef]
  4. Panagiotakis, C.; Athanassopoulos, K.; Tziritas, G. The equipartition of curves. Comput. Geom. 2009, 42, 677–689. [Google Scholar] [CrossRef]
  5. Shapira, L.; Shamir, A.; Cohen-Or, D. Consistent mesh partitioning and skeletonisation using the shape diameter function. Vis. Comput. 2008, 24, 249–259. [Google Scholar] [CrossRef]
  6. Markaki, S.; Panagiotakis, C. Unsupervised Tree Detection and Counting via Region-Based Circle Fitting. In Proceedings of the ICPRAM, Lisbon, Portugal, 22–24 February 2023; pp. 95–106. [Google Scholar]
  7. Panagiotakis, C. The 2D Shape Equipartition Problem Under Minimum Boundary Length. In Proceedings of the International Conference on Pattern Recognition, Kolkata, India, 1–5 December 2024; Springer: Berlin/Heidelberg, Germany, 2024; pp. 64–79. [Google Scholar]
  8. Ostu, N. A threshold selection method from gray-level histograms. IEEE Trans. Syst. Man Cybern. 1979, 9, 62. [Google Scholar]
  9. Zheng, J.; Gao, Y.; Zhang, H.; Lei, Y.; Zhang, J. OTSU multi-threshold image segmentation based on improved particle swarm algorithm. Appl. Sci. 2022, 12, 11514. [Google Scholar] [CrossRef]
  10. Preetha, M.M.S.J.; Suresh, L.P.; Bosco, M.J. Image segmentation using seeded region growing. In Proceedings of the 2012 International Conference on Computing, Electronics and Electrical Technologies (ICCEET), Nagercoil, Tamil Nadu, India, 21–22 March 2012; pp. 576–583. [Google Scholar]
  11. Lv, X.; Persello, C.; Li, W.; Huang, X.; Ming, D.; Stein, A. Deep Merge: Deep-Learning-Based Region Merging for Remote Sensing Image Segmentation. IEEE Trans. Geosci. Remote Sens. 2025, 63, 5614120. [Google Scholar] [CrossRef]
  12. Dhanachandra, N.; Manglem, K.; Chanu, Y.J. Image segmentation using K-means clustering algorithm and subtractive clustering algorithm. Procedia Comput. Sci. 2015, 54, 764–771. [Google Scholar] [CrossRef]
  13. Grau, V.; Mewes, A.; Alcaniz, M.; Kikinis, R.; Warfield, S.K. Improved watershed transform for medical image segmentation using prior information. IEEE Trans. Med Imaging 2004, 23, 447–458. [Google Scholar] [CrossRef]
  14. Kornilov, A.; Safonov, I.; Yakimchuk, I. A review of watershed implementations for segmentation of volumetric images. J. Imaging 2022, 8, 127. [Google Scholar] [CrossRef] [PubMed]
  15. Chan, T.F.; Vese, L.A. Active contours without edges. IEEE Trans. Image Process. 2001, 10, 266–277. [Google Scholar] [CrossRef] [PubMed]
  16. Niazi, M.; Rahbar, K.; Taheri, F.; Sheikhan, M.; Khademi, M. Delicate image segmentation based on cosine kernel graph cut. J. Vis. Commun. Image Represent. 2025, 108, 104430. [Google Scholar] [CrossRef]
  17. Minaee, S.; Wang, Y. An ADMM approach to masked signal decomposition using subspace representation. IEEE Trans. Image Process. 2019, 28, 3192–3204. [Google Scholar] [CrossRef]
  18. Minaee, S.; Boykov, Y.; Porikli, F.; Plaza, A.; Kehtarnavaz, N.; Terzopoulos, D. Image segmentation using deep learning: A survey. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 3523–3542. [Google Scholar] [CrossRef]
  19. Wang, Z.; Wang, E.; Zhu, Y. Image segmentation evaluation: A survey of methods. Artif. Intell. Rev. 2020, 53, 5637–5674. [Google Scholar] [CrossRef]
  20. Khan, J.F.; Bhuiyan, S.M. Weighted entropy for segmentation evaluation. Opt. Laser Technol. 2014, 57, 236–242. [Google Scholar] [CrossRef]
  21. Panagiotakis, C. Particle Swarm Optimization-Based Unconstrained Polygonal Fitting of 2D Shapes. Algorithms 2024, 17, 25. [Google Scholar] [CrossRef]
  22. Lempitsky, V.; Blake, A.; Rother, C. Image segmentation by branch-and-mincut. In Proceedings of the Computer Vision–ECCV 2008: 10th European Conference on Computer Vision, Marseille, France, 12–18 October 2008; Proceedings, Part IV 10. Springer: Berlin/Heidelberg, Germany, 2008; pp. 15–29. [Google Scholar]
  23. Jain, A. Data clustering: 50 years beyond K-means. Pattern Recognit. Lett. 2010, 31, 651–666. [Google Scholar] [CrossRef]
  24. Ikotun, A.M.; Ezugwu, A.E.; Abualigah, L.; Abuhaija, B.; Heming, J. K-means clustering algorithms: A comprehensive review, variants analysis, and advances in the era of big data. Inf. Sci. 2023, 622, 178–210. [Google Scholar] [CrossRef]
  25. MacQueen, J.B. Some Methods for Classification and Analysis of MultiVariate Observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Berkeley, CA, USA, 21 June–18 July 1965 and 27 December 1965–7 January 1966; Volume 1, pp. 281–297. [Google Scholar]
  26. Arthur, D.; Vassilvitskii, S. k-means++: The advantages of careful seeding. In Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, New Orleans, LA, USA, 7–9 January 2007; pp. 1027–1035. [Google Scholar]
  27. Theodoridis, S.; Koutroumbas, K. Pattern Recognition, 3rd ed.; Elsevier: Amsterdam, The Netherlands, 2006; p. 635. [Google Scholar]
  28. Malinen, M.I.; Fränti, P. Balanced k-means for clustering. In Proceedings of the Structural, Syntactic, and Statistical Pattern Recognition: Joint IAPR InternationalWorkshop, S+ SSPR 2014, Joensuu, Finland, 20–22 August 2014; Springer: Berlin/Heidelberg, Germany, 2014; pp. 32–41. [Google Scholar]
  29. Lin, W.; He, Z.; Xiao, M. Balanced Clustering: A Uniform Model and Fast Algorithm. In Proceedings of the IJCAI, Macao, 10–16 August 2019; pp. 2987–2993. [Google Scholar]
  30. Hales, T.C. The honeycomb conjecture. Discret. Comput. Geom. 2001, 25, 1–22. [Google Scholar] [CrossRef]
  31. Oikonomidis, I.; Kyriazis, N.; Argyros, A.A. Efficient model-based 3D tracking of hand articulations using Kinect. In Proceedings of the BMVC, Dundee, UK, 29 August–2 September 2011; Volume 1, p. 3. [Google Scholar]
  32. Farshi, T.R.; Drake, J.H.; Özcan, E. A multimodal particle swarm optimization-based approach for image segmentation. Expert Syst. Appl. 2020, 149, 113233. [Google Scholar] [CrossRef]
  33. Gad, A.G. Particle swarm optimization algorithm and its applications: A systematic review. Arch. Comput. Methods Eng. 2022, 29, 2531–2561. [Google Scholar] [CrossRef]
  34. Kimia, B. A Large Binary Image Database, LEMS Vision Group at Brown University. 2002. Available online: http://www.lems.brown.edu/~dmc/ (accessed on 7 May 2024).
  35. Latecki, L.J.; Lakamper, R.; Eckhardt, T. Shape descriptors for non-rigid shapes with a single closed contour. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Head, SC, USA, 13–15 June 2000; Volume 1, pp. 424–429. [Google Scholar]
  36. Bai, X.; Yang, X.; Latecki, L.J.; Liu, W.; Tu, Z. Learning context-sensitive shape similarity by graph transduction. Pattern Anal. Mach. Intell. IEEE Trans. 2010, 32, 861–874. [Google Scholar]
  37. Zdilla, M.J.; Hatfield, S.A.; McLean, K.A.; Cyrus, L.M.; Laslo, J.M.; Lambert, H.W. Circularity, solidity, axes of a best fit ellipse, aspect ratio, and roundness of the foramen ovale: A morphometric analysis with neurosurgical considerations. J. Craniofacial Surg. 2016, 27, 222–228. [Google Scholar] [CrossRef]
Figure 1. A curve equipartition example for N = 3 , | A P 1 | = | P 1 P 2 | = | P 2 B | .
Figure 1. A curve equipartition example for N = 3 , | A P 1 | = | P 1 P 2 | = | P 2 B | .
Algorithms 18 00277 g001
Figure 2. Two solutions with different chord lengths of curve equipartition problem with N = 5 are projected on the curve c ( t ) (blue curve) with the green color points connected with red line segments.
Figure 2. Two solutions with different chord lengths of curve equipartition problem with N = 5 are projected on the curve c ( t ) (blue curve) with the green color points connected with red line segments.
Algorithms 18 00277 g002
Figure 3. Instances of the proposed 2D Shape Equipartition problem. In the first and second rows, the results come from the SEP-ILS and SEP-RG methods [7] from literature, respectively. In the third row, the corresponding results come from the proposed SEP-FBC method. The number of regions (N) and the intrinsic boundary length (L) are reported in the caption of each shape.
Figure 3. Instances of the proposed 2D Shape Equipartition problem. In the first and second rows, the results come from the SEP-ILS and SEP-RG methods [7] from literature, respectively. In the third row, the corresponding results come from the proposed SEP-FBC method. The number of regions (N) and the intrinsic boundary length (L) are reported in the caption of each shape.
Algorithms 18 00277 g003
Figure 4. Tessellations using (a) hexagons, (b) squares, and (c) equilateral triangles.
Figure 4. Tessellations using (a) hexagons, (b) squares, and (c) equilateral triangles.
Algorithms 18 00277 g004
Figure 5. Optimal solutions of the 2D-SEP for unit area (ad) square and (eh) circle under N { 2 , 3 , 4 , 5 } . The intrinsic boundary length (L) is reported in the caption of each shape.
Figure 5. Optimal solutions of the 2D-SEP for unit area (ad) square and (eh) circle under N { 2 , 3 , 4 , 5 } . The intrinsic boundary length (L) is reported in the caption of each shape.
Algorithms 18 00277 g005
Figure 6. Suboptimal solutions of the 2D-SEP for unit area (a,b) square and (c,d) circle under N { 3 , 5 } . The intrinsic boundary length (L) is reported in the caption of each shape.
Figure 6. Suboptimal solutions of the 2D-SEP for unit area (a,b) square and (c,d) circle under N { 3 , 5 } . The intrinsic boundary length (L) is reported in the caption of each shape.
Algorithms 18 00277 g006
Figure 7. Optimal solutions of the 2D-SEP for unit area (ad) square and (eh) circle with N { 2 , 3 , 4 , 5 } . The intrinsic boundary length (L) is reported in the caption of each shape.
Figure 7. Optimal solutions of the 2D-SEP for unit area (ad) square and (eh) circle with N { 2 , 3 , 4 , 5 } . The intrinsic boundary length (L) is reported in the caption of each shape.
Algorithms 18 00277 g007
Figure 8. A special case of shape where it holds that L ( R * ( S , 2 ) ) > L ( R * ( S , 3 ) ) = 2 · ε . The red and green lines show the intrinsic boundary for the optimal segmentation into two and three regions, respectively.
Figure 8. A special case of shape where it holds that L ( R * ( S , 2 ) ) > L ( R * ( S , 3 ) ) = 2 · ε . The red and green lines show the intrinsic boundary for the optimal segmentation into two and three regions, respectively.
Algorithms 18 00277 g008
Figure 9. Segmentation results of the two stages of the proposed SEP-FBC method for N = 5 .
Figure 9. Segmentation results of the two stages of the proposed SEP-FBC method for N = 5 .
Algorithms 18 00277 g009
Figure 10. Twelve sample images form (a) the LEMS dataset and (b) the MPEG-7 dataset.
Figure 10. Twelve sample images form (a) the LEMS dataset and (b) the MPEG-7 dataset.
Algorithms 18 00277 g010
Figure 11. The relative frequency histogram of (a) circularity and (b) solidity for the LEMS and the MPEG-7 datasets.
Figure 11. The relative frequency histogram of (a) circularity and (b) solidity for the LEMS and the MPEG-7 datasets.
Algorithms 18 00277 g011
Figure 12. The average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on (a) LEMS and (b) MPEG7 datasets.
Figure 12. The average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on (a) LEMS and (b) MPEG7 datasets.
Algorithms 18 00277 g012
Figure 13. The average execution time (AET) in seconds of the methods SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on all images of LEMS and MPEG7 dataset.
Figure 13. The average execution time (AET) in seconds of the methods SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on all images of LEMS and MPEG7 dataset.
Algorithms 18 00277 g013
Figure 14. The average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC and SEP-FBC computed on (ac) LEMS and (df) MPEG7 datasets for (a,d) low, (b,e) medium, and (c,f) high circularity shapes.
Figure 14. The average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC and SEP-FBC computed on (ac) LEMS and (df) MPEG7 datasets for (a,d) low, (b,e) medium, and (c,f) high circularity shapes.
Algorithms 18 00277 g014
Figure 15. The average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC and SEP-PSO FBC computed on (ac) LEMS and (df) MPEG7 datasets for (a,d) low, (b,e) medium, and (c,f) high solidity shapes.
Figure 15. The average NL metric for nine different values of N { 2 , , 10 } of the methods SEP-PSO FBC and SEP-PSO FBC computed on (ac) LEMS and (df) MPEG7 datasets for (a,d) low, (b,e) medium, and (c,f) high solidity shapes.
Algorithms 18 00277 g015
Figure 16. Results of SEP-PSO FBC and SEP-FBC for the two shapes of LEMS (first two columns) and MPEG7 (last two columns) datasets, where the outperformance of SEP-PSO FBC is maximized.
Figure 16. Results of SEP-PSO FBC and SEP-FBC for the two shapes of LEMS (first two columns) and MPEG7 (last two columns) datasets, where the outperformance of SEP-PSO FBC is maximized.
Algorithms 18 00277 g016
Figure 17. A sensitivity analysis of the NL metric for the parameter λ and different values of N under the SEP-FBC method and the MPEG7 dataset.
Figure 17. A sensitivity analysis of the NL metric for the parameter λ and different values of N under the SEP-FBC method and the MPEG7 dataset.
Algorithms 18 00277 g017
Figure 18. The percentage of shapes where the sequence L ( R ( S , N ) ) is not monotonically increasing for (a) LEMS and (b) MPEG-7 datasets, with N 9 .
Figure 18. The percentage of shapes where the sequence L ( R ( S , N ) ) is not monotonically increasing for (a) LEMS and (b) MPEG-7 datasets, with N 9 .
Algorithms 18 00277 g018
Figure 19. A promising result of the proposed (a) SEP-PSO FBC and (b) SEP-FBC methods on the tree detection problem under a low-quality dense forest image.
Figure 19. A promising result of the proposed (a) SEP-PSO FBC and (b) SEP-FBC methods on the tree detection problem under a low-quality dense forest image.
Algorithms 18 00277 g019
Table 1. The perimeter of a hexagon, square, and equilateral triangle as a function of its area (s).
Table 1. The perimeter of a hexagon, square, and equilateral triangle as a function of its area (s).
ShapePerimeter
hexagon 12 · s 3 4 3.722 · s
square 4 · s
equilateral triangle 6 · s 4 3 4.559 · s
Table 2. The average N L , P r (m/NL) and A E T (in secs) of the SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on all shapes of LEMS and MPEG7 dataset.
Table 2. The average N L , P r (m/NL) and A E T (in secs) of the SEP-PSO FBC, SEP-FBC, SEP-RG, and SEP-ILS methods computed on all shapes of LEMS and MPEG7 dataset.
LEMS DatasetMPEG7 Dataset
Methods NL Pr (m/NL) AET NL Pr (m/NL) AET
SEP-PSO FBC0.38476.89%11.260.35074.48%6.049
SEP-FBC0.40512.33%0.280.36813.42%0.184
SEP-RG0.4138.11%1.460.3788.46%1.145
SEP-ILS0.5841.12%21.490.5720.96%9.727
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Panagiotakis, C. Fast Equipartition of Complex 2D Shapes with Minimal Boundaries. Algorithms 2025, 18, 277. https://doi.org/10.3390/a18050277

AMA Style

Panagiotakis C. Fast Equipartition of Complex 2D Shapes with Minimal Boundaries. Algorithms. 2025; 18(5):277. https://doi.org/10.3390/a18050277

Chicago/Turabian Style

Panagiotakis, Costas. 2025. "Fast Equipartition of Complex 2D Shapes with Minimal Boundaries" Algorithms 18, no. 5: 277. https://doi.org/10.3390/a18050277

APA Style

Panagiotakis, C. (2025). Fast Equipartition of Complex 2D Shapes with Minimal Boundaries. Algorithms, 18(5), 277. https://doi.org/10.3390/a18050277

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop