Abstract
Traditional body classification methods are usually based on three-dimensional human body data. With the development of computer vision technology, two-dimensional (2D) anthropometry technology has garnered a great deal of research attention in the field of anthropometry. This paper presents a body shape classification and discrimination method using 2D images based on computer vision technology. The research included three main parts. (1) Index extraction of body shape classification based on computer vision. The orthogonal 2D human body image information of 362 young female samples was extracted. After normalizing the body height, three body shape classification indexes were separated: the body height pixel value (H), the feature of the projected unit area (ρ), and the feature of the projected area ratio of the front and side of the human body (F). (2) Two-dimensional human body shape classification based on the two-step cluster model. The optimal classification number was determined, and the characteristics of each type of body shape were analyzed. (3) Automatic discrimination of the 2D human body shape based on the Bayesian algorithm. The correct rate of recognition was 94.8%. The results indicate that the body shape classification method based on computer vision technology and the selection of the proposed classification indexes are effective, and the accuracy of body shape recognition is high. In this paper, the classification of human body shape based on 2D digital images was realized, and this method can be applied to 2D anthropometry and other related fields.
Keywords
Body shape is an important symbol reflecting the morphological characteristics of the human body. Body shape classification provides the basis for human body shape analysis, 1 garment pattern design, 2 size gradation, three-dimensional (3D) body modeling, 3 , 4 and virtual fitting. 5 The essence of body shape classification is the selection of classification indexes. At present, the commonly used classification indexes mainly include the circumference difference, 6 section shape, body surface angle, characteristic index, and so on. Circumference difference classification refers to the classification of body types by using differences in body girth, such as the chest–waist difference and waist–hip difference. This kind of method is adopted by China’s Standard Sizing Systems for Garments-Women, which divides the human body into four types—Y, A, B, and C—based on the difference between the net chest and waist circumference. This method only considers the body shape characteristics of the upper body, not those of the lower body. With the increase in people's requirements for the fit of clothing, the body shape classification of the lower body is also a part that we should consider, as it affects the generation of pants pattern design. 7 Liu et al. 8 used height, waist circumference, and hip–waist difference as key indexes to describe the body shape of young females, and classified the lower body shape by triangular fuzzy numbers. Section shape classification refers to the method of body shape classification using the cross- or longitudinal section characteristics of the human body as the classification index. Yao et al. 9 used the low-frequency coefficients of wavelet analysis to extract the shape of the longitudinal section curve of the human body, and used the difference in low-frequency wavelet coefficients of the human body profile curve as a classification index to subdivide the trunk shape of young females. Wang 10 used the ratio of the cross-sectional area of the chest, waist, and buttocks to the square of the circumference to divide body types into three categories: flat shape, middle shape, and round shape. Body surface angle classification refers to the method of classification based on the angle between the body surface shape and the reference plane. Naglic et al., 11 who used the curve angle of the human body as the classification index, divided the human body into nine body types to improve the garment pattern and improve the fit of the garment. Characteristic index classification is the classification of human physique and fatness using the ratio of height to weight, such as the body mass index (BMI). 12 There are still many interesting classification methods for human body shape in the clothing industry, such as South Korean scholars Kim and Nam, 13 who divided the human body into 16 types by the waist and hip curve to study the fit evaluation of slacks. Chi et al. 14 segmented the human body into different areas and classified them respectively to verify the accuracy of human body modeling.
In the abovementioned studies and others not listed here, the classification methods are based on the 3D human body and human body size. 15 However, practical problems such as the high cost and difficult operation of 3D human body scanning hinder its wide application in daily life. 16 With the development of mobile phone and computer vision technology, two-dimensional (2D) anthropometry has been widely studied and applied, 17 so many classification methods of human body shape based on 2D images have been established in turn. Sun et al. 18 extracted 2D images of the front and side of the human body, calculated the angles representing the morphological characteristics of the human body, and classified the human body shape into four categories using k-means clustering. Wang and Gu 19 used the 3D point cloud data of young females to classify the neck–shoulder part of the human body by selecting the back angle, shoulder angle, armpit depth/width ratio, and shoulder depth/width ratio, and then realized the automatic identification of the neck and shoulder shape based on 2D photos of young females. Cai et al. 20 used a method of “3D scanning + photos” for the body shape classification of young females’ waist–abdomen–hip. These methods represent the embryonic form of 2D image body shape classification and discrimination, but they are still based on the human body size.
The applications of computer vision mainly include image classification, 21 object detection, and image segmentation. This study primarily used the image classification technology of computer vision to extract classification indexes. In this paper, a human body computer vision classification method based on 2D images is proposed, which has the advantage of directly classifying body types without the complicated 3D data extraction process. The method aims to realize the transformation of the body shape classification from 3D to 2D. The height pixel value (H), projection unit area feature (ρ), and the feature of the projected area ratio of the front and side of the human body (F) were used as feature variables to classify body types. The two-step cluster (TSC) model was used to classify human bodies into six categories, and the Bayesian algorithm was used to automatically identify body shapes, which could effectively distinguish these six types of body shapes with high accuracy, high speed, and strong adaptability. The results verify the feasibility of using computer vision technology to classify and recognize body shapes, indicating that the proposed three types of classification indexes can better classify and recognize 2D human bodies.
Methods
Anthropometric experiment
Two-dimensional human body images from a 3D human body database were selected, which were used for body shape classification and discrimination. Then, 362 young females aged 18–25 years were randomly measured as subjects. They came from various provinces and cities in China, and their occupations included students and workers. They were 147.3–178.6 cm in height and 35.6–79.4 kg in weight, without structural deformations of the locomotor system. 22
Image preprocessing and height normalization
In the process of image acquisition and transmission, noise pollution can occur, which will easily interfere with image processing and information acquisition. Therefore, it is necessary to denoise the image before image processing. In this study, Gaussian filtering was used to smooth the image, which had a good effect on noise suppression.
In the process of extracting 2D human body images, because the human body data information does not form a mapping relationship on the 2D images, it is necessary to normalize the 2D digital images to eliminate the influence of size factors on the body shape classification from the perspective of computer vision.
23
In daily life, height is the most convenient to measure, so height was selected as the standard of image normalization. The maximum height of the sample was selected. In the area of the human body, the distance from the top of the head to the ground was set to 700 pixels. The height was normalized by Equation (1), where h is the height of any sample,

