Open Access Paper
28 December 2022 Binocular camera based express packaging box dimension measurement
Fangfang Huang, Ying Luo, Zhuoqian Liang
Author Affiliations +
Proceedings Volume 12506, Third International Conference on Computer Science and Communication Technology (ICCSCT 2022); 125063X (2022) https://doi.org/10.1117/12.2662563
Event: International Conference on Computer Science and Communication Technology (ICCSCT 2022), 2022, Beijing, China
Abstract
The inefficiency of the dimension measurement on express packaging box lags behind the fast development of logistics industry in China. Therefore, focusing on improving the measurement efficiency of express packaging box, this paper proposes a new study on combining dimension binocular camera together with artificial intelligence algorithms. Specifically, a method combining HSV color space with OTSU is proposed to extract the box contour, straight line fitting is used to extract box corner points, and epipolar constraint is used for stereo matching of images, and finally the box dimension is obtained. The results show that in the experimental condition, this method can effectively control the relative error rate of the measurement of express box dimension to about ± 5 mm, which is close to the theoretical precision.

1.

INTRODUCTION

China’s e-commerce booms with the arrival of the information age, as well as the logistics industry, changing from the traditional ways of classifying and handling goods by manpower to ways combining artificial intelligence and information management. The huge logistics volume, brings a substantial income for logistics companies, and also poses a great challenge to them. How to improve the utilization rate of storage space and optimize the time of goods sorting, the manpower efficiency and the arrangement and deployment of truck space becomes a strong basis for logistics companies to compete with their counterparts and is problems that need to be optimized and solved constantly. The key to these problems is the rational use of the dimension information of logistics cartons.

With the coming of the automated industrial age and the maturity of OpenCV algorithms, computer vision as a subject has been studied and improved by scholars at home and abroad. Meanwhile, many scholars have also come up with their own schemes for the contactless measurement of the express box volume.

2.

RELATED WORK

According to Mi Yizhou, a binocular vision system was composed of two industrial CCD cameras, stereo matching was conducted for the measured box by semi-global dynamic programming algorithm to obtain a dense disparity map containing the three-dimensional space information of the parcels to be measured, and the volume of the measured box was obtained by three-dimensional reconstruction1. Wang and Yi used a trained RCF network model to binarize the edges of the measured box, and preprocessed the binarization images of the edges to accurately locate the vertices and edges of the box2. Liu proposed the method of self-built datasets and Viola-Jones algorithm-based optimization for automatic detection of logistics parcels and preprocessing of images. After the depth image was transformed into the three-dimensional point cloud image, point clouds were sampled and outliers were removed by Voxel Grid voxel filter and statistics filter. Point clouds on each plane were segmented and counted by RANSAC algorithm, and finally the volume of the box was obtained by statistical calculation3. Qiu designed two-object dimension measuring devices, which were respectively placed in two non-parallel vertical surfaces of the measured logistics carton, and the laser of the devices was adjusted to point to the geometric center of the object according to the position-type PID algorithm. Then, images taken by OpenMV module were processed by Hough transform to obtain the dimension of the corresponding vertical surface of the measured box. Finally, the dimension data of the two vertical surfaces were compared and integrated to obtain the dimension of the measured box4.

The existing measurement of the size of express packaging boxes has the following problems: first, the outline of the box cannot be well traced to obtain an approximate box model; second, the accuracy of the box size automatically measured by the existing method is not high enough, the error is relatively large. In view of these deficiencies in the current research, a method for measuring the dimensions of express packaging boxes based on binocular camera is proposed, and the outline of the box is obtained by combining the HSV color space and the Otsu method.

3.

MEASUREMENT OF EXPRESS PACKAGING BOX DIMENSION BASED ON BINOCULAR CAMERA

(1) Obtaining of box contour based on HSV color space and Otsu

To obtain an ideal contour extraction effect, the advantages of complete box segmentation by HSV color space and clear lower edge segmentation by Otsu were combined in the experiment5, 6. Let’s assume that the image processed by HSV is 𝑝1, and that processed by Otsu is 𝑝2. First, the maximum areas of the while parts in 𝑝1 and 𝑝2 images are obtained by the function get_lagrest_connect_component1() to obtain parameters 𝑝1max and 𝑝2max. Since the advantages of both areas are needed, namely the intersection of 𝑝1max and 𝑝2max, the formula is:

00143_PSISDG12506_125063X_page_2_1.jpg

Through the above combination based on HSV and Otsu characteristics, we can obtain a good carton contour, as shown in Figure 1.

Figure 1.

Obtaining of the measured box contour based on HSV and Otsu.

00143_PSISDG12506_125063X_page_2_2.jpg

(2) Extraction of corner points based on straight line fitting

To measure the dimension of the measured box, we actually only need to extract the four corner points of the box from the extracted contour7, as shown in Figure 2.

Figure 2.

Schematic diagram of extracting corner points.

00143_PSISDG12506_125063X_page_3_4.jpg

Therefore, the corner points were extracted based on straight line fitting in the experiment. Specific steps were as follows:

Step 1: the maximum contour was extracted from Figure 2, and the point with ymax within the contour was searched as 𝑝1 and denoted by 𝑝1(x,ymax). The reason for using Otsu method to extract the maximum contour is that the carton contour obtained is smooth and can be easily operated.

Step 2: the parameter k = 50 was set, 50 points were respectively taken on both sides of point 𝑝1 along the carton edge and were denoted by 𝑝Li and 𝑝Ri. Another 50 points were respectively taken by straight line fitting, and were denoted by 00143_PSISDG12506_125063X_page_2_3.jpg and 00143_PSISDG12506_125063X_page_2_4.jpg. By calculation:

00143_PSISDG12506_125063X_page_2_5.jpg

The errors of the left and right points were included in the array and denoted by E1 and E2.

Step 3: by calculating 00143_PSISDG12506_125063X_page_3_1.jpg, we could obtain the mean error parameter delta. The refined point 𝑝1 could be calculated by the formula 𝑝′ = 𝑝 + delta, which was denoted by 00143_PSISDG12506_125063X_page_3_2.jpg.

Step 4: based on the refined point 00143_PSISDG12506_125063X_page_3_3.jpg, straight line fitting was made clockwise or counterclockwise along the carton edge, errors between points on the straight line before and after straight line fitting were recorded, and the graph was drawn, as shown in Figure 3.

Figure 3.

Error curve.

00143_PSISDG12506_125063X_page_3_5.jpg

According to Figure 3, when the point exceeds a certain value, the error curve significantly increases. In the theory, this is because the point falls outside the box contour and the error between the point and those on straight line fitting is large. Therefore, the point before the error increases is taken as another corner point. Step 4 was repeated to obtain points 𝑝2 and 𝑝3.

Step 5: Step 2 and Step 3 were repeated and points 𝑝2 and 𝑝3 were refined, and the refined points were denoted by 00143_PSISDG12506_125063X_page_3_6.jpg and 00143_PSISDG12506_125063X_page_3_7.jpg.

Step 6: Step 4 was repeated and the point 00143_PSISDG12506_125063X_page_3_8.jpg was changed to 00143_PSISDG12506_125063X_page_3_9.jpg, and the point 𝑝4 could be obtained in the same way.

The above steps are the method used in the experiment to extract corner points based on straight line fitting, which is used in the experiment.

(3) Image matching based on epipolar constraint

In this experiment, image matching is the key step, and those before image matching are actually preparations for this step, and the accuracy of image matching directly affects the accuracy of numerical values. In traditional methods, violent matching of feature points was generally carried out. Let’s assume that there are m feature points in the left image and n feature points in the right image, then all feature points on both images need to be matched mn times. Obviously, this method is inefficient, and cannot ensure the accurate matching of feature points8. Very limited results can be achieved even optimization conditions are added in the violent matching. Thus, it is found in the study of binocular vision principle that images are matched by epipolar constraint.

First, corner points are marked and lined up in the left image, as shown in Figure 4.

Figure 4.

Image after lining up the feature corner points in the left image.

00143_PSISDG12506_125063X_page_4_1.jpg

Then, corner points are marked and lined up in the right image shown in Figure 5, where the green line is the mapping of the epipolar line of the point in the lower left corner of Figures 4 and 5.

Figure 5.

Image after lining up the feature corner points in the right image.

00143_PSISDG12506_125063X_page_4_2.jpg

