Next Article in Journal
An Accelerometer Based on All Silica In-Line Fiber Fabry-Perot Etalon for High Temperature up to 800 °C
Previous Article in Journal
Thin Film Encapsulation for LCP-Based Flexible Bioelectronic Implants: Comparison of Different Coating Materials Using Test Methodologies for Life-Time Estimation
Previous Article in Special Issue
Design and Implementation of an Urban Farming Robot
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Measuring Shape Parameters of Pearls in Batches Using Machine Vision: A Case Study

1
College of Mechanical and Electrical Engineering, Xi’an Polytechnic University, Xi’an 710060, China
2
Faculty of Mechanical Engineering, Opole University of Technology, 45-758 Opole, Poland
3
Yonsei Frontier Lab, Yonsei University, Seoul 03722, Korea
*
Author to whom correspondence should be addressed.
Submission received: 15 February 2022 / Revised: 24 March 2022 / Accepted: 28 March 2022 / Published: 30 March 2022
(This article belongs to the Special Issue Micromachines in Agriculture: Current Trends and Perspectives)

Abstract

:
To solve the problem of low precision of pearl shape parameters’ measurement caused by the mutual contact of batches of pearls and the error of shape sorting, a method of contacting pearls’ segmentation based on the pit detection was proposed. Multiple pearl images were obtained by backlit imaging, the quality of the pearl images was improved through appropriate preprocessing, and the contacted pearl area was extracted by calculating the area ratio of the connected domains. Then, the contour feature of the contact area was obtained by edge tracking to establish the mathematical model of the angles between the edge contour points. By judging the angle with a threshold of 60° as the candidate concave point, a concave point matching algorithm was introduced to get the true concave point, and the Euclidean distance was adopted as a metric function to achieve the segmentation of the tangent pearls. The pearl shape parameters’ model was established through the pearl contour image information, and the shape classification standard was constructed according to the national standard. Experimental results showed that the proposed method produced a better segmentation performance than the popular watershed algorithm and morphological algorithm. The segmentation accuracy was above 95%, the average loss rate was within 4%, and the sorting accuracy based on the shape information was 94%.

1. Introduction

Pearl shape is one of the important reference indicators of pearl quality. At present, the pearl shape parameters are mainly calculated by manually measuring the long and short axes of the pearls using a vernier caliper [1,2]. Although manual sorting has the advantages of high flexibility and comprehensive evaluation, the labor intensity is high, the efficiency is low, and the subjective factors make the sorting accuracy unstable [3]. In recent years, with the rapid development of machine vision technology, it has been feasible to use machine vision to replace manual measuring to eliminate the interference of subjective factors (such as fatigue and human emotions) and improve the measurement accuracy and efficiency for the pearl shape parameters [4]. In fact, accurate and rapid detection of pearl shapes has become an urgent need for pearl manufacturers. The machine vision technology has sufficient market prospects [5].
Existing literature shows that there are few research results in the pearl shape detection, particularly for batch pearls’ detection. Many detection methods are applied to a single pearl to measure the thickness of the pearl layer [6,7], pearl donor [8], internal structure [9,10], luster [11,12], color [13,14], etc. Although single pearl detection can analyze the surface and internal quality of the pearls from multiple angles [15], most of them are limited to laboratory environments. In addition, the market demands more for processing a batch of pearls at the same time; but batch pearl detection suffers from measurement accuracy due to mutual contact between pearls. Therefore, it is necessary to analyze and summarize the contact problems of batches of pearls.
For the issue of contacting target segmentation in different fields, researchers have proposed various segmentation algorithms, including the watershed algorithm [16,17], morphological algorithm [18,19], contour curve method [20,21,22], concave point method [23,24], and so on. These algorithms can achieve contact target segmentation for specific situations but, at the same time, they all have certain limitations. The watershed algorithm is a classic algorithm for segmenting overlapping images. It is fast, accurate, and effective, but it will be disturbed by noise to produce over-segmentation or under-segmentation, causing a large number of false edges, especially when multiple pearls are in contact. The morphological algorithm can easily destroy the original shape of the pearl, which is not conducive to the measurement of the pearl shape parameters in this paper. The contour curvature method and the curve fitting method have a large amount of calculation and low recognition rate and generally are only suitable for 2–3 pearls. The concave point method mainly uses the concave–convex characteristics of the target when it is in contact and divides the contact target according to the angle of the concave point; but the detection of the concave point is prone to errors. In comparison, the concave point method has more advantages, but its effect needs to be improved to increase the segmentation.
In summary, in view of the segmentation problem of contacting a large number of pearls in the shape detection, this paper proposes a new segmentation method based on the pit detection and target contact segmentation. Firstly, the backlit imaging was used to obtain a large number of pearl images and the area of pearl contact was extracted according to the area ratio of the connected domain mark. Secondly, a mathematical model of the angle between the contour points of the edge of the contact area was established to extract the concave point information, and the interference points were eliminated through the concave point matching. Then, the Euclidean distance was used as the distance measurement to complete the segmentation of tangent pearls. Lastly, the pearl contour and the position of the center of mass were calculated, and the pearl shape parameters’ model based on the image information was established to quantify the pearl shape. After the characterization was completed, the algorithm accuracy comparison and verification were performed.
We arranged this paper by the following. Section 1: For the pearl shape detection system, this paper selected the hardware required for robots and visual recognition and built an experimental platform. Section 2: The tangent pearls’ image was segmented based on concave point detection and concave point matching. Pearl shape parameters were measured by extracting the features of the contour edge. Section 3: Through the experimental platform built to conduct the experimental analysis of different numbers of pearl images contacted at different angles, we determined the pearl shape parameters and used the robot to complete the pearl classification according to the recognition results. Section 4: Conclusions.

