원시데이터 수집 시스템
선정목록으로

Portable System for Box Volume Measurement Based on Line-Structured Light Vision and Deep Learning

관련 필름·전자재료 · (16) CPI(투명 폴리이미드)

기본 정보

저자
  1. Tao Peng — Key Laboratory of Specialty Fiber Optics and Optical Access Networks, Joint International Research Laboratory of Specialty Fiber Optics and Advanced Communication, Shanghai Institute for Advanced Communication and Data Science, Shanghai University, 99 Shangda Road, Shanghai 200444, China
  2. Zhijiang Zhang — Key Laboratory of Specialty Fiber Optics and Optical Access Networks, Joint International Research Laboratory of Specialty Fiber Optics and Advanced Communication, Shanghai Institute for Advanced Communication and Data Science, Shanghai University, 99 Shangda Road, Shanghai 200444, China
  3. Yingjie Song — Key Laboratory of Specialty Fiber Optics and Optical Access Networks, Joint International Research Laboratory of Specialty Fiber Optics and Advanced Communication, Shanghai Institute for Advanced Communication and Data Science, Shanghai University, 99 Shangda Road, Shanghai 200444, China
  4. Fansheng Chen — Key Laboratory of Intelligent Infrared Perception, Chinese Academy of Sciences, Shanghai 200444, China
  5. Dan Zeng — Key Laboratory of Specialty Fiber Optics and Optical Access Networks, Joint International Research Laboratory of Specialty Fiber Optics and Advanced Communication, Shanghai Institute for Advanced Communication and Data Science, Shanghai University, 99 Shangda Road, Shanghai 200444, China
DOI
10.3390/s19183921
저널
Sensors
발행년도
2019
발행기관
Multidisciplinary Digital Publishing Institute
피인용수
14
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.3390/s19183921
토픽
Surface Roughness and Optical Measurements
OpenAlex ID
W2972318032

평가 내용

관련도
관련
사업분야
필름·전자재료 · (16) CPI(투명 폴리이미드)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > CPI(투명 폴리이미드)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Portable box volume measurement has always been a popular issue in the intelligent logistic industry. This work presents a portable system for box volume measurement that is based on line-structured light vision and deep learning. This system consists of a novel 2 × 2 laser line grid projector, a sensor, and software modules, with which only two laser-modulated images of boxes are required for volume measurement. For laser-modulated images, a novel end-to-end deep learning model is proposed by using an improved holistically nested edge detection network to extract edges. Furthermore, an automatic one-step calibration method for the line-structured light projector is designed for fast calibration. The experimental results show that the measuring range of our proposed system is 100-1800 mm, with errors less than ±5.0 mm. Theoretical analysis indicates that within the measuring range of the system, the measurement uncertainty of the measuring device is ±0.52 mm to ±4.0 mm, which is consistent with the experimental results. The device size is 140 mm × 35 mm × 35 mm and the weight is 110 g, thus the system is suitable for portable automatic box volume measurement.

본문 63,122자

