| Literature DB >> 35457852 |
Xinying Liu1, Shoufeng Jin1, Zixuan Yang1, Grzegorz Królczyk2, Zhixiong Li2,3.
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%.Entities:
Keywords: image segmentation; intelligent agriculture; machine vision; pit detection
Year: 2022 PMID: 35457852 PMCID: PMC9025023 DOI: 10.3390/mi13040546
Source DB: PubMed Journal: Micromachines (Basel) ISSN: 2072-666X Impact factor: 3.523
Figure 1Pearl shape detection system platform.
Figure 2Operation flowchart.
Figure 3Pearl image preprocessing. (a) Original image of pearl; (b) pearl binary diagram.
Figure 4Connected domain labeling.
Connected domain area and area ratio.
| Serial Number | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Connected area (pixel) | 14,193 | 14,382 | 14,064 | 13,249 | 13,434 | 13,068 | 13,211 | 13,751 | 41,467 | 25,796 |
|
| 1.09 | 1.10 | 1.08 | 1.01 | 1.03 | 1.00 | 1.01 | 1.05 | 3.17 | 1.97 |
Figure 5A partial enlargement of the contour of the tangent pearls’ edges.
Figure 6Angle distribution diagram.
Figure 7Preliminary pit detection.
Figure 8Tangent pearls’ segmentation.
Figure 9Pearls in two states. (a) Pearls in non-contact state; (b) contact state pearls.
The main differences between the three algorithms.
| Algorithm | Watershed Algorithm | Morphological Algorithm | Algorithm of this Paper |
|---|---|---|---|
| Principles and ideas | The 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. |
| Advantage | The 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. |
| Disadvantage | It 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. |
Figure 10Different methods for different numbers of tangent pearls’ segmentation results. (a) Watershed algorithm; (b) morphological algorithm; (c) proposed algorithm.
Three algorithm segmentation results.
| Algorithm | Watershed Algorithm ( | Morphological Algorithm ( | Algorithm of This Paper ( |
|---|---|---|---|
| Segmentation | It 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. |
Figure 11Comparison test statistical results of different segmentation methods.
Pearl shape level.
| Pearl Shape | Perfect Circle A1 | Circle A2 | Near Circle A3 | Ellipse B |
|---|---|---|---|---|
| Diameter range (mm) | 8 ≤ | 8 ≤ | 8 ≤ | 7.2 ≤ |
| Percentage difference in diameter (%) | ≤3.0 | ≤8.0 | ≤12.0 | ≤20.0 |
Confusion matrix for binary classification problem.
| Real Result | Forecast Result | |
|---|---|---|
| Positive Example | Counter Example | |
| Positive example | ||
| Counter example | ||
Evaluation index.
| Accuracy (P) | Recall Rate ® | |
|---|---|---|
| 0.95 | 0.94 | 0.95 |
Pearl grade classification results.
| Pearl Grade | Machine Inspection (Pieces) | Manual Detection (Pieces) | Consistency Rate (%) |
|---|---|---|---|
| Perfect circle A1 | 39 | 39 | 100.0 |
| Circle A2 | 54 | 52 | 96.3 |
| Near circle A3 | 55 | 58 | 94.8 |
| Ellipse B | 52 | 51 | 98.1 |
Figure 12Robot sorting results.
Figure 13Recognition results of different shapes of pearls under different contact posture conditions. (a) Perfect circle; (b) Circle; (c) Near circle; (d) Ellipse.