2. Materials and Method

2.1. Experimental Platform

A pearl shape detection system based on machine vision was developed, as shown in Figure 1, including a robot system, a vision detection system, a platform, a sorting box, and a computer. The visual inspection system consisted of a camera, lens, light source, computer, and the objective table. The camera was the Daheng Mercury camera MER-502-79U3M POL camera. The collected picture contained 20 pixels of 1 mm. The optical axis of the camera was perpendicular to the objective table. The lens was a computer series M2514-MP2 lens. The distance from the objective table was 250 mm. The pearls were randomly laid on the objective table. The light source adopted an LED array surface light source with an illuminance of 40,000 Lux. The camera, the pearl to be detected, and the light source acquired the pearl image with backlit imaging. The system software adopted Python3.7 and opencv3.4.2, and the computer performance was by CPU i7-11700k, 16-G memory, and a GTX 2080ti graphics card. A Dobot magician robot was adopted, and the end effector was a SMC-ZP3-T04BN-A5 vacuum suction cup.
The specific operation process for the pearl detection is shown in Figure 2.

2.2. Pearl Image Processing Method

Firstly, this work proposed a tangent pearls’ segmentation method based on an improved concave point detection for the boundary connectivity problem caused by batch pearls. Secondly, the tangent pearls’ area was extracted based on the connected domain mark. According to the principle of point matching, the true concave point pairs were screened out. Then, the tangent pearls were divided based on the Euclidean distance.

2.2.1. Boundary Connectivity Problem

There are texture and luster on the pearl surfaces [25]. In order to reduce the interference of these factors on the pearl shape detection, the backlit imaging was used to collect multiple pearl images, as shown in Figure 3a. In order to extract the pearls’ contour features, Gaussian filtering was performed after equalizing the histogram of Figure 3a, which preserved more edge information of the images while smoothing the image [26]. According to the gray distribution characteristics of the pearl images [27], the maximum between-class variance method [28] was used to segment the preprocessed pearl images and solved the problems of cavities and rough contour edges in the segmented pearl area. Linear structural elements were processed by the morphological algorithm [29]; the result is shown in Figure 3b.
It can be seen from Figure 3b that there were separate pearl outline areas in the divided pearl images, which were in contact with each other. To solve the segmentation problem of pearls in contact with each other, pit detection based on the three-point including angle and the pit matching method with adaptive characteristics were adopted.

2.2.2. Extraction of Tangent Pearls’ Region

The connected domain labeling of the pearl images after binarization is shown in Figure 4. The pixel area of each connected domain was counted as S 1 , S 2 , , S n , as shown in Table 1. The area sequence was sorted and the smallest area was Smin, as expressed by Equation (1).
S min = min { S 1 , S 2 , , S n }
where n is the number of connected domains.
Calculating the connected area of each connected domain is shown in Figure 4 and Table 1. The area of the smallest connected domain corresponded to a single, independent pearl. In order to obtain the pearl area in contact with each other, the ratio of the pixel area of each connected domain to the area of the smallest connected domain Smin was used to determine whether it was a contact area.
K n = S 1 , S 2 , S 3 S n S min
where Kn is the area ratio.
Since a large number of pearls were randomly laid out and there was no stacking state, it was necessary to select an area ratio as the threshold for judging whether the pearls were in contact. It can be seen from Table 1 that if S1–S8 were all less than 1.50, there were no tangent pearls in these eight areas; if S9 and S10 were both greater than 1.50, then there were pearls contacting each other in these two areas. Therefore, the area ratio 1.50 was selected as the threshold value. When Kn > 1.50, the pearls were contacted; otherwise, they were independent. The edge tracking was used to extract the edge contour features of the pearls in contact with each other [30], as shown in contour nos. 9 and 10 in Figure 4.