본문 펼치기
# _sensors_ _Article_ ## Portable System for Box Volume Measurement Based on Line-Structured Light Vision and Deep Learning Tao Peng <sup>1</sup> , Zhijiang Zhang <sup>1</sup> , Yingjie Song <sup>1</sup> , Fansheng Chen <sup>2</sup> and Dan Zeng <sup>1,</sup> * 1 Key Laboratory of Specialty Fiber Optics and Optical Access Networks, Joint International Research Laboratory of Specialty Fiber Optics and Advanced Communication, Shanghai Institute for Advanced Communication and Data Science, Shanghai University, 99 Shangda Road, Shanghai 200444, China 2 Key Laboratory of Intelligent Infrared Perception, Chinese Academy of Sciences, Shanghai 200444, China * Correspondence: dzeng@shu.edu.cn; Tel.: +86-131-2230-0551 Received: 22 July 2019; Accepted: 9 September 2019; Published: 11 September 2019 [���������](https://www.mdpi.com/1424-8220/19/18/3921?type=check_update&version=3) [�������](https://www.mdpi.com/1424-8220/19/18/3921?type=check_update&version=3) Abstract: Portable box volume measurement has always been a popular issue in the intelligent logistic industry. This work presents a portable system for box volume measurement that is based on line-structured light vision and deep learning. This system consists of a novel 2 × 2 laser line grid projector, a sensor, and software modules, with which only two laser-modulated images of boxes are required for volume measurement. For laser-modulated images, a novel end-to-end deep learning model is proposed by using an improved holistically nested edge detection network to extract edges. Furthermore, an automatic one-step calibration method for the line-structured light projector is designed for fast calibration. The experimental results show that the measuring range of our proposed system is 100–1800 mm, with errors less than ±5.0 mm. Theoretical analysis indicates that within the measuring range of the system, the measurement uncertainty of the measuring device is ±0.52 mm to ±4.0 mm, which is consistent with the experimental results. The device size is 140 mm × 35 mm × 35 mm and the weight is 110 g, thus the system is suitable for portable automatic box volume measurement. Keywords: volume measurement; line-structured light; edge detection; deep learning 1. Introduction Box volume measurement is important for many sectors, including logistics, transportation, and production, and it can assist in designing, packaging, and allocating strategies. Fast, intelligent, accurate, and automatic volume measurement can improve efficiency and reduce labor intensity. User-friendly and cost-effective systems are also vital for box volume measurement. As previously mentioned, a practical measurement system for box volume should have the following characteristics: (1) relatively small to be handled gracefully, (2) wide measuring range, (3) high measurement accuracy, (4) stable and robust, and (5) easy to use and flexible. At present, the research hotspots of large-scale measurement methods with three-dimensional (3D) geometric dimension focus on non-contact 3D measurement methods based on computer vision technology. This method has a rigorous theoretical basis, a large range of elasticity, high measurement accuracy and efficiency, no rigid requirement for the spatial relationship between the measuring device and measured object, good robustness, and non-contact measurement. Thus, this method is a feasible solution for solving large-scale 3D geometric measurement. With the development of computer vision technology, object volume can be calculated while using new technology and sensors [1–3]. Many advanced sensors, such as stereovision, time-of-flight (ToF) camera, and structured-light vision sensor, can represent spatial and color information from natural objects, thereby playing a crucial role in the development of industrial automation measurement. _Sensors_ 2019, _19_ [, 3921; doi:10.3390/s19183921](http://dx.doi.org/10.3390/s19183921) [www.mdpi.com/journal/sensors](http://www.mdpi.com/journal/sensors) _Sensors_ 2019, _19_, 3921 2 of 23 A method for the dimension measurement and inspection of cuboidal objects (boxes) with a ToF camera was described in [4], with an average error of 5 mm. The same ToF camera was used in [5] to build a system for computing the volume of cuboidal objects with an accuracy of 8 mm. The ToF technology can obtain depth information in real time by calculating the time that it takes for a pulse of energy to travel from its transmitter to the object surface and then back to the receiver. The ToF camera technique, due to its robustness and popularity, has been widely studied and applied in industries [6,7]. The dimensional measurement methods for objects that are based on stereovision have also been widely used. A stereovision technique for accurately measuring the distance and size (height and width) of an object in view was introduced in [8]. Ge et al. [9] proposed a method of broccoli seedling recognition in natural environments based on binocular stereovision. As binocular cameras heavily rely on image feature matching, the effect is poor under dark or overexposed lighting. In addition, if the measured scene lacks texture, then extracting and matching the features are difficult. In addition, a binocular stereocamera uses complex correlation algorithm, which is time consuming. The depth calculation of ToF is unaffected by the grayscale and features of the object surface, and the ToF can accurately perform 3D detection. The depth calculation accuracy of ToF does not change with the change in distance. The measurement accuracy can reach the mm level by using an advanced ToF camera and algorithm, as previously mentioned [4,5]. Recently, the technique of computer vision and structured light (SL) measurement has been widely applied in many fields of high-precision measurement, due to its simple structure. Triangulation-based visual sensors are popular for measurement in various industries. They have many advantages, such as non-contact, high-precision, rapid, and automated measurements [10–13]. Fernandes et al. [14] presented an approach that is based on projective geometry; they computed the box dimensions by using data that were extracted from the box silhouette and the projection of two parallel laser beams on one of the imaged faces of the box. Wang et al. [15] proposed a handheld 3D laser scanning system that consists of a binocular stereovision and line laser projector for measuring large-sized objects on site. Pan et al. [16] proposed a wheel size measurement framework that is based on a structured-light vision sensor, which has high precision and reliability and is suitable for highly reflective conditions. In the present study, we develop a novel volume measurement system for a box that contains high-resolution color digital cameras and line-structured lights and that works indoors and outdoors. Figure 1c shows the designed device for box volume measurement. The device size is 140 mm × 35 mm × 35 mm and the weight is 110 g, thereby easily meeting the requirements of stability and portability. The line-structured light projectors emit laser planes onto the box face, and the laser planes intersect with the face of the measured box and form laser stripes in the laser-modulated image. As the face of the measured box modulates the laser stripes, the image processing algorithm can calculate the dimension information of the box on the basis of the laser triangulation principle and some key points. Thus, our method calculates the volume of boxes from two laser-modulated images (two adjacent faces of the box), and the technique mainly includes two aspects: (1) calibration technology of the vision sensor and (2) the extraction of the box silhouette to obtain the key points from the laser-modulated images. ( a ) ( b ) ( c ) Figure 1. Box in the distribution center and design prototype; ( a, b ) show the box in the distribution, and ( c ) shows the proposed system prototype. _Sensors_ 2019, _19_, 3921 3 of 23 The measuring range and precision can be settled by studying the calibration algorithms [17–25]. Silhouette extraction is another key issue for laser-modulated image processing. Figure 1a,b show the differences in the appearances of boxes and backgrounds. Therefore, we need a robust algorithm to extract edges for laser-modulated images. The vigorous development of deep learning provides us with possible solutions. The deep fully convolutional neural network (FCNN) [26] has been proposed as a solution to similar problems. FCNN has reached the level of human beings in multi-level edge and target boundary detections in natural images [27,28], which leads to a breakthrough in semantic segmentation [29]. Song et al. [30] proposed an algorithm for detecting building corners in aerial images by training a DeepLab network; they achieved excellent results. Xie et al. [31] developed an efficient and accurate edge detector, namely, holistically nested edge detection (HED), which performs well in edge detection tasks. Inspired by HED, the present study trains an end-to-end deep learning model for the laser-modulated image by adopting an improved holistically nested edge detection (IHED) network. This work presents an approach for computing the box volume from only two laser-modulated images in a completely automatic manner. The method uses information that was extracted from the structure edges of the measured boxes, which can be computed when at least two of their faces are projected by the laser projector. We demonstrate this approach by developing a prototype visual sensor for calculating the box volume online (Figure 1c). The main contributions of this study are as follows: 1. Visual sensor. A portable mechanical structure for box volume measurement is proposed with an accuracy of ±5.0 mm and measuring range of 10–1800 mm (Sections 2 and 3.1). 2. Box volume measurement algorithm. A novel algorithm for calculating the box volume in a completely automatic manner online is presented (Section 3.2). 3. Calibration. A novel calibration method for the automatic calibration of our system is proposed. This method performs camera and laser projector calibrations in a single step, thus avoiding the digitalization of a reference sphere to obtain extrinsic parameters (Section 3.3). 4. Edge detection. A total of 40,000 labeled laser-modulated images are collected. With this box edge detection database, a novel end-to-end deep learning architecture that is based on IHED is proposed and it has achieved excellent performance (Section 3.4). The paper is organized, as follows. Section 2 presents a brief overview and operating instructions of the visual sensor of the system. Our new approach for measuring the box volume is investigated in detail in Section 3. The experimental results and discussions are presented in Section 4. Finally, conclusions are drawn in Section 5. 2. Overview Figure 1c displays the proposed system. High-precision sensors and strict measurement rules achieve high-accuracy measurement. Figure 2b shows the measurement method of the visual sensor and measured box. The detailed workflow is listed, as follows: 1. Solving parameters: Before using the system, we obtain the parameters by using our calibration method (Section 3.3). 2. Data collection: The visual sensor connected to a portable mobile device is used. Two images of any two adjacent faces of the box are obtained. The four modulated laser stripes should intersect the four edges of the box face, as shown in Figure 2c,d. 3. Volume measurement: The system will automatically process the collected images and then obtain the box length, width, and height. Finally, the system automatically obtains the volume of the measured box. _Sensors_ 2019, _19_, 3921 4 of 23 Position 1 ~~x~~ y <mark>Length</mark> Visual senso <mark>r</mark> y The first face of the box z width z x Position 2 The second face of the box ( a ) ( b ) ( c ) ( d ) Figure 2. Schematic of the measurement system and two images captured by the system; ( a ) the box model; ( b ) the measurement method of the visual sensor and measured box; ( c, d ) the captured images for the measured box. The regular logistics box volume is an important indicator of the freight that was collected in the logistics industry. The box length, width, and height should be measured to determine the box volume. Certain difficulties exist in volume measurement system, which are reflected in the following four aspects: (1) The environment inside the distribution center is complex and it suffers from different illumination information (Figure 3a,c,g,h). (2) Logistics boxes have varied sizes, and the box length ranges from 10 mm to 1800 mm (Figure 3a,b,e,f,j). (3) Laser-modulated images are influenced by variations in box materials, color, and appendages (Figure 3b,d,f,h,i). (4) Non-contact and portable measurements are required. ( a ) ( f ) ( b ) ( g ) ( c ) ( h ) ( d ) ( i ) ( e ) ( j ) Figure 3. Images that are captured by our device in the distribution center; ( a - j ) show the different images captured by our system. To solve the abovementioned problems, we model the boxes as parallelepipeds, as shown in Figure 2a. The volume of a parallelepiped can be calculated while using the 3D coordinates of the vertices with two arbitrary adjacent faces of the box. The 3D coordinates of a box’s face can be obtained on the basis of the intersection of the laser lines and the edges of the box’s face. Thus, the edge of the laser line and box edges on the laser-modulated images must be extracted before we can calculate the volume of the measured box (Section 3.4), and then the equations of the laser planes of the laser projector and the camera parameters must be obtained (Section 3.3). Our portable system for box volume measurement that is based on line-structured light vision and deep learning only requires two laser-modulated box images for the measurement. Figure 4 depicts the scheme behind the proposed solution. Before the measurement, we obtain the parameters by using our calibration method and write the parameters to the device. We input the two laser-modulated images into the designed network to generate the edge probability map. Subsequently, we obtain the _Sensors_ 2019, _19_, 3921 5 of 23 coordinates of key points of the box face through a simple image processing of the edge probability map. We can obtain the box volume combined with the calibration parameters and key points. Figure 4. Workflow of the box volume measurement system. 3. Mathematical Modeling _3.1._ _Design of the Visual Sensor Measurement System_ The portable volume measurement system that was proposed in this work consists of a 2 × 2 laser line grid projector and high-resolution camera, as shown in Figure 5b; it has a low computational cost. Table 1 lists the detailed parameters of the visual sensor. The size of the designed device is 140 mm × 35 mm × 35 mm, and the weight is 110 g. The baseline length of the device is 120 mm, thereby easily meeting the requirements of stability and portability. Furthermore, connection to other mobile devices, such as a mobile phone or pad, is convenient. ( a ) ( b ) Figure 5. ( a ) Measurement schematics of the proposed volume measurement system; and, ( b ) volume measurement device that we designed. Figure 5a presents the measurement schematics of the proposed volume measurement system. _Ow_ - _XwYwZw_ is the world coordinate system (WCS), and _Oc_ - _XcYcZc_ is the camera coordinate system (CCS). The laser stripes are projected onto the box face through a laser projector. The camera captures the laser stripes that are modulated by the box faces. Afterwards, the laser-modulated images are captured. However, the four modulated laser stripes must intersect the four edges of the box faces. _Sensors_ 2019, _19_, 3921 6 of 23 ~~<u>Table 1.</u>~~ ~~<u>Detailed parameters of the experimental equipment.</u>~~ Device <u>Picture of Real Products</u> <u>Parameters</u> <u>Number</u> Digital color camera Laser line projector _3.2._ _Geometric Model_ CCD: S-YUE, 1/1.8” Resolution: 2592 (H) × 1944 (V) Pixel size: 4.4 µm × 4.4 µm Frame rate: 15 fps Focal length: 3.6 mm Signal-to-noise ratio: 50 db Field of view: 71.9 <sup>◦</sup> × 60.4 <sup>◦</sup> Size: 32 × 32 × 22 mm Operation temperature: −20 <sup>◦</sup> C–60 <sup>◦</sup> C <u>Shooting distance:</u> <u>50 mm~inf.</u> ~~Power:~~ ~~10 mW (adjustable)~~ Focal length: adjustable Wavelength: 635 nm Size: φ5 × 20 mm Fan angle: 60 <sup>◦</sup> <u>temperature:</u> <u>−20</u> <sup>◦</sup> <u>C–60</u> <sup>◦</sup> <u>C</u> 1 pcs 4 pcs Camera mapping coordinate points in a 3D world to a two-dimensional (2D) image plane can be described while using a pinhole model [32]. Figure 6 shows the perspective projection relationship between 3D space point and 2D image point in the pinhole camera model. Figure 6. Perspective projection model of the visual sensor. The projection from a 3D point _P_ ( _xw_, _yw_, _zw_ ) in the WCS to a 2D image point _p_ ( _u_, _v_ ) in the image plane is expressed by the following equation: _Xw_ _Yw_ _Zw_ 1 , (1)   α δ _u_ 0 0 0 β ν0 0 0 0 1 0 _r_ 1 _r_ 2 _r_ 3 _r_ 4 _r_ 5 _r_ 6 _r_ 7 _r_ 8 _r_ 9       ρ _R_ =     _u_ ν 1 , _T_ = =   - _R_ _T_ _O_ <sup>_T_</sup> 1 α δ _u_ 0 0 β _v_ 0 0 0 1 _Tx_ _Ty_ _Tz_        , _A_ =    where _T_ and _R_ represent the translation vector and rotation matrix from the coordinate system to the CCS, respectively. α an β are the scale factors in _u_ and _v_ axes of the camera, respectively, and δ is the skew of the two image axes. ρ is a nonzero factor, and ( _u_ 0, _v_ 0) is the principal point. _Sensors_ 2019, _19_, 3921 7 of 23 The rotation matrix _R_ and translation vector _T_, which translate to a 3D point _Pc_ ( _xc_, _yc_, _zc_ ) in the CCS, encapsulate the camera orientation and position. The transformation relation of the CCS to the image coordinate system can be shown as _Xc_ _Yc_ _Zc_ α δ _u_ 0 0 β ν0 0 0 1 _u_ ν 1       ρ   =   , (2) Equation (2) shows the expression of a straight line in space, which connects the point in CCS with the point in the image plane. Practically, radial and tangential distortions of the lens are inevitable. In our practical engineering application, the tangential distortion of the lens has a minimal effect on the result. In this study, we only consider the radial distortion and we have the following equations: - _<u>x</u>_ ~~=~~ _x_ (1 + _k_ 1 _r_ <sup>2</sup> + _k_ 2 _r_ <sup>4</sup> ) _<u>y</u>_ = _y_ (1 + _k_ 1 _r_ <sup>2</sup> + _k_ 2 _r_ <sup>4</sup> ) <sup>,</sup> (3) where r <sup>2</sup> = _x_ <sup>2</sup> + _y_ <sup>2</sup>, ( _x_, _y_ ) <sup>_T_</sup> is the distorted image coordinate and ( _<u>x</u>_, _<u>y</u>_ ) <sup>_T_</sup> is the idealized one. _k_ 1 and _k_ 2 are the radial distortion coefficients of the lens. The laser light plane that is emitted from the visual sensor intersects with the box face and forms laser stripes in the image plane captured by the camera, as shown in Figure 7a. Assume that we have obtained ( _u_, _v_ ) of the eight key points (D1–D8) on the laser line, as shown in Figure 7a. Section 3.4 presents the method of obtaining the eight key points in detail. Subsequently, we can obtain the spatial coordinates of key points (D1–D8) in the CCS, as shown in Figure 7b. Points A, B, C, and D are the four vertices of the measured box face. ( a ) ( b ) Figure 7. Key points in the image and camera coordinate system (CCS): ( a ) image coordinate system, and ( b ) CCS. Point _D_ 1 in the image not only belongs to the intersection line with the surface to be digitized, but also to the laser light plane must fulfil the camera model equations. Once the perspective projection matrix of the camera and the equations of the planes containing the sheets of light relative to a global coordinate frame are obtained from the calibration, the triangulation for computing the 3D coordinates of object points simply involves finding the intersection of a ray from the camera and a plane from the projector. Thus, the equation of the laser plane in the CCS is as follows: _aixc_ + _biyc_ + _cizc_ + _di_ = 0, (4) _Sensors_ 2019, _19_, 3921 8 of 23 where _i_ is the laser stripe number and _ai_, _bi_, _ci_, and _di_ are the coefficients. The number of equations of the planes and light stripes is equal. The laser plane contributes with the additional information that is necessary for completing the equation of the straight line of the camera model, such that their 3D coordinates can be extracted from their 2D image coordinates _u_, _v_ . A 3D point _P_ ( _xc_, _yc_, _zc_ ) at the intersection of the viewpoint from the camera and the laser stripe from the projector is triangulated while using the camera and projector parameters. On the basis of Equations (2) and (4), we derive the set of linear equations [ _Xc_ / _Yc_, _Yc_ / _Zc_, 1/ _Zc_ ], as follows: _u_ - _u_ 0 _v_ - _v_ 0 - _ci_ _Xc_ / _Zc_ _Yc_ / _Zc_ 1/ _Zc_     α δ 0 0 β 0 _ai_ _bi_ _di_       =   , (5) Therefore, _P_ ( _xc_, _yc_, _zc_ ) in the CCS can be expressed as _Xc_ = _Zc_ ( _u_ - _u_ 0) − β <sup><u>δ</u></sup> , (6) α β <sup><u>δ</u></sup> <sup>(</sup> <sup>_v_</sup> <sup>−</sup> <sup>_v_</sup> <sup>0)</sup> _Yc_ = _Zc_ ( _<u>v</u>_ - _<u>v</u>_ <u>0)</u> , (7) β −1 _Zc_ = <sup>_<u>di</u>_</sup> _ai_ _Zc_ = <sup>_<u>di</u>_</sup> (− <sup>_<u>ci</u>_</sup> _ai_ (− <sup>_<u>ci</u>_</sup> ( _u_ - _u_ 0) − β <sup><u>δ</u></sup> β <sup><u>δ</u></sup> <sup>(</sup> <sup>_v_</sup> <sup>−</sup> <sup>_v_</sup> <sup>0)</sup> - <sup>_<u>bi</u>_</sup> α _ai_ β <sup><u>δ</u></sup> <sup>(</sup> <sup>_v_</sup> <sup>−</sup> <sup>_v_</sup> <sup>0)</sup> _ai_ ( _<u>v</u>_ - _<u>v</u>_ <u>0)</u> ) β , (8) On the basis of the intersection of lines _D_ 1 _D_ 3 and _D_ 5 _D_ 7 in the CCS, the coordinate of intersection point _A_ could be obtained as _A_ ( _Xca_, _Yca_, _Zca_ ). Similarly, we can generate the 3D coordinates of _B_, _C_, _D_ in the CCS: _B_ ( _Xcb_, _Ycb_, _Zcb_ ), _C_ ( _Xcc_, _Ycc_, _Zcc_ ), and _D_ ( _Xcd_, _Ycd_, _Zcd_ ). Thus, we derive the length and width of this box side. _width_ = 1/2( ( _Xca_ - _Xcb_ ) <sup>2</sup> + ( _Yca_ - _Ycb_ ) <sup>2</sup> + ( _Zca_ - _Zcb_ ) <sup>2</sup> + �( _Xcd_ - _Xcc_ ) <sup>2</sup> + ( _Ycd_ - _Ycc_ ) <sup>2</sup> + ( _Zcd_ - _Zcc_ ) <sup>2</sup> ) ~~�~~ _length_ = 1/2( ( _Xca_ - _Xcd_ ) <sup>2</sup> + ( _Yca_ - _Ycd_ ) <sup>2</sup> + ( _Zca_ - _Zcd_ ) <sup>2</sup> + �( _Xcb_ - _Xcc_ ) <sup>2</sup> + ( _Ycb_ - _Ycc_ ) <sup>2</sup> + ( _Zcb_ - _Zcc_ ) <sup>2</sup> ) , (9) Similarly, we capture the box’s image of the adjacent face to the first image. On the basis of Equation (9), we can measure the length and width of the second image: _width_ <sup>′</sup> and _length_ <sup>′</sup> . Hence, the box height can be calculated. _width_ <sup>′</sup> ( _min_ [( _width_ <sup>′</sup> - _width_ ), ( _width_ <sup>′</sup> - _length_ )] - _min_ [( _length_ <sup>′</sup> - _width_ ), ( _length_ <sup>′</sup> - _length_ )]) _height_ =  < _min_ [( _length_ <sup>′</sup> - _width_ ), ( _length_ <sup>′</sup> - _length_ )]) _height_ <sup>′</sup> ( _min_ [( _width_ <sup>′</sup> - _width_ ), ( _width_ <sup>′</sup> - _length_ )] , (10) Therefore, we can obtain the box volume. _V_ = _width_ ∗ _length_ ∗ _height_ . (11) However, a dimension of _A_ ∗ _A_ ∗ _B_ of the measured box is a problem. At this time, if the two captured images that were calculated with the length of the box’s faces are _A_ ∗ _B_, then our algorithm will not work properly. At this point, we obtain the box length and width through the first image, but we cannot calculate the box height from the second image through Equation (10). As the values of A and B calculated by the second image satisfy Equation (10), we must manually select a suitable A or B as the box height in our system. _Sensors_ 2019, _19_, 3921 9 of 23 To date, a box volume measurement approach, which only requires two laser-modulated images of boxes, has been introduced. Section 3.3 designs a one-step calibration method for camera and laser projector. The coordinates of key points, which are automatically obtained by deep learning for laser-modulated image, are presented in Section 3.4. _3.3._ _Calibration Method for the Camera and 2_ × _2 Laser Line Grid Projector_ In this work, we present a one-step intrinsic and extrinsic calibration method for line-structured light projector that is based on circle calibration target. The coordinates of the key points are solved by increasing the equation of the laser plane. Zhang et al. [17] provided an excellent method for camera calibration. Line-structured light projector calibration involves determining the camera’s intrinsic and extrinsic parameters. Equation (1) represents a camera perspective projection model. The 3 × 3 rotation matrix _R_ and 3 × 1 translation vector _T_ are the external parameters of the camera. The laser plane (Equation (4)) in this coordinate system is obtained during line-structured light projector calibration. Here, we simultaneously generate the system parameters of the camera and the laser projector. Figure 8a shows the circle target that is used in this paper. The visual sensor is placed at a distance from the target board similar to the nominal working distance. _N_ images with different positions, which contain the laser line corresponding to the intersection of the laser plane with the calibration board, are captured (Figure 8b). We select the first local WCS as the absolute WCS from the _N_ local WCSs previously established. The _X_ and _Y_ axes of each moving target are used as the local WCS to calculate the relative position between the CCS and local WCS _Ri_ and _Ti_ . The laser plane (Equation (4)) is fitted in the absolute CCS (Figure 8c). ( a ) ( b ) ( c ) Figure 8. Calibration of the visual sensor: ( a ) circle calibration target; ( b ) calibration image; and, ( c ) laser plan fitting. Therefore, the equation coefficients of the _i_ th plane ( _ai_, _bi_, _ci_, and _di_ ) can be computed while using the least squares method. We obtain the line-structured light projector parameters on the basis of the circle calibration target by one step. Moreover, the proposed approach does not need to extract the standard points, but the inputs all coordinates of the laser stripes converted into the CCS. Therefore, the number of calibrated points is sufficient for the calibration of the laser plane. Subsequently, the equation of the laser plane is fitted to reduce the error. The calibration board is 1300 × 1200 × 5.0 mm, and _N_ ( _N_ = 28) images with different poses calibrate the system. The circle calibration target is printed with a high-quality printer and then placed on glass. Table 1 lists the detailed parameters of the camera and laser projector. Table 2 presents the calibration parameters. _Sensors_ 2019, _19_, 3921 10 of 23 Table 2. Calibration parameters of the structured optical system. Title Value 2458.9172 0 1239.5188 0 2453.8100 1032.5590 0 0 1 <u></u>  Camera intrinsic _A_ = <u></u>  Distortion coefficients k1 = −0.03415937, k2 = 0.321070446 Pixel error [0.0654, 0.0845] Laser projector parameters _3.4._ _Laser-Modulated Image Processing_ 0.00792910x + (−0.00817394)y + 0.00018065z = 1 0.01078476x + (−0.01121147)y + 0.00223845z = 1 0.01037354x + 0.00959161y + 0.00170705z = 1 0.00799885x + 0.00730513y + (−0.00038506)z = 1 3.4.1. IHED Network for Extracting the Edge of the Laser-Modulated Image Variation in box materials, color, and appendages and the box texture influence laser-modulated images. The actual box edges and laser center lines are difficult to distinguish from lines in the laser-modulated images in complex scenarios. Although edge detection technology [33,34] can be used to find the box contour, these algorithms often perform particularly poorly in image processing in practical applications. Recently, FCNN has advanced in addressing the problem of detecting edge and object boundaries in natural images. Inspired by HED, we adopt a similar structure to the HED network and continuously inherit and learn the precise edge in the generated output process through the side output layer. We also design our network by modifying the VGG16 [35] network. Figure 9 displays the developed IHED network for edge detection. In comparison with HED, our modifications can be described, as follows: 1. To achieve the best edge detection effect, we build our own laser-modulated image dataset. 2. We cut the first two side output layers. Such an operation can remove considerable low-level edge information. 3. A cross-entropy loss/sigmoid layer is connected to the up-sampling layer in each stage without deep supervision. Figure 9. Architecture of the proposed improved holistically nested edge detection (IHED) network. _Sensors_ 2019, _19_, 3921 11 of 23 In total, 40,000 training images are obtained to determine the IHED network parameters and 1500 images are provided for testing. We manually mark the coordinate of the eight key points of the laser-modulated images and then draw straight lines to obtain the ground truth. Figure 10 shows two example images and the ground-truth edge results of the developed dataset. ( a ) ( b ) ( c ) ( d ) Figure 10. Two example images and ground-truth edge results for our dataset: ( a, c ) Input images; ( b, d ) ground-truth edges by human annotation of ( a, c ), respectively. In our IHED network, we consider the following objective function: _L_ s _ide_ ( _W_, _w_ ) = _M_ _m_ =1 α _mlside_ <sup>(</sup> <sup>_m_</sup> <sup>)(</sup> <sup>_W_</sup> <sup>,</sup> <sup>_w_</sup> <sup>(</sup> <sup>_m_</sup> <sup>)),</sup> (12) where _lside_ denotes the image-level loss function for side outputs. _W_ is the set representation of all standard network layer parameters. The parameters of side output are denoted as _w_ = ( _w_ <sup>(1)</sup>, . . ., _w_ <sup>_M_</sup> ), and the network has _M_ side output layers. In our network architecture, the loss function is computed over all the pixels in a training image _X_ = ( _xj_, _j_ = 1, . . ., | _X_ |) and edge map _Y_ = ( _yj_, _j_ = 1, . . ., | _Y_ |), _y_ _j_ ∈{0, 1}. In the training process, this cost function traverses every pixel of the input image and of the output probability graph. For each image, this function is defined as log Pr( _y_ _j_ = 1��� _X_ ; _W_, _w_ ( _m_ ) ) − (1 − β) _j_ ∈ _Y_ _ _lside_ <sup>(</sup> <sup>_m_</sup> <sup>)(</sup> <sup>_W_</sup> <sup>,</sup> <sup>_w_</sup> <sup>(</sup> <sup>_m_</sup> <sup>)) = −β</sup> _j_ ∈ _Y_ + log Pr( _yj_ = 0��� _X_ ; _W_, _w_ ( _m_ ) ), (13) where β = ��� _Y_ _���/| _Y_ | and 1−β = | _Y_ +|/| _Y_ |. _Y_ + and _Y_ _ denote the edge and non-edge ground-truth label sets, respectively. At each side output layer, we obtain the edge probability map prediction _Y_ ˆ _side_ <sup>(</sup> <sup>_m_</sup> <sup>)</sup> <sup>= σ(</sup> <sup>_A_</sup> <sup>ˆ</sup> _side_ <sup>(</sup> <sup>_m_</sup> <sup>)), where</sup> <sup>_A_</sup> <sup>ˆ</sup> _side_ <sup>(</sup> <sup>_m_</sup> <sup>)</sup> <sup>≡{α(m), j = 1, . . ., |Y|}</sup> <sup>are the activations of the side output of layer</sup> <sup>_m_</sup> <sup>.</sup> Thus, the loss function for “weighted-fusion” layer is as follows: _side_ <sup>(</sup> <sup>_m_</sup> <sup>)), where</sup> <sup>_A_</sup> <sup>ˆ</sup> _side_ <sup>(</sup> <sup>_m_</sup> <sup>)</sup> _side_ <sup>(</sup> <sup>_m_</sup> <sup>)</sup> <sup>= σ(</sup> <sup>_A_</sup> <sup>ˆ</sup> _side_ <sup>(</sup> <sup>_m_</sup> <sup>)</sup> _M_ _m_ =1 _L fuse_ ( _W_, _w_ ) = _Dis_ ( _Y_, σ( _A_ ˆ <sup>_m_</sup> _side_ <sup>)),</sup> (14) _A_ ˆ <sup>_m_</sup> where σ(.) is the sigmoid function. _Dis_ (.) is the distance between the fused predictions and ground-truth label map. For all of these parameters, _W_, _w_ is simultaneously optimized through standard backpropagation: ( _W_, _w_ ) <sup>∗</sup> = _argmin_ ( _L_ _fuse_ ( _W_, _w_ )), (15) Hence, in the testing stage, given an image _X_, the final edge probability map can be defined as _Y_ ˆ _edge_ = _Average_ ( ˆ _Y fuse_, _Y_ ˆ _side_ <sup>(3)</sup> _side_ <sup>(3)</sup> <sup>,</sup> <sup>_Y_</sup> <sup>ˆ</sup> _side_ <sup>(4)</sup> _side_ <sup>(4)</sup> <sup>,</sup> <sup>_Y_</sup> <sup>ˆ</sup> _side_ <sup>(5)</sup> (16) _side_ <sup>(5)</sup> <sup>),</sup> The network parameter settings are as follows: input image size (512 × 512), mini-batch size (9), learning rate (1 × 10 <sup>−3</sup> ), loss weight for each side output layer (1), weight decay (2 × 10 <sup>−4</sup> ), and number _Sensors_ 2019, _19_, 3921 12 of 23 of training iterations (1 × 10 <sup>5</sup>, learning rate is divided by 10 after 1000). This network design can not only realize high-precision and high-sensitivity edge detection, but also suppress internal texture edge. A total of 1500 testing images are used to verify the effectiveness of our algorithm. This study uses the precision, recall, and F-measure to evaluate the edge detection performance of the laser-modulated image. The precision recall curve includes the recall rate and precision of the detection result. The precision reflects the pixel ratio of the used approach to extract the true structure edges (TP) and the total number of all detected edges. The recall rate reflects the TP and ground-truth edge. The F-measure is a comprehensive evaluation indicator with a fixed conversion relationship between recall and precision. The recall, precision, and F-measure are calculated, as follows: <u>TP</u> Precision = TP + FP <sup>,</sup> (17) <u>TP</u> Recall = TP + FN <sup>,</sup> (18) F − measure = <sup><u>2</u></sup> Precision <sup>∗</sup> <sup><u>Precision</u></sup> + <sup>∗</sup> Recall <sup><u>Recall</u></sup> <sup>,</sup> (19) where FP is the wrong edge pixels that have been extracted and FN is the number of mis-extracted pixels. The proposed IHED network without deep-supervision extraction of structure edges is compared with the HED algorithm to show its effectiveness. Figure 11 shows a performance comparison of these detection algorithms on our dataset with respect to the precision, recall, and F-measure of the extracted edges. The IHED without deep supervision has a better edge extraction performance than the other three network models. Figure 11. Performance comparison of the IHED and holistically nested edge detection (HED) networks with/without deep-supervision with respect to edge extraction. Figure 12 shows several examples of edge detection on the dataset for the HED and IHED networks (network parameters are consistent). Rows 1, 2, 3, and 4 in Figure 12 display that IHED is more advantageous than HED in detecting the structural edge of the box. The HED network detects other non-box structure edges, which are avoided by the improved network (IHED). This result is consistent with the original intention of the edge detection of the design structure. _Sensors_ 2019, _19_, 3921 13 of 23 Raw image HED with deep supervision HED without deep supervision IHED with deep supervision IHED without deep supervision Figure 12. Edge detection results by the HED/IHED network with/without deep supervision. 3.4.2. Method for Extracting the 2D Coordinates of the Key Points of the Laser-Modulated Image We must obtain the supporting lines for the edge probability maps to obtain the 2D coordinates of the box vertices. The edge probability map of the laser-modulated image has been obtained by our network (Section 3.4.1). By using the center coordinate of the image as the origin coordinate, we use the Hough line transform [36] to detect all the straight lines on the edge probability map. Equation (20) is used to represent them. ρ = _x_ cos(θ) + _y_ sin(θ), (20) Subsequently, we cluster the nearly collinear line segments by setting the suitable segmentation thresholds for ρ and θ (ρ ∈ [0 _pixel_, 15 _pixel_ ] and θ ∈ [−1.8 <sup>◦</sup>, 1.8 <sup>◦</sup> ] in this study). We separately obtain the fitting line equation of the laser line and the edge of the measured box. Figure 13 shows the operation process. By finding the intersection points of these lines, the coordinates of eight key points on the 2D image can be deduced. Finally, we can easily locate the relationship of the eight key points (D1–D8) on the laser line through the geometric relationships between the box face’s edge and the laser line in the 2D image, as shown in Figure 14. Figure 13. Edge probability map processing and key point extraction procedure. _Sensors_ 2019, _19_, 3921 14 of 23 ( a ) ( b ) ( c ) Figure 14. Verification of the accuracy of extracting pixel coordinates of eight key points; ( a ) original image (2592 × 1944); ( b ) edge probability map (512 × 512); and, ( c ) eight key points obtained by our approach. The original image resolution is 2592 × 1944 pixels and the size of the edge probability map output by the network is 512 × 512 pixels. Automatically extracting the eight key points in the collected box image with laser line has an important influence on the accuracy and automatic operation of the proposed system. We conduct pixel level coordinate error analysis between the raw image and edge probability image that were obtained through the IHED network. We convert the coordinates of the eight key points obtained to a camera resolution of 2592 × 1944. Here, we consider the maximum measuring range of the system to be 1800 mm. Thus, we can roughly estimate the actual physical distance of each pixel as <sup><u>1800</u></sup> 1944 <sup>mm.</sup> <sup>Assume that the maximum error allowed by the system is 5.0 mm.</sup> <sup>We</sup> can obtain the maximum pixel error that is allowed by the system as 5 ∗ 1800 <sup><u>1944</u></sup> <sup>= 5.40 pixels.</sup> <sup>We analyze</sup> the pixel values of 1500 images in the test dataset. _N_ _i_ =1 _pixel_ _ _error_ = _M_ _j_ =1 <u>1</u> _N_ <sup>[(</sup> <sup>_ui_</sup> <sup>−</sup> <sup>_ui_</sup> <sup>′) + (</sup> <sup>_vi_</sup> <sup>−</sup> <sup>_vi_</sup> <sup>′)],</sup> (21) where _M_ is the number of test datasets. _N_ is the number of key points on the image. In the experiment, _M_ is 1500 and _N_ is 8. ( _u_, _v_ ) is the label pixel coordinate and ( _u_ <sup>′</sup>, _v_ <sup>′</sup> ) is the pixel coordinate that was obtained by our approach. The pixel coordinate error of key points is 1.96 < 5.40 pixels, which can meet our requirements. 4. Experiments Figure 1c illustrates the system, wherein the device is connected with an android phone (HUAWEI honor Play) through a USB cable. The measurement environment parameters are as follows: temperature ( −15 ∼ 60 <sup>◦</sup> C), measured distance from the visual sensor to the measured box (0.1–2.5 m), and measuring range of the box length, width, and height (10–1800 mm). The initial status calibration is performed before the experiment. Table 2 lists the calibration parameters of the visual sensor. Various experimental tests are conducted under varying operating conditions to test the robustness of the proposed system. Four experimental phases are performed to evaluate the system performances: (1) In Section 4.1, the measurement statistical analysis of boxes in complex scene is conducted. (2) In Section 4.2, the stability of the proposed system is verified. (3) In Section 4.3, the statistical analysis on real boxes is performed and the measurement uncertainty is evaluated by using the expression _Sensors_ 2019, _19_, 3921 15 of 23 of uncertainty in measurement [37]. (4) In Section 4.4, the measurement error analysis of the optical quality of the boxes surface and the surface variation is performed. (5) In Section 4.5, the practical performance of the proposed system is evaluated in real-world tests. _4.1._ _Measurement Statistical Analysis of Boxes in Complex Scenarios_ The experiment tests the accuracy of the system’s measurements in complex and outdoor environments. Figure 15a shows a single box captured indoors, with a dimension of 490.7 mm × 560.5 mm × 651.0 mm. Figure 15b presents the box measurement in a complex indoor environment, with multiple interfering boxes that are near the measured box. Figure 15c exhibits the image captured outdoors, in which the laser line is dim in the image due to the influence of strong illumination. ( a ) ( b ) ( c ) Figure 15. Measured box in different scenarios; ( a - c ) are three boxes in different scenarios. Figure 16 shows the measurement results of the box that was acquired in Figure 15. The edge probability map is obtained after processing the IHED network, and coordinates of the eight key points are determined. Even if the box images (Figure 16c) are collected outdoors, the edge probability map can be efficiently processed by our system. Lasermolded image ( a ) ( b ) ( c ) Edge map Eight key point Figure 16. Image processing and key point extraction by our algorithm; ( a - c ) are the measured images captured by our device. The final estimated values are recorded as the average of three experimental sessions on the box. Figure 17 shows the measurement results and actual dimensions of the measured box under different scenarios. The maximum average absolute error is 1.3 mm. Hence, our volume measurement system can accurately measure the length of each side of the box in a complex environment, which can meet the actual measurement requirements. _Sensors_ 2019, _19_, 3921 16 of 23 Figure 17. Measurement results of the box system in different scenarios. _4.2._ _Pose Stability Testing_ This experiment aims to verify the stability of the measured box from different viewpoints. As shown in Figure 18, the box is measured from different angles with nine poses to simulate the pose difference in actual measurement. In this experiment, the volume measurement system is used to obtain the box length and width under different poses. Only one face of the standard box (800 mm × 600 mm) is measured in this experiment to facilitate measurement and comparison. Estimated values are reported as the average of 30 experimental sessions on the same surface (800 mm × 600 mm) in Table 3. The relative errors are generally relatively small. The deviation between the estimated and actual values is within ±5.0 mm at each pose. The pose of the visual device appears to have minimal effect on the measurement accuracy of the proposed system on the basis of the mean error analysis in Table 3. The proposed system can effectively handle the measured certainty, regardless of which view the images are captured with strict measurement rules. The values of standard deviations are 1.7521 and 1.7175 mm respectively, which indicates that the box measurement system has reliable repeated measurement accuracy. Figure 19 shows that the length errors of the box dimensions are within 5.0 mm. The results show that the system stability is remarkable. Table 3. Error analysis of the measurement results of nine different poses for 30 times. Actual Pose Length / mm Average Estimated Length / mm Error (Length) / mm Actual Width / mm Average Estimated Width / mm Error (Width) / mm (a) 800.6 +0.6 598.6 −1.4 (b) 802.9 +2.9 599.7 −0.3 (c) 800.2 +0.2 600.5 +0.5 (d) 799.6 −0.4 600.8 +0.8 (e) 800 803.4 +3.4 600 600.0 +0.0 (f) 796.2 −3.8 604.8 +4.8 (g) 803.3 +3.3 602.9 +2.9 (h) 798.5 +1.5 598.3 −1.7 (i) 799.7 +0.3 597.2 −2.8 standard deviations 1.7521 1.7175 (a) 800.6 +0.6 800 600 _Sensors_ 2019, _19_, 3921 17 of 23 ( a ) ( b ) ( c ) ( d ) ( e ) ( f ) ( g ) ( h ) ( i ) Figure 18. Images of nine different poses; ( a ) vertical shooting; ( b ) tilt 30 <sup>◦</sup> to the left; ( c ) tilt 60 <sup>◦</sup> to the left; ( d ) tilt 30 <sup>◦</sup> to the right; ( e ) tilt 60 <sup>◦</sup> to the right; ( f ) tilt 30 <sup>◦</sup> upward; ( g ) tilt 60 <sup>◦</sup> upward; ( h ) tilt 30 <sup>◦</sup> <u>downward; and, (</u> <u>i</u> <u>) tilt 60</u> <sup>◦</sup> <u>downward.</u> Figure 19. Errors between the standard box and the measured result. _4.3._ _Error Analysis on Real Box and the Evaluation of Uncertainty in the Measurement Result of Box Volume_ This volume measurement system can calculate the dimension parameters of the box simply via laser triangulation and deep learning technology; thus, the entire system maintains the advantages of simple configuration and low cost. However, this method includes three main factors that affect the measurement accuracy of the box length: the measurement error of the visual sensor and the position error of the box (the distance and pose between the measured box and visual sensor). We conduct statistical experiments to evaluate the effectiveness of the method. As shown in Figure 20, the three standard boxes (#1, #2, and #3) are selected in the experiment. Their length, width, and height are 330.4 × 110.3 × 440.6, 690.7 × 570.5 × 1500.0, and 900.0 × 400.0 × 1800.0, respectively. We use our system to collect 15 measurements for each of the three standard boxes (Table 4). We utilize these data to calculate the mean and standard deviation of each box’s side length. ( a ) ( b ) ( c ) Figure 20. Examples of real standard boxes used for testing; ( a - c ) are the boxes of #1, #2, #3 respectively. _Sensors_ 2019, _19_, 3921 18 of 23 Table 4. Measurement results of the system of three standard boxes (mm). Length No. (#1) Width (#1) Height (#1) Length (#2) Width (#2) Height (#2) Length (#3) Width (#3) Height (#3) 1 330.1 110.6 441.6 691.2 571.3 1503.2 902.5 400.3 1804.6 2 330.5 110.1 440.1 690.5 571.6 1503.3 898.3 399.8 1802.5 3 330.2 110.6 441.4 691.2 571.8 1497.7 900.5 401.2 1804.4 4 331.4 111.2 439.7 690.5 568.9 1498.4 902.1 402.1 1796.7 5 329.2 110.3 438.8 689.2 570.6 1497.6 898.2 398.9 1796.9 6 330.4 110.8 440.7 688.4 569.7 1502.2 899.4 399.5 1803.7 7 329.2 110.6 437.4 691.7 572.5 1501.1 901.7 400.8 1795.1 8 331.8 110.9 441.2 692.5 570.2 1499.6 901.9 400.6 1803.2 9 330.9 110.6 440.6 690.6 569.4 1500.4 903.6 399.8 1798.3 10 331.5 110.8 440.5 691.5 571.7 1498.9 901.3 398.7 1795.4 11 332.6 110.4 440.8 688.7 569.8 1496.9 899.5 401.2 1796.7 12 330.5 110.2 441.7 689.5 571.5 1495.7 898.4 398.6 1795.5 13 330.7 109.3 442.3 691 571.4 1502.1 901.6 399.9 1804.6 14 330.6 109.4 439.5 691.4 570.1 1497.7 902.7 400.6 1796.4 15 329.8 110.2 438.3 692.6 571.0 1504.5 902.9 400.1 1804.7 Mean 330.6 110.4 440.3 690.7 570.7 1500.0 901.0 400.1 1799.9 Standard deviation 0.8952 0.5007 0.9630 1.2285 1.0066 2.5868 1.7401 0.9550 3.8859 Uncertainty 0.9266 0.5182 0.9968 1.2717 1.042 2.6776 1.8012 0.9885 4.0223 The data of the measurement results in Table 4 are statistically analyzed to evaluate the measurement accuracy scientifically, and the uncertainty of class A (µ _A_ ) is calculated as ( _xi_ - _<u>x</u>_ ) <sup>2</sup> , (22) _n_ - 1 µ _A_ = ~~�~~ <u>���</u> - _n_ _<u>i</u>_ <u>=1</u> where _xi_ is the estimated length and _<u>x</u>_ is the mean value of the measured data. _n_ is the number of measurements, which is 15 in this study. Table 4 shows the measurements result, with a minimum uncertainty of ±0.52 mm and maximum uncertainty of ±4.0 mm. The measurement uncertainty in the estimated length increases with the length. The measurement uncertainty is in accordance with the experiment that is described in Table 4. Figure 21 shows that the length errors of the box dimensions are within ±5.0 mm. The results show that the system has good accuracy. Figure 22 shows the measurement uncertainty of the measuring device, which is consistent with the experimental results. Figure 21. Errors between the standard box and the measured result. _Sensors_ 2019, _19_, 3921 19 of 23 Figure 22. The relationship between the measurement uncertainty and the box length. _4.4._ _Measurement Error Analysis of the Optical Quality of the Boxes Surface and the Surface Variation_ The experiment tests the effect of the system’s measurements on the optical quality of the boxes surface and the surface variation. Figure 23 shows the boxes, and only one face of the box is measured in this experiment: (a) 350.2 mm × 260.5 mm, (b) 376.5mm × 276.4 mm, (c) 340.4 mm × 420.6 mm, (d) 560.0 mm × 380.0 mm, (e) 480.6 mm × 365.7 mm, and (f) 300.6 mm × 250.0 mm. Figure 23a–c exhibit the images captured at different optical quality. Figure 23d–f test boxes with surface variation. The second row in Figure 23 shows the image processing results of the boxes faces. Lasermolded image ( a ) ( b ) ( c ) ( d ) ( e ) ( f ) Edge map Figure 23. Image processing by our algorithm; ( a - c ) exhibit the images captured at different optical quality; ( d - f ) exhibit the images captured the boxes with surface variation. Figure 24a shows the measurement results of the optical quality of the boxes surface, with a minimum measurement error of 0.2 mm and maximum error of 1.3 mm. Figure 24b shows the measurements result of the surface variation, with a minimum measurement error of 2.0 mm and maximum error of 7.6 mm. The results show that the system suffered little from the optical quality of the surface, but it has big uncertainty when measuring the surface variation of the box. _Sensors_ 2019, _19_, 3921 20 of 23 ( a ) ( b ) Figure 24. Measurement results; ( a ) Errors between the actual length and the measured result affected by optical quality of the box surface; and, ( b ) Errors between the actual length and the measured result tested on boxes with surface variation. _4.5._ _Online Measurement Testing_ Six standard boxes with different sizes and volumes are selected for measurement to evaluate the measurement accuracy scientifically, as shown in Figure 25. Table 5 displays the corresponding experimental results. The final measurement of the box length is highlighted in bold. We estimate of the relative measurement error of the volume ε = | _ve_ - _va_ |/ _va_, where _ve_ is the estimated volume and _va_ is the value of actual volume. The results in Table 5 indicate that the error of the measurement system increases with the side length of the measured box, but the error range of the measured and actual values of the single side length of each standard box is within ±5.0 mm. The maximum relative measurement error of the volume (ε) of the measured box is 2.27% and the mean relative error is 0.83%, which indicates good precision. ( c ) ( a ) ( b ) ( d ) ( f ) ( e ) Figure 25. Six standard boxes with different dimension parameters: ( a ) 143.4 × 120.5 × 100; ( b ) 550.6 × 350.5 × 300.0; ( c ) 800.0 × 600.0 × 500.0; ( d ) 1200.0 × 900.0 × 700.0; ( e ) 1500.0 × 690.7 × 570.5; and, ( f ) 1800.0 × 900.0 × 400.0. Table 5. Volume measurement results in real applications. Estimated <u>Length</u> <u>/</u> <u>mm</u> Error <u>Length</u> <u>/</u> <u>mm</u> Actual <u>Volume</u> <u>/</u> <u>m</u> <sup>3</sup> Estimated <u>Volume</u> / m <sup>3</sup> Relative Error / % Box ~~<u>Edge</u>~~ Probability ~~<u>Map</u>~~ Actual <u>Length</u> <u>/</u> <u>mm</u> (a) 143.4 142.2 −1.2 120.5 119.6 −0.9 120.5 119.2 −1.3 100.0 99.3 −0.7 0.0017 0.00169 2.27 _Sensors_ 2019, _19_, 3921 21 of 23 Table 5. _Cont._ ~~<u>Estimated</u>~~ ~~<u>Length</u>~~ ~~<u>/</u>~~ ~~<u>mm</u>~~ ~~<u>Error</u>~~ ~~<u>Length</u>~~ ~~<u>/</u>~~ ~~<u>mm</u>~~ ~~<u>Actual</u>~~ ~~<u>Volume</u>~~ ~~<u>/</u>~~ ~~<u>m</u>~~ <sup>~~<u>3</u>~~</sup> ~~<u>Estimate</u>~~ d ~~<u>Volume</u>~~ ~~<u>/</u>~~ m <sup>3</sup> Relative Error / % ~~<u>Box</u>~~ (b) (c) (d) (e) (f ~~)~~ 5. Conclusions <u>Edge</u> ~~<u>Probability</u>~~ ~~<u>Map</u>~~ ~~<u>Actual</u>~~ ~~<u>Length</u>~~ ~~<u>/</u>~~ ~~<u>mm</u>~~ 550.6 552.3 1.7 300.0 299.3 −0.7 300.0 301.2 1.2 350.5 349.6 −0.9 ~~<u>800.0</u>~~ ~~<u>801.6</u>~~ ~~<u>1.6</u>~~ 500.0 503.5 3.5 500.0 504.6 4.6 600.0 598.9 −1.1 ~~<u>1200.0</u>~~ ~~<u>1204.6</u>~~ ~~<u>4.6</u>~~ 900.0 898.6 −1.4 900.0 903.4 3.4 700.0 703.0 3.0 ~~<u>570.5</u>~~ ~~<u>569.0</u>~~ ~~<u>−1.5</u>~~ 1500.0 1502.3 2.3 1500.0 1497.6 −2.4 690.7 692.8 2.1 ~~<u>400.0</u>~~ ~~<u>397.6</u>~~ ~~<u>−2.4</u>~~ 1800.0 1805.0 5.0 1800.0 1795.5 −4.5 ~~<u>900.0</u>~~ ~~<u>899.0</u>~~ ~~<u>−1.0</u>~~ 0.0579 0.05779 0.18 0.2400 0.24171 0.72 0.7560 0.76096 0.66 0.5911 0.59221 0.19 ~~0.6480~~ ~~0.64179~~ 0.96 This research presents a line-structured light-based 3D measuring sensor and deep-learning-based box volume measuring method. Our box volume measurement method only requires two laser-modulated images. We propose a novel end-to-end edge detection architecture based on an IHED network to extract the structure straight edge lines in laser-modulated images. By cutting the first two side output layers and training without deep supervision of HED, our network can learn robust straight line features from laser-modulated images. Moreover, we present a one-step calibration method to calibrate our portable measuring sensor automatically. Experimental results show that the measuring range of our proposed system is 100–1800 mm with errors less than ±5.0 mm. Our system is suitable for portable automatic box volume measurement, and it is useful for warehouses and distribution and logistics companies. Our future work will focus on small portable measuring devices. _Sensors_ 2019, _19_, 3921 22 of 23 Author Contributions: Conceptualization, Z.Z., F.C., and D.Z.; methodology, T.P., Z.Z., and D.Z.; software, T.P. and Y.S.; validation, T.P., F.C., and Y.S.; formal analysis, T.P. and F.C.; investigation, T.P. and Y.S.; resources, Z.Z.; data curation, T.P. and Y.S.; writing (original draft preparation), T.P.; writing (review and editing), T.P., Z.Z., and D.Z.; visualization, T.P. and Z.Z.; supervision, Z.Z., F.C., and D.Z.; project administration, T.P.; funding acquisition, Z.Z. and D.Z. Funding: This work was supported by the National Natural Science Foundation of China (61572307). Conflicts of Interest: The authors declare no conflict of interest. References 1. Park, H.M.; Van Messemac, A.; De Neveac, W. Box-Scan: An efficient and effective algorithm for box dimension measurement in conveyor systems using a single RGB-D camera. In Proceedings of the 7th IIAE International Conference on Industrial Application Engineering, Kitakyushu, Japan, 26–30 March 2019. 2. Chan, T.; Lichti, D.; Jahraus, A.; Esfandiari, H.; Lahamy, H.; Steward, J.; Glanzer, M. An Egg Volume Measurement System Based on the Microsoft Kinect. _Sensors_ 2018, _18_, 2454. [[CrossRef] [PubMed]](http://dx.doi.org/10.3390/s18082454) 3. Andújar, D.; Dorado, J.; Fernández-Quintanilla, C.; Ribeiro, A. An approach to the use of depth cameras for weed volume estimation. _Sensors_ 2016, _16_, 972. [[CrossRef] [PubMed]](http://dx.doi.org/10.3390/s16070972) 4. Leo, M.; Natale, A.; Del-Coco, M.; Carcagnì, P.; Distante, C. Robust estimation of object dimensions and external defect detection with a low-cost sensor. _J. Nondestruct._ _Eval._ 2017, _36_, 17. [[CrossRef]](http://dx.doi.org/10.1007/s10921-017-0395-7) 5. Ferreira, B.Q.; Griné, M.; Gameiro, D.; Costeira, J.P.; Santos, B.S. VOLUMNECT: Measuring volumes with Kinect. In _Three-Dimensional Image Processing, Measurement (3DIPM), and Applications 2014_ ; Proceeding SPIE 9013; SPIE: Bellingham, WA, USA, 2014. 6. Wang, W.; Liu, P.; Ying, R.; Wang, J.; Qian, J.; Jia, J.; Gao, J. A High-Computational Efficiency Human Detection and Flow Estimation Method Based on TOF Measurements. _Sensors_ 2019, _19_, 729. [[CrossRef]](http://dx.doi.org/10.3390/s19030729) [[PubMed]](http://www.ncbi.nlm.nih.gov/pubmed/30754685) 7. Wang, Z.; Walsh, K.; Verma, B. On-tree mango fruit size estimation using RGB-D images. _Sensors_ 2017, _17_, 2738. [[CrossRef] [PubMed]](http://dx.doi.org/10.3390/s17122738) 8. Mustafah, Y.M.; Noor, R.; Hasbi, H.; Azma, A.W. Stereo vision images processing for real-time object distance and size measurements. In Proceedings of the 2012 International Conference on Computer and Communication Engineering (ICCCE), Kuala Lumpur, Malaysia, 3–5 July 2012; pp. 659–663. 9. Ge, L.; Yang, Z.; Sun, Z.; Zhang, G.; Zhang, M.; Zhang, K.; Zhang, C.; Tan, Y.; Li, W. A method for broccoli seedling recognition in natural environment based on binocular stereo vision and gaussian mixture model. _Sensors_ 2019, _19_, 1132. [[CrossRef] [PubMed]](http://dx.doi.org/10.3390/s19051132) 10. Makhsous, S.; Mohammad, H.M.; Schenk, J.M.; Mamishev, A.V.; Kristal, A.R. A Novel Mobile Structured Light System in Food 3D Reconstruction and Volume Estimation. _Sensors_ 2019, _19_, 564. [[CrossRef]](http://dx.doi.org/10.3390/s19030564) 11. Shang, J.; Duong, M.; Pepin, E.; Zhang, X.; Sandara-Rajan, K.; Mamishev, A.; Kristal, A. A mobile structured light system for food volume estimation. In Proceedings of the 2011 IEEE International Conference on Computer Vision Workshops (ICCV Workshops), Barcelona, Spain, 7 November 2011; pp. 100–101. 12. Sarbolandi, H.; Lefloch, D.; Kolb, A. Kinect range sensing: Structured-light versus Time-of-Flight Kinect. _Comput._ _Vis._ _Image Underst._ 2015, _139_, 20. [[CrossRef]](http://dx.doi.org/10.1016/j.cviu.2015.05.006) 13. Liberadzki, P.; Adamczyk, M.; Witkowski, M.; Sitnik, R. Structured-Light-Based System for Shape Measurement of the Human Body in Motion. _Sensors_ 2018, _18_, 2827. [[CrossRef]](http://dx.doi.org/10.3390/s18092827) 14. Fernandes, L.A.; Oliveira, M.M.; da Silva, R.; Crespo, G.J. A fast and accurate approach for computing the dimensions of boxes from single perspective images. _J. Braz._ _Comput._ _Soc._ 2006, _12_, 19–30. [[CrossRef]](http://dx.doi.org/10.1007/BF03192392) 15. Wang, X.; Xie, Z.; Wang, K.; Zhou, L. Research on a Handheld 3D Laser Scanning System for Measuring Large-Sized Objects. _Sensors_ 2018, _18_, 3567. [[CrossRef]](http://dx.doi.org/10.3390/s18103567) 16. Pan, X.; Liu, Z.; Zhang, G. Reliable and Accurate Wheel Size Measurement under Highly Reflective Conditions. _Sensors_ 2018, _18_, 4296. [[CrossRef] [PubMed]](http://dx.doi.org/10.3390/s18124296) 17. Zhang, Z.Y. A flexible new technique for camera calibration. _IEEE Trans._ _Pattern Anal._ _Mach._ _Intell._ 2000, _22_, 1330–1334. [[CrossRef]](http://dx.doi.org/10.1109/34.888718) 18. Santolaria, J.; Guillomía, D.; Cajal, C.; Albajez, J.A.; Aguilar, J.J. Modelling and calibration technique of laser triangulation sensors for integration in robot arms and articulated arm coordinate measuring machines. _Sensors_ 2009, _9_, 7374–7396. [[CrossRef]](http://dx.doi.org/10.3390/s90907374) _Sensors_ 2019, _19_, 3921 23 of 23 19. Li, Y.F.; Chen, S.Y. Automatic recalibration of an active structured light vision system. _IEEE Trans._ _Robot. Autom._ 2003, _19_, 259–268. [[CrossRef]](http://dx.doi.org/10.1109/TRA.2003.808859) 20. An, Y.; Bell, T.; Li, B.; Xu, J.; Zhang, S. Method for large-range structured light system calibration. _Appl._ _Opt._ 2016, _55_, 9563–9572. [[CrossRef] [PubMed]](http://dx.doi.org/10.1364/AO.55.009563) 21. Zhang, G.; Liu, Z.; Sun, J.; Wei, Z. Novel calibration method for a multi-sensor visual measurement system based on structured light. _Opt._ _Eng._ 2010, _49_, 043602. [[CrossRef]](http://dx.doi.org/10.1117/1.3407429) 22. Bazargani, H.; Laganière, R. Camera calibration and pose estimation from planes. _IEEE Instrum._ _Meas._ _Mag._ 2015, _18_, 20–27. [[CrossRef]](http://dx.doi.org/10.1109/MIM.2015.7335834) 23. Rodríguez, J.A.M.; Mejía Alanís, F.C. Binocular self-calibration performed via adaptive genetic algorithm based on laser line imaging. _J. Mod._ _Opt._ 2016, _63_, 1219–1232. [[CrossRef]](http://dx.doi.org/10.1080/09500340.2015.1130271) 24. Muñoz-Rodriguez, J.A. Mobile calibration based on laser metrology and approximation networks. _Sensors_ 2010, _10_, 7681–7704. [[CrossRef]](http://dx.doi.org/10.3390/s100807681) 25. Muñoz-Rodriguez, J.A. Microscope self-calibration based on micro laser line imaging and soft computing algorithms. _Opt._ _Lasers Eng._ 2018, _105_, 75–85. [[CrossRef]](http://dx.doi.org/10.1016/j.optlaseng.2017.12.010) 26. Long, J.; Shelhamer, E.; Darrell, T. Fully convolutional networks for semantic segmentation. _IEEE Trans._ _Pattern Anal._ _Mach._ _Intell._ 2014, _39_, 640–651. 27. Shen, W.; Wang, X.; Wang, Y.; Bai, X.; Zhang, Z. Deepcontour: A deep convolutional feature learned by positive-sharing loss for contour detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 3982–3991. 28. Hallman, S.; Fowlkes, C.C. Oriented edge forests for boundary detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 1732–1740. 29. Liu, Y.; Cheng, M.M.; Hu, X.; Wang, K.; Bai, X. Richer convolutional features for edge detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 3000–3009. 30. Song, W.; Zhong, B.; Sun, X. Building Corner Detection in Aerial Images with Fully Convolutional Networks. _Sensors_ 2019, _19_, 1915. [[CrossRef] [PubMed]](http://dx.doi.org/10.3390/s19081915) 31. Xie, S.; Tu, Z. Holistically-nested edge detection. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1395–1403. 32. Zhou, P.; Xu, K.; Wang, D. Rail profile measurement based on line-structured light vision. _IEEE Access_ 2018, _6_, 16423–16431. [[CrossRef]](http://dx.doi.org/10.1109/ACCESS.2018.2813319) 33. Canny, J. A computational approach to edge detection. _IEEE_ _Trans._ _Pattern_ _Anal._ _Mach._ _Intell._ 1986, _8_, 679–698. [[CrossRef] [PubMed]](http://dx.doi.org/10.1109/TPAMI.1986.4767851) 34. Martin, D.; Fowlkes, C.; Malik, J. Learning to detect natural image boundaries using local brightness, color, and texture cues. _IEEE Trans._ _PAMI_ 2004, _26_, 530–549. [[CrossRef]](http://dx.doi.org/10.1109/TPAMI.2004.1273918) 35. Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. _arXiv_ 2014, arXiv:1409.1556. 36. Duda, R.O.; Hart, P.E. _Use of the Hough Transformation to Detect Lines and Curves in Pictures (No._ _SRI-TN-36)_ ; Sri International Artificial Intelligence Center: Menlo Park, CA, USA, 1971. 37. Kirkup, L.; Frenkel, R.B. _An Introduction to Uncertainty in Measurement:_ _Using the GUM (Guide to the Expression_ _of Uncertainty in Measurement)_ ; Cambridge University Press: Cambridge, UK, 2006. © 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution [(CC BY) license (http://creativecommons.org/licenses/by/4.0/).](http://creativecommons.org/licenses/by/4.0/.)