Normalized representation diagram of height: (a) height of sample 1 = 152.9 cm; (b) height of sample 2 = 165.6 cm and (c) height of sample 3 = 177 cm.
Extraction of classification indexes
The selection of classification indexes is important when using the clustering method to classify the human body shape. Therefore, this paper selects the classification indexes of the human body shape from the perspective of computer vision. It proposes using three indexes—the height pixel value (H), the feature of the projected unit area (ρ), and the feature of the projected area ratio of the front and side of the human body (F)—to classify the human body shape.
Feature extraction of ρ
The size of 2D digital images of the human body was set to M × N. After binarization, each sample obtained two black-and-white images. The human body area was white, with a gray value of 255, and the pixel value was set to 1. Moreover, the background area was black, the gray value was 0, and the pixel value was 0. The binary images of the front and side of the human body were traversed. Then, the direction from the ground to the top point of the head was set as the y-axis direction, and the direction perpendicular to it was set as the x-axis direction. We separately counted the cumulative distribution of white points in the human body area along the x-axis and y-axis directions; that is, the cumulative distribution of pixel value f (i, j) = 1:
Figure 2 shows the front binary image, gray histogram, side binary image, and gray histogram of the 2D photos. It reflects the gray distribution of different body shapes. The formula for calculating the maximum height difference of white spots along the x-axis direction and the y-axis direction is as follows:

Comparison of gray features of body fat and height: (a) a sample with height = 170.7 cm, weight = 74 kg and (b) sample with height = 152.9 cm, weight = 35.6 kg.
The maximum gray distribution difference
Feature extraction of F
Only using the feature of the projected unit area to classify the body shape cannot accurately express the body shape information of the human body. The trunk of the human body is shaped like an irregular ellipse. Because of the different distributions of thickness and width of the human body, the oblateness of the ellipse is also different. Many scholars have classified the body type according to the degree of roundness of the human body, such as chest width/chest thickness, waist width/waist thickness, and buttocks width/buttocks thickness.
24
Following this classification idea, it was applied to 2D body shape classification based on computer vision, and it was reasonable to distinguish the roundness of the human body by using the ratio of the projected area of the front and side of the human body. This specific method was used in shape classification, and the information of the human head and arm cannot represent the roundness of the human body, as it would affect the classification effect. Therefore, the information of the head and neck was removed along the side neck points of the human body in the 2D human body image, and the information of the human arm was removed along the shoulder end points of the human body. We let the cumulative white points on the front of the human body be Z. The cumulative white points on the side of the human body are represented by C. The ratio of Z to C is defined as F, as follows:
Two-step cluster model
The TSC model is an intelligent clustering method that can be used to reveal the natural grouping of unknown data sets. Compared with traditional clustering methods, the TSC model can automatically determine the optimal number of clusters, and it can be used for clustering of discrete data and continuous data. 25 This study used computer vision technology to classify 2D images of the human body, which was an exploratory experiment. The number of clusters was unknown, so this study tried to use the TSC model to automatically divide the cluster data.
The TSC model was divided into two stages. The first stage was called the pre-cluster, which clustered the data into several sub-classes. In the second stage, the clustering results of the first stage were used to cluster again, and these sub-classes were clustered into the desired number of clusters. According to the combination of the two data processing methods, the TSC model had an accurate clustering effect and good scalability. There were two main steps to calculate the TSC.
Step 1: a cluster feature (CF) tree is established, and then the first record in the data set is placed on a leaf node initiated by the root of the tree, which contains all the variable information in this record. Using distance measurement as the similarity criterion, according to its similarity with existing nodes, it combines with existing nodes to generate new nodes and then recursively induces the clustering feature tree. The established CF provides a summary of the variable information of the data set. The distance measurement model adopts logarithmic similarity, and the calculation formula is as follows:
In the second step, the leaf nodes are combined with the merging clustering algorithm to produce a group of clustering schemes with different clustering numbers. Various clustering schemes are compared by the Bayesian information criterion (BIC), and the system automatically selects the optimal number of clusters. For cluster J, the BIC is calculated by Equations (11) and (12):
Bayesian shape classification discrimination model
The Bayesian algorithm is a basic method in statistical model decision-making. The basic idea is that the conditional probability density parameter expression and prior probability are known, and the formula is used to convert them into posterior probability. Finally, the posterior probability is used for decision classification. In this study, the Bayes discrimination analysis method was used to intelligently identify 2D human body images. When the new 2D human body images were obtained, the body shape was discriminated, and the human body size was extracted according to different categories, providing a simple and fast new way to improve the accuracy of 2D human body measurement and 3D human body modeling.
Results and discussion
The classification of body shape
In this study, the TSC model in SPSS (Statistical Product and Service Solutions) software was used to cluster the body shape, and the classification variables were H, ρ, and F.
The BIC was used to judge the best number of classifications, and the TSC method was used to automatically determine that the best number of clusters was six, and the measured value of the cluster contour was 0.4. The clustering quality was acceptable.
The cluster summary is shown in Table 1. The sample size proportions of clusters 1–6 are 15.2%, 27.3%, 21.8%, 6.4%, 14.6%, and 14.6%, respectively. In the table, the importance of input variables to clustering is arranged from top to bottom, and the importance gradually decreases. The table also shows the centroids of various body types, and the centroids were the average values of each group of samples.
Cluster summary
Cluster 1: the centroid of H = 666.21 was the largest of all groups, and this group was the tallest. The centroid of ρ = 108.03, and the population was moderately fat and thin. The centroid of F = 1.57, in all groups, and the F value of this group was the farthest from one. This indicates that the frontal projection area of this group was large, the side projected area was small, and the sectional shape of this group was the flattest ellipse.
Cluster 2: this group had the largest number. The centroid of H = 647.16, and in the middle area of all samples, the height of this group was medium to high. For the centroid of ρ = 102.49, this group was thinner. For the centroid of F = 1.51, it was in the middle state in all clusters, which indicates that the cross-sectional shape of the population was closer to the more standard elliptical shape.
Cluster 3: the centroid of H = 625.7 was in the middle area of all clusters, and this cluster was of medium-short height. The centroid of ρ = 107.19, which was moderately fat and thin. The centroid of F = 1.53 was in the middle state in all clusters, which shows that the cross-sectional shape of the population was closer to the more standard elliptical shape.
Cluster 4: the centroid of H = 637.61, which was in the middle of all clusters, and this cluster was of medium height. The centroid of ρ = 118.67. Compared with others, ρ was the largest, so this group was the fattest. The centroid of F = 1.45. In all clusters, the F value of this population was the closest to one, which shows that the cross-sectional shape of the sample was closer to a circular ellipse.
Cluster 5: the centroid of H = 613.14, which was shorter than those of clusters 1–4. The centroid of ρ was 98.41, which was the smallest feature compared with the other categories, so this group was the thinnest. The centroid of F = 1.55, and the cross-sectional shape of the human body was close to an oblate ellipse. However, it will be slightly round compared with cluster 1.
Cluster 6: the centroid of H = 607.5. This group had the shortest height among all the clusters. The centroid of ρ = 103.11, which was in the middle of all samples, so the population was moderately fat and thin. The centroid of F = 1.48, which shows that the cross-sectional shape of this sample is rounder in all clusters except cluster 4.
To verify the classification effect of this data set, the sample closest to the centroid in each cluster was found. The comparison of binary images of various body types is shown in Figure 3. From the figure, it can be seen that computer vision technology is used to classify 2D photos of human bodies, the difference between each body type is obvious, and the method is feasible.