2.2.3. Image Segmentation

The concave point information is the point with the maximum value of curvature on the contour of the target edge in the image. The shape of a single, independent pearl is similar to the circle, and the surface curvature changes smoothly; therefore, it does not have the feature of concave points. Many pearls in contact with each other have large curvature mutations at the contact points and have obvious concave point characteristics. On the basis of extracting the edge contours of the pearls in contact with each other, this paper segmented the pearls in contact with each other based on an improved pit detection.
The edge contour of the tangent pearls was firstly detected to obtain their edge contour sequence, as shown in Figure 5, from a partially enlarged view of the contour of the tangent pearls’ edges. A certain point was selected in the edge contour sequence as the current detection point, pk. The step size was set and then the coordinates of the point pk+1 were obtained. The step size was 2 pixels, and the coordinates of the three consecutive points were pk−1 (xk−1, yk−1), pk (xk, yk), and pk+1 (xk+1, yk+1).
The straight line pk−1pk intersected the straight line pkpk+1, and the obtained angle θ was the angle between the contour points of the pearl edge, as expressed by:
S k 1 = | p k + 1 p k | = ( x k + 1 x k ) 2 + ( y k + 1 y k ) 2
S k = | p k + 1 p k 1 | = ( x k + 1 x k 1 ) 2 + ( y k + 1 y k 1 ) 2
S k + 1 = | p k p k 1 | = ( x k x k 1 ) 2 + ( y k y k 1 ) 2
According to the law of cosines, the angle θ is described as
θ = arccos ( S k + 1 2 + S k 1 2 S k 2 ) 2 S k + 1 S k 1
Due to the texture of the pearl surface, the outline angle fluctuated and the actual concave point was relatively small. As shown in the angle distribution diagram shown in Figure 6 calculated by Equation (6), the general distribution of angles was within the range of 150°–80°, and the individual angles were within the range of 30°–60°, which can be used for initial pits’ determination.
The angle distribution in Figure 6 shows that there were interference points in the concave points determined by the included angle of the contour, and the preliminarily determined concave points were defined as the candidate concave points. In order to accurately determine the pits in the pearl contact areas, this paper developed a specific matching algorithm on the candidate pits; the steps were as follows:
(1)
According to the distance between the candidate pits, the K-means clustering [31] was used to classify the candidate pits into classes A and B, as shown in Figure 7.
(2)
We found a pair of candidate pits with the shortest distance between classes A and B.
(3)
We connected the pair of candidate points and calculated the vertical line of the connecting contour.
(4)
We set a minimum circle range with the length of the connecting line as the diameter and calculated the coordinates of the points of the mid-vertical line within this range.
(5)
We found the gray value in the original image according to the acquired coordinates.
(6)
If the gray value of the points was the gray of the pearl, then the pair of candidate pits were the real pits; if there were both the gray of the pearl and the gray of the background, it meant that the candidate pit contained only one true pit.
(7)
If only one true pit was included, we increased the number of the candidate pits and returned to step (1).
Among them, the K-means clustering is a process of classifying and organizing data members that are similar in some respects.
The result of the concave point matching is shown in Figure 7; the pair of concave points (a1, b1) and (a2, b2) of the pearl contact point were accurately determined.
Figure 7. Preliminary pit detection.
Figure 7. Preliminary pit detection.
Micromachines 13 00546 g007
Using the Euclidean distance as the distance metric function [32] D i s t [ ( a 1 , b 1 ) , ( a 2 , b 2 ) ] = ( a 2 a 1 ) 2 + ( b 2 b 1 ) 2 , the tangent pearls were segmented; the result is shown in Figure 8.

2.2.4. Comparison of Different Image Segmentation Algorithms