섹션 본문 82문단 · 60,690자

(제목 없음)

1Portable box volume measurement has always been a popular issue in the intelligent logistic industry. This work presents a portable system for box volume measurement that is based on line-structured light vision and deep learning. This system consists of a novel 2 × 2 laser line grid projector, a sensor, and software modules, with which only two laser-modulated images of boxes are required for volume measurement. For laser-modulated images, a novel end-to-end deep learning model is proposed by using an improved holistically nested edge detection network to extract edges. Furthermore, an automatic one-step calibration method for the line-structured light projector is designed for fast calibration. The experimental results show that the measuring range of our proposed system is 100-1800 mm, with errors less than ±5.0 mm. Theoretical analysis indicates that within the measuring range of the system, the measurement uncertainty of the measuring device is ±0.52 mm to ±4.0 mm, which is consistent with the experimental results. The device size is 140 mm × 35 mm × 35 mm and the weight is 110 g, thus the system is suitable for portable automatic box volume measurement.The measuring range and precision can be settled by studying the calibration algorithms[17][18][19][20][21][22][23][24][25]. Silhouette extraction is another key issue for laser-modulated image processing.Figure 1a,b show the differences in the appearances of boxes and backgrounds. Therefore, we need a robust algorithm to extract edges for laser-modulated images. The vigorous development of deep learning provides us with possible solutions. The deep fully convolutional neural network (FCNN)[26]has been proposed as a solution to similar problems. FCNN has reached the level of human beings in multi-level edge and target boundary detections in natural images[27,28], which leads to a breakthrough in semantic segmentation[29]. Song et al. [30] proposed an algorithm for detecting building corners in aerial images by training a DeepLab network; they achieved excellent results. Xie et al.[31]developed an efficient and accurate edge detector, namely, holistically nested edge detection (HED), which performs well in edge detection tasks. Inspired by HED, the present study trains an end-to-end deep learning model for the laser-modulated image by adopting an improved holistically nested edge detection (IHED) network.This work presents an approach for computing the box volume from only two laser-modulated images in a completely automatic manner. The method uses information that was extracted from the structure edges of the measured boxes, which can be computed when at least two of their faces are projected by the laser projector. We demonstrate this approach by developing a prototype visual sensor for calculating the box volume online(Figure 1c).The main contributions of this study are as follows:1. Visual sensor. A portable mechanical structure for box volume measurement is proposed with an accuracy of ±5.0 mm and measuring range of 10-1800 mm (Sections 2 and 3.1).2.Box volume measurement algorithm. A novel algorithm for calculating the box volume in a completely automatic manner online is presented (Section 3.2).3.Calibration. A novel calibration method for the automatic calibration of our system is proposed. This method performs camera and laser projector calibrations in a single step, thus avoiding the digitalization of a reference sphere to obtain extrinsic parameters (Section 3.3). 4.Edge detection. A total of 40,000 labeled laser-modulated images are collected. With this box edge detection database, a novel end-to-end deep learning architecture that is based on IHED is proposed and it has achieved excellent performance (Section 3.4). Box Edge Probability Map Actual Length/mm Estimated Length/mm Error Length/mm Actual Volume/m 3 Estimated Volume/m 3 Relative Error/% (b) Sensors 2019, 19, 3921 21 of 24 Box Edge Probability Map Actual Length/m m Estimated Length/m m Error Length/m m Actual Volume/ m 3EstimatedVolume/ m 3 software, T.P. and Y.S.; validation, T.P., F.C., and Y.S.; formal analysis, T.P. and F.C.; investigation, T.P. and Y.S.; resources, Z.Z.; data curation, T.P. and Y.S.; writing (original draft preparation), T.P.; writing (review and editing), T.P.

