# Cutting Blade Measurement of an Ultrasonic Cutting Machine Using Multi-Step Detection
## 3 Curvature-Based Binarization Method
### Cutting Blade Rotation Angle and Length Measurement  
The commonly used bounding box suffers from the disadvantage of non-consideration of the rotation angle of the object, which leads to inaccurate measurement of the length and thickness of the cutting blade. The problem is addressed in this paper by using the minimum rotated rectangle method to measure the angle and length of the cutting blade.  
A rotated rectangular bounding box for finding the least circumscribed rectangle is shown in Figure 10.  
Figure 10: Formation of rectangle \(R^{\prime}\) by edge rotation.  
Figure 9: Lost tip data restoration process. (**a**) ROI assignment to the morphological filtered image; (**b**) boundary mapping using straight lines; (**c**) restored tip data image.  
The difference, \(\Delta A\), between the area of rectangle, \(R\), and the area of rectangle, \(R^{\prime}\), can be determined by using the following method described by [PERSON] et al. [14]:  
\[\Delta A=\left|\sum_{i=1}^{4}S_{i}-\sum_{i=1}^{4}T_{i}\right|. \tag{11}\]  
\(S_{i}\) and \(T_{i}\) can be given as follows:  
\[S_{i}=\frac{1}{2}(q_{i,2}-q_{i+1,1}\tan\theta)^{2}\sin\theta\,\cos\theta, \tag{12}\]  
\[T_{i}=\frac{1}{2}q_{i,1}\,2\tan\theta. \tag{13}\]  
By substituting Equations (12) and (13) in Equation (11) and simplifying:  
\[\Delta A=\sin^{2}\theta\sum_{i=1}^{4}q_{i,2}q_{i+1,1}+\frac{1}{2}\sin\theta \cos\theta\left[\sum_{i=1}^{4}q_{i,1}^{2}-\sum_{i=1}^{4}q_{i,2}^{2}\right], \tag{14}\]  
\[\Delta A=N_{1}+N_{2}\left[\sum_{i=1}^{4}q_{i,1}^{2}-\sum_{i=1}^{4}q_{i,2}^{2}\right], \tag{15}\]  
where \(N_{1}\) and \(N_{2}\) are both positive quantities. \(\Delta A\) is the amount by which the area of \(R^{\prime}\) is less than that of \(R\)[15; 16; 17].  
The input image for the detection of the cutting blade area is shown in Figure 11. A commonly used rectangular bounding box for the detection of the cutting blade is shown in Figure 11. The cutting blade does not lie in the perpendicular plane rather it is rotated by some angle, which makes the measurements obtained through the commonly used rectangle inaccurate and unreliable due to the reduced length and increased thickness of the cutting blade. The measurements can be accurate only if the rectangular bounding box is also rotated by a similar angle to that of the cutting blade. A rotating rectangular bounding box that accurately measures the length of the cutting blade and the angle of rotation by means of the least sized bounding box that considers the rotation angle of the cutting blade is shown in Figure 11.  
The thickness and length of the cutting blade can also be measured by using the minimum rotated rectangle method. However, if some fine noise is present along the edges of the cutting blade, the outermost boundary of the bounding box is unable to exclude such noise, which results in the slightly inaccurate thickness measurement. The problem is resolved by using the optimized line fitting algorithms for thickness measurement.  
Figure 11: Detection of rotated cutting blade. (**a**) Acquired image; (**b**) generalized bounding box used for image detection; (**c**) minimum rotated rectangle bounding box for image detection.