In order to test the accuracy and stability of the proposed segmentation method, comparative experiments with different contact numbers and different segmentation methods were carried out, and the reliability evaluation parameters were used to analyze the results.
The segmentation accuracy rate Y and the loss rate of area Z were used to evaluate the segmentation accuracy of the tangent pearls.
(1) Segmentation accuracy
Assuming that the actual number of pearls in the pearl image is L, and the number of correctly segmented pearls is C, the expression for the correct rate of segmentation of the contact image is shown in Equation (7).
Y = C L
(2) The loss rate of area
Assuming that the area of pearl A is S1 and the area of pearl B is S2, then the sum of the areas in the non-contact state is (Sa = S1 + S2), and the total area in the contact state is Sb.
The area ratio of pearl A in the non-contact state and the contact state is K1 and K2, and the expression is shown in Equation (8).
K 1 = S 1 S a ,   K 2 = S 2 S b
Thus, the expression of the loss rate of area Z is:
Z = ( 1 K 1 K 2 ) × 100 %
The smaller the loss rate of area Z is, the higher the precision is of dividing the tangent pearls, and vice versa.
As shown in Figure 9, taking multiple pearls as an example, Figure 9a is a non-contact state and Figure 9b is a contact state.
Based on the developed experimental platform in this paper, the watershed algorithm, the morphological algorithm, and the proposed method WERE compared with the experimental images. The differences of these three algorithms are discussed in Table 2.
The comparative results of the three algorithms are shown in Figure 10, and the comparison of segmentation results is shown in Table 3.
It can be seen from Table 3 that, compared with other methods, the proposed method was able to suppress under-segmentation and over-segmentation, and the segmentation effect was the best.
Figure 11 shows the experimental segmentation performance of the three methods, where WA is the loss rate of area of the watershed algorithm, MA is the loss rate of area of the morphological algorithm, and TA is the loss rate of area of the proposed method, MC is the correct segmentation rate of the watershed algorithm segmentation, WC is the correct segmentation rate of the morphological algorithm, and TC is the correct segmentation rate of the proposed method. It can be seen from Figure 11 that the proposed method performed better than the other two methods in the comparison because its segmentation accuracy was less affected by the degree of contact and the average loss rate of area remained within 4%. As the number of tangent pearls increased, the segmentation accuracy of all three methods was reduced and the loss rate of the area was increased. When the number of the tangent pearls was two, all three methods achieved complete segmentation of the tangent pearls. When there were three tangent pearls, the correct segmentation rates of the proposed method, the morphological algorithm, and the watershed algorithm were 98.7%, 98.5%, and 96.6%, respectively, but the area loss rate of the morphological algorithm was higher than the others. When there were four tangent pearls, the correct segmentation rates of the proposed method, the morphological algorithm, and the watershed algorithm were, respectively, 97.1%, 95.4%, and 93.8%. When there were more pearls in contact, the segmentation accuracy of 95.5% for the proposed method was still the best and the loss rate of 3.9% was the least.

3. Experimental Results

3.1. Experimental Testing

In this paper, 200 pearls of different shapes were used to evaluate the shape parameters’ detection of the proposed method, including 39 round pearls, 52 round pearls, 58 near round pearls, and 51 oval pearls. According to the “National Standard of the People’s Republic of China GB/T18781-2008”, the size of a perfect circle, a circle, and nearly circular freshwater pearls is expressed by the minimum diameter. The sizes of other shapes of pearls are expressed by the maximum size multiplied by the minimum size. The pearl shape parameter is expressed by the diameter expressed as a percentage (%) in Equation (10).
X = d max d min d ¯ × 100 = max ( d i ) min ( d i ) m e a n ( d i ) × 100
where dmax is the maximum diameter of the pearl, dmin is the minimum diameter of the pearl, d ¯ is the average of the maximum diameter and the minimum diameter, d i is any diameter, i is the number of pixels on the pearl outline; the smaller the diameter percentage is, the closer the pearl shape is to a circle, not vice versa. Taking a pearl with a diameter of 8 mm as an example and referring to the GB/T18781-2008 standard, the grading standards are shown in Table 4.

3.2. Experimental Results

There were 200 experimental pearls in the experiments. Firstly, the longest diameter and shortest diameter of each pearl were manually measured, the percentage differences between each pearl were calculated, and then all pearls were classified in advance as true values. Secondly, the diameter difference percentage of each pearl was obtained by the proposed method to classify the pearls. Lastly, the detection result of the proposed method was compared with the manual detection result and the performance evaluation index F1 was used for the multi-classification problem. The confusion matrix for binary classification problem is shown in Table 5.
The evaluation index F1 is calculated as follows.
P = T P T P + F P
R = T P T P + F N
f 1 s c o r e = 1 1 2 ( 1 P + 1 R ) = 2 P R P + R
where P is the precision rate, R is the recall rate, and the f1-score is the F1 value.
For a multi-classification problem, there are multiple confusion matrices. The macro-F1 method is used to calculate the F1 value.
m a c r o P = 1 m i P i
m a c r o R = 1 m i R i
m a c r o F 1 = 2 · m a c r o P · m a c r o R m a c r o P + m a c r o R
The experimental results are shown in Table 6, Table 7, and Figure 12.
The experimental results showed that the proposed method produced a high detection accuracy. Among the four roundness pearls, the coincidence rate first decreased and then rose, and the lowest coincidence rate was reflected in the nearly circular shape. The trend of the coincidence rate was suspected to be caused by the differences in the pearl diameter because the diameter differences between the perfect circle and the ellipse were more obvious. The circle and the near circle were between the perfect circle and the ellipse, and the pearl diameter difference was small; therefore, there will be a certain error between the measurement results of the system software and the vernier caliper measurement results. In order to verify this conjecture, this work used some simulation pictures to contact different shapes of pearls at different angles, which simulated all possible contact situations of the pearls to detect the sensitivity of different pearl contact gestures.
Figure 13 shows the recognition results of different shapes of the pearls under different contact posture conditions. Using the proposed method to segment and detect simulated pearl images, when the pearls of different shapes were in contact at different angles, the detection coincidence rate of the perfect circle (a) and ellipse (d) was still high, respectively, i.e., 100% and 99.6%, and the detection coincidence rate of the circle (b) and near circle (c) was 97.8% and 97.1%. The coincidence rate between the artificial pearl shape detection and artificial comparison was consistent with the real pearl experiment results. It should be noted that since the behavior of the simulated pearls in this verification process was an ideal pearl, the coincidence rate of the simulation verification was higher than that of the real pearls.