Introduction

2Box volume measurement is important for many sectors, including logistics, transportation, and production, and it can assist in designing, packaging, and allocating strategies. Fast, intelligent, accurate, and automatic volume measurement can improve efficiency and reduce labor intensity. User-friendly and cost-effective systems are also vital for box volume measurement.

3As previously mentioned, a practical measurement system for box volume should have the following characteristics: (1) relatively small to be handled gracefully, (2) wide measuring range, (3) high measurement accuracy, (4) stable and robust, and (5) easy to use and flexible.

4At present, the research hotspots of large-scale measurement methods with three-dimensional (3D) geometric dimension focus on non-contact 3D measurement methods based on computer vision technology. This method has a rigorous theoretical basis, a large range of elasticity, high measurement accuracy and efficiency, no rigid requirement for the spatial relationship between the measuring device and measured object, good robustness, and non-contact measurement. Thus, this method is a feasible solution for solving large-scale 3D geometric measurement.

5With the development of computer vision technology, object volume can be calculated while using new technology and sensors [1][2][3]. Many advanced sensors, such as stereovision, time-of-flight (ToF) camera, and structured-light vision sensor, can represent spatial and color information from natural objects, thereby playing a crucial role in the development of industrial automation measurement.

6A method for the dimension measurement and inspection of cuboidal objects (boxes) with a ToF camera was described in [4], with an average error of 5 mm. The same ToF camera was used in [5] to build a system for computing the volume of cuboidal objects with an accuracy of 8 mm. The ToF technology can obtain depth information in real time by calculating the time that it takes for a pulse of energy to travel from its transmitter to the object surface and then back to the receiver. The ToF camera technique, due to its robustness and popularity, has been widely studied and applied in industries [6,7]. The dimensional measurement methods for objects that are based on stereovision have also been widely used. A stereovision technique for accurately measuring the distance and size (height and width) of an object in view was introduced in [8]. Ge et al. [9] proposed a method of broccoli seedling recognition in natural environments based on binocular stereovision. As binocular cameras heavily rely on image feature matching, the effect is poor under dark or overexposed lighting. In addition, if the measured scene lacks texture, then extracting and matching the features are difficult. In addition, a binocular stereocamera uses complex correlation algorithm, which is time consuming. The depth calculation of ToF is unaffected by the grayscale and features of the object surface, and the ToF can accurately perform 3D detection. The depth calculation accuracy of ToF does not change with the change in distance. The measurement accuracy can reach the mm level by using an advanced ToF camera and algorithm, as previously mentioned [4,5].