Through the epipolar line, we can determine that the point closest to the epipolar line is the matching point. In this way, we can easily find the matching point of each point in the left and right images by lining up each point.

4.

DATA ANALYSIS

After image matching, the image was triangulated to obtain the length9, width and height of the measured box. Then we analyze the experiment accuracy based on the experimental data.

In the experiment, 30 different types of boxes were selected as the measured samples, and the samples were measured several times (Unit: cm).

As shown in Table 1, it is the first set of measurement data of the selected box 1. It can be seen that the measurement accuracy of length, width and height can basically be maintained at an error rate of 5%-10%. Similar experiments were carried out in the following 30*5 groups, and the measurement data can be obtained. The measurement accuracy of length, width and height is basically kept within 10% of the error rate.

Table 1.

Measured data of box 1 (Unit: cm).

Box 1LengthError rate %WidthError rate %HeightError rate %
Actual dimension32176.5
Measurement 131.61.2517.15.25.99.2
Measurement 2333.115.876.41.5
Measurement 332.82.517.63.55.99.2
Measurement 429.48.116.90.567.6
Measurement 529.96.515.68.26.84.6

Through the above multiple sets of experiments, it can be obtained that the box size obtained by this method is close to the theoretical accuracy10, which is reliable and practical.

5.

CONCLUSION

In this paper, a binocular camera-based express delivery size measurement scheme is proposed for the regular express box. Through the analysis of multiple groups of experimental data, the accuracy and validity of the data obtained by this method are verified, which can be considered in the The measurement of the actual express box has practical application value.

REFERENCES

[1] 

Mi, Y., A Volume Measurement System for Express Parcels Based on Binocular Vision, Hefei University of Technology, (2017). Google Scholar

[2] 

Wang, Y. and Yi, Y., “Box volume measurement algorithm based on RCF edge detection and binocular vision,” Modern Computer (Pro), 35 71 –74 (2017). Google Scholar

[3] 

Liu, H., Research on Principle and Realization of Real-Time Volume Measurement of Logistics Package Based on Depth Camera, Zhejiang University, (2020). Google Scholar

[4] 

Qiu, Y., Li, W. and Xia, H., “Design of automatic measurement system for carton dimension in non-contact logistics,” Heze University Xuebao, 43 (02), 30 –35 (2012). Google Scholar

[5] 

Ikeda, O., “Segmentation of faces in video footage using HSV color for face detection and image retrieval,” in Proceedings 2003 International Conference on Image Processing (Cat. No.03CH37429), (2003). https://doi.org/10.1109/ICIP.2003.1247394 Google Scholar

[6] 

Huang, C., Li, X. and Wen, Y., “AN OTSU image segmentation based on fruitfly optimization algorithm,” 60 (1), 183 –188 (2021). Google Scholar

[7] 

Qiao, Y., Huang, X., Chai, Y., et al., “Corner detection based on adaptive line fitting,” Journal of Chongqing University, (2), 29 –31 (2003). Google Scholar

[8] 

Shi, M., An Image Recognition Method Based on Lexical Tree Retrieval and Violent Matching, CN106844726A (2017). Google Scholar

[9] 

Stigvall, J., Jensen, T. and Champ, P., Methods and Ranging Units for Distance Determination Based on the Principle of Triangulation, (2017). Google Scholar

[10] 

Lin, X., Wang, Z. and Shi, Y., “Evaluation and discrimination of profile error of complex plane curves,” Journal of Metrology, 32 (3), 8 (2011). Google Scholar
© (2022) COPYRIGHT Society of Photo-Optical Instrumentation Engineers (SPIE). Downloading of the abstract is permitted for personal use only.
Fangfang Huang, Ying Luo, and Zhuoqian Liang "Binocular camera based express packaging box dimension measurement", Proc. SPIE 12506, Third International Conference on Computer Science and Communication Technology (ICCSCT 2022), 125063X (28 December 2022); https://doi.org/10.1117/12.2662563
Advertisement
Advertisement
RIGHTS & PERMISSIONS
Get copyright permission  Get copyright permission on Copyright Marketplace
KEYWORDS
Cameras

Packaging

RGB color model

Image processing

Clouds

Evolutionary algorithms

Image segmentation

RELATED CONTENT


Back to Top