4. Conclusions

To solve the problem of the multiple pearls in contact with each other in the pearl shape measurement, this paper proposed a new segmentation method based on pit detection. Compared with the watershed algorithm and the morphological algorithm, the proposed method was superior in the case of different numbers of tangent pearls; the segmentation accuracy of the proposed method was above 95% and the average loss rate of area was within 4%. Using simulated tangent pearls to investigate the sensitivity of different shapes of pearls with the proposed method under different contact angles, the coincidence rate of the round pearls was the highest, at 100%, and the coincidence rate of the nearly round pearls was the lowest, at 97.8%.

Author Contributions

Conceptualization, S.J. and Z.L.; methodology, X.L.; software, X.L.; validation, X.L. and Z.Y.; formal analysis, X.L.; investigation, S.J.; resources, G.K.; data curation, Z.L.; writing—original draft preparation, X.L., Z.Y. and Z.L.; writing—review and editing, G.K.; visualization, S.J.; supervision, S.J.; project administration, G.K.; funding acquisition, S.J., Z.L. and G.K. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Key R&D Program Project (No. 2019YFB1707205), Key R&D Project of Shaanxi Science and Technology Department (No. 2020GY-172), and Narodowego Centrum Nauki, Poland (No. 2020/37/K/ST8/02748).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