7Recently, the technique of computer vision and structured light (SL) measurement has been widely applied in many fields of high-precision measurement, due to its simple structure. Triangulation-based visual sensors are popular for measurement in various industries. They have many advantages, such as non-contact, high-precision, rapid, and automated measurements [10][11][12][13]. Fernandes et al. [14] presented an approach that is based on projective geometry; they computed the box dimensions by using data that were extracted from the box silhouette and the projection of two parallel laser beams on one of the imaged faces of the box. Wang et al. [15] proposed a handheld 3D laser scanning system that consists of a binocular stereovision and line laser projector for measuring large-sized objects on site. Pan et al. [16] proposed a wheel size measurement framework that is based on a structured-light vision sensor, which has high precision and reliability and is suitable for highly reflective conditions. In the present study, we develop a novel volume measurement system for a box that contains high-resolution color digital cameras and line-structured lights and that works indoors and outdoors. Figure 1c shows the designed device for box volume measurement. The device size is 140 mm × 35 mm × 35 mm and the weight is 110 g, thereby easily meeting the requirements of stability and portability. The line-structured light projectors emit laser planes onto the box face, and the laser planes intersect with the face of the measured box and form laser stripes in the laser-modulated image. As the face of the measured box modulates the laser stripes, the image processing algorithm can calculate the dimension information of the box on the basis of the laser triangulation principle and some key points. Thus, our method calculates the volume of boxes from two laser-modulated images (two adjacent faces of the box), and the technique mainly includes two aspects: (1) calibration technology of the vision sensor and (2) the extraction of the box silhouette to obtain the key points from the laser-modulated images. A method for the dimension measurement and inspection of cuboidal objects (boxes) with a ToF camera was described in [4], with an average error of 5 mm. The same ToF camera was used in [5] to build a system for computing the volume of cuboidal objects with an accuracy of 8 mm. The ToF technology can obtain depth information in real time by calculating the time that it takes for a pulse of energy to travel from its transmitter to the object surface and then back to the receiver. The ToF camera technique, due to its robustness and popularity, has been widely studied and applied in industries [6,7]. The dimensional measurement methods for objects that are based on stereovision have also been widely used. A stereovision technique for accurately measuring the distance and size (height and width) of an object in view was introduced in [8]. Ge et al. [9] proposed a method of broccoli seedling recognition in natural environments based on binocular stereovision. As binocular cameras heavily rely on image feature matching, the effect is poor under dark or overexposed lighting. In addition, if the measured scene lacks texture, then extracting and matching the features are difficult. In addition, a binocular stereocamera uses complex correlation algorithm, which is time consuming. The depth calculation of ToF is unaffected by the grayscale and features of the object surface, and the ToF can accurately perform 3D detection. The depth calculation accuracy of ToF does not change with the change in distance. The measurement accuracy can reach the mm level by using an advanced ToF camera and algorithm, as previously mentioned [4,5].