Comparison of images of various body shapes: (a), (b) binary images of the front and side images of the human body closest to the centroid in clusters 1–6.
Intelligent discrimination of body shape
In this study, the Bayesian algorithm was used to verify the body shape discrimination model of 362 samples. The k-fold cross-validation method was used, 10% of the samples were used as the verification set, and the rest of the samples were used as the training set. We take 10% of samples for iteration each time, and cross-verify them 10 times. When 19 samples were shown to be wrong, the accuracy of the algorithm was about 94.8%. This indicates that it is effective to use the three discrimination indexes of H, ρ, and F for body type discrimination; the discrimination of various body types is shown in Figure 4. In the figure, clusters 1–6 are distinguished by different colors. It can be seen that the distribution of six clusters of people with different body types is relatively concentrated, and the classification effect is good. The rectangle represents the centroid of the group. As shown in the figure, the centroid is in the middle of the group.

Discriminant all-group scatter plot after being standardized (color online only).
Application and advantages of the research methods
Future anthropometric systems must be convenient, fast, inexpensive, and easy to apply. The body shape classification method proposed in this study can be applied to remote customization of clothing to solve the problems of remote acquisition of the human body size and remote fitting. 26 When new custom-made clothing users acquire and provide 2D orthogonal photos of human bodies with camera equipment such as mobile phones, the method proposed in this study can automatically classify and discriminate human bodies the first time. Then, it can extract feature points and extract the body size, thus reducing the error caused by inaccurate extraction of feature points due to different features of 2D contour images from the data source. It can accurately extract the human body size according to different body shapes and then match and model human bodies of various body shapes. This classification method is simple and effective, and its advantage is that it solves the problem of body shape classification without the body size. In future research, the body shape classification method based on contours will be used in the research of clothing patterns, and pattern optimization will be carried out to improve the fit of clothing.
Conclusions
In this study, computer vision technology was used for body shape classification and discrimination on 2D human body images, and the feasibility of this method was tested. The body height pixel value (H), the feature of projected unit area (ρ), and the feature of projected area ratio of the front and side of the human body (F) were proposed as the feature index for body type classification. The TSC model was used to classify the samples. The body shapes were divided into six categories. The experimental results show that these three classification indexes could effectively distinguish the 2D images of the human body. The Bayesian algorithm was used to discriminate the body shape; the correct rate of discrimination was 94.8%, and the correct rate of classification and recognition was high, which further verify the correctness of the classification method.
Footnotes
Declaration of conflicting interests
The author(s) declare no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Liaoning Provincial Department of Education scientific research project [LJKMR20220912], [LJKZZ20220068] and the entrusted project of Young Talents Training Object of Philosophy and Social Sciences in Liaoning Province in 2021 [2022lslwtkt-007].