All data used in this work can be requested from the corresponding author.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Ho, J.W.Y.; Shih, S.C. Pearl Classification: The Gia 7 Pearl Value Factors. Gems Gemol. 2021, 57, 135–137. [Google Scholar]
  2. Xuan, Q.; Fang, B.; Liu, Y.; Wang, J.; Zhang, J.; Zheng, Y.; Bao, G. Automatic Pearl Classification Machine Based on a Multistream Convolutional Neural Network. IEEE Trans. Ind. Electron. 2018, 65, 6538–6547. [Google Scholar] [CrossRef]
  3. Bai, F.; Fan, M.; Yang, H.; Dong, L. Image Segmentation Method for Coal Particle Size Distribution Analysis. Particuology 2021, 56, 163–170. [Google Scholar] [CrossRef]
  4. Yaghoobi, H.; Mansouri, H.; Farsangi, M.A.E.; Nezamabadi-Pour, H. Determining the Fragmented Rock Size Distribution Using Textural Feature Extraction of Images. Powder Technol. 2019, 342, 630–641. [Google Scholar] [CrossRef]
  5. Cao, Y.L.; Zheng, H.W.; Yang, J.X.; He, Y.F. Automatic Shape Grading of Pearl Using Machine Vision Based Measurement. Key Eng. Mater. 2010, 437, 389–392. [Google Scholar] [CrossRef]
  6. Ju, M.J.; Lee, S.J.; Min, E.J.; Kim, Y.; Kim, H.Y.; Lee, B.H. Evaluating and Identifying Pearls and Their Nuclei by Using Optical Coherence Tomography. Opt. Express 2010, 18, 13468–13477. [Google Scholar] [CrossRef]
  7. Ju, M.J.; Lee, S.J.; Kim, Y.; Shin, J.G.; Kim, H.Y.; Lim, Y.; Yasuno, Y.; Lee, B.H. Multimodal analysis of pearls and pearl treatments by using optical coherence tomography and fluorescence spectroscopy. Opt. Express 2011, 19, 6420–6432. [Google Scholar] [CrossRef]
  8. Agatonovic-Kustrin, S.; Morton, D.W. The Use of UV-Visible Reflectance Spectroscopy as an Objective Tool to Evaluate Pearl Quality. Mar. Drugs 2012, 10, 1459–1475. [Google Scholar] [CrossRef]
  9. Toyota, T.; Nakauchi, S. Optical Measurement of Interference Color of Pearls and Its Relation to Subjective Quality. Opt. Rev. 2013, 20, 50–58. [Google Scholar] [CrossRef]
  10. Nagata, N.; Dobashi, T.; Manabe, Y. Modeling and Visualization for a Pearl-Quality Evaluation Simulator. IEEE Trans. Vis. Comput. Graph. 1997, 3, 307–315. [Google Scholar] [CrossRef]
  11. Satitkune, S.; Monarumit, N.; Boonmee, C.; Phlayrahan, A.; Promdee, K.; Won-In, K. Combination of FTIR and SEM for Identifying Freshwater-Cultured Pearls from Different Quality. Opt. Spectrosc. 2016, 120, 500–504. [Google Scholar] [CrossRef]
  12. Monarumit, N.; Noirawee, N.; Phlayrahan, A.; Promdee, K.; Won-In, K.; Satitkune, S. Identification of High-Luster and Lusterless Freshwater-Cultured Pearls by X-Ray Absorption Spectroscopy. J. Appl. Spectrosc. 2015, 82, 677–680. [Google Scholar] [CrossRef]
  13. Xuan, Q.; Chen, Z.; Liu, Y.; Huang, H.; Bao, G.; Zhang, D. Multiview Generative Adversarial Network and Its Application in Pearl Classification. IEEE Trans. Ind. Electron. 2019, 66, 8244–8252. [Google Scholar] [CrossRef]
  14. Ozaki, R.; Kikumoto, K.; Takagaki, M.; Kadowaki, K.; Odawara, K. Structural colors of pearls. Sci. Rep. 2021, 11, 15224. [Google Scholar] [CrossRef] [PubMed]
  15. Loesdau, M. Towards a Computer Vision Based Quality Assessment of Tahitian Pearls: Automatic Nacre Thickness Measurement and Color Classification, Computer Science. Ph.D. Thesis, Université de la Polynésie Française, Puna’auia, French Polynesia, 2016. [Google Scholar]
  16. Liang, Y.; Fu, J. Watershed Algorithm for Medical Image Segmentation Based on Morphology and Total Variation Model. Int. J. Pattern Recognit. Artif. Intell. 2019, 33, 1954019. [Google Scholar] [CrossRef]
  17. Zhang, C.; Shen, X.; Cheng, H.; Qian, Q. Brain Tumor Segmentation Based on Hybrid Clustering and Morphological Operations. Int. J. Biomed. Imaging 2019, 2019, 7305832. [Google Scholar] [CrossRef]
  18. Lei, T.; Jia, X.; Zhang, Y.; He, L.; Meng, H.; Nandi, A.K. Significantly Fast and Robust Fuzzy C-Means Clustering Algorithm Based on Morphological Reconstruction and Membership Filtering. IEEE Trans. Fuzzy Syst. 2018, 26, 3027–3041. [Google Scholar] [CrossRef] [Green Version]
  19. Lei, T.; Jia, X.; Liu, T.; Liu, S.; Meng, H.; Nandi, A.K. Adaptive Morphological Reconstruction for Seeded Image Segmentation. IEEE Trans. Image Processing 2019, 28, 5510–5523. [Google Scholar] [CrossRef] [Green Version]
  20. Yu, Y.; Cao, H.; Wang, Z.; Li, Y.; Li, K.; Xie, S. Texture-and-Shape Based Active Contour Model for Insulator Segmentation. IEEE Access 2019, 7, 78706–78714. [Google Scholar] [CrossRef]
  21. Zhou, Z.; Dai, M.; Wang, T.; Zhao, R. Prior Distribution-Based Statistical Active Contour Model. Multimed. Tools Appl. 2019, 78, 35813–35833. [Google Scholar] [CrossRef]
  22. Dan, Z.; Philip, C.C.; He, Y.; Tieshan, L. Multi-Scale Adaptive Level Set Segmentation Method Based on Saliency. IEEE Access 2019, 7, 153031–153040. [Google Scholar] [CrossRef]
  23. Wang, D.; Fu, Y.; Yang, G.; Yang, X.; Liang, D.; Zhou, C.; Zhang, D. Combined Use of FCN and Harris Corner Detection for Counting Wheat Ears in Field Conditions. IEEE Access 2019, 7, 178930–178941. [Google Scholar] [CrossRef]
  24. Luo, L.; Liu, W.; Lu, Q.; Wang, J.; Wen, W.; Yan, D.; Tang, Y. Grape Berry Detection and Size Measurement Based on Edge Image Processing and Geometric Morphology. Machines 2021, 9, 233. [Google Scholar] [CrossRef]
  25. Wang, Z.; Adzigbli, L.; Zheng, Z.; Yang, C.; Deng, Y. How Cultured Pearls Acquire Their Colour. Aquac. Res. 2020, 51, 3925–3934. [Google Scholar] [CrossRef]
  26. McGuinness, B.; Duke, M.; Au, C.K.; Lim, S.H. Measuring Radiata Pine Seedling Morphological Features Using a Machine Vision System. Comput. Electron. Agric. 2021, 189, 106355. [Google Scholar] [CrossRef]
  27. Heriawan, M.N.; Koike, K. Coal quality related to microfractures identified by CT image analysis. Int. J. Coal Geol. 2015, 140, 97–110. [Google Scholar] [CrossRef]
  28. Sung, H.-J.; Park, M.-K.; Choi, J.W. Automatic Grader for Flatfishes Using Machine Vision. Int. J. Control. Autom. Syst. 2020, 18, 3073–3082. [Google Scholar] [CrossRef]
  29. Liu, L.; Lim, S.; Shen, X.; Yebra, M. A multiscale morphological algorithm for improvements to canopy height models. Comput. Geosci. 2019, 130, 20–31. [Google Scholar] [CrossRef]
  30. Lapico, A.; Sankupellay, M.; Cianciullo, L.; Myers, T.; Konovalov, D.A.; Jerry, D.R.; Zenger, K.R. Using Image Processing to Automatically Measure Pearl Oyster Size for Selective Breeding. Digit. Image Comput. Tech. Appl. DICTA 2019, 11, 1–8. [Google Scholar]
  31. Sinaga, K.P.; Yang, M.-S. Unsupervised K-Means Clustering Algorithm. IEEE Access 2020, 8, 80716–80727. [Google Scholar] [CrossRef]
  32. Cardarilli, G.C.; Di Nunzio, L.; Fazzolari, R.; Nannarelli, A.; Re, M.; Spanò, S. N-Dimensional Approximation of Euclidean Distance. IEEE Trans. Circuits Syst. II Express Briefs 2020, 67, 565–569. [Google Scholar] [CrossRef]