8Recently, the technique of computer vision and structured light (SL) measurement has been widely applied in many fields of high-precision measurement, due to its simple structure. Triangulation-based visual sensors are popular for measurement in various industries. They have many advantages, such as non-contact, high-precision, rapid, and automated measurements [10][11][12][13]. Fernandes et al. [14] presented an approach that is based on projective geometry; they computed the box dimensions by using data that were extracted from the box silhouette and the projection of two parallel laser beams on one of the imaged faces of the box. Wang et al. [15] proposed a handheld 3D laser scanning system that consists of a binocular stereovision and line laser projector for measuring large-sized objects on site. Pan et al. [16] proposed a wheel size measurement framework that is based on a structured-light vision sensor, which has high precision and reliability and is suitable for highly reflective conditions. In the present study, we develop a novel volume measurement system for a box that contains high-resolution color digital cameras and line-structured lights and that works indoors and outdoors. Figure 1c shows the designed device for box volume measurement. The device size is 140 mm × 35 mm × 35 mm and the weight is 110 g, thereby easily meeting the requirements of stability and portability. The line-structured light projectors emit laser planes onto the box face, and the laser planes intersect with the face of the measured box and form laser stripes in the laser-modulated image. As the face of the measured box modulates the laser stripes, the image processing algorithm can calculate the dimension information of the box on the basis of the laser triangulation principle and some key points. Thus, our method calculates the volume of boxes from two laser-modulated images (two adjacent faces of the box), and the technique mainly includes two aspects: (1) calibration technology of the vision sensor and (2) the extraction of the box silhouette to obtain the key points from the laser-modulated images. The paper is organized, as follows. Section 2 presents a brief overview and operating instructions of the visual sensor of the system. Our new approach for measuring the box volume is investigated in detail in Section 3. The experimental results and discussions are presented in Section 4. Finally, conclusions are drawn in Section 5.

Overview

9Figure 1c displays the proposed system. High-precision sensors and strict measurement rules achieve high-accuracy measurement. Figure 2b shows the measurement method of the visual sensor and measured box. The detailed workflow is listed, as follows:

1.

10Solving parameters: Before using the system, we obtain the parameters by using our calibration method (Section 3.3).

2.

11Data collection: The visual sensor connected to a portable mobile device is used. Two images of any two adjacent faces of the box are obtained. The four modulated laser stripes should intersect the four edges of the box face, as shown in Figure 2c,d.

3.

12Volume measurement: The system will automatically process the collected images and then obtain the box length, width, and height. Finally, the system automatically obtains the volume of the measured box. The regular logistics box volume is an important indicator of the freight that was collected in the logistics industry. The box length, width, and height should be measured to determine the box volume. Certain difficulties exist in volume measurement system, which are reflected in the following four aspects: (1) The environment inside the distribution center is complex and it suffers from different illumination information (Figure 3a,c,g,h). (2) Logistics boxes have varied sizes, and the box length ranges from 10 mm to 1800 mm (Figure 3a,b,e,f,j). (3) Laser-modulated images are influenced by variations in box materials, color, and appendages (Figure 3b,d,f,h,i). (4) Non-contact and portable measurements are required. To solve the abovementioned problems, we model the boxes as parallelepipeds, as shown in Figure 2a. The volume of a parallelepiped can be calculated while using the 3D coordinates of the vertices with two arbitrary adjacent faces of the box. The 3D coordinates of a box's face can be obtained on the basis of the intersection of the laser lines and the edges of the box's face. Thus, the edge of the laser line and box edges on the laser-modulated images must be extracted before we can calculate the volume of the measured box (Section 3.4), and then the equations of the laser planes of the laser projector and the camera parameters must be obtained (Section 3.3).

13Our portable system for box volume measurement that is based on line-structured light vision and deep learning only requires two laser-modulated box images for the measurement. Figure 4 depicts the scheme behind the proposed solution. Before the measurement, we obtain the parameters by using our calibration method and write the parameters to the device. We input the two lasermodulated images into the designed network to generate the edge probability map. Subsequently, we obtain the coordinates of key points of the box face through a simple image processing of the edge probability map. We can obtain the box volume combined with the calibration parameters and key points. The regular logistics box volume is an important indicator of the freight that was collected in the logistics industry. The box length, width, and height should be measured to determine the box volume. Certain difficulties exist in volume measurement system, which are reflected in the following four aspects: (1) The environment inside the distribution center is complex and it suffers from different illumination information (Figure 3a,c,g,h). (2) Logistics boxes have varied sizes, and the box length ranges from 10 mm to 1800 mm (Figure 3a The regular logistics box volume is an important indicator of the freight that was collected in the logistics industry. The box length, width, and height should be measured to determine the box volume. Certain difficulties exist in volume measurement system, which are reflected in the following four aspects: (1) The environment inside the distribution center is complex and it suffers from different illumination information (Figure 3a,c,g,h). (2) Logistics boxes have varied sizes, and the box length ranges from 10 mm to 1800 mm (Figure 3a,b,e,f,j). (3) Laser-modulated images are influenced by variations in box materials, color, and appendages (Figure 3b,d,f,h,i). (4) Non-contact and portable measurements are required. To solve the abovementioned problems, we model the boxes as parallelepipeds, as shown in Figure 2a. The volume of a parallelepiped can be calculated while using the 3D coordinates of the vertices with two arbitrary adjacent faces of the box. The 3D coordinates of a box's face can be obtained on the basis of the intersection of the laser lines and the edges of the box's face. Thus, the edge of the laser line and box edges on the laser-modulated images must be extracted before we can calculate the volume of the measured box (Section 3.4), and then the equations of the laser planes of the laser projector and the camera parameters must be obtained (Section 3.3).

14Our portable system for box volume measurement that is based on line-structured light vision and deep learning only requires two laser-modulated box images for the measurement. Figure 4 depicts the scheme behind the proposed solution. Before the measurement, we obtain the parameters by using our calibration method and write the parameters to the device. We input the two lasermodulated images into the designed network to generate the edge probability map. Subsequently, we obtain the coordinates of key points of the box face through a simple image processing of the edge probability map. We can obtain the box volume combined with the calibration parameters and key points. To solve the abovementioned problems, we model the boxes as parallelepipeds, as shown in Figure 2a. The volume of a parallelepiped can be calculated while using the 3D coordinates of the vertices with two arbitrary adjacent faces of the box. The 3D coordinates of a box's face can be obtained on the basis of the intersection of the laser lines and the edges of the box's face. Thus, the edge of the laser line and box edges on the laser-modulated images must be extracted before we can calculate the volume of the measured box (Section 3.4), and then the equations of the laser planes of the laser projector and the camera parameters must be obtained (Section 3.3).

15Our portable system for box volume measurement that is based on line-structured light vision and deep learning only requires two laser-modulated box images for the measurement. Figure 4 depicts the scheme behind the proposed solution. Before the measurement, we obtain the parameters by using our calibration method and write the parameters to the device. We input the two laser-modulated images into the designed network to generate the edge probability map. Subsequently, we obtain the coordinates of key points of the box face through a simple image processing of the edge probability map. We can obtain the box volume combined with the calibration parameters and key points.

Design of the Visual Sensor Measurement System

16The portable volume measurement system that was proposed in this work consists of a 2 × 2 laser line grid projector and high-resolution camera, as shown in Figure 5b; it has a low computational cost. Table 1 lists the detailed parameters of the visual sensor. The size of the designed device is 140 mm × 35 mm × 35 mm, and the weight is 110 g. The baseline length of the device is 120 mm, thereby easily meeting the requirements of stability and portability. Furthermore, connection to other mobile devices, such as a mobile phone or pad, is convenient.

17The portable volume measurement system that was proposed in this work consists of a 2 × 2 laser line grid projector and high-resolution camera, as shown in Figure 5b; it has a low computational cost. Table 1 lists the detailed parameters of the visual sensor. The size of the designed device is 140 mm × 35 mm × 35 mm, and the weight is 110 g. The baseline length of the device is 120 mm, thereby easily meeting the requirements of stability and portability. Furthermore, connection to other mobile devices, such as a mobile phone or pad, is convenient.

18The portable volume measurement system that was proposed in this work consists of a 2 × 2 laser line grid projector and high-resolution camera, as shown in Figure 5b; it has a low computational cost. Table 1 lists the detailed parameters of the visual sensor. The size of the designed device is 140 mm × 35 mm × 35 mm, and the weight is 110 g. The baseline length of the device is 120 mm, thereby easily meeting the requirements of stability and portability. Furthermore, connection to other mobile devices, such as a mobile phone or pad, is convenient. Figure 5a presents the measurement schematics of the proposed volume measurement system. O w − X w Y w Z w is the world coordinate system (WCS), and O c − X c Y c Z c is the camera coordinate system (CCS). The laser stripes are projected onto the box face through a laser projector. The camera captures the laser stripes that are modulated by the box faces. Afterwards, the laser-modulated images are captured. However, the four modulated laser stripes must intersect the four edges of the box faces.

Geometric Model

19Camera mapping coordinate points in a 3D world to a two-dimensional (2D) image plane can be described while using a pinhole model [32]. Figure 6 shows the perspective projection relationship between 3D space point and 2D image point in the pinhole camera model.

20Camera mapping coordinate points in a 3D world to a two-dimensional (2D) image plane can be described while using a pinhole model [32]. Figure 6 shows the perspective projection relationship between 3D space point and 2D image point in the pinhole camera model.

21Camera mapping coordinate points in a 3D world to a two-dimensional (2D) image plane can be described while using a pinhole model [32]. Figure 6 shows the perspective projection relationship between 3D space point and 2D image point in the pinhole camera model.

22Camera mapping coordinate points in a 3D world to a two-dimensional (2D) image plane can be described while using a pinhole model [32]. Figure 6 shows the perspective projection relationship between 3D space point and 2D image point in the pinhole camera model. The projection from a 3D point P(x w , y w , z w ) in the WCS to a 2D image point p(u, v) in the image plane is expressed by the following equation:

23where T and R represent the translation vector and rotation matrix from the coordinate system to the CCS, respectively. α an β are the scale factors in u and v axes of the camera, respectively, and δ is the skew of the two image axes. ρ is a nonzero factor, and (u 0 , v 0 ) is the principal point. The rotation matrix R and translation vector T, which translate to a 3D point P c (x c , y c , z c ) in the CCS, encapsulate the camera orientation and position. The transformation relation of the CCS to the image coordinate system can be shown as

24Equation (2) shows the expression of a straight line in space, which connects the point in CCS with the point in the image plane. Practically, radial and tangential distortions of the lens are inevitable. In our practical engineering application, the tangential distortion of the lens has a minimal effect on the result. In this study, we only consider the radial distortion and we have the following equations:

25where r 2 = x 2 + y 2 , (x, y) T is the distorted image coordinate and (x, y) T is the idealized one. k 1 and k 2 are the radial distortion coefficients of the lens. The laser light plane that is emitted from the visual sensor intersects with the box face and forms laser stripes in the image plane captured by the camera, as shown in Figure to the CCS, respectively. α an β are the scale factors in u and v axes of the camera, respectively, and δ is the skew of the two image axes. ρ is a nonzero factor, and

26The rotation matrix R and translation vector T , which translate to a 3D point ) , , ( c c c c z y x P in the CCS, encapsulate the camera orientation and position. The transformation relation of the CCS to the image coordinate system can be shown as

27Equation (2) shows the expression of a straight line in space, which connects the point in CCS with the point in the image plane. Practically, radial and tangential distortions of the lens are inevitable. In our practical engineering application, the tangential distortion of the lens has a minimal effect on the result. In this study, we only consider the radial distortion and we have the following equations:

28, ( is the idealized one. Point D 1 in the image not only belongs to the intersection line with the surface to be digitized, but also to the laser light plane must fulfil the camera model equations. Once the perspective projection matrix of the camera and the equations of the planes containing the sheets of light relative to a global coordinate frame are obtained from the calibration, the triangulation for computing the 3D coordinates of object points simply involves finding the intersection of a ray from the camera and a plane from the projector. Thus, the equation of the laser plane in the CCS is as follows: where i is the laser stripe number and a i , b i , c i , and d i are the coefficients. The number of equations of the planes and light stripes is equal. The laser plane contributes with the additional information that is necessary for completing the equation of the straight line of the camera model, such that their 3D coordinates can be extracted from their 2D image coordinates u, v. A 3D point P(x c , y c , z c ) at the intersection of the viewpoint from the camera and the laser stripe from the projector is triangulated while using the camera and projector parameters. On the basis of Equations (2) and (4), we derive the set of linear equations [X c /Y c , Y c /Z c , 1/Z c ], as follows:

29Therefore, P(x c , y c , z c ) in the CCS can be expressed as

30On the basis of the intersection of lines D 1 D 3 and D 5 D 7 in the CCS, the coordinate of intersection point A could be obtained as A(X ca , Y ca , Z ca ). Similarly, we can generate the 3D coordinates of B, C, D in the CCS: B(X cb , Y cb , Z cb ), C(X cc , Y cc , Z cc ), and D(X cd , Y cd , Z cd ). Thus, we derive the length and width of this box side.

31Similarly, we capture the box's image of the adjacent face to the first image. On the basis of Equation (9), we can measure the length and width of the second image: width and length . Hence, the box height can be calculated.

32Therefore, we can obtain the box volume.

33However, a dimension of A * A * B of the measured box is a problem. At this time, if the two captured images that were calculated with the length of the box's faces are A * B, then our algorithm will not work properly. At this point, we obtain the box length and width through the first image, but we cannot calculate the box height from the second image through Equation (10). As the values of A and B calculated by the second image satisfy Equation (10), we must manually select a suitable A or B as the box height in our system.

34To date, a box volume measurement approach, which only requires two laser-modulated images of boxes, has been introduced. Section 3.3 designs a one-step calibration method for camera and laser projector. The coordinates of key points, which are automatically obtained by deep learning for laser-modulated image, are presented in Section 3.4.

Calibration Method for the Camera and 2 × 2 Laser Line Grid Projector

35In this work, we present a one-step intrinsic and extrinsic calibration method for line-structured light projector that is based on circle calibration target. The coordinates of the key points are solved by increasing the equation of the laser plane.

36Zhang et al. [17] provided an excellent method for camera calibration. Line-structured light projector calibration involves determining the camera's intrinsic and extrinsic parameters. Equation (1) represents a camera perspective projection model. The 3 × 3 rotation matrix R and 3 × 1 translation vector T are the external parameters of the camera. The laser plane (Equation (4)) in this coordinate system is obtained during line-structured light projector calibration. Here, we simultaneously generate the system parameters of the camera and the laser projector. Figure 8a shows the circle target that is used in this paper. The visual sensor is placed at a distance from the target board similar to the nominal working distance. N images with different positions, which contain the laser line corresponding to the intersection of the laser plane with the calibration board, are captured ( Figure 8b). We select the first local WCS as the absolute WCS from the N local WCSs previously established. The X and Y axes of each moving target are used as the local WCS to calculate the relative position between the CCS and local WCS R i and T i . The laser plane (Equation (4)) is fitted in the absolute CCS ( Figure 8c).

37However, a dimension of B A A * * of the measured box is a problem. At this time, if the two captured images that were calculated with the length of the box's faces are B A* , then our algorithm will not work properly. At this point, we obtain the box length and width through the first image, but we cannot calculate the box height from the second image through Equation (10). As the values of A and B calculated by the second image satisfy Equation (10), we must manually select a suitable A or B as the box height in our system.

38To date, a box volume measurement approach, which only requires two laser-modulated images of boxes, has been introduced. Section 3.3 designs a one-step calibration method for camera and laser projector. The coordinates of key points, which are automatically obtained by deep learning for lasermodulated image, are presented in Section 3.4.

39In this work, we present a one-step intrinsic and extrinsic calibration method for line-structured light projector that is based on circle calibration target. The coordinates of the key points are solved by increasing the equation of the laser plane.

40Zhang et al. [17] provided an excellent method for camera calibration. Line-structured light projector calibration involves determining the camera's intrinsic and extrinsic parameters. Equation (1) represents a camera perspective projection model. The

3 rotation matrix

41R and 1 3 translation vector T are the external parameters of the camera. The laser plane (Equation (4)) in this coordinate system is obtained during line-structured light projector calibration. Here, we simultaneously generate the system parameters of the camera and the laser projector. Figure 8a shows the circle target that is used in this paper. The visual sensor is placed at a Therefore, the equation coefficients of the ith plane (a i , b i , c i , and d i ) can be computed while using the least squares method. We obtain the line-structured light projector parameters on the basis of the circle calibration target by one step. Moreover, the proposed approach does not need to extract the standard points, but the inputs all coordinates of the laser stripes converted into the CCS. Therefore, the number of calibrated points is sufficient for the calibration of the laser plane. Subsequently, the equation of the laser plane is fitted to reduce the error.

42The calibration board is 1300 × 1200 × 5.0 mm, and N(N = 28) images with different poses calibrate the system. The circle calibration target is printed with a high-quality printer and then placed on glass. Table 1 lists the detailed parameters of the camera and laser projector. Table 2 presents the calibration parameters. Variation in box materials, color, and appendages and the box texture influence laser-modulated images. The actual box edges and laser center lines are difficult to distinguish from lines in the laser-modulated images in complex scenarios. Although edge detection technology [33,34] can be used to find the box contour, these algorithms often perform particularly poorly in image processing in practical applications. Recently, FCNN has advanced in addressing the problem of detecting edge and object boundaries in natural images. Inspired by HED, we adopt a similar structure to the HED network and continuously inherit and learn the precise edge in the generated output process through the side output layer. We also design our network by modifying the VGG16 [35] network. Figure 9 displays the developed IHED network for edge detection. In comparison with HED, our modifications can be described, as follows:

1.

43To achieve the best edge detection effect, we build our own laser-modulated image dataset.

2.

44We cut the first two side output layers. Such an operation can remove considerable low-level edge information.

3.

45A cross-entropy loss/sigmoid layer is connected to the up-sampling layer in each stage without deep supervision. In total, 40,000 training images are obtained to determine the IHED network parameters and 1500 images are provided for testing. We manually mark the coordinate of the eight key points of the laser-modulated images and then draw straight lines to obtain the ground truth. Figure 10 shows two example images and the ground-truth edge results of the developed dataset. In total, 40,000 training images are obtained to determine the IHED network parameters and 1500 images are provided for testing. We manually mark the coordinate of the eight key points of the laser-modulated images and then draw straight lines to obtain the ground truth. Figure 10 shows two example images and the ground-truth edge results of the developed dataset. In total, 40,000 training images are obtained to determine the IHED network parameters and 1500 images are provided for testing. We manually mark the coordinate of the eight key points of the laser-modulated images and then draw straight lines to obtain the ground truth. Figure 10 shows two example images and the ground-truth edge results of the developed dataset. Figure 10. Two example images and ground-truth edge results for our dataset: (a,c) Input images; (b,d) ground-truth edges by human annotation of (a,c), respectively.

46In our IHED network, we consider the following objective function: In our IHED network, we consider the following objective function:

47where l side denotes the image-level loss function for side outputs. W is the set representation of all standard network layer parameters. The parameters of side output are denoted as w = (w (1) , . . . , w M ), and the network has M side output layers. In our network architecture, the loss function is computed over all the pixels in a training image X = (x j , j = 1, . . . , |X|) and edge map Y = (y j , j = 1, . . . , |Y|), y j ∈ {0, 1}. In the training process, this cost function traverses every pixel of the input image and of the output probability graph. For each image, this function is defined as

48where β = Y _ /|Y| and 1−β = |Y + |/|Y|. Y + and Y _ denote the edge and non-edge ground-truth label sets, respectively. At each side output layer, we obtain the edge probability map prediction

49side ≡ {α (m) , j = 1, . . . , |Y|} are the activations of the side output of layer m. Thus, the loss function for "weighted-fusion" layer is as follows:

50where σ(.) is the sigmoid function. Dis(.) is the distance between the fused predictions and ground-truth label map. For all of these parameters, W, w is simultaneously optimized through standard backpropagation:

51Hence, in the testing stage, given an image X, the final edge probability map can be defined aŝ

52side ,Ŷ

53side ,Ŷ

54The network parameter settings are as follows: input image size (512 × 512), mini-batch size (9), learning rate (1 × 10 −3 ), loss weight for each side output layer (1), weight decay (2 × 10 −4 ), and number of training iterations (1 × 10 5 , learning rate is divided by 10 after 1000). This network design can not only realize high-precision and high-sensitivity edge detection, but also suppress internal texture edge.

55A total of 1500 testing images are used to verify the effectiveness of our algorithm. This study uses the precision, recall, and F-measure to evaluate the edge detection performance of the laser-modulated image. The precision recall curve includes the recall rate and precision of the detection result. The precision reflects the pixel ratio of the used approach to extract the true structure edges (TP) and the total number of all detected edges. The recall rate reflects the TP and ground-truth edge. The F-measure is a comprehensive evaluation indicator with a fixed conversion relationship between recall and precision. The recall, precision, and F-measure are calculated, as follows:

56where FP is the wrong edge pixels that have been extracted and FN is the number of mis-extracted pixels. The proposed IHED network without deep-supervision extraction of structure edges is compared with the HED algorithm to show its effectiveness. Figure 11 shows a performance comparison of these detection algorithms on our dataset with respect to the precision, recall, and F-measure of the extracted edges. The IHED without deep supervision has a better edge extraction performance than the other three network models. Figure 12 shows several examples of edge detection on the dataset for the HED and IHED networks (network parameters are consistent). Rows 1, 2, 3, and 4 in Figure 12 display that IHED is more advantageous than HED in detecting the structural edge of the box. The HED network detects other non-box structure edges, which are avoided by the improved network (IHED). This result is consistent with the original intention of the edge detection of the design structure.

57Raw image HED with deep supervision Figure 11. Performance comparison of the IHED and holistically nested edge detection (HED) networks with/without deep-supervision with respect to edge extraction. Figure 12 shows several examples of edge detection on the dataset for the HED and IHED networks (network parameters are consistent). Rows 1, 2, 3, and 4 in Figure 12 display that IHED is more advantageous than HED in detecting the structural edge of the box. The HED network detects other non-box structure edges, which are avoided by the improved network (IHED). This result is consistent with the original intention of the edge detection of the design structure. Figure 12 shows several examples of edge detection on the dataset for the HED and IHED networks (network parameters are consistent). Rows 1, 2, 3, and 4 in Figure 12 display that IHED is more advantageous than HED in detecting the structural edge of the box. The HED network detects other non-box structure edges, which are avoided by the improved network (IHED). This result is consistent with the original intention of the edge detection of the design structure.

Method for Extracting the 2D Coordinates of the Key Points of the Laser-Modulated Image

58We must obtain the supporting lines for the edge probability maps to obtain the 2D coordinates of the box vertices. The edge probability map of the laser-modulated image has been obtained by our network (Section 3.4.1). By using the center coordinate of the image as the origin coordinate, we use

59We must obtain the supporting lines for the edge probability maps to obtain the 2D coordinates of the box vertices. The edge probability map of the laser-modulated image has been obtained by our network (Section 3.4.1). By using the center coordinate of the image as the origin coordinate, we use the Hough line transform [36] to detect all the straight lines on the edge probability map. Equation (20) is used to represent them.

60Subsequently, we cluster the nearly collinear line segments by setting the suitable segmentation thresholds for ρ and θ (ρ ∈ [0pixel, 15pixel] and θ ∈ [−1.8 • , 1.8 • ] in this study).

61We separately obtain the fitting line equation of the laser line and the edge of the measured box. Figure 13 shows the operation process. By finding the intersection points of these lines, the coordinates of eight key points on the 2D image can be deduced. Finally, we can easily locate the relationship of the eight key points (D1-D8) on the laser line through the geometric relationships between the box face's edge and the laser line in the 2D image, as shown in Figure 14. We separately obtain the fitting line equation of the laser line and the edge of the measured box. Figure 13 shows the operation process. By finding the intersection points of these lines, the coordinates of eight key points on the 2D image can be deduced. Finally, we can easily locate the relationship of the eight key points (D1-D8) on the laser line through the geometric relationships between the box face's edge and the laser line in the 2D image, as shown in Figure 14. The original image resolution is 2592 × 1944 pixels and the size of the edge probability map output by the network is 512 × 512 pixels. Automatically extracting the eight key points in the collected box image with laser line has an important influence on the accuracy and automatic operation of the proposed system. We conduct pixel level coordinate error analysis between the raw image and edge probability image that were obtained through the IHED network. We convert the coordinates of the eight key points obtained to a camera resolution of 2592 × 1944. Here, we consider the maximum measuring range of the system to be 1800 mm. Thus, we can roughly estimate the actual physical distance of each pixel as 1944 1800 mm. Assume that the maximum error allowed by the The original image resolution is 2592 × 1944 pixels and the size of the edge probability map output by the network is 512 × 512 pixels. Automatically extracting the eight key points in the collected box image with laser line has an important influence on the accuracy and automatic operation of the proposed system. We conduct pixel level coordinate error analysis between the raw image and edge probability image that were obtained through the IHED network. We convert the coordinates of the eight key points obtained to a camera resolution of 2592 × 1944. Here, we consider the maximum measuring range of the system to be 1800 mm. Thus, we can roughly estimate the actual physical distance of each pixel as 1800 1944 mm. Assume that the maximum error allowed by the system is 5.0 mm. We can obtain the maximum pixel error that is allowed by the system as 5 * 1944 1800 = 5.40 pixels. We analyze the pixel values of 1500 images in the test dataset.

62where M is the number of test datasets. N is the number of key points on the image. In the experiment, M is 1500 and N is 8. (u, v) is the label pixel coordinate and (u , v ) is the pixel coordinate that was obtained by our approach. The pixel coordinate error of key points is 1.96 < 5.40 pixels, which can meet our requirements. Figure 1c illustrates the system, wherein the device is connected with an android phone (HUAWEI honor Play) through a USB cable. The measurement environment parameters are as follows: temperature ( −15 ∼ 60 • C), measured distance from the visual sensor to the measured box (0.1-2.5 m), and measuring range of the box length, width, and height (10-1800 mm). The initial status calibration is performed before the experiment. Table 2 lists the calibration parameters of the visual sensor.

Experiments

63Various experimental tests are conducted under varying operating conditions to test the robustness of the proposed system. Four experimental phases are performed to evaluate the system performances:

64(1) In Section 4.1, the measurement statistical analysis of boxes in complex scene is conducted. (2) In Section 4.2, the stability of the proposed system is verified. (3) In Section 4.3, the statistical analysis on real boxes is performed and the measurement uncertainty is evaluated by using the expression of uncertainty in measurement [37]. (4) In Section 4.4, the measurement error analysis of the optical quality of the boxes surface and the surface variation is performed. (5) In Section 4.5, the practical performance of the proposed system is evaluated in real-world tests.

Measurement Statistical Analysis of Boxes in Complex Scenarios

65The experiment tests the accuracy of the system's measurements in complex and outdoor environments. Figure 15a shows a single box captured indoors, with a dimension of 490.7 mm × 560.5 mm × 651.0 mm. Figure 15b presents the box measurement in a complex indoor environment, with multiple interfering boxes that are near the measured box. Figure 15c exhibits the image captured outdoors, in which the laser line is dim in the image due to the influence of strong illumination. calibration is performed before the experiment. Table 2 lists the calibration parameters of the visual sensor.

66Various experimental tests are conducted under varying operating conditions to test the robustness of the proposed system. Four experimental phases are performed to evaluate the system performances: (1) In Section 4.1, the measurement statistical analysis of boxes in complex scene is conducted. (2) In Section 4.2, the stability of the proposed system is verified. (3) In Section 4.3, the statistical analysis on real boxes is performed and the measurement uncertainty is evaluated by using the expression of uncertainty in measurement [37]. (4) In Section 4.4, the measurement error analysis of the optical quality of the boxes surface and the surface variation is performed. (5) In Section 4.5, the practical performance of the proposed system is evaluated in real-world tests.

67The experiment tests the accuracy of the system's measurements in complex and outdoor environments. Figure 15a shows a single box captured indoors, with a dimension of 490.7 mm × 560.5 mm × 651.0 mm. Figure 15b presents the box measurement in a complex indoor environment, with multiple interfering boxes that are near the measured box. Figure 15c exhibits the image captured outdoors, in which the laser line is dim in the image due to the influence of strong illumination. Figure 16 shows the measurement results of the box that was acquired in Figure 15. The edge probability map is obtained after processing the IHED network, and coordinates of the eight key points are determined. Even if the box images (Figure 16c) are collected outdoors, the edge probability map can be efficiently processed by our system. Figure 16 shows the measurement results of the box that was acquired in Figure 15. The edge probability map is obtained after processing the IHED network, and coordinates of the eight key points are determined. Even if the box images (Figure 16c) are collected outdoors, the edge probability map can be efficiently processed by our system. The final estimated values are recorded as the average of three experimental sessions on the box. Figure 17 shows the measurement results and actual dimensions of the measured box under different scenarios. The maximum average absolute error is 1.3 mm. Hence, our volume measurement system can accurately measure the length of each side of the box in a complex environment, which can meet the actual measurement requirements. Figure 17 shows the measurement results and actual dimensions of the measured box under different scenarios. The maximum average absolute error is 1.3 mm. Hence, our volume measurement system can accurately measure the length of each side of the box in a complex environment, which can meet the actual measurement requirements.

68The final estimated values are recorded as the average of three experimental sessions on the box. Figure 17 shows the measurement results and actual dimensions of the measured box under different scenarios. The maximum average absolute error is 1.3 mm. Hence, our volume measurement system can accurately measure the length of each side of the box in a complex environment, which can meet the actual measurement requirements.

Pose Stability Testing

69This experiment aims to verify the stability of the measured box from different viewpoints. As shown in Figure 18, the box is measured from different angles with nine poses to simulate the pose difference in actual measurement. In this experiment, the volume measurement system is used to obtain the box length and width under different poses. Only one face of the standard box (800 mm × 600 mm) is measured in this experiment to facilitate measurement and comparison. Estimated values are reported as the average of 30 experimental sessions on the same surface (800 mm × 600 mm) in Table 3. The relative errors are generally relatively small. The deviation between the estimated and actual values is within ±5.0 mm at each pose. The pose of the visual device appears to have minimal effect on the measurement accuracy of the proposed system on the basis of the mean error analysis in Table 3. The proposed system can effectively handle the measured certainty, regardless of which

70This experiment aims to verify the stability of the measured box from different viewpoints. As shown in Figure 18, the box is measured from different angles with nine poses to simulate the pose difference in actual measurement. In this experiment, the volume measurement system is used to obtain the box length and width under different poses. Only one face of the standard box (800 mm × 600 mm) is measured in this experiment to facilitate measurement and comparison. Estimated values are reported as the average of 30 experimental sessions on the same surface (800 mm × 600 mm) in Table 3. The relative errors are generally relatively small. The deviation between the estimated and actual values is within ±5.0 mm at each pose. The pose of the visual device appears to have minimal effect on the measurement accuracy of the proposed system on the basis of the mean error analysis in Table 3. The proposed system can effectively handle the measured certainty, regardless of which view the images are captured with strict measurement rules. The values of standard deviations are 1.7521 and 1.7175 mm respectively, which indicates that the box measurement system has reliable repeated measurement accuracy. Figure 19 shows that the length errors of the box dimensions are within 5.0 mm. The results show that the system stability is remarkable. view the images are captured with strict measurement rules. The values of standard deviations are 1.7521 and 1.7175 mm respectively, which indicates that the box measurement system has reliable repeated measurement accuracy. Figure 19 shows that the length errors of the box dimensions are within 5.0 mm. The results show that the system stability is remarkable. 19. Errors between the standard box and the measured result.

Error Analysis on Real Box and the Evaluation of Uncertainty in the Measurement Result of Box Volume

71This volume measurement system can calculate the dimension parameters of the box simply via laser triangulation and deep learning technology; thus, the entire system maintains the advantages of simple configuration and low cost. However, this method includes three main factors that affect the measurement accuracy of the box length: the measurement error of the visual sensor and the 19. Errors between the standard box and the measured result.

72This volume measurement system can calculate the dimension parameters of the box simply via laser triangulation and deep learning technology; thus, the entire system maintains the advantages of simple configuration and low cost. However, this method includes three main factors that affect the measurement accuracy of the box length: the measurement error of the visual sensor and the Figure 19. Errors between the standard box and the measured result.

73This volume measurement system can calculate the dimension parameters of the box simply via laser triangulation and deep learning technology; thus, the entire system maintains the advantages of simple configuration and low cost. However, this method includes three main factors that affect the measurement accuracy of the box length: the measurement error of the visual sensor and the position error of the box (the distance and pose between the measured box and visual sensor). We conduct statistical experiments to evaluate the effectiveness of the method.

74As shown in Figure 20, the three standard boxes (#1, #2, and #3) are selected in the experiment. Their length, width, and height are 330.4 × 110.3 × 440.6, 690.7 × 570.5 × 1500.0, and 900.0 × 400.0 × 1800.0, respectively. We use our system to collect 15 measurements for each of the three standard boxes (Table 4). We utilize these data to calculate the mean and standard deviation of each box's side length. position error of the box (the distance and pose between the measured box and visual sensor). We conduct statistical experiments to evaluate the effectiveness of the method. As shown in Figure 20, the three standard boxes (#1, #2, and #3) are selected in the experiment. Their length, width, and height are 330.4 × 110.3 × 440.6, 690.7 × 570.5 × 1500.0, and 900.0 × 400.0 × 1800.0, respectively. We use our system to collect 15 measurements for each of the three standard boxes (Table 4). We utilize these data to calculate the mean and standard deviation of each box's side length. The data of the measurement results in Table 4 are statistically analyzed to evaluate the measurement accuracy scientifically, and the uncertainty of class A (µ A ) is calculated as

75where x i is the estimated length and x is the mean value of the measured data. n is the number of measurements, which is 15 in this study. Table 4 shows the measurements result, with a minimum uncertainty of ±0.52 mm and maximum uncertainty of ±4.0 mm. The measurement uncertainty in the estimated length increases with the length. The measurement uncertainty is in accordance with the experiment that is described in Table 4. Figure 21 shows that the length errors of the box dimensions are within ±5.0 mm. The results show that the system has good accuracy. Figure 22 shows the measurement uncertainty of the measuring device, which is consistent with the experimental results. results show that the system has good accuracy. Figure 22 shows the measurement uncertainty of the measuring device, which is consistent with the experimental results.

Measurement Error Analysis of the Optical Quality of the Boxes Surface and the Surface Variation

76The experiment tests the effect of the system's measurements on the optical quality of the boxes surface and the surface variation. Figure Figure 23a,b,c exhibit the images captured at different optical quality. Figure 23d,e,f test boxes with surface variation. The second row in Figure 23 shows the image processing results of the boxes faces.

77The experiment tests the effect of the system's measurements on the optical quality of the boxes surface and the surface variation. Figure

78The experiment tests the effect of the system's measurements on the optical quality of the boxes surface and the surface variation. Figure Figure 23a,b,c exhibit the images captured at different optical quality. Figure 23d,e,f test boxes with surface variation. The second row in Figure 23 shows the image processing results of the boxes faces. Figure 24b shows the measurements result of the surface variation, with a minimum measurement error of 2.0 mm and maximum error of 7.6 mm. The results show that the system suffered little from the optical quality of the surface, but it has big uncertainty when measuring the surface variation of the box. Figure 24b shows the measurements result of the surface variation, with a minimum measurement error of 2.0 mm and maximum error of 7.6 mm. The results show that the system suffered little from the optical quality of the surface, but it has big uncertainty when measuring the surface variation of the box. Figure 24a shows the measurement results of the optical quality of the boxes surface, with a minimum measurement error of 0.2 mm and maximum error of 1.3 mm. Figure 24b shows the measurements result of the surface variation, with a minimum measurement error of 2.0 mm and maximum error of 7.6 mm. The results show that the system suffered little from the optical quality of the surface, but it has big uncertainty when measuring the surface variation of the box.

Online Measurement Testing

79Six standard boxes with different sizes and volumes are selected for measurement to evaluate the measurement accuracy scientifically, as shown in Figure 25. Table 5 Table 5 indicate that the error of the measurement system increases with the side length of the measured box, but the error range of the measured and actual values of the single side length of each standard box is within ±5.0 mm. The maximum relative measurement error of the volume ( ε ) of the measured box is 2.27% and the mean relative error is 0.83%, which indicates good precision.

80Six standard boxes with different sizes and volumes are selected for measurement to evaluate the measurement accuracy scientifically, as shown in Figure 25. Table 5 displays the corresponding experimental results. The final measurement of the box length is highlighted in bold. We estimate of the relative measurement error of the volume ε = |v e − v a |/v a , where v e is the estimated volume and v a is the value of actual volume. The results in Table 5 indicate that the error of the measurement system increases with the side length of the measured box, but the error range of the measured and actual values of the single side length of each standard box is within ±5.0 mm. The maximum relative measurement error of the volume (ε) of the measured box is 2.27% and the mean relative error is 0.83%, which indicates good precision. optical quality; (d), (e) and (f) exhibit the images captured the boxes with surface variation. Figure 24a shows the measurement results of the optical quality of the boxes surface, with a minimum measurement error of 0.2 mm and maximum error of 1.3 mm. Figure 24b shows the measurements result of the surface variation, with a minimum measurement error of 2.0 mm and maximum error of 7.6 mm. The results show that the system suffered little from the optical quality of the surface, but it has big uncertainty when measuring the surface variation of the box.

81Six standard boxes with different sizes and volumes are selected for measurement to evaluate the measurement accuracy scientifically, as shown in Figure 25. Table 5 Table 5 indicate that the error of the measurement system increases with the side length of the measured box, but the error range of the measured and actual values of the single side length of each standard box is within ±5.0 mm. The maximum relative measurement error of the volume ( ε ) of the measured box is 2.27% and the mean relative error is 0.83%, which indicates good precision.

Conclusions

82This research presents a line-structured light-based 3D measuring sensor and deep-learningbased box volume measuring method. Our box volume measurement method only requires two laser-modulated images. We propose a novel end-to-end edge detection architecture based on an IHED network to extract the structure straight edge lines in laser-modulated images. By cutting the first two side output layers and training without deep supervision of HED, our network can learn robust straight line features from laser-modulated images. Moreover, we present a one-step calibration method to calibrate our portable measuring sensor automatically. Experimental results show that the measuring range of our proposed system is 100-1800 mm with errors less than ±5.0 mm. Our system is suitable for portable automatic box volume measurement, and it is useful for warehouses and distribution and logistics companies. Our future work will focus on small portable measuring devices.

참고문헌 35건

  1. Kinect range sensing: Structured-light versus Time-of-Flight Kinect Computer Vision and Image Understanding · Elsevier BV · 2015 10.1016/j.cviu.2015.05.006
  2. Fully convolutional networks for semantic segmentation 2015 10.1109/cvpr.2015.7298965
  3. Oriented edge forests for boundary detection 2015 10.1109/cvpr.2015.7298782
  4. Novel calibration method for a multi-sensor visual measurement system based on structured light Optical Engineering · SPIE · 2010 10.1117/1.3407429
  5. Stereo vision images processing for real-time object distance and size measurements 2012 10.1109/iccce.2012.6271270
  6. Modelling and Calibration Technique of Laser Triangulation Sensors for Integration in Robot Arms and Articulated Arm Coordinate Measuring Machines Sensors · Multidisciplinary Digital Publishing Institute · 2009 10.3390/s90907374
  7. Mobile Calibration Based on Laser Metrology and Approximation Networks Sensors · Multidisciplinary Digital Publishing Institute · 2010 10.3390/s100807681
  8. Learning to detect natural image boundaries using local brightness, color, and texture cues IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2004 10.1109/tpami.2004.1273918
  9. A mobile structured light system for food volume estimation 2011 10.1109/iccvw.2011.6130229
  10. A Computational Approach to Edge Detection IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 1986 10.1109/tpami.1986.4767851
  11. Automatic recalibration of an active structured light vision system IEEE Transactions on Robotics and Automation · Institute of Electrical and Electronics Engineers · 2003 10.1109/tra.2003.808859
  12. A flexible new technique for camera calibration IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2000 10.1109/34.888718
  13. A fast and accurate approach for computing the dimensions of boxes from single perspective images Journal of the Brazilian Computer Society · Springer Science+Business Media · 2006 10.1007/bf03192392
  14. Camera calibration and pose estimation from planes IEEE Instrumentation & Measurement Magazine · Institute of Electrical and Electronics Engineers · 2015 10.1109/mim.2015.7335834
  15. Binocular self-calibration performed via adaptive genetic algorithm based on laser line imaging Journal of Modern Optics · Taylor & Francis · 2016 10.1080/09500340.2015.1130271
  16. Fully Convolutional Networks for Semantic Segmentation IEEE Transactions on Pattern Analysis and Machine Intelligence · IEEE Computer Society · 2016 10.1109/tpami.2016.2572683
  17. An Approach to the Use of Depth Cameras for Weed Volume Estimation Sensors · Multidisciplinary Digital Publishing Institute · 2016 10.3390/s16070972
  18. Method for large-range structured light system calibration Applied Optics · Optica Publishing Group · 2016 10.1364/ao.55.009563
  19. Robust Estimation of Object Dimensions and External Defect Detection with a Low-Cost Sensor Journal of Nondestructive Evaluation · Springer Science+Business Media · 2017 10.1007/s10921-017-0395-7
  20. On-Tree Mango Fruit Size Estimation Using RGB-D Images Sensors · Multidisciplinary Digital Publishing Institute · 2017 10.3390/s17122738
  21. Rail Profile Measurement Based on Line-structured Light Vision IEEE Access · Institute of Electrical and Electronics Engineers · 2018 10.1109/access.2018.2813319
  22. Microscope self-calibration based on micro laser line imaging and soft computing algorithms Optics and Lasers in Engineering · Elsevier BV · 2018 10.1016/j.optlaseng.2017.12.010
  23. An Egg Volume Measurement System Based on the Microsoft Kinect Sensors · Multidisciplinary Digital Publishing Institute · 2018 10.3390/s18082454
  24. Structured-Light-Based System for Shape Measurement of the Human Body in Motion Sensors · Multidisciplinary Digital Publishing Institute · 2018 10.3390/s18092827
  25. Research on a Handheld 3D Laser Scanning System for Measuring Large-Sized Objects Sensors · Multidisciplinary Digital Publishing Institute · 2018 10.3390/s18103567
  26. Reliable and Accurate Wheel Size Measurement under Highly Reflective Conditions Sensors · Multidisciplinary Digital Publishing Institute · 2018 10.3390/s18124296
  27. A High-Computational Efficiency Human Detection and Flow Estimation Method Based on TOF Measurements Sensors · Multidisciplinary Digital Publishing Institute · 2019 10.3390/s19030729
  28. A Novel Mobile Structured Light System in Food 3D Reconstruction and Volume Estimation Sensors · Multidisciplinary Digital Publishing Institute · 2019 10.3390/s19030564
  29. A Method for Broccoli Seedling Recognition in Natural Environment Based on Binocular Stereo Vision and Gaussian Mixture Model Sensors · Multidisciplinary Digital Publishing Institute · 2019 10.3390/s19051132
  30. Building Corner Detection in Aerial Images with Fully Convolutional Networks Sensors · Multidisciplinary Digital Publishing Institute · 2019 10.3390/s19081915
  31. Box-Scan: An Efficient and Effective Algorithm for Box Dimension Measurement in Conveyor Systems using a Single RGB-D Camera 2019 10.12792/iciae2019.032
  32. Fully Convolutional Networks for Semantic Segmentation arXiv (Cornell University) · Cornell University · 2016 10.48550/arxiv.1605.06211
  33. Introduction to Uncertainty in Measurement: Using the GUM (Guide to the Expression of Uncertainty in Measurement) 2006 10.1017/cbo9780511755538
  34. Richer Convolutional Features for Edge Detection 2017 10.1109/cvpr.2017.622
  35. Holistically-Nested Edge Detection 2015 10.1109/iccv.2015.164