Figure 1. Pearl shape detection system platform.
Figure 1. Pearl shape detection system platform.
Micromachines 13 00546 g001
Figure 2. Operation flowchart.
Figure 2. Operation flowchart.
Micromachines 13 00546 g002
Figure 3. Pearl image preprocessing. (a) Original image of pearl; (b) pearl binary diagram.
Figure 3. Pearl image preprocessing. (a) Original image of pearl; (b) pearl binary diagram.
Micromachines 13 00546 g003
Figure 4. Connected domain labeling.
Figure 4. Connected domain labeling.
Micromachines 13 00546 g004
Figure 5. A partial enlargement of the contour of the tangent pearls’ edges.
Figure 5. A partial enlargement of the contour of the tangent pearls’ edges.
Micromachines 13 00546 g005
Figure 6. Angle distribution diagram.
Figure 6. Angle distribution diagram.
Micromachines 13 00546 g006
Figure 8. Tangent pearls’ segmentation.
Figure 8. Tangent pearls’ segmentation.
Micromachines 13 00546 g008
Figure 9. Pearls in two states. (a) Pearls in non-contact state; (b) contact state pearls.
Figure 9. Pearls in two states. (a) Pearls in non-contact state; (b) contact state pearls.
Micromachines 13 00546 g009
Figure 10. Different methods for different numbers of tangent pearls’ segmentation results. (a) Watershed algorithm; (b) morphological algorithm; (c) proposed algorithm.
Figure 10. Different methods for different numbers of tangent pearls’ segmentation results. (a) Watershed algorithm; (b) morphological algorithm; (c) proposed algorithm.
Micromachines 13 00546 g010
Figure 11. Comparison test statistical results of different segmentation methods.
Figure 11. Comparison test statistical results of different segmentation methods.
Micromachines 13 00546 g011
Figure 12. Robot sorting results.
Figure 12. Robot sorting results.
Micromachines 13 00546 g012
Figure 13. Recognition results of different shapes of pearls under different contact posture conditions. (a) Perfect circle; (b) Circle; (c) Near circle; (d) Ellipse.
Figure 13. Recognition results of different shapes of pearls under different contact posture conditions. (a) Perfect circle; (b) Circle; (c) Near circle; (d) Ellipse.
Micromachines 13 00546 g013
Table 1. Connected domain area and area ratio.
Table 1. Connected domain area and area ratio.
Serial Number12345678910
Connected area (pixel)14,19314,38214,06413,24913,43413,06813,21113,75141,46725,796
Kn1.091.101.081.011.031.001.011.053.171.97
Table 2. The main differences between the three algorithms.
Table 2. The main differences between the three algorithms.
AlgorithmWatershed AlgorithmMorphological AlgorithmAlgorithm of this Paper
Principles and ideasThe basic idea of the algorithm is to regard the image as a geodesic topological landform. The gray value of each pixel in the image represents the altitude of the point, and each local minimum and its affected area are called the catchment basin. The boundary of the catchment basin forms the watershed.The basic idea of the algorithm is to measure and extract the corresponding shape in the image by using structural elements with a certain shape to achieve the purposes of image analysis and recognition.The algorithm uses the concave points to describe the concave situation of the boundary, uses the boundary contour of the overlapping area to find the concave points, and finds the separation points from the concave points on the boundary to divide the overlapping area.
AdvantageThe obtained boundaries are continuous with high accuracy and fast speed.Good positioning effect, high segmentation accuracy, and good anti-noise performance. The basic morphological operations are erosion and dilation.The calculation is simple; the features of the extracted points are uniform and reasonable; it is insensitive to image rotation, brightness changes, noise effects, and viewpoint changes.
DisadvantageIt has a good response to weak edges, noise in the image, and subtle grayscale changes on the surface of the object, which will cause over-segmentation.After image processing, there are still a large number of short lines and isolated points that do not match the target. Due to the incomplete preprocessing work, a series of point-based opening (closing) operations are also required; so, the operation speed drops significantly.It is sensitive to scale and has no geometric scale invariance. The extracted corners are pixel-level.
Table 3. Three algorithm segmentation results.
Table 3. Three algorithm segmentation results.
AlgorithmWatershed Algorithm (Figure 10a)Morphological Algorithm (Figure 10b)Algorithm of This Paper (Figure 10c)
SegmentationIt can segment obviously tangent pearls. When multiple pearls are seriously tangent, the binary image cannot extract the background area features at the location where the pearls are tangent and then cannot extract the segmentation endpoints, resulting in under-segmentation.It is possible to achieve better segmentation of tangent pearls; but, since corrosion and expansion are not reversible operations, it can be clearly seen that the pearls’ shapes have changed significantly.The selection of candidate concave points in the tangent pearl image is “adaptive”. When it is determined that all the current candidate concave points are near the real concave points, the follow-up candidate points will continue to be searched until a new candidate point appears, which avoids the difficulty of using it. Determined algorithm parameters can remove the interference of pseudo-pits.
Table 4. Pearl shape level.
Table 4. Pearl shape level.
Pearl ShapePerfect Circle A1Circle A2Near Circle A3Ellipse B
Diameter range (mm)8 ≤ d i ≤ 8.248 ≤ d i ≤ 8.678 ≤ d i ≤ 9.027.2 ≤ d i ≤ 8.8
Percentage difference in diameter (%)≤3.0≤8.0≤12.0≤20.0
Table 5. Confusion matrix for binary classification problem.
Table 5. Confusion matrix for binary classification problem.
Real ResultForecast Result
Positive ExampleCounter Example
Positive exampleTP (real example)FN (false counter example)
Counter exampleFP (false positive)TN (true counter example)
Table 6. Evaluation index.
Table 6. Evaluation index.
Accuracy (P)Recall Rate ®F1 Value
0.950.940.95
Table 7. Pearl grade classification results.
Table 7. Pearl grade classification results.
Pearl GradeMachine Inspection (Pieces)Manual Detection (Pieces)Consistency Rate (%)
Perfect circle A13939100.0
Circle A2545296.3
Near circle A3555894.8
Ellipse B525198.1
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Liu, X.; Jin, S.; Yang, Z.; Królczyk, G.; Li, Z. Measuring Shape Parameters of Pearls in Batches Using Machine Vision: A Case Study. Micromachines 2022, 13, 546. https://0-doi-org.brum.beds.ac.uk/10.3390/mi13040546

AMA Style

Liu X, Jin S, Yang Z, Królczyk G, Li Z. Measuring Shape Parameters of Pearls in Batches Using Machine Vision: A Case Study. Micromachines. 2022; 13(4):546. https://0-doi-org.brum.beds.ac.uk/10.3390/mi13040546

Chicago/Turabian Style

Liu, Xinying, Shoufeng Jin, Zixuan Yang, Grzegorz Królczyk, and Zhixiong Li. 2022. "Measuring Shape Parameters of Pearls in Batches Using Machine Vision: A Case Study" Micromachines 13, no. 4: 546. https://0-doi-org.brum.beds.ac.uk/10.3390/mi13